diff options
-rw-r--r-- | kyra/animator.cpp | 3 | ||||
-rw-r--r-- | kyra/animator.h | 3 | ||||
-rw-r--r-- | kyra/debugger.cpp | 3 | ||||
-rw-r--r-- | kyra/debugger.h | 3 | ||||
-rw-r--r-- | kyra/gui.cpp | 3 | ||||
-rw-r--r-- | kyra/items.cpp | 3 | ||||
-rw-r--r-- | kyra/kyra.cpp | 182 | ||||
-rw-r--r-- | kyra/kyra.h | 7 | ||||
-rw-r--r-- | kyra/resource.cpp | 3 | ||||
-rw-r--r-- | kyra/resource.h | 3 | ||||
-rw-r--r-- | kyra/saveload.cpp | 3 | ||||
-rw-r--r-- | kyra/scene.cpp | 3 | ||||
-rw-r--r-- | kyra/screen.cpp | 17 | ||||
-rw-r--r-- | kyra/screen.h | 3 | ||||
-rw-r--r-- | kyra/script.cpp | 3 | ||||
-rw-r--r-- | kyra/script.h | 3 | ||||
-rw-r--r-- | kyra/script_v1.cpp | 30 | ||||
-rw-r--r-- | kyra/seqplayer.cpp | 7 | ||||
-rw-r--r-- | kyra/seqplayer.h | 3 | ||||
-rw-r--r-- | kyra/sequences.cpp | 45 | ||||
-rw-r--r-- | kyra/sound.cpp | 5 | ||||
-rw-r--r-- | kyra/sound.h | 3 | ||||
-rw-r--r-- | kyra/sprites.cpp | 3 | ||||
-rw-r--r-- | kyra/sprites.h | 3 | ||||
-rw-r--r-- | kyra/staticres.cpp | 3 | ||||
-rw-r--r-- | kyra/text.cpp | 8 | ||||
-rw-r--r-- | kyra/text.h | 3 | ||||
-rw-r--r-- | kyra/timer.cpp | 3 | ||||
-rw-r--r-- | kyra/wsamovie.cpp | 3 | ||||
-rw-r--r-- | kyra/wsamovie.h | 3 |
30 files changed, 196 insertions, 171 deletions
diff --git a/kyra/animator.cpp b/kyra/animator.cpp index 057bb0cbeb..e6d5d09862 100644 --- a/kyra/animator.cpp +++ b/kyra/animator.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/animator.h b/kyra/animator.h index a20e2ae193..5a08c5f467 100644 --- a/kyra/animator.h +++ b/kyra/animator.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/debugger.cpp b/kyra/debugger.cpp index 51b0cdd81a..b78056e3ad 100644 --- a/kyra/debugger.cpp +++ b/kyra/debugger.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/debugger.h b/kyra/debugger.h index b7998427a6..69766f3fc0 100644 --- a/kyra/debugger.h +++ b/kyra/debugger.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/gui.cpp b/kyra/gui.cpp index 990b91cf6b..296f46b04e 100644 --- a/kyra/gui.cpp +++ b/kyra/gui.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/items.cpp b/kyra/items.cpp index 2f48433d7e..c98e1ee607 100644 --- a/kyra/items.cpp +++ b/kyra/items.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index 6969e3309e..9e4d91eb0d 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -347,7 +348,6 @@ int KyraEngine::init(GameDetector &detector) { memset(_flagsTable, 0, sizeof(_flagsTable)); - _fastMode = false; _abortWalkFlag = false; _abortWalkFlag2 = false; _talkingCharNum = -1; @@ -416,6 +416,9 @@ int KyraEngine::init(GameDetector &detector) { _lastMusicCommand = 0; + _gameSpeed = 60; + _tickLength = (uint8)(1000.0 / _gameSpeed); + return 0; } @@ -553,9 +556,6 @@ void KyraEngine::startup() { _animator->initAnimStateList(); setCharactersInDefaultScene(); - _gameSpeed = 50; - _tickLength = (uint8)(1000.0 / _gameSpeed); - if (!_scriptInterpreter->loadScript("_STARTUP.EMC", _npcScriptData, _opcodeTable, _opcodeTableSize, 0)) { error("Could not load \"_STARTUP.EMC\" script"); } @@ -576,7 +576,7 @@ void KyraEngine::startup() { snd_setSoundEffectFile(1); enterNewScene(_currentCharacter->sceneId, _currentCharacter->facing, 0, 0, 1); - if (_abortIntroFlag && _skipIntroFlag) { + if (_abortIntroFlag && _skipFlag) { _menuDirectlyToLoad = true; _screen->setMouseCursor(1, 1, _shapes[4]); buttonMenuCallback(0); @@ -585,6 +585,64 @@ void KyraEngine::startup() { saveGame(getSavegameFilename(0), "New game"); } +void KyraEngine::mainLoop() { + debug(9, "KyraEngine::mainLoop()"); + + while (!_quitFlag) { + int32 frameTime = (int32)_system->getMillis(); + _skipFlag = false; + + if (_currentCharacter->sceneId == 210) { + _animator->updateKyragemFading(); + if (seq_playEnd()) { + if (_deathHandler != 8) + break; + } + } + + if (_deathHandler != 0xFF) { + // this is only used until the original gui is implemented + GUI::MessageDialog dialog("Brandon is dead! Game over!", "Quit"); + dialog.runModal(); + break; + } + + if (_brandonStatusBit & 2) { + if (_brandonStatusBit0x02Flag) + animRefreshNPC(0); + } + if (_brandonStatusBit & 0x20) { + if (_brandonStatusBit0x20Flag) { + animRefreshNPC(0); + _brandonStatusBit0x20Flag = 0; + } + } + + _screen->showMouse(); + + processButtonList(_buttonList); + updateMousePointer(); + updateGameTimers(); + updateTextFade(); + + _handleInput = true; + delay((frameTime + _gameSpeed) - _system->getMillis(), true, true); + _handleInput = false; + } +} + +void KyraEngine::quitGame() { + res_unloadResources(RES_ALL); + + for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i) { + _movieObjects[i]->close(); + delete _movieObjects[i]; + _movieObjects[i] = 0; + } + + _system->quit(); +} + void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { OSystem::Event event; char saveLoadSlot[20]; @@ -606,13 +664,17 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { saveGame(saveLoadSlot, savegameName); } } else if (event.kbd.flags == OSystem::KBD_CTRL) { - if (event.kbd.keycode == 'f') - _fastMode = !_fastMode; - else if (event.kbd.keycode == 'd') + if (event.kbd.keycode == 'd') _debugger->attach(); else if (event.kbd.keycode == 'q') _quitFlag = true; + } else if (event.kbd.keycode == '.') + _skipFlag = true; + else if (event.kbd.keycode == 13 || event.kbd.keycode == 32 || event.kbd.keycode == 27) { + _abortIntroFlag = true; + _skipFlag = true; } + break; case OSystem::EVENT_MOUSEMOVE: _mouseX = event.mouse.x; @@ -635,28 +697,29 @@ void KyraEngine::delay(uint32 amount, bool update, bool isMainLoop) { _handleInput = false; processInput(_mouseX, _mouseY); _handleInput = true; - } + } else + _skipFlag = true; break; default: break; } } - if (_debugger->isAttached()) _debugger->onFrame(); - _sprites->updateSceneAnims(); if (update) + _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); - if (_currentCharacter->sceneId == 210) { + if (_currentCharacter && _currentCharacter->sceneId == 210) { _animator->updateKyragemFading(); } - if (amount > 0) { + if (amount > 0 && !_skipFlag) { _system->delayMillis((amount > 10) ? 10 : amount); } - } while (!_fastMode && _system->getMillis() < start + amount); + } while (!_skipFlag && _system->getMillis() < start + amount); + } void KyraEngine::waitForEvent() { @@ -677,6 +740,7 @@ void KyraEngine::waitForEvent() { break; case OSystem::EVENT_LBUTTONDOWN: finished = true; + _skipFlag = true; break; default: break; @@ -690,93 +754,9 @@ void KyraEngine::waitForEvent() { } } -void KyraEngine::mainLoop() { - debug(9, "KyraEngine::mainLoop()"); - - while (!_quitFlag) { - int32 frameTime = (int32)_system->getMillis(); - if (_currentCharacter->sceneId == 210) { - _animator->updateKyragemFading(); - if (seq_playEnd()) { - if (_deathHandler != 8) - break; - } - } - - if (_deathHandler != 0xFF) { - // this is only used until the original gui is implemented - GUI::MessageDialog dialog("Brandon is dead! Game over!", "Quit"); - dialog.runModal(); - break; - } - - if (_brandonStatusBit & 2) { - if (_brandonStatusBit0x02Flag) - animRefreshNPC(0); - } - if (_brandonStatusBit & 0x20) { - if (_brandonStatusBit0x20Flag) { - animRefreshNPC(0); - _brandonStatusBit0x20Flag = 0; - } - } - - _screen->showMouse(); - - processButtonList(_buttonList); - updateMousePointer(); - updateGameTimers(); - updateTextFade(); - - _handleInput = true; - delay((frameTime + _gameSpeed) - _system->getMillis(), true, true); - _handleInput = false; - } -} - -void KyraEngine::quitGame() { - res_unloadResources(RES_ALL); - - for (int i = 0; i < ARRAYSIZE(_movieObjects); ++i) { - _movieObjects[i]->close(); - delete _movieObjects[i]; - _movieObjects[i] = 0; - } - - _system->quit(); -} - -void KyraEngine::waitTicks(int ticks) { - debug(9, "KyraEngine::waitTicks(%d)", ticks); - const uint32 end = _system->getMillis() + ticks * 1000 / 60; - do { - OSystem::Event event; - while (_system->pollEvent(event)) { - switch (event.type) { - case OSystem::EVENT_QUIT: - _quitFlag = true; - quitGame(); - break; - case OSystem::EVENT_KEYDOWN: - if (event.kbd.flags == OSystem::KBD_CTRL) { - if (event.kbd.keycode == 'f') { - _fastMode = !_fastMode; - } - } else if (event.kbd.keycode == 13 || event.kbd.keycode == 32 || event.kbd.keycode == 27) { - _abortIntroFlag = true; - } - break; - default: - break; - } - } - _system->delayMillis(10); - } while (!_fastMode && _system->getMillis() < end); -} - void KyraEngine::delayWithTicks(int ticks) { uint32 nextTime = _system->getMillis() + ticks * _tickLength; - while (_system->getMillis() < nextTime) { + while (_system->getMillis() < nextTime && !_skipFlag) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); if (_currentCharacter->sceneId == 210) { @@ -1247,7 +1227,7 @@ int KyraEngine::handleMalcolmFlag() { while (_system->getMillis() < timer2) {} } snd_playWanderScoreViaMap(51, 1); - waitTicks(60); + delay(60*_tickLength); _malcolmFlag = 0; return 1; break; diff --git a/kyra/kyra.h b/kyra/kyra.h index 51838068c3..cac2d5647a 100644 --- a/kyra/kyra.h +++ b/kyra/kyra.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -266,6 +267,7 @@ public: const uint8 **palTable2() { return const_cast<const uint8 **>(&_specialPalettes[29]); } bool seq_skipSequence() const; + void delay(uint32 millis, bool update = false, bool mainLoop = false); void quitGame(); void loadBitmap(const char *filename, int tempPage, int dstPage, uint8 *palData); @@ -600,7 +602,6 @@ protected: void res_freeLangTable(char ***sting, int *size); void waitForEvent(); - void delay(uint32 millis, bool update = false, bool mainLoop = false); void loadPalette(const char *filename, uint8 *palData); void loadMouseShapes(); void loadCharacterShapes(); @@ -676,8 +677,8 @@ protected: void gui_restorePalette(); uint8 _game; - bool _fastMode; bool _quitFlag; + bool _skipFlag; bool _skipIntroFlag; bool _abortIntroFlag; bool _menuDirectlyToLoad; diff --git a/kyra/resource.cpp b/kyra/resource.cpp index 50062726ea..313c06d719 100644 --- a/kyra/resource.cpp +++ b/kyra/resource.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/resource.h b/kyra/resource.h index 010cf43d8b..3355d6c819 100644 --- a/kyra/resource.h +++ b/kyra/resource.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/saveload.cpp b/kyra/saveload.cpp index f1a09f3667..8a297eda77 100644 --- a/kyra/saveload.cpp +++ b/kyra/saveload.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/scene.cpp b/kyra/scene.cpp index daf44f4135..e99812b439 100644 --- a/kyra/scene.cpp +++ b/kyra/scene.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/screen.cpp b/kyra/screen.cpp index bd93646d36..a75bf4a5e3 100644 --- a/kyra/screen.cpp +++ b/kyra/screen.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -225,7 +226,8 @@ void Screen::fadePalette(const uint8 *palData, int delay) { } setScreenPalette(fadePal); _system->updateScreen(); - _system->delayMillis((delayAcc >> 8) * 1000 / 60); + //_system->delayMillis((delayAcc >> 8) * 1000 / 60); + _vm->delay((delayAcc >> 8) * 1000 / 60); delayAcc &= 0xFF; } } @@ -415,8 +417,11 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag int i = _vm->_rnd.getRandomNumber(h - 1); SWAP(y_offs[y], y_offs[i]); } - + + int32 start, now; + int wait; for (y = 0; y < h; ++y) { + start = (int32)_system->getMillis(); int y_cur = y; for (x = 0; x < w; ++x) { int i = sx + x_offs[x]; @@ -431,7 +436,11 @@ void Screen::shuffleScreen(int sx, int sy, int w, int h, int srcPage, int dstPag } } updateScreen(); - _system->delayMillis(ticks * 1000 / 60); + now = (int32)_system->getMillis(); + wait = ticks * _vm->tickLength() - (now - start); + if (wait > 0) { + _vm->delay(wait); + } } } diff --git a/kyra/screen.h b/kyra/screen.h index dc0095351a..0f2c59cbea 100644 --- a/kyra/screen.h +++ b/kyra/screen.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/script.cpp b/kyra/script.cpp index d956401308..b43766dba7 100644 --- a/kyra/script.cpp +++ b/kyra/script.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/script.h b/kyra/script.h index 3962d079c5..28f5170422 100644 --- a/kyra/script.h +++ b/kyra/script.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/script_v1.cpp b/kyra/script_v1.cpp index 53310f1237..209e894023 100644 --- a/kyra/script_v1.cpp +++ b/kyra/script_v1.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -40,14 +41,7 @@ int KyraEngine::cmd_magicInMouseItem(ScriptState *script) { } int KyraEngine::cmd_characterSays(ScriptState *script) { - // Japanese version? - /*const char *str1 = "âuâëâôââôüAé?é¢ùêé¢é+é®üH"; - const char *str2 = "âuâëâôâ\\âôüAé?é¢ùêé¢é+é®üH"; - - if (strcmp(stackPosString(0), str1) == 0) - characterSays((char *)str2, stackPos(1), stackPos(2)); - else*/ - + _skipFlag = false; if (_features & GF_TALKIE) { debug(3, "cmd_characterSays(0x%X) (%d, '%s', %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3)); snd_voiceWaitForFinish(); @@ -351,8 +345,9 @@ int KyraEngine::cmd_setBrandonStatusBit(ScriptState *script) { int KyraEngine::cmd_pauseSeconds(ScriptState *script) { debug(3, "cmd_pauseSeconds(0x%X) (%d)", script, stackPos(0)); - if (stackPos(0) > 0) + if (stackPos(0) > 0 && !_skipFlag) delay(stackPos(0)*1000, true); + _skipFlag = false; return 0; } @@ -489,7 +484,7 @@ int KyraEngine::cmd_displayWSAFrame(ScriptState *script) { _movieObjects[wsaIndex]->displayFrame(frame); _animator->_updateScreen = true; uint32 continueTime = waitTime * _tickLength + _system->getMillis(); - while (_system->getMillis() < continueTime) { + while (_system->getMillis() < continueTime && !_skipFlag) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); if (continueTime - _system->getMillis() >= 10) @@ -617,12 +612,14 @@ int KyraEngine::cmd_customPrintTalkString(ScriptState *script) { debug(3, "cmd_customPrintTalkString(0x%X) (%d, '%s', %d, %d, %d)", script, stackPos(0), stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF); snd_voiceWaitForFinish(); snd_playVoiceFile(stackPos(0)); + _skipFlag = false; _text->printTalkTextMessage(stackPosString(1), stackPos(2), stackPos(3), stackPos(4) & 0xFF, 0, 2); } else { debug(3, "cmd_customPrintTalkString(0x%X) ('%s', %d, %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF); + _skipFlag = false; _text->printTalkTextMessage(stackPosString(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF, 0, 2); } - _animator->_updateScreen = true; + _screen->updateScreen(); return 0; } @@ -755,7 +752,7 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) { _movieObjects[wsaIndex]->displayFrame(frame); _animator->_updateScreen = true; uint32 continueTime = waitTime * _tickLength + _system->getMillis(); - while (_system->getMillis() < continueTime) { + while (_system->getMillis() < continueTime && !_skipFlag) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); if (continueTime - _system->getMillis() >= 10) @@ -769,7 +766,7 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) { _movieObjects[wsaIndex]->displayFrame(frame); _animator->_updateScreen = true; uint32 continueTime = waitTime * _tickLength + _system->getMillis(); - while (_system->getMillis() < continueTime) { + while (_system->getMillis() < continueTime && !_skipFlag) { _sprites->updateSceneAnims(); _animator->updateAllObjectShapes(); if (continueTime - _system->getMillis() >= 10) @@ -778,7 +775,10 @@ int KyraEngine::cmd_displayWSASequentialFrames(ScriptState *script) { --frame; } } - ++curTime; + if (!_skipFlag) + break; + else + ++curTime; } _screen->showMouse(); diff --git a/kyra/seqplayer.cpp b/kyra/seqplayer.cpp index 5f1223bd8a..dd9a745379 100644 --- a/kyra/seqplayer.cpp +++ b/kyra/seqplayer.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -170,7 +171,7 @@ void SeqPlayer::s1_drawShape() { void SeqPlayer::s1_waitTicks() { uint16 ticks = READ_LE_UINT16(_seqData); _seqData += 2; - _vm->waitTicks(ticks); + _vm->delay(ticks); } void SeqPlayer::s1_copyWaitTicks() { @@ -373,7 +374,7 @@ void SeqPlayer::s1_fillRect() { void SeqPlayer::s1_playEffect() { uint8 track = *_seqData++; - _vm->waitTicks(3); + _vm->delay(3 * _vm->tickLength()); _sound->playSoundEffect(track); } diff --git a/kyra/seqplayer.h b/kyra/seqplayer.h index 6e9f3cf2bf..ad747238c5 100644 --- a/kyra/seqplayer.h +++ b/kyra/seqplayer.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/sequences.cpp b/kyra/sequences.cpp index 1ac3574a47..8b7822f0e6 100644 --- a/kyra/sequences.cpp +++ b/kyra/sequences.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -43,7 +44,7 @@ void KyraEngine::seq_demo() { _screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0); _system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200); _screen->fadeFromBlack(); - waitTicks(60); + delay(60 * _tickLength); _screen->fadeToBlack(); _screen->clearPage(0); @@ -55,8 +56,7 @@ void KyraEngine::seq_demo() { _screen->fadeFromBlack(); _seq->playSequence(_seq_WestwoodLogo, true); - waitTicks(60); - + delay(60 * _tickLength); _seq->playSequence(_seq_KyrandiaLogo, true); _screen->fadeToBlack(); @@ -80,13 +80,14 @@ void KyraEngine::seq_demo() { _screen->copyRegion(0, 0, 0, 0, 320, 200, 6, 0); _system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200); _screen->fadeFromBlack(); - waitTicks(60); + delay(60 * _tickLength); _screen->fadeToBlack(); _sound->stopMusic(); } void KyraEngine::seq_intro() { debug(9, "KyraEngine::seq_intro()"); + if (_features & GF_TALKIE) { _res->loadPakFile("INTRO.VRM"); } @@ -115,7 +116,7 @@ void KyraEngine::seq_intro() { (this->*introProcTable[i])(); } _text->setTalkCoords(136); - waitTicks(30); + delay(30 * _tickLength); _seq->setCopyViewOffs(false); _sound->stopMusic(); if (_features & GF_TALKIE) { @@ -135,13 +136,13 @@ void KyraEngine::seq_introLogos() { _system->copyRectToScreen(_screen->getPagePtr(0), 320, 0, 0, 320, 200); _screen->fadeFromBlack(); - if (_seq->playSequence(_seq_WestwoodLogo, _skipIntroFlag)) { + if (_seq->playSequence(_seq_WestwoodLogo, _skipFlag)) { _screen->fadeToBlack(); _screen->clearPage(0); return; } - waitTicks(60); - if (_seq->playSequence(_seq_KyrandiaLogo, _skipIntroFlag)) { + delay(60 * _tickLength); + if (_seq->playSequence(_seq_KyrandiaLogo, _skipFlag) && !seq_skipSequence()) { _screen->fadeToBlack(); _screen->clearPage(0); return; @@ -152,9 +153,12 @@ void KyraEngine::seq_introLogos() { int h1 = 175; int y2 = 176; int h2 = 0; + int32 start, now; + int wait; _screen->copyRegion(0, 91, 0, 8, 320, 103, 6, 2); _screen->copyRegion(0, 0, 0, 111, 320, 64, 6, 2); do { + start = (int32)_system->getMillis(); if (h1 > 0) { _screen->copyRegion(0, y1, 0, 8, 320, h1, 2, 0); } @@ -166,7 +170,11 @@ void KyraEngine::seq_introLogos() { --y2; ++h2; _screen->updateScreen(); - waitTicks(1); + now = (int32)_system->getMillis(); + wait = _tickLength - (now - start); + if (wait > 0) { + delay(wait); + } } while (y2 >= 64); _seq->playSequence(_seq_Forest, true); @@ -176,22 +184,23 @@ void KyraEngine::seq_introStory() { debug(9, "KyraEngine::seq_introStory()"); _screen->clearPage(3); _screen->clearPage(0); - if ((_features & GF_ENGLISH) && (_features & GF_TALKIE)) { - loadBitmap("TEXT_ENG.CPS", 3, 3, 0); + if (_features & GF_TALKIE) { + return; + } else if (_features & GF_ENGLISH) { + loadBitmap("TEXT.CPS", 3, 3, 0); } else if (_features & GF_GERMAN) { loadBitmap("TEXT_GER.CPS", 3, 3, 0); } else if (_features & GF_FRENCH) { loadBitmap("TEXT_FRE.CPS", 3, 3, 0); } else if (_features & GF_SPANISH) { loadBitmap("TEXT_SPA.CPS", 3, 3, 0); - } else if ((_features & GF_ENGLISH) && (_features & GF_FLOPPY)) { - loadBitmap("TEXT.CPS", 3, 3, 0); } else { warning("no story graphics file found"); } _screen->copyRegion(0, 0, 0, 0, 320, 200, 3, 0); _screen->updateScreen(); - waitTicks(360); + debug("skipFlag %i, %i", _skipFlag, _tickLength); + delay(360 * _tickLength); } void KyraEngine::seq_introMalcolmTree() { @@ -852,7 +861,7 @@ int KyraEngine::seq_playEnd() { _screen->_curPage = 0; checkAmuletAnimFlags(); seq_brandonToStone(); - waitTicks(60); + delay(60 * _tickLength); return 1; } else { _endSequenceSkipFlag = 1; @@ -862,7 +871,7 @@ int KyraEngine::seq_playEnd() { _screen->_curPage = 0; _screen->hideMouse(); _screen->fadeSpecialPalette(32, 228, 20, 60); - waitTicks(60); + delay(60 * _tickLength); loadBitmap("GEMHEAL.CPS", 3, 3, _screen->_currentPalette); _screen->setScreenPalette(_screen->_currentPalette); _screen->shuffleScreen(8, 8, 304, 128, 2, 0, 1, 0); @@ -954,7 +963,7 @@ void KyraEngine::seq_playCredits() { // delete _screen->updateScreen(); // XXX - waitTicks(120); // wait until user presses escape normally + delay(120 * _tickLength); // wait until user presses escape normally _screen->fadeToBlack(); _screen->clearCurPage(); _screen->showMouse(); diff --git a/kyra/sound.cpp b/kyra/sound.cpp index 535a29a3b8..68f06d4fa6 100644 --- a/kyra/sound.cpp +++ b/kyra/sound.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -421,7 +422,7 @@ void KyraEngine::snd_playVoiceFile(int id) { void KyraEngine::snd_voiceWaitForFinish(bool ingame) { debug(9, "KyraEngine::snd_voiceWaitForFinish(%d)", ingame); - while (_sound->voiceIsPlaying() && !_fastMode) { + while (_sound->voiceIsPlaying() && !_skipFlag) { if (ingame) { delay(10, true); } else { diff --git a/kyra/sound.h b/kyra/sound.h index 9adce35819..150ee4c927 100644 --- a/kyra/sound.h +++ b/kyra/sound.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/sprites.cpp b/kyra/sprites.cpp index 9d91bb59e8..91d6eedb45 100644 --- a/kyra/sprites.cpp +++ b/kyra/sprites.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/sprites.h b/kyra/sprites.h index e368e994d0..b37f0990cd 100644 --- a/kyra/sprites.h +++ b/kyra/sprites.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/staticres.cpp b/kyra/staticres.cpp index 2720af4c03..66e10358c3 100644 --- a/kyra/staticres.cpp +++ b/kyra/staticres.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/text.cpp b/kyra/text.cpp index b39a589f12..540044dcd9 100644 --- a/kyra/text.cpp +++ b/kyra/text.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ @@ -92,6 +93,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch currPage = _screen->_curPage; _screen->_curPage = 2; _text->printCharacterText(chatStr, charNum, _characterList[charNum].x1); + _animator->_updateScreen = true; _screen->_curPage = currPage; _animator->copyChangedObjectsForward(0); @@ -104,7 +106,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch switch (event.type) { case OSystem::EVENT_KEYDOWN: if (event.kbd.keycode == '.') - runLoop = false; + _skipFlag = true; break; case OSystem::EVENT_QUIT: quitGame(); @@ -116,7 +118,7 @@ void KyraEngine::waitForChatToFinish(int16 chatDuration, char *chatStr, uint8 ch } } - if (_fastMode) + if (_skipFlag) runLoop = false; delayTime = (loopStart + _gameSpeed) - _system->getMillis(); diff --git a/kyra/text.h b/kyra/text.h index 59063e4e91..f8f7c975a6 100644 --- a/kyra/text.h +++ b/kyra/text.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/timer.cpp b/kyra/timer.cpp index 4dd50c569b..9cfcacf002 100644 --- a/kyra/timer.cpp +++ b/kyra/timer.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/wsamovie.cpp b/kyra/wsamovie.cpp index 6a61a80327..17fe3f8cb2 100644 --- a/kyra/wsamovie.cpp +++ b/kyra/wsamovie.cpp @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ diff --git a/kyra/wsamovie.h b/kyra/wsamovie.h index 40e911c5b8..fe3927f175 100644 --- a/kyra/wsamovie.h +++ b/kyra/wsamovie.h @@ -15,7 +15,8 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $Header$ + * $URL$ + * $Id$ * */ |