Silence compiler complaints about memory leaks in tile drawing code.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@4992 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-05-09 18:13:03 +00:00
parent c5187c9406
commit bdb6bf9ef0
3 changed files with 22 additions and 1 deletions

View File

@ -106,6 +106,7 @@ extern void pie_Draw3DShape(iIMDShape *shape, int frame, int team, PIELIGHT colo
extern void pie_DrawImage(PIEIMAGE *image, PIERECT *dest);
void pie_TerrainInit(int sizex, int sizey);
void pie_TerrainCleanup(void);
void pie_DrawTerrain(int mapx, int mapy);
void pie_DrawTerrainTriangle(int index, const TERRAIN_VERTEX *aVrts);
void pie_DrawWaterTriangle(const TERRAIN_VERTEX *aVrts);

View File

@ -778,6 +778,25 @@ void pie_TerrainInit(int sizex, int sizey)
rowLength = sizex;
}
void pie_TerrainCleanup()
{
if (aColour)
{
free(aColour);
}
if (aTexCoord)
{
free(aTexCoord);
}
if (aVertex)
{
free(aVertex);
}
aColour = NULL;
aTexCoord = NULL;
aVertex = NULL;
}
void pie_DrawTerrain(int mapx, int mapy)
{
glEnableClientState(GL_COLOR_ARRAY);

View File

@ -487,6 +487,7 @@ void systemShutdown(void)
iV_ShutDown();
levShutDown();
widgShutDown();
pie_TerrainCleanup();
return;
}
@ -1157,7 +1158,7 @@ BOOL stageThreeShutDown(void)
{
initPlayerColours(); // reset colours leaving multiplayer game.
}
setScriptWinLoseVideo(PLAY_NONE);
return true;