From e367e4871400068f60fecbc1acdd94bd5a8e3a6c Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 14 Dec 2010 15:20:29 +0000 Subject: [PATCH] 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 ::stable-branch::merge=cbbf18e419ad4d6b1848192cf86aba37b9fb6df4 --- gl_rmain.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; -- 2.39.2