Add support for looping the kyra3 main menu.

svn-id: r23593
This commit is contained in:
Johannes Schickel 2006-07-25 15:11:42 +00:00
parent bb5280bb2f
commit 37d050e9da
2 changed files with 59 additions and 47 deletions

View File

@ -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)

View File

@ -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);
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;
}
}
switch (handleMainMenu(logo)) {
case 0:
break;
case 1:
playVQA("K3INTRO");
// TODO: Restart the menu animation
break;
case 2:
break;
case 3:
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;
}
}