aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2013-07-24 21:09:16 +0200
committeruruk2013-07-24 21:09:16 +0200
commit0beae3b95cbdd719b5778c79ee944ab2f426e7fc (patch)
tree5cd9664b2926148b455169c74b6b7d5276da875a
parent03665fac214574ec58458676789347855c34c29a (diff)
downloadscummvm-rg350-0beae3b95cbdd719b5778c79ee944ab2f426e7fc.tar.gz
scummvm-rg350-0beae3b95cbdd719b5778c79ee944ab2f426e7fc.tar.bz2
scummvm-rg350-0beae3b95cbdd719b5778c79ee944ab2f426e7fc.zip
AVALANCHE: free() the surfaces in Graphics' functions.
-rw-r--r--engines/avalanche/graphics.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 287f85c092..aa49a0c3dd 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -138,20 +138,24 @@ void Graphics::drawPicture(const byte *source, uint16 destX, uint16 destY) {
for (uint16 y = 0; y < picture.h; y++)
for (uint16 x = 0; x < picture.w; x++)
*(byte *)_surface.getBasePtr(x + destX, y + destY) = *(byte *)picture.getBasePtr(x, y);
+
+ picture.free();
}
void Graphics::refreshScreen() {
// These cycles are for doubling the screen height.
- ::Graphics::Surface source;
- source.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
- for (uint16 y = 0; y < source.h / 2; y++)
- for (uint16 x = 0; x < source.w; x++)
+ ::Graphics::Surface picture;
+ picture.create(kScreenWidth, kScreenHeight * 2, ::Graphics::PixelFormat::createFormatCLUT8());
+ for (uint16 y = 0; y < picture.h / 2; y++)
+ for (uint16 x = 0; x < picture.w; x++)
for (byte j = 0; j < 2; j++)
- *(byte *)source.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);
+ *(byte *)picture.getBasePtr(x, y * 2 + j) = *(byte *)_surface.getBasePtr(x, y);
// Now we copy the stretched picture to the screen.
- g_system->copyRectToScreen(source.pixels, source.pitch , 0, 0, kScreenWidth, kScreenHeight * 2);
+ g_system->copyRectToScreen(picture.pixels, picture.pitch, 0, 0, kScreenWidth, kScreenHeight * 2);
g_system->updateScreen();
+
+ picture.free();
}