aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/animation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads/animation.cpp')
-rw-r--r--engines/mads/animation.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index f581bf42ce..769bd39aef 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -144,7 +144,15 @@ Animation::Animation(MADSEngine *vm, Scene *scene) : _vm(vm), _scene(scene) {
}
Animation::~Animation() {
- delete _font;
+ Scene &scene = _vm->_game->_scene;
+
+ if (_header._manualFlag)
+ scene._sprites.remove(_spriteListIndexes[_header._spritesIndex]);
+
+ for (uint idx = 0; idx < _header._spriteSetsCount; ++idx) {
+ if (!_header._manualFlag || _header._spritesIndex != idx)
+ scene._sprites.remove(_spriteListIndexes[idx]);
+ }
}
void Animation::free() {