Fog: move setting of GL_FOG_MODE to GL_EXP2 to a new Fog_SetupState() function and call it in VID_Restart.

Fixes bug where the fog mode was resetting to the default (GL_EXP) after a mode switch, causing fog to look different. This was only affecting SDL1 for me.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1259 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Eric Wasylishen 2015-11-26 09:06:42 +00:00
parent f715aca4d1
commit e2321d816b
3 changed files with 14 additions and 0 deletions

View file

@ -394,5 +394,17 @@ void Fog_Init (void)
fog_green = DEFAULT_GRAY;
fog_blue = DEFAULT_GRAY;
Fog_SetupState ();
}
/*
=============
Fog_SetupState
ericw -- moved from Fog_Init, state that needs to be setup when a new context is created
=============
*/
void Fog_SetupState (void)
{
glFogi(GL_FOG_MODE, GL_EXP2);
}

View file

@ -760,6 +760,7 @@ static void VID_Restart (void)
GL_BuildBModelVertexBuffer ();
GLMesh_LoadVertexBuffers ();
GL_SetupState ();
Fog_SetupState ();
//warpimages needs to be recalculated
TexMgr_RecalcWarpImageSize ();

View file

@ -313,6 +313,7 @@ void Fog_StopAdditive (void);
void Fog_SetupFrame (void);
void Fog_NewMap (void);
void Fog_Init (void);
void Fog_SetupState (void);
void R_NewGame (void);