From 978006bc97c894e61996bc9815e56debea5a2957 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Thu, 17 Mar 2022 03:40:01 +0200 Subject: [PATCH] Ensure consistent GL state when drawing screen textures Fixes palettized wipes being broken under some common conditions --- src/hardware/r_opengl/r_opengl.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 7354f2b76..b4bd14d7e 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -3016,11 +3016,9 @@ EXPORT void HWRAPI(DrawScreenTexture)(int tex, FSurfaceInfo *surf, FBITFIELD pol pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]); - if (surf) - PreparePolygon(surf, NULL, polyflags); - else - Shader_SetUniforms(NULL, NULL, NULL, NULL); // prepare shader, if it is enabled - pglColor4ubv(white); + PreparePolygon(surf, NULL, surf ? polyflags : (PF_NoDepthTest)); + if (!surf) + pglColor4ubv(white); pglTexCoordPointer(2, GL_FLOAT, 0, fix); pglVertexPointer(3, GL_FLOAT, 0, screenVerts); @@ -3226,6 +3224,7 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int tex, int width, int height) clearColour.red = clearColour.green = clearColour.blue = 0; clearColour.alpha = 1; ClearBuffer(true, false, &clearColour); + SetBlend(PF_NoDepthTest); pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]); pglColor4ubv(white);