diff options
Diffstat (limited to 'engines/xeen/worldofxeen')
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen.cpp | 57 | ||||
-rw-r--r-- | engines/xeen/worldofxeen/worldofxeen.h | 17 |
2 files changed, 60 insertions, 14 deletions
diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp index 0ad76ce09b..19ca2f2bb1 100644 --- a/engines/xeen/worldofxeen/worldofxeen.cpp +++ b/engines/xeen/worldofxeen/worldofxeen.cpp @@ -34,19 +34,50 @@ WorldOfXeenEngine::WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *g _seenDarkSideIntro = false; } -void WorldOfXeenEngine::showIntro() { - File::setCurrentArchive(INTRO_ARCHIVE); - - // **DEBUG** - if (gDebugLevel == 0) - return; - - showCloudsEnding(); - /* - bool completed = showDarkSideTitle(); - if (!_seenDarkSideIntro && completed) - showDarkSideIntro(); - */ +void WorldOfXeenEngine::outerGameLoop() { + _pendingAction = getGameID() == GType_DarkSide ? WOX_DARKSIDE_INTRO : WOX_CLOUDS_INTRO; + + while (!shouldQuit() && _pendingAction != WOX_QUIT) { + switch (_pendingAction) { + case WOX_CLOUDS_INTRO: + if (showCloudsTitle()) + showCloudsIntro(); + _pendingAction = WOX_MENU; + break; + + case WOX_CLOUDS_ENDING: + showCloudsEnding(); + _pendingAction = WOX_MENU; + break; + + case WOX_DARKSIDE_INTRO: + if (showDarkSideTitle()) + showDarkSideIntro(); + _pendingAction = WOX_MENU; + break; + + case WOX_DARKSIDE_ENDING: + showDarkSideEnding(); + _pendingAction = WOX_MENU; + break; + + case WOX_WORLD_ENDING: + // TODO + return; + + case WOX_MENU: + // TODO + _pendingAction = WOX_PLAY_GAME; + break; + + case WOX_PLAY_GAME: + playGame(); + break; + + default: + break; + } + } } } // End of namespace WorldOfXeen diff --git a/engines/xeen/worldofxeen/worldofxeen.h b/engines/xeen/worldofxeen/worldofxeen.h index 3dceb891ee..41fe4b3b83 100644 --- a/engines/xeen/worldofxeen/worldofxeen.h +++ b/engines/xeen/worldofxeen/worldofxeen.h @@ -30,6 +30,11 @@ 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 @@ -38,12 +43,22 @@ namespace WorldOfXeen { class WorldOfXeenEngine: public XeenEngine, public CloudsCutscenes, public DarkSideCutscenes { protected: - virtual void showIntro(); + /** + * Outer gameplay loop responsible for dispatching control to game-specific + * intros, main menus, or to play the actual game + */ + virtual void outerGameLoop(); public: bool _seenDarkSideIntro; + WOXGameAction _pendingAction; public: WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc); virtual ~WorldOfXeenEngine() {} + + /** + * Set the next overall game action to do + */ + void setPendingAction(WOXGameAction action) { _pendingAction = action; } }; } // End of namespace WorldOfXeen |