Skip to content

Commit

Permalink
LAB: Fix waiting for sounds embedded in animations
Browse files Browse the repository at this point in the history
A regression of 75d1385
  • Loading branch information
bluegr committed May 17, 2016
1 parent 89ca6fd commit 7be8658
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
8 changes: 7 additions & 1 deletion engines/lab/anim.cpp
Expand Up @@ -206,6 +206,8 @@ void Anim::diffNextFrame(bool onlyDiffData) {
_vm->updateEvents();
_vm->waitTOF();
}

_waitForEffect = false;
}

_size -= 8;
Expand All @@ -215,7 +217,9 @@ void Anim::diffNextFrame(bool onlyDiffData) {
_diffFile->skip(2);

// Sound effects embedded in animations are started here. These are
// usually animation-specific, like door opening sounds, and are not looped
// usually animation-specific, like door opening sounds, and are not looped.
// The engine should wait for all such sounds to end.
_waitForEffect = true;
_vm->_music->playSoundEffect(_sampleSpeed, _size, false, _diffFile);
break;

Expand All @@ -231,6 +235,8 @@ void Anim::diffNextFrame(bool onlyDiffData) {
if (drawOnScreen)
didTOF = true;
}

_waitForEffect = false;
}

_isPlaying = false;
Expand Down
9 changes: 1 addition & 8 deletions engines/lab/processroom.cpp
Expand Up @@ -254,16 +254,9 @@ void LabEngine::doActions(const ActionList &actionList) {
_music->loadSoundEffect(action->_messages[0], true, false);
break;

case kActionShowDiff: {
bool curWait = _anim->_waitForEffect;
// Pause the engine until the sound is finished
_anim->_waitForEffect = true;
case kActionShowDiff:
_graphics->readPict(action->_messages[0], true);

// Restore the previous value of _waitForEffect
_anim->_waitForEffect = curWait;
break;
}

case kActionShowDiffLooping: // used in scene 44 (heart of the labyrinth, minotaur)
_graphics->readPict(action->_messages[0], false);
Expand Down

0 comments on commit 7be8658

Please sign in to comment.