mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-09 12:22:51 +00:00
MADS: Rework removePlayerSprites(), get rid of another TODO
This commit is contained in:
parent
edb5db36b5
commit
7f82b0eafa
@ -217,6 +217,8 @@ public:
|
||||
bool freeFlag() const { return _freeFlag; }
|
||||
bool getAnimMode() const { return _header._animMode; }
|
||||
int roomNumber() const { return _header._roomNumber; }
|
||||
|
||||
void resetSpriteSetsCount() { _header._spriteSetsCount = 0; } // CHECKME: See if it doesn't leak the memory when the destructor is called
|
||||
};
|
||||
|
||||
} // End of namespace MADS
|
||||
|
@ -1340,7 +1340,7 @@ void Scene205::actions() {
|
||||
_vm->_sound->command(27);
|
||||
} else if (_game._trigger == 1) {
|
||||
if (_scene->_activeAnimation != nullptr)
|
||||
warning("scene->_activeAnimation._spriteSetsCount = 0;");
|
||||
_scene->_activeAnimation->resetSpriteSetsCount();
|
||||
|
||||
_vm->_dialogs->show(20516);
|
||||
_scene->_reloadSceneFlag = true;
|
||||
|
@ -767,17 +767,20 @@ void Player::synchronize(Common::Serializer &s) {
|
||||
}
|
||||
|
||||
void Player::removePlayerSprites() {
|
||||
Scene &scene = _vm->_game->_scene;
|
||||
int heroSpriteId = _spritesStart;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (_spriteSetsPresent[i]) {
|
||||
_vm->_game->_scene._sprites.remove(heroSpriteId++);
|
||||
scene._sprites.remove(heroSpriteId++);
|
||||
_spriteSetsPresent[i] = false;
|
||||
}
|
||||
}
|
||||
|
||||
_vm->_game->_scene._spriteSlots.clear();
|
||||
_vm->_game->_scene._spriteSlots.fullRefresh();
|
||||
_vm->_game->_player._visible = false;
|
||||
if (scene._activeAnimation != nullptr)
|
||||
scene._activeAnimation->resetSpriteSetsCount();
|
||||
|
||||
scene._spriteSlots.fullRefresh();
|
||||
_visible = false;
|
||||
}
|
||||
|
||||
} // End of namespace MADS
|
||||
|
Loading…
x
Reference in New Issue
Block a user