]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix a case where r_hdr 1 can cause message spam (previously: crashes) for not existin...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 14 Dec 2010 15:20:29 +0000 (15:20 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 14 Dec 2010 18:46:57 +0000 (19:46 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10660 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=cbbf18e419ad4d6b1848192cf86aba37b9fb6df4

gl_rmain.c

index 0808d5b17a53a9dcd171b63180f5f54022ad3bbf..8130d159aa6f08e3e4b5118a3d700e66e2af222f 100644 (file)
@@ -9168,13 +9168,18 @@ void R_HDR_RenderBloomTexture(void)
 {
        int oldwidth, oldheight;
        float oldcolorscale;
+       int oldwaterstate;
 
+       oldwaterstate = r_waterstate.enabled;
        oldcolorscale = r_refdef.view.colorscale;
        oldwidth = r_refdef.view.width;
        oldheight = r_refdef.view.height;
        r_refdef.view.width = r_bloomstate.bloomwidth;
        r_refdef.view.height = r_bloomstate.bloomheight;
 
+       if(r_hdr.integer < 2)
+               r_waterstate.enabled = false;
+
        // TODO: support GL_EXT_framebuffer_object rather than reusing the framebuffer?  it might improve SLI performance.
        // TODO: add exposure compensation features
        // TODO: add fp16 framebuffer support (using GL_EXT_framebuffer_object)
@@ -9194,7 +9199,7 @@ void R_HDR_RenderBloomTexture(void)
 
        // only do secondary renders with HDR if r_hdr is 2 or higher
        r_waterstate.numwaterplanes = 0;
-       if (r_waterstate.enabled && r_hdr.integer >= 2)
+       if (r_waterstate.enabled)
                R_RenderWaterPlanes();
 
        r_refdef.view.showdebug = true;
@@ -9207,6 +9212,7 @@ void R_HDR_RenderBloomTexture(void)
        R_Bloom_MakeTexture();
 
        // restore the view settings
+       r_waterstate.enabled = oldwaterstate;
        r_refdef.view.width = oldwidth;
        r_refdef.view.height = oldheight;
        r_refdef.view.colorscale = oldcolorscale;