diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp index ec80f9c634a..91b02af647e 100644 --- a/engines/lab/engine.cpp +++ b/engines/lab/engine.cpp @@ -396,10 +396,7 @@ void LabEngine::mainGameLoop() { loadGame(ConfMan.getInt("save_slot")); // Since the intro hasn't been shown, init the background music here - if (getPlatform() != Common::kPlatformAmiga) - _music->changeMusic("Music:BackGrou", false, false); - else - _music->changeMusic("Music:BackGround", false, false); + _music->resetMusic(false); _music->checkRoomMusic(); } diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp index b2a1b2059e5..4988e76a8d1 100644 --- a/engines/lab/intro.cpp +++ b/engines/lab/intro.cpp @@ -238,11 +238,7 @@ void Intro::play() { } _vm->_graphics->blackAllScreen(); - - if (_vm->getPlatform() != Common::kPlatformAmiga) - _vm->_music->changeMusic("Music:BackGrou", false, false); - else - _vm->_music->changeMusic("Music:BackGround", false, false); + _vm->_music->resetMusic(false); if (_vm->getPlatform() == Common::kPlatformDOS) nReadPict("TNDcycle.pic", true, true); diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp index 8045c510445..9f9d8eab8f6 100644 --- a/engines/lab/music.cpp +++ b/engines/lab/music.cpp @@ -104,16 +104,12 @@ void Music::checkRoomMusic() { if ((_curRoomMusic == _vm->_roomNum) || !_musicFile) return; - if (_vm->_roomNum == CLOWNROOM) { + if (_vm->_roomNum == CLOWNROOM) changeMusic("Music:Laugh", true, false); - } else if (_vm->_roomNum == DIMROOM) { + else if (_vm->_roomNum == DIMROOM) changeMusic("Music:Rm81", true, false); - } else if (_curRoomMusic == CLOWNROOM || _curRoomMusic == DIMROOM) { - if (_vm->getPlatform() != Common::kPlatformAmiga) - changeMusic("Music:Backgrou", false, true); - else - changeMusic("Music:Background", false, true); - } + else if (_curRoomMusic == CLOWNROOM || _curRoomMusic == DIMROOM) + resetMusic(true); _curRoomMusic = _vm->_roomNum; } @@ -175,4 +171,11 @@ void Music::readSound(bool waitTillFinished, bool loop, Common::File *file) { } } +void Music::resetMusic(bool seektoStoredPos) { + if (_vm->getPlatform() != Common::kPlatformAmiga) + changeMusic("Music:BackGrou", false, seektoStoredPos); + else + changeMusic("Music:BackGround", false, seektoStoredPos); +} + } // End of namespace Lab diff --git a/engines/lab/music.h b/engines/lab/music.h index 09bb9694ac3..45eb2175509 100644 --- a/engines/lab/music.h +++ b/engines/lab/music.h @@ -68,6 +68,8 @@ public: */ void changeMusic(const Common::String filename, bool storeCurPos, bool seektoStoredPos); + void resetMusic(bool seekToStoredPos); + /** * Checks the music that should be playing in a particular room. */ diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 491cdf39da9..bc09bf5f3a9 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -389,10 +389,7 @@ void LabEngine::doActions(const ActionList &actionList) { break; case kActionResetMusic: // used in scene 45 (sheriff's office, after museum) - if (getPlatform() != Common::kPlatformAmiga) - _music->changeMusic("Music:BackGrou", false, true); - else - _music->changeMusic("Music:BackGround", false, true); + _music->resetMusic(true); break; case kActionFillMusic: