aboutsummaryrefslogtreecommitdiff
path: root/engines/avalanche/mainmenu.cpp
diff options
context:
space:
mode:
authoruruk2014-03-06 23:01:53 +0100
committeruruk2014-03-06 23:02:07 +0100
commitd09b482bcb976ab36a5a4aa670b7258b1e12a65c (patch)
tree825c5bdf2bdd8e3763fb4c234a14f5d231c48855 /engines/avalanche/mainmenu.cpp
parentd22d20077b15e9d45a5892380681380d4f84fd3d (diff)
downloadscummvm-rg350-d09b482bcb976ab36a5a4aa670b7258b1e12a65c.tar.gz
scummvm-rg350-d09b482bcb976ab36a5a4aa670b7258b1e12a65c.tar.bz2
scummvm-rg350-d09b482bcb976ab36a5a4aa670b7258b1e12a65c.zip
AVALANCHE: Implement MainMenu::wait().
Rework other pieces of the engine to fit to it's mechanism.
Diffstat (limited to 'engines/avalanche/mainmenu.cpp')
-rw-r--r--engines/avalanche/mainmenu.cpp33
1 files changed, 31 insertions, 2 deletions
diff --git a/engines/avalanche/mainmenu.cpp b/engines/avalanche/mainmenu.cpp
index 0f64527305..543684556c 100644
--- a/engines/avalanche/mainmenu.cpp
+++ b/engines/avalanche/mainmenu.cpp
@@ -37,6 +37,7 @@ MainMenu::MainMenu(AvalancheEngine *vm) {
}
void MainMenu::run() {
+ CursorMan.showMouse(false);
_vm->_graphics->menuInitialize();
_vm->_graphics->menuLoadPictures();
loadRegiInfo();
@@ -54,7 +55,6 @@ void MainMenu::run() {
_vm->_graphics->menuRefreshScreen();
wait();
- _vm->_graphics->menuClear();
}
void MainMenu::loadFont() {
@@ -81,7 +81,36 @@ void MainMenu::centre(int16 y, Common::String text) {
}
void MainMenu::wait() {
- warning("STUB: MainMenu::wait()");
+ int x = 0;
+ while (!_vm->shouldQuit()) {
+ _vm->_graphics->menuDrawIndicator(x);
+ _vm->_system->delayMillis(40);
+ x++;
+ if (x == 641)
+ x = 0;
+ Common::Event event;
+ _vm->getEvent(event);
+ if (event.type == Common::EVENT_KEYDOWN) {
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_SPACE:
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_1: // Falltroughs are inteded.
+ // Play the game
+ _vm->_graphics->menuFree();
+ _vm->_graphics->menuRestoreScreen();
+ CursorMan.showMouse(true);
+ return;
+ case Common::KEYCODE_ESCAPE:
+ case Common::KEYCODE_6: // Falltroughs are inteded.
+ // Exit back to DOS
+ _vm->_letMeOut = true;
+ _vm->_graphics->menuFree();
+ return;
+ default:
+ break;
+ }
+ }
+ }
}
} // End of namespace Avalanche