mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-05-18 01:52:54 +00:00
fix: use standard OpenGL constants on Linux to fix invisible terrain
This commit is contained in:
parent
f8510b88f0
commit
12c48a02ad
|
|
@ -244,15 +244,15 @@ const int GL_EYE_PLANE = 1;
|
|||
|
||||
|
||||
// These things are used by glEnable/glDisable so must be different and non-zero (zero is used by things we haven't assigned yet)
|
||||
const int GL_TEXTURE_2D = 1;
|
||||
const int GL_BLEND = 2;
|
||||
const int GL_CULL_FACE = 3;
|
||||
const int GL_ALPHA_TEST = 4;
|
||||
const int GL_DEPTH_TEST = 5;
|
||||
const int GL_FOG = 6;
|
||||
const int GL_LIGHTING = 7;
|
||||
const int GL_LIGHT0 = 8;
|
||||
const int GL_LIGHT1 = 9;
|
||||
const int GL_TEXTURE_2D = 0x0DE1;
|
||||
const int GL_BLEND = 0x0BE2;
|
||||
const int GL_CULL_FACE = 0x0B44;
|
||||
const int GL_ALPHA_TEST = 0x0BC0;
|
||||
const int GL_DEPTH_TEST = 0x0B71;
|
||||
const int GL_FOG = 0x0B60;
|
||||
const int GL_LIGHTING = 0x0B50;
|
||||
const int GL_LIGHT0 = 0x4000;
|
||||
const int GL_LIGHT1 = 0x4001;
|
||||
|
||||
const int CLEAR_DEPTH_FLAG = 1;
|
||||
const int CLEAR_COLOUR_FLAG = 2;
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ void Chunk::rebuild()
|
|||
MemSect(0);
|
||||
glPushMatrix();
|
||||
glDepthMask(true); // 4J added
|
||||
t->useCompactVertices(false); // 4J added
|
||||
t->useCompactVertices(true); // 4J added
|
||||
translateToPos();
|
||||
float ss = 1.000001f;
|
||||
// 4J - have removed this scale as I don't think we should need it, and have now optimised the vertex
|
||||
|
|
@ -704,7 +704,7 @@ void Chunk::rebuild_SPU()
|
|||
MemSect(0);
|
||||
glPushMatrix();
|
||||
glDepthMask(true); // 4J added
|
||||
t->useCompactVertices(false); // 4J added
|
||||
t->useCompactVertices(true); // 4J added
|
||||
translateToPos();
|
||||
float ss = 1.000001f;
|
||||
// 4J - have removed this scale as I don't think we should need it, and have now optimised the vertex
|
||||
|
|
|
|||
|
|
@ -1428,7 +1428,7 @@ void GameRenderer::renderLevel(float a, __int64 until)
|
|||
// 4J - have changed this fancy rendering option to work with our command buffers. The original used to use frame buffer flags to disable
|
||||
// writing to colour when doing the z-only pass, but that value gets obliterated by our command buffers. Using alpha blend function instead
|
||||
// to achieve the same effect.
|
||||
if (false) // (mc->options->fancyGraphics)
|
||||
if (true) // (mc->options->fancyGraphics)
|
||||
{
|
||||
if (mc->options->ambientOcclusion)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ void Texture::transferFromImage(BufferedImage *image)
|
|||
#ifdef _XBOX
|
||||
int byteRemapRGBA[] = { 0, 1, 2, 3 };
|
||||
#else
|
||||
int byteRemapRGBA[] = { 0, 1, 2, 3 };
|
||||
int byteRemapRGBA[] = { 3, 0, 1, 2 };
|
||||
#endif
|
||||
int byteRemapBGRA[] = { 3, 2, 1, 0 };
|
||||
// #endif
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ void Textures::loadTexture(BufferedImage *img, int id, bool blur, bool clamp)
|
|||
// Swap ARGB to RGBA
|
||||
for( int i = 0; i < ww * hh ; i++ )
|
||||
{
|
||||
tempData[i] = ( tempData[i] << 8 ) | ( ( tempData[i] >> 24 ) & 0xff );
|
||||
tempData[i] = ( tempData[i] >> 24 ) | (tempData[i] << 8 );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue