Skip to content

Commit

Permalink
Add changes that were intended to be included in f83a8aa.
Browse files Browse the repository at this point in the history
  • Loading branch information
Safety0ff committed Oct 16, 2010
1 parent b5e6432 commit 3a37a47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions lib/ivis_opengl/piefunc.c
Expand Up @@ -119,6 +119,9 @@ void pie_DrawSkybox(float scale, int u, int v, int w, int h)
{
const float r = 1.0f; // just because it is shorter than 1.0f

// enable alpha
pie_SetRendMode(REND_ALPHA);

glPushAttrib(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT | GL_FOG_BIT);
// no use in updating the depth buffer
glDepthMask(GL_FALSE);
Expand All @@ -129,9 +132,6 @@ void pie_DrawSkybox(float scale, int u, int v, int w, int h)
// So we have realistic colors
glColor4ub(0xFF,0xFF,0xFF,0xFF);

// enable alpha
pie_SetRendMode(REND_ALPHA);

// for the nice blend of the sky with the fog
glDisable(GL_ALPHA_TEST);

Expand Down
4 changes: 2 additions & 2 deletions lib/ivis_opengl/piestate.c
Expand Up @@ -286,7 +286,7 @@ void pie_ActivateShader_TCMask(PIELIGHT teamcolour, SDWORD maskpage)
glUniform4fv(loc, 1, &colour4f[0]);

glActiveTexture(GL_TEXTURE1);
pie_SetTexturePage(maskpage);
glBindTexture(GL_TEXTURE_2D, _TEX_PAGE[maskpage].id);
glActiveTexture(GL_TEXTURE0);

#ifdef _DEBUG
Expand Down Expand Up @@ -405,7 +405,7 @@ void pie_SetTexturePage(SDWORD num)
glDisable(GL_TEXTURE_2D);
break;
case TEXPAGE_EXTERN:
// GLC will set the texture, we just need to enable texturing
// The texture will be set outside of ivis, we just need to enable texturing
glEnable(GL_TEXTURE_2D);
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions src/terrain.c
Expand Up @@ -1017,7 +1017,7 @@ bool initTerrain(void)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);

glTexImage2D(GL_TEXTURE_2D, 0, 3, lightmapWidth, lightmapHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, lightmapPixmap);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, lightmapWidth, lightmapHeight, 0, GL_RGB, GL_UNSIGNED_BYTE, lightmapPixmap);

terrainInitalised = true;

Expand Down Expand Up @@ -1224,7 +1224,7 @@ void drawTerrain(void)
}
finishDrawRangeElements();

if (rendStates.fogEnabled)
if (pie_GetFogStatus())
{
glEnable(GL_FOG); // resync fog state
glColor4ub(0xFF, 0xFF, 0xFF, 0xFF);
Expand Down Expand Up @@ -1416,7 +1416,7 @@ void drawWater(void)

// multiplicative blending
pie_SetRendMode(REND_MULTIPLICATIVE);

// second texture unit
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, iV_NativeTexID(iV_GetTexture("page-81")));
Expand Down

0 comments on commit 3a37a47

Please sign in to comment.