diff options
Diffstat (limited to 'engines/draci/script.cpp')
-rw-r--r-- | engines/draci/script.cpp | 46 |
1 files changed, 9 insertions, 37 deletions
diff --git a/engines/draci/script.cpp b/engines/draci/script.cpp index f938737728..6a2eaeddd4 100644 --- a/engines/draci/script.cpp +++ b/engines/draci/script.cpp @@ -359,11 +359,7 @@ void Script::play(Common::Queue<int> ¶ms) { // Runs just one phase of the loop and exits. Used when waiting for a // particular animation phase to come. - _vm->_game->setLoopSubstatus(kSubstatusStrange); - _vm->_game->setExitLoop(true); - _vm->_game->loop(); - _vm->_game->setExitLoop(false); - _vm->_game->setLoopSubstatus(kSubstatusOrdinary); + _vm->_game->loop(kInnerUntilExit, true); } Animation *Script::loadObjectAnimation(GameObject *obj, int animID) { @@ -463,19 +459,14 @@ void Script::startPlay(Common::Queue<int> ¶ms) { anim->registerCallback(&Animation::exitGameLoop); - _vm->_game->setLoopSubstatus(kSubstatusStrange); - bool visible = (obj->_location == _vm->_game->getRoomNum() && obj->_visible); - if (objID == kDragonObject || visible) { _vm->_anims->play(animID); } // Runs an inner loop until the animation ends. - _vm->_game->loop(); - _vm->_game->setExitLoop(false); + _vm->_game->loop(kInnerUntilExit, false); _vm->_anims->stop(animID); - _vm->_game->setLoopSubstatus(kSubstatusOrdinary); anim->registerCallback(&Animation::doNothing); } @@ -677,17 +668,12 @@ void Script::walkOnPlay(Common::Queue<int> ¶ms) { int y = params.pop(); SightDirection dir = static_cast<SightDirection> (params.pop()); - // HACK: This should be an onDest action when hero walking is properly implemented - // For now, we just go throught the loop-body once to redraw the screen. - _vm->_game->setExitLoop(true); - _vm->_game->walkHero(x, y, dir); - _vm->_game->setLoopSubstatus(kSubstatusStrange); - _vm->_game->loop(); - _vm->_game->setLoopSubstatus(kSubstatusOrdinary); - - _vm->_game->setExitLoop(false); + // HACK: This (shouldExit==true) should be an onDest action when hero + // walking is properly implemented For now, we just go throught the + // loop-body once to redraw the screen. + _vm->_game->loop(kInnerUntilExit, true); } void Script::newRoom(Common::Queue<int> ¶ms) { @@ -737,9 +723,6 @@ void Script::talk(Common::Queue<int> ¶ms) { speechFrame->setFont(_vm->_smallFont); } - // Set the loop substatus to an appropriate value - _vm->_game->setLoopSubstatus(kSubstatusTalk); - // Speak the dubbing if possible uint dubbingDuration = 0; if (sample) { @@ -776,12 +759,8 @@ void Script::talk(Common::Queue<int> ¶ms) { speechFrame->setX(x); speechFrame->setY(y); - // Prevent the loop from exiting early if other things left the loop in the - // "exit immediately" state - _vm->_game->setExitLoop(false); - // Call the game loop to enable interactivity until the text expires. - _vm->_game->loop(); + _vm->_game->loop(kInnerWhileTalk, false); // Delete the text _vm->_screen->getSurface()->markDirtyRect(speechFrame->getRect(kNoDisplacement)); @@ -793,10 +772,6 @@ void Script::talk(Common::Queue<int> ¶ms) { _vm->_sound->stopVoice(); sample->close(); } - - // Revert to "normal" loop status - _vm->_game->setLoopSubstatus(kSubstatusOrdinary); - _vm->_game->setExitLoop(false); } void Script::dialogue(Common::Queue<int> ¶ms) { @@ -877,7 +852,7 @@ void Script::fadePalette(Common::Queue<int> ¶ms) { int phases = params.pop(); // Let the palette fade in the background while the game continues. - // Since we don't set substatus to kSubstatusFade, the outer loop will + // Since we don't set substatus to kInnerWhileFade, the outer loop will // just continue rather than exit. _vm->_game->initializeFading(phases); } @@ -889,10 +864,7 @@ void Script::fadePalettePlay(Common::Queue<int> ¶ms) { _vm->_game->initializeFading(phases); // Call the game loop to enable interactivity until the fading is done. - _vm->_game->setLoopSubstatus(kSubstatusFade); - _vm->_game->loop(); - _vm->_game->setExitLoop(false); - _vm->_game->setLoopSubstatus(kSubstatusOrdinary); + _vm->_game->loop(kInnerWhileFade, false); } void Script::setPalette(Common::Queue<int> ¶ms) { |