Workaround for texture corruption bug on Ati Mobility Radeon HD 2400 (R610) open source radeon + mesa drivers.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9845 4a71c877-e1ca-e34f-864e-861f7616d084
master
Git SVN Gateway 2010-02-17 20:47:26 +00:00
parent 2f13ea644f
commit a981dbf610
1 changed files with 9 additions and 7 deletions

View File

@ -1295,13 +1295,18 @@ void drawTerrain(void)
}
// we don't need this one anymore
glDisableClientState( GL_COLOR_ARRAY );
//////////////////////////////////
// decals
// no texture generation
// no more texture generation
glDisable(GL_TEXTURE_GEN_S); glError();
glDisable(GL_TEXTURE_GEN_T); glError();
// prevent the terrain from getting corrupted by the decal drawing code
// (something with VBO + changing the texture)
// this happens on radeon + mesa
// FIXME: remove this after the driver is fixed
glFlush();
//////////////////////////////////
// decals
// select the terrain texture page
pie_SetTexturePage(terrainPage); glError();
// use the alpha to blend
@ -1347,9 +1352,6 @@ void drawTerrain(void)
// leave everything in a sane state so it won't mess up somewhere else
glDisableClientState( GL_TEXTURE_COORD_ARRAY );
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisableClientState( GL_VERTEX_ARRAY );
glDepthMask(GL_TRUE);