diff --git a/code/renderergl1/tr_flares.c b/code/renderergl1/tr_flares.c index 1d0a9175..7bd95194 100644 --- a/code/renderergl1/tr_flares.c +++ b/code/renderergl1/tr_flares.c @@ -86,6 +86,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 @@ -102,6 +115,8 @@ void R_ClearFlares( void ) { r_flareStructs[i].next = r_inactiveFlares; r_inactiveFlares = &r_flareStructs[i]; } + + R_SetFlareCoeff(); } @@ -450,11 +465,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; } diff --git a/code/renderergl2/tr_flares.c b/code/renderergl2/tr_flares.c index bc016c1c..4447aa23 100644 --- a/code/renderergl2/tr_flares.c +++ b/code/renderergl2/tr_flares.c @@ -86,6 +86,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 @@ -102,6 +115,8 @@ void R_ClearFlares( void ) { r_flareStructs[i].next = r_inactiveFlares; r_inactiveFlares = &r_flareStructs[i]; } + + R_SetFlareCoeff(); } @@ -451,11 +466,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; }