diff options
author | Nicola Mettifogo | 2007-05-06 09:59:05 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-05-06 09:59:05 +0000 |
commit | e2f8d9c80b89f7795b55baf906a23f6f99fe3287 (patch) | |
tree | 8cb5dcf2eb62063b05039503ed232a2579546dfa /engines | |
parent | 6ddc79a9a84bf8b8dbbfe28e4ffafeff5f87b26b (diff) | |
download | scummvm-rg350-e2f8d9c80b89f7795b55baf906a23f6f99fe3287.tar.gz scummvm-rg350-e2f8d9c80b89f7795b55baf906a23f6f99fe3287.tar.bz2 scummvm-rg350-e2f8d9c80b89f7795b55baf906a23f6f99fe3287.zip |
Menu handling simplification.
svn-id: r26760
Diffstat (limited to 'engines')
-rw-r--r-- | engines/parallaction/menu.cpp | 77 | ||||
-rw-r--r-- | engines/parallaction/menu.h | 1 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 5 |
3 files changed, 53 insertions, 30 deletions
diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp index 5f804d59f4..74d5b07827 100644 --- a/engines/parallaction/menu.cpp +++ b/engines/parallaction/menu.cpp @@ -94,6 +94,7 @@ static uint16 _doughKey[] = { 1, 7 ,7, 2, 2, 6 }; Menu::Menu(Parallaction *vm) { _vm = vm; + } Menu::~Menu() { @@ -105,6 +106,20 @@ void Menu::start() { _vm->_disk->selectArchive((_vm->getPlatform() == Common::kPlatformPC) ? "disk1" : "disk0"); + splash(); + + _language = chooseLanguage(); + _vm->_disk->setLanguage(_language); + + int game = selectGame(); + if (game == 0) + newGame(); + + return; +} + +void Menu::splash() { + _vm->_disk->loadSlide("intro"); _vm->_gfx->setPalette(_vm->_gfx->_palette); _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); @@ -115,33 +130,17 @@ void Menu::start() { _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); g_system->delayMillis(2000); - if (_vm->getPlatform() == Common::kPlatformPC) { - _vm->_gfx->setFont(kFontMenu); - - _vm->_disk->loadSlide("lingua"); - _vm->_gfx->setPalette(_vm->_gfx->_palette); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); - - _vm->_gfx->displayString(60, 30, "SELECT LANGUAGE"); - - _vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); - _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); - _language = chooseLanguage(); - - _vm->_disk->setLanguage(_language); - - if (selectGame() == 0) { - newGame(); - } - } else { - _vm->_disk->setLanguage(1); - } - - return; } void Menu::newGame() { + if (_vm->getFeatures() & GF_DEMO) { + // character screen is not shown on demo + // so user warps to the playable intro + strcpy(_vm->_location._name, "fognedemo"); + return; + } + const char **v14 = introMsg3; _vm->_disk->loadScenery("test", NULL); @@ -156,7 +155,6 @@ void Menu::newGame() { _vm->_gfx->updateScreen(); _vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); - _mouseButtons = kMouseNone; for (; _mouseButtons != kMouseLeftUp; ) { @@ -164,8 +162,10 @@ void Menu::newGame() { if (_mouseButtons == kMouseRightUp) break; } - if (_mouseButtons != kMouseRightUp) + if (_mouseButtons != kMouseRightUp) { + strcpy(_vm->_location._name, "fogne"); return; // show intro + } selectCharacter(); @@ -177,6 +177,25 @@ void Menu::newGame() { uint16 Menu::chooseLanguage() { + if (_vm->getPlatform() == Common::kPlatformAmiga) { + // TODO: should return the language ID supported by this version + // this can be done with some flags in the detection structures + return 1; + } + + // user can choose language in dos version + + _vm->_gfx->setFont(kFontMenu); + + _vm->_disk->loadSlide("lingua"); + _vm->_gfx->setPalette(_vm->_gfx->_palette); + _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront); + + _vm->_gfx->displayString(60, 30, "SELECT LANGUAGE"); + + _vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack); + _vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2); + _vm->changeCursor(kCursorArrow); do { @@ -210,6 +229,9 @@ uint16 Menu::chooseLanguage() { uint16 Menu::selectGame() { // printf("selectGame()\n"); + if (_vm->getFeatures() & GF_DEMO) { + return 0; // can't load a savegame in demo versions + } _vm->_disk->loadSlide("restore"); _vm->_gfx->setPalette(_vm->_gfx->_palette); @@ -254,6 +276,11 @@ uint16 Menu::selectGame() { // load game + // TODO: allow the user to change her mind in this screen, that is + // don't force her to start at the intro when she closes her load + // game window without picking a savegame. + // The 2 strcpy's below act as workaround to prevent crashes for + // time being. strcpy(_vm->_location._name, "fogne"); strcpy(_vm->_characterName, "dough"); diff --git a/engines/parallaction/menu.h b/engines/parallaction/menu.h index 666305e693..8f9c870a84 100644 --- a/engines/parallaction/menu.h +++ b/engines/parallaction/menu.h @@ -41,6 +41,7 @@ public: void selectCharacter(); protected: + void splash(); void newGame(); uint16 chooseLanguage(); uint16 selectGame(); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index ac76ca49ca..87c06b8c36 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -193,11 +193,6 @@ int Parallaction::init() { _location._startPosition.y = -1000; _location._startFrame = 0; - if (getFeatures() & GF_DEMO) - strcpy(_location._name, "fognedemo"); - else - strcpy(_location._name, "fogne"); - _location._comment = NULL; _location._endComment = NULL; |