Fix crash when both shaders and FoW are enabled (#549)

PerformBlt and BlitLandscape did not clean up the GL state properly as the
texcoord pointer for texture 3 was still set and enabled but pointing to
nowhere anymore.
Armin Burgmeier 2011-01-02 20:33:45 +01:00
parent 08ae037534
commit 9a15b99753
1 changed files with 13 additions and 0 deletions

View File

@ -474,6 +474,12 @@ void CStdGL::PerformBlt(CBltData &rBltData, CTexRef *pTex, DWORD dwModClr, bool
glClientActiveTexture(GL_TEXTURE0);
}
glDrawArrays(GL_POLYGON, 0, rBltData.byNumVertices);
if(shaders[0] && fUseClrModMap)
{
glClientActiveTexture(GL_TEXTURE3);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTexture(GL_TEXTURE0);
}
glLoadIdentity();
if (!fExact)
{
@ -1577,6 +1583,13 @@ void CStdGL::BlitLandscape(SURFACE sfcSource, float fx, float fy,
glDrawArrays(GL_QUADS, 0, 4);
}
if(shaders[0] && fUseClrModMap)
{
glClientActiveTexture(GL_TEXTURE3);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glClientActiveTexture(GL_TEXTURE0);
}
}
}
if (mattextures)