From a9f515331547b95d2c4813a57e89e8fbf66f161b Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sat, 9 Nov 2013 16:57:43 -0600 Subject: 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. --- src/renderergl2/tr_flares.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'src/renderergl2/tr_flares.c') diff --git a/src/renderergl2/tr_flares.c b/src/renderergl2/tr_flares.c index 4c047afc..4ac81329 100644 --- a/src/renderergl2/tr_flares.c +++ b/src/renderergl2/tr_flares.c @@ -87,6 +87,19 @@ flare_t *r_activeFlares, *r_inactiveFlares; 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 @@ -103,6 +116,8 @@ void R_ClearFlares( void ) { r_flareStructs[i].next = r_inactiveFlares; r_inactiveFlares = &r_flareStructs[i]; } + + R_SetFlareCoeff(); } @@ -452,11 +467,7 @@ void RB_RenderFlares (void) { if(r_flareCoeff->modified) { - if(r_flareCoeff->value == 0.0f) - flareCoeff = atof(FLARE_STDCOEFF); - else - flareCoeff = r_flareCoeff->value; - + R_SetFlareCoeff(); r_flareCoeff->modified = qfalse; } -- cgit