forked from Mirrors/openclonk
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.
parent
08ae037534
commit
9a15b99753
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue