From: divverent Date: Tue, 14 Dec 2010 15:20:29 +0000 (+0000) Subject: fix a case where r_hdr 1 can cause message spam (previously: crashes) for not existin... X-Git-Tag: xonotic-v0.5.0~438^2~181 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=cbbf18e419ad4d6b1848192cf86aba37b9fb6df4;p=xonotic%2Fdarkplaces.git fix a case where r_hdr 1 can cause message spam (previously: crashes) for not existing but referenced waterplanes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10660 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 0808d5b1..8130d159 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -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;