AVALANCHE: Move freeing of the used surfaces in Nim to a better place.

This commit is contained in:
uruk 2013-12-21 19:09:57 +01:00
parent 439817d42e
commit eeca348953
3 changed files with 10 additions and 5 deletions

View File

@ -60,11 +60,6 @@ GraphicManager::~GraphicManager() {
_scrolls.free();
_backup.free();
_nimStone.free();
for (int i = 0; i < 3; i++)
_nimInitials[i].free();
_nimLogo.free();
for (int i = 0; i < 10; i++)
_digits[i].free();
for (int i = 0; i < 9; i++)
@ -494,6 +489,13 @@ void GraphicManager::nimDrawLogo() {
drawPicture(_surface, _nimLogo, 392, 5);
}
void GraphicManager::nimFree() {
_nimStone.free();
for (int i = 0; i < 3; i++)
_nimInitials[i].free();
_nimLogo.free();
}
/**
* This function mimics Pascal's getimage().
*/

View File

@ -84,6 +84,7 @@ public:
void nimDrawStone(int x, int y);
void nimDrawInitials();
void nimDrawLogo();
void nimFree();
void clearAlso();
void clearTextBar();

View File

@ -424,6 +424,8 @@ void Nim::endOfGame() {
}
}
}
_vm->_graphics->nimFree();
}
bool Nim::find(byte x) {