aboutsummaryrefslogtreecommitdiff
path: root/engines/lab/processroom.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-27 21:12:41 +0200
committerFilippos Karapetis2015-12-27 21:16:43 +0200
commitc5f5fbc208d473d87d42edd64113728bf26153b1 (patch)
tree3c8adca326cb484297b5a0901b5b23e3b5df0b5e /engines/lab/processroom.cpp
parent29342b1331533b2e85057e4cf0a2d2acffd3d56d (diff)
downloadscummvm-rg350-c5f5fbc208d473d87d42edd64113728bf26153b1.tar.gz
scummvm-rg350-c5f5fbc208d473d87d42edd64113728bf26153b1.tar.bz2
scummvm-rg350-c5f5fbc208d473d87d42edd64113728bf26153b1.zip
LAB: Refactor the music code
Diffstat (limited to 'engines/lab/processroom.cpp')
-rw-r--r--engines/lab/processroom.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index 66619af967..491cdf39da 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -235,19 +235,19 @@ bool LabEngine::takeItem(Common::Point pos) {
void LabEngine::doActions(const ActionList &actionList) {
ActionList::const_iterator action;
for (action = actionList.begin(); action != actionList.end(); ++action) {
- updateMusicAndEvents();
+ updateEvents();
switch (action->_actionType) {
case kActionPlaySound:
- _music->readMusic(action->_messages[0], false, true);
+ _music->loadSoundEffect(action->_messages[0], false, true);
break;
case kActionPlaySoundNoWait: // only used in scene 7 (street, when teleporting to the surreal maze)
- _music->readMusic(action->_messages[0], false, false);
+ _music->loadSoundEffect(action->_messages[0], false, false);
break;
case kActionPlaySoundLooping:
- _music->readMusic(action->_messages[0], true, false);
+ _music->loadSoundEffect(action->_messages[0], true, false);
break;
case kActionShowDiff:
@@ -370,26 +370,29 @@ void LabEngine::doActions(const ActionList &actionList) {
_graphics->screenUpdate();
while (_system->getMillis() < targetMillis) {
- updateMusicAndEvents();
+ updateEvents();
_anim->diffNextFrame();
}
}
break;
case kActionStopMusic: // used in scene 44 (heart of the labyrinth, minotaur)
- _music->setMusic(false);
+ _music->freeMusic();
break;
- case kActionStartMusic:
+ case kActionStartMusic: // unused
error("Unused opcode kActionStartMusic has been called");
break;
case kActionChangeMusic: // used in scene 46 (museum exhibit, for the alarm)
- _music->changeMusic(action->_messages[0]);
+ _music->changeMusic(action->_messages[0], true, false);
break;
- case kActionResetMusic: // used in scene 45
- _music->resetMusic();
+ 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);
break;
case kActionFillMusic:
@@ -398,7 +401,7 @@ void LabEngine::doActions(const ActionList &actionList) {
case kActionWaitSound: // used in scene 44 (heart of the labyrinth / ending)
while (_music->isSoundEffectActive()) {
- updateMusicAndEvents();
+ updateEvents();
_anim->diffNextFrame();
waitTOF();
}
@@ -410,7 +413,7 @@ void LabEngine::doActions(const ActionList &actionList) {
case kActionWinMusic: // used in scene 44 (heart of the labyrinth / ending)
_music->freeMusic();
- _music->initMusic("Music:WinGame");
+ _music->changeMusic("Music:WinGame", false, false);
break;
case kActionWinGame: // used in scene 44 (heart of the labyrinth / ending)