aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/worldofxeen
diff options
context:
space:
mode:
authorPaul Gilbert2018-02-26 19:15:00 -0500
committerPaul Gilbert2018-02-26 19:15:00 -0500
commit0fc11aef63d2abbc695d64ed41053b4163aac69c (patch)
tree5c3da450b0112529f48e909a81cb58609052f1ba /engines/xeen/worldofxeen
parent724c4e57add58362395ad6b6e79bcdaed1ff073b (diff)
downloadscummvm-rg350-0fc11aef63d2abbc695d64ed41053b4163aac69c.tar.gz
scummvm-rg350-0fc11aef63d2abbc695d64ed41053b4163aac69c.tar.bz2
scummvm-rg350-0fc11aef63d2abbc695d64ed41053b4163aac69c.zip
XEEN: Cleanup of the game title, intro, and menu launching code
Diffstat (limited to 'engines/xeen/worldofxeen')
-rw-r--r--engines/xeen/worldofxeen/worldofxeen.cpp91
-rw-r--r--engines/xeen/worldofxeen/worldofxeen.h21
-rw-r--r--engines/xeen/worldofxeen/worldofxeen_menu.cpp3
3 files changed, 41 insertions, 74 deletions
diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp
index 54d3b482fc..9403b94bc2 100644
--- a/engines/xeen/worldofxeen/worldofxeen.cpp
+++ b/engines/xeen/worldofxeen/worldofxeen.cpp
@@ -32,63 +32,7 @@ namespace WorldOfXeen {
WorldOfXeenEngine::WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
: XeenEngine(syst, gameDesc), WorldOfXeenCutscenes(this) {
_seenDarkSideIntro = false;
- _pendingAction = WOX_PLAY_GAME;
-}
-
-void WorldOfXeenEngine::outerGameLoop() {
- //_pendingAction = getGameID() == GType_DarkSide ? WOX_DARKSIDE_INTRO : WOX_CLOUDS_INTRO;
- _pendingAction = WOX_MENU;
-
- if (_loadSaveSlot != -1)
- // Loading savegame from launcher, so Skip menu and go straight to game
- _pendingAction = WOX_PLAY_GAME;
-
- while (!shouldQuit() && _pendingAction != WOX_QUIT) {
- // TODO: Remove this once proper startup menus are added for Clouds & Dark Side
- if (g_vm->getGameID() != GType_WorldOfXeen) {
- _saves->newGame();
- _pendingAction = WOX_PLAY_GAME;
- }
-
- WOXGameAction action = _pendingAction;
- _pendingAction = WOX_MENU;
- _quitMode = QMODE_NONE;
-
- switch (action) {
- case WOX_CLOUDS_INTRO:
- if (showCloudsTitle())
- showCloudsIntro();
- break;
-
- case WOX_CLOUDS_ENDING:
- //showCloudsEnding();
- break;
-
- case WOX_DARKSIDE_INTRO:
- if (showDarkSideTitle())
- showDarkSideIntro();
- break;
-
- case WOX_DARKSIDE_ENDING:
- //showDarkSideEnding();
- break;
-
- case WOX_WORLD_ENDING:
- // TODO
- return;
-
- case WOX_MENU:
- WorldOfXeenMenu::show(this);
- break;
-
- case WOX_PLAY_GAME:
- playGame();
- break;
-
- default:
- break;
- }
- }
+ _gameMode = GMODE_STARTUP;
}
void WorldOfXeenEngine::death() {
@@ -218,11 +162,42 @@ void WorldOfXeenEngine::showCutscene(const Common::String &name, int status, uin
showDarkSideEnding(score);
else if (name == "WORLDEND")
showWorldOfXeenEnding((GooberState)status, score);
+ else if (name == "CLOUDS_TITLE")
+ showCloudsTitle();
+ else if (name == "CLOUDS_INTRO")
+ showCloudsIntro();
+ else if (name == "DARKSIDE_TITLE")
+ showDarkSideTitle();
+ else if (name == "DARKSIDE_INTRO")
+ showDarkSideIntro();
_screen->freePages();
_sound->stopAllAudio();
_events->clearEvents();
- _quitMode = QMODE_MENU;
+ _gameMode = GMODE_MENU;
+}
+
+void WorldOfXeenEngine::showStartup() {
+ if (getGameID() == GType_Clouds) {
+ if (showCloudsTitle())
+ showCloudsIntro();
+ } else {
+ if (showDarkSideTitle())
+ showDarkSideIntro();
+ }
+
+ _gameMode = GMODE_MENU;
+}
+
+void WorldOfXeenEngine::showMainMenu() {
+ if (getGameID() != GType_WorldOfXeen) {
+ // TODO: Implement menus for Clouds and Dark Side of Xeen
+ _saves->newGame();
+ _gameMode = GMODE_PLAY_GAME;
+ return;
+ }
+
+ WorldOfXeenMenu::show(this);
}
} // End of namespace WorldOfXeen
diff --git a/engines/xeen/worldofxeen/worldofxeen.h b/engines/xeen/worldofxeen/worldofxeen.h
index f985947af4..08c2e25ace 100644
--- a/engines/xeen/worldofxeen/worldofxeen.h
+++ b/engines/xeen/worldofxeen/worldofxeen.h
@@ -29,11 +29,6 @@
namespace Xeen {
namespace WorldOfXeen {
-enum WOXGameAction {
- WOX_QUIT, WOX_CLOUDS_INTRO, WOX_CLOUDS_ENDING, WOX_DARKSIDE_INTRO,
- WOX_DARKSIDE_ENDING, WOX_WORLD_ENDING, WOX_MENU, WOX_PLAY_GAME
-};
-
/**
* Implements a descendant of the base Xeen engine to handle
* Clouds of Xeen, Dark Side of Xeen, and Worlds of Xeen specific
@@ -42,10 +37,14 @@ enum WOXGameAction {
class WorldOfXeenEngine: public XeenEngine, public WorldOfXeenCutscenes {
protected:
/**
- * Outer gameplay loop responsible for dispatching control to game-specific
- * intros, main menus, or to play the actual game
+ * Show the starting sequence/intro
+ */
+ virtual void showStartup();
+
+ /**
+ * Show the startup menu
*/
- virtual void outerGameLoop();
+ virtual void showMainMenu();
/**
* Death cutscene
@@ -53,7 +52,6 @@ protected:
virtual void death();
public:
bool _seenDarkSideIntro;
- WOXGameAction _pendingAction;
public:
WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc);
virtual ~WorldOfXeenEngine() {}
@@ -67,11 +65,6 @@ public:
* Dream sequence
*/
virtual void dream();
-
- /**
- * Set the next overall game action to do
- */
- void setPendingAction(WOXGameAction action) { _pendingAction = action; }
};
#define WOX_VM (*(::Xeen::WorldOfXeen::WorldOfXeenEngine *)g_vm)
diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.cpp b/engines/xeen/worldofxeen/worldofxeen_menu.cpp
index f43b00f027..42a55885a0 100644
--- a/engines/xeen/worldofxeen/worldofxeen_menu.cpp
+++ b/engines/xeen/worldofxeen/worldofxeen_menu.cpp
@@ -112,8 +112,7 @@ void WorldOfXeenMenu::execute() {
// Load a new game state and set the difficulty
_vm->_saves->newGame();
_vm->_party->_difficulty = (Difficulty)result;
-
- WOX_VM._pendingAction = WOX_PLAY_GAME;
+ _vm->_gameMode = GMODE_PLAY_GAME;
closeWindow();
return;
}