From 9a07589de815ce0e05a5a3398f084a37a3e56c57 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 17 Nov 2007 11:03:18 +0000 Subject: Bugfix to properly clear previous room layers and fade in the screen when restoring a game svn-id: r29537 --- engines/lure/room.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/lure/room.cpp b/engines/lure/room.cpp index fa69255ee7..5b7ca082f8 100644 --- a/engines/lure/room.cpp +++ b/engines/lure/room.cpp @@ -112,13 +112,6 @@ Room &Room::getReference() { void Room::leaveRoom() { Resources &r = Resources::getReference(); - // Deallocate graphical layers from the room - for (int layerNum = 0; layerNum < _numLayers; ++layerNum) - if (_layers[layerNum]) { - delete _layers[layerNum]; - _layers[layerNum] = NULL; - } - // Scan through the hotspot list and remove any uneeded entries HotspotList &list = r.activeHotspots(); @@ -545,6 +538,14 @@ void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) { // disk cursor as a room changes _screen.paletteFadeOut(GAME_COLOURS - 1); + // Deallocate graphical layers from the room + for (int layerNum = 0; layerNum < _numLayers; ++layerNum) { + if (_layers[layerNum]) { + delete _layers[layerNum]; + _layers[layerNum] = NULL; + } + } + if (leaveFlag) { leaveRoom(); Sound.removeSounds(); @@ -595,7 +596,7 @@ void Room::setRoomNumber(uint16 newRoomNumber, bool showOverlay) { update(); _screen.update(); - if (leaveFlag) + if (fadeFlag) _screen.paletteFadeIn(&p); else _screen.setPalette(&p); -- cgit v1.2.3