Slight cleanup of fog setting code

master
Per Inge Mathisen 2011-10-16 20:01:30 -04:00
parent 55a6259b12
commit c0fec82d43
2 changed files with 5 additions and 13 deletions

View File

@ -91,17 +91,13 @@ void pie_EnableFog(bool val)
{
debug(LOG_FOG, "pie_EnableFog: Setting fog to %s", val ? "ON" : "OFF");
rendStates.fogEnabled = val;
if (val == true)
if (val)
{
pie_SetFogColour(WZCOL_FOG);
}
else
{
PIELIGHT black;
black.rgba = 0;
black.byte.a = 255;
pie_SetFogColour(black); // clear background to black
pie_SetFogColour(WZCOL_BLACK); // clear background to black
}
}
}

View File

@ -175,24 +175,20 @@ void war_SetFog(bool val)
{
warGlobs.bFog = val;
}
if (warGlobs.bFog == true)
if (warGlobs.bFog)
{
setRevealStatus(false);
}
else
{
PIELIGHT black;
setRevealStatus(true);
black.rgba = 0;
black.byte.a = 255;
pie_SetFogColour(black);
pie_SetFogColour(WZCOL_BLACK);
}
}
bool war_GetFog(void)
{
return warGlobs.bFog;
return warGlobs.bFog;
}
/***************************************************************************/