mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-15 16:41:22 +00:00
Fog_ParseWorldspawn: before reading the worldspawn value, clear the fog rgb color back to the default value (0.3).
This fixes a bug seen in jam3_tronyn.bsp (which only has a density value in the worldspawn), where the fog color of the last map played would carry over. git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@1140 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
d4bc9c723a
commit
fe70de4507
1 changed files with 17 additions and 6 deletions
|
@ -29,6 +29,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
//
|
//
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
|
#define DEFAULT_DENSITY 0.0
|
||||||
|
#define DEFAULT_GRAY 0.3
|
||||||
|
|
||||||
float fog_density;
|
float fog_density;
|
||||||
float fog_red;
|
float fog_red;
|
||||||
float fog_green;
|
float fog_green;
|
||||||
|
@ -176,8 +179,16 @@ void Fog_ParseWorldspawn (void)
|
||||||
const char *data;
|
const char *data;
|
||||||
|
|
||||||
//initially no fog
|
//initially no fog
|
||||||
fog_density = 0.0;
|
fog_density = DEFAULT_DENSITY;
|
||||||
old_density = 0.0;
|
fog_red = DEFAULT_GRAY;
|
||||||
|
fog_green = DEFAULT_GRAY;
|
||||||
|
fog_blue = DEFAULT_GRAY;
|
||||||
|
|
||||||
|
old_density = DEFAULT_DENSITY;
|
||||||
|
old_red = DEFAULT_GRAY;
|
||||||
|
old_green = DEFAULT_GRAY;
|
||||||
|
old_blue = DEFAULT_GRAY;
|
||||||
|
|
||||||
fade_time = 0.0;
|
fade_time = 0.0;
|
||||||
fade_done = 0.0;
|
fade_done = 0.0;
|
||||||
|
|
||||||
|
@ -378,10 +389,10 @@ void Fog_Init (void)
|
||||||
//Cvar_RegisterVariable (&r_vfog);
|
//Cvar_RegisterVariable (&r_vfog);
|
||||||
|
|
||||||
//set up global fog
|
//set up global fog
|
||||||
fog_density = 0.0;
|
fog_density = DEFAULT_DENSITY;
|
||||||
fog_red = 0.3;
|
fog_red = DEFAULT_GRAY;
|
||||||
fog_green = 0.3;
|
fog_green = DEFAULT_GRAY;
|
||||||
fog_blue = 0.3;
|
fog_blue = DEFAULT_GRAY;
|
||||||
|
|
||||||
glFogi(GL_FOG_MODE, GL_EXP2);
|
glFogi(GL_FOG_MODE, GL_EXP2);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue