aboutsummaryrefslogtreecommitdiff
path: root/engines/sludge
diff options
context:
space:
mode:
authoryinsimei2017-07-03 21:23:35 +0200
committerEugene Sandulenko2017-07-13 18:27:45 +0200
commit91d2b5d31e72f635e0f7d498f632fcd942713a15 (patch)
tree3e823638c7680e7f0fc0819877dc484bb70c20b2 /engines/sludge
parent082bf55b56712715391831b851b5b4aec64c8632 (diff)
downloadscummvm-rg350-91d2b5d31e72f635e0f7d498f632fcd942713a15.tar.gz
scummvm-rg350-91d2b5d31e72f635e0f7d498f632fcd942713a15.tar.bz2
scummvm-rg350-91d2b5d31e72f635e0f7d498f632fcd942713a15.zip
SLUDGE: kill a sprite bank
Diffstat (limited to 'engines/sludge')
-rw-r--r--engines/sludge/sprites.cpp22
1 files changed, 6 insertions, 16 deletions
diff --git a/engines/sludge/sprites.cpp b/engines/sludge/sprites.cpp
index dc3dc82205..161cb6237b 100644
--- a/engines/sludge/sprites.cpp
+++ b/engines/sludge/sprites.cpp
@@ -75,21 +75,6 @@ extern Graphics::Surface backdropSurface;
unsigned char currentBurnR = 0, currentBurnG = 0, currentBurnB = 0;
void forgetSpriteBank(spriteBank &forgetme) {
-#if 0
- deleteTextures(forgetme.myPalette.numTextures, forgetme.myPalette.tex_names);
- if (forgetme.isFont) {
- deleteTextures(forgetme.myPalette.numTextures, forgetme.myPalette.burnTex_names);
- delete [] forgetme.myPalette.burnTex_names;
- forgetme.myPalette.burnTex_names = NULL;
- }
-
- delete [] forgetme.myPalette.tex_names;
- forgetme.myPalette.tex_names = NULL;
- delete[] forgetme.myPalette.tex_w;
- forgetme.myPalette.tex_w = NULL;
- delete[] forgetme.myPalette.tex_h;
- forgetme.myPalette.tex_h = NULL;
-#endif
if (forgetme.myPalette.pal) {
delete[] forgetme.myPalette.pal;
forgetme.myPalette.pal = NULL;
@@ -101,7 +86,12 @@ void forgetSpriteBank(spriteBank &forgetme) {
forgetme.myPalette.b = NULL;
}
- delete forgetme.sprites;
+ for (int i = 0; i < forgetme.total; ++i) {
+ forgetme.sprites[i].surface.free();
+ forgetme.sprites[i].burnSurface.free();
+ }
+
+ delete []forgetme.sprites;
forgetme.sprites = NULL;
// TODO: also remove sprite bank from allLoadedBanks