Fix flares being invisible after vid_restart

flareCoeff was only set if r_flareCoeff cvar was set as modified.
Cvars are set as modified when created or changed.
This commit is contained in:
Zack Middleton 2013-11-09 16:57:43 -06:00
parent ae57eebf52
commit d526eacd10
2 changed files with 32 additions and 10 deletions

View file

@ -86,6 +86,19 @@ flare_t *r_activeFlares, *r_inactiveFlares;
int flareCoeff; int flareCoeff;
/*
==================
R_SetFlareCoeff
==================
*/
static void R_SetFlareCoeff( void ) {
if(r_flareCoeff->value == 0.0f)
flareCoeff = atof(FLARE_STDCOEFF);
else
flareCoeff = r_flareCoeff->value;
}
/* /*
================== ==================
R_ClearFlares R_ClearFlares
@ -102,6 +115,8 @@ void R_ClearFlares( void ) {
r_flareStructs[i].next = r_inactiveFlares; r_flareStructs[i].next = r_inactiveFlares;
r_inactiveFlares = &r_flareStructs[i]; r_inactiveFlares = &r_flareStructs[i];
} }
R_SetFlareCoeff();
} }
@ -450,11 +465,7 @@ void RB_RenderFlares (void) {
if(r_flareCoeff->modified) if(r_flareCoeff->modified)
{ {
if(r_flareCoeff->value == 0.0f) R_SetFlareCoeff();
flareCoeff = atof(FLARE_STDCOEFF);
else
flareCoeff = r_flareCoeff->value;
r_flareCoeff->modified = qfalse; r_flareCoeff->modified = qfalse;
} }

View file

@ -86,6 +86,19 @@ flare_t *r_activeFlares, *r_inactiveFlares;
int flareCoeff; int flareCoeff;
/*
==================
R_SetFlareCoeff
==================
*/
static void R_SetFlareCoeff( void ) {
if(r_flareCoeff->value == 0.0f)
flareCoeff = atof(FLARE_STDCOEFF);
else
flareCoeff = r_flareCoeff->value;
}
/* /*
================== ==================
R_ClearFlares R_ClearFlares
@ -102,6 +115,8 @@ void R_ClearFlares( void ) {
r_flareStructs[i].next = r_inactiveFlares; r_flareStructs[i].next = r_inactiveFlares;
r_inactiveFlares = &r_flareStructs[i]; r_inactiveFlares = &r_flareStructs[i];
} }
R_SetFlareCoeff();
} }
@ -451,11 +466,7 @@ void RB_RenderFlares (void) {
if(r_flareCoeff->modified) if(r_flareCoeff->modified)
{ {
if(r_flareCoeff->value == 0.0f) R_SetFlareCoeff();
flareCoeff = atof(FLARE_STDCOEFF);
else
flareCoeff = r_flareCoeff->value;
r_flareCoeff->modified = qfalse; r_flareCoeff->modified = qfalse;
} }