From d1b5d41005ea89e20ae449e6ea815b1dfb5997e6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 26 Dec 2015 12:45:48 +0200 Subject: LAB: Clean up sound effect looping, starting and stopping code --- engines/lab/processroom.cpp | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) (limited to 'engines/lab/processroom.cpp') diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index 4d42f96b50..b955306b7b 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -239,18 +239,15 @@ void LabEngine::doActions(const ActionList &actionList, CloseDataPtr *closePtrLi switch (action->_actionType) { case kActionPlaySound: - _music->_loopSoundEffect = false; - _music->readMusic(action->_messages[0], true); + _music->readMusic(action->_messages[0], false, true); break; - case kActionPlaySoundNoWait: - _music->_loopSoundEffect = false; - _music->readMusic(action->_messages[0], false); + case kActionPlaySoundNoWait: // only used in scene 7 (street, when teleporting to the surreal maze) + _music->readMusic(action->_messages[0], false, false); break; case kActionPlaySoundLooping: - _music->_loopSoundEffect = true; - _music->readMusic(action->_messages[0], false); + _music->readMusic(action->_messages[0], true, false); break; case kActionShowDiff: @@ -411,12 +408,7 @@ void LabEngine::doActions(const ActionList &actionList, CloseDataPtr *closePtrLi break; case kActionClearSound: - if (_music->_loopSoundEffect) { - _music->_loopSoundEffect = false; - _music->stopSoundEffect(); - } else if (_music->isSoundEffectActive()) - _music->stopSoundEffect(); - + _music->stopSoundEffect(); break; case kActionWinMusic: @@ -474,16 +466,7 @@ void LabEngine::doActions(const ActionList &actionList, CloseDataPtr *closePtrLi } } - if (_music->_loopSoundEffect) { - _music->_loopSoundEffect = false; - _music->stopSoundEffect(); - } else { - while (_music->isSoundEffectActive()) { - updateMusicAndEvents(); - _anim->diffNextFrame(); - waitTOF(); - } - } + _music->stopSoundEffect(); } bool LabEngine::doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults) { -- cgit v1.2.3