From 195c53a68853db6a77c6a63d392968ba912cf2f4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 30 Mar 2014 22:37:08 -0400 Subject: MADS: Added some missing code for scene change freeing --- engines/mads/player.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'engines/mads/player.cpp') diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp index e726c800fd..5546784083 100644 --- a/engines/mads/player.cpp +++ b/engines/mads/player.cpp @@ -662,4 +662,19 @@ void Player::addWalker(int walker, int trigger) { } } + +/** +* Releases any sprites used by the player +*/ +void Player::releasePlayerSprites() { + Scene &scene = _vm->_game->_scene; + + if (_spritesLoaded && _numSprites > 0) { + int spriteEnd = _spritesStart + _numSprites - 1; + do { + scene._sprites.remove(spriteEnd); + } while (--spriteEnd >= _spritesStart); + } +} + } // End of namespace MADS -- cgit v1.2.3