attempt to fix white flicker when r_water is toggled
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 24 Jan 2010 18:19:03 +0000 (18:19 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 24 Jan 2010 18:19:03 +0000 (18:19 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9845 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 3c6bd98..aab6fd6 100644 (file)
@@ -7775,6 +7775,7 @@ void R_RenderView(void)
 {
        if (r_timereport_active)
                R_TimeReport("start");
 {
        if (r_timereport_active)
                R_TimeReport("start");
+       r_textureframe++; // used only by R_GetCurrentTexture
        rsurface.entity = NULL; // used only by R_GetCurrentTexture and RSurf_ActiveWorldEntity/RSurf_ActiveModelEntity
 
        if (!r_drawentities.integer)
        rsurface.entity = NULL; // used only by R_GetCurrentTexture and RSurf_ActiveWorldEntity/RSurf_ActiveModelEntity
 
        if (!r_drawentities.integer)
@@ -7834,7 +7835,11 @@ void R_RenderView(void)
 
        // this produces a bloom texture to be used in R_BlendView() later
        if (r_hdr.integer && r_bloomstate.bloomwidth)
 
        // this produces a bloom texture to be used in R_BlendView() later
        if (r_hdr.integer && r_bloomstate.bloomwidth)
+       {
                R_HDR_RenderBloomTexture();
                R_HDR_RenderBloomTexture();
+               // we have to bump the texture frame again because r_refdef.view.colorscale is cached in the textures
+               r_textureframe++; // used only by R_GetCurrentTexture
+       }
 
        r_refdef.view.showdebug = true;
 
 
        r_refdef.view.showdebug = true;
 
@@ -7895,7 +7900,6 @@ extern qboolean r_shadow_usingdeferredprepass;
 void R_RenderScene(void)
 {
        r_refdef.stats.renders++;
 void R_RenderScene(void)
 {
        r_refdef.stats.renders++;
-       r_textureframe++; // used only by R_GetCurrentTexture
 
        R_UpdateFogColor();
 
 
        R_UpdateFogColor();