mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-12-23 11:10:56 +00:00
Ensure consistent GL state when drawing screen textures
Fixes palettized wipes being broken under some common conditions
This commit is contained in:
parent
1fd9d38994
commit
978006bc97
1 changed files with 4 additions and 5 deletions
|
@ -3016,11 +3016,9 @@ EXPORT void HWRAPI(DrawScreenTexture)(int tex, FSurfaceInfo *surf, FBITFIELD pol
|
||||||
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
pglClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
|
||||||
|
|
||||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||||
if (surf)
|
PreparePolygon(surf, NULL, surf ? polyflags : (PF_NoDepthTest));
|
||||||
PreparePolygon(surf, NULL, polyflags);
|
if (!surf)
|
||||||
else
|
pglColor4ubv(white);
|
||||||
Shader_SetUniforms(NULL, NULL, NULL, NULL); // prepare shader, if it is enabled
|
|
||||||
pglColor4ubv(white);
|
|
||||||
|
|
||||||
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
||||||
pglVertexPointer(3, GL_FLOAT, 0, screenVerts);
|
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.red = clearColour.green = clearColour.blue = 0;
|
||||||
clearColour.alpha = 1;
|
clearColour.alpha = 1;
|
||||||
ClearBuffer(true, false, &clearColour);
|
ClearBuffer(true, false, &clearColour);
|
||||||
|
SetBlend(PF_NoDepthTest);
|
||||||
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
pglBindTexture(GL_TEXTURE_2D, screenTextures[tex]);
|
||||||
|
|
||||||
pglColor4ubv(white);
|
pglColor4ubv(white);
|
||||||
|
|
Loading…
Reference in a new issue