From 91d79769cc2a0189ed106fb454e14135a995f8ee Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 29 Oct 2017 17:06:58 -0400 Subject: XEEN: Enable starting game from startup menu --- engines/xeen/worldofxeen/worldofxeen.cpp | 4 ++++ engines/xeen/worldofxeen/worldofxeen.h | 2 ++ engines/xeen/worldofxeen/worldofxeen_menu.cpp | 13 +++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp index 93a0005088..0b19c607ff 100644 --- a/engines/xeen/worldofxeen/worldofxeen.cpp +++ b/engines/xeen/worldofxeen/worldofxeen.cpp @@ -38,6 +38,10 @@ WorldOfXeenEngine::WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *g void WorldOfXeenEngine::outerGameLoop() { //_pendingAction = getGameID() == GType_DarkSide ? WOX_DARKSIDE_INTRO : WOX_CLOUDS_INTRO; _pendingAction = WOX_MENU; + if (gDebugLevel >= 1) + // Skip main menu when starting in debug mode + _pendingAction = WOX_PLAY_GAME; + while (!shouldQuit() && _pendingAction != WOX_QUIT) { switch (_pendingAction) { case WOX_CLOUDS_INTRO: diff --git a/engines/xeen/worldofxeen/worldofxeen.h b/engines/xeen/worldofxeen/worldofxeen.h index 7dbb710430..0177e7cacf 100644 --- a/engines/xeen/worldofxeen/worldofxeen.h +++ b/engines/xeen/worldofxeen/worldofxeen.h @@ -61,6 +61,8 @@ public: void setPendingAction(WOXGameAction action) { _pendingAction = action; } }; +#define WOX_VM (*(::Xeen::WorldOfXeen::WorldOfXeenEngine *)g_vm) + } // End of namespace WorldOfXeen } // End of namespace Xeen diff --git a/engines/xeen/worldofxeen/worldofxeen_menu.cpp b/engines/xeen/worldofxeen/worldofxeen_menu.cpp index ff73cab4bb..fb25ba1757 100644 --- a/engines/xeen/worldofxeen/worldofxeen_menu.cpp +++ b/engines/xeen/worldofxeen/worldofxeen_menu.cpp @@ -23,6 +23,7 @@ #include "common/scummsys.h" #include "xeen/worldofxeen/worldofxeen_menu.h" #include "xeen/resources.h" +#include "xeen/worldofxeen/worldofxeen.h" namespace Xeen { namespace WorldOfXeen { @@ -92,13 +93,17 @@ void WorldOfXeenMenu::execute() { int key = toupper(_buttonValue); _buttonValue = 0; - if (key == 'C' || key == 'V') { + if (key == 27) { + // Hide the options menu + break; + } else if (key == 'C' || key == 'V') { // Show credits CreditsScreen::show(_vm); break; - } else if (key == 27) { - // Hide the options menu - break; + } else if (key == 'S') { + // Start new game + WOX_VM._pendingAction = WOX_PLAY_GAME; + return; } } } -- cgit v1.2.3