diff options
author | Johannes Schickel | 2006-07-25 15:11:42 +0000 |
---|---|---|
committer | Johannes Schickel | 2006-07-25 15:11:42 +0000 |
commit | 37d050e9da0ef9adb2de6c906e665ccda03c838b (patch) | |
tree | 8cbc49f5d6496664aa1c72f01816ed9c5d3d41ce /engines/kyra | |
parent | bb5280bb2f143d195d77675fa774e509ebed8179 (diff) | |
download | scummvm-rg350-37d050e9da0ef9adb2de6c906e665ccda03c838b.tar.gz scummvm-rg350-37d050e9da0ef9adb2de6c906e665ccda03c838b.tar.bz2 scummvm-rg350-37d050e9da0ef9adb2de6c906e665ccda03c838b.zip |
Add support for looping the kyra3 main menu.
svn-id: r23593
Diffstat (limited to 'engines/kyra')
-rw-r--r-- | engines/kyra/kyra.cpp | 1 | ||||
-rw-r--r-- | engines/kyra/kyra3.cpp | 105 |
2 files changed, 59 insertions, 47 deletions
diff --git a/engines/kyra/kyra.cpp b/engines/kyra/kyra.cpp index 2c346f9fac..299f93c5b4 100644 --- a/engines/kyra/kyra.cpp +++ b/engines/kyra/kyra.cpp @@ -104,6 +104,7 @@ KyraEngine::KyraEngine(OSystem *system) _scrollDownButton.process0PtrShape = _scrollDownButton.process1PtrShape = _scrollDownButton.process2PtrShape = 0; memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable)); _features = 0; + _quitFlag = false; } KyraEngine_v1::KyraEngine_v1(OSystem *system) diff --git a/engines/kyra/kyra3.cpp b/engines/kyra/kyra3.cpp index 258330e4c5..0bf7c865da 100644 --- a/engines/kyra/kyra3.cpp +++ b/engines/kyra/kyra3.cpp @@ -93,59 +93,70 @@ int KyraEngine_v3::init() { } int KyraEngine_v3::go() { - _screen->_curPage = 0; - _screen->clearPage(0); - - uint8 pal[768]; - memset(pal, 0, sizeof(pal)); + uint8 *pal = _screen->getPalette(1); + assert(pal); WSAMovieV3 *logo = new WSAMovieV3(this); + assert(logo); logo->open("REVENGE.WSA", 1, pal); assert(logo->opened()); - pal[0] = pal[1] = pal[2] = 0; - - _screen->setScreenPalette(pal); - - // XXX - playMenuAudioFile(); - - logo->setX(0); logo->setY(0); - logo->setDrawPage(0); + bool running = true; + while (running) { + _screen->_curPage = 0; + _screen->clearPage(0); - for (int i = 0; i < 64 && !_quitFlag; ++i) { - uint32 nextRun = _system->getMillis() + 3 * _tickLength; - logo->displayFrame(i); - _screen->updateScreen(); - delayUntil(nextRun); - } + pal[0] = pal[1] = pal[2] = 0; + + _screen->setScreenPalette(pal); + + // XXX + playMenuAudioFile(); + + logo->setX(0); logo->setY(0); + logo->setDrawPage(0); - for (int i = 64; i > 29 && !_quitFlag; --i) { - uint32 nextRun = _system->getMillis() + 3 * _tickLength; - logo->displayFrame(i); - _screen->updateScreen(); - delayUntil(nextRun); - } - - switch (handleMainMenu(logo)) { - case 0: - break; - - case 1: - playVQA("K3INTRO"); - // TODO: Restart the menu animation - break; - - case 2: - break; - - case 3: - break; - - default: - break; + for (int i = 0; i < 64 && !_quitFlag; ++i) { + uint32 nextRun = _system->getMillis() + 3 * _tickLength; + logo->displayFrame(i); + _screen->updateScreen(); + delayUntil(nextRun); + } + + for (int i = 64; i > 29 && !_quitFlag; --i) { + uint32 nextRun = _system->getMillis() + 3 * _tickLength; + logo->displayFrame(i); + _screen->updateScreen(); + delayUntil(nextRun); + } + + switch (handleMainMenu(logo)) { + case 0: + //delete logo; + //logo = 0; + //XXX run game + //running = false; + break; + + case 1: + playVQA("K3INTRO"); + break; + + case 2: + //delete logo; + //logo = 0; + //show load dialog + //running = false; + break; + + case 3: + running = false; + break; + + default: + break; + } } - delete logo; return 0; @@ -301,8 +312,8 @@ int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) { // TODO: Flash the text command = item; - // TODO: For now, only the intro is supported - if (command != 1) + // TODO: For now, only playing the intro and quitting is supported + if (command != 1 && command != 3) command = -1; } } |