diff options
author | johndoe123 | 2013-01-29 11:00:49 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:47:42 +0200 |
commit | 53a81d11b8e5e34478e75a8797b094ec53976c68 (patch) | |
tree | cbc47b45d7d17a4c725dba2db97319a185cfb745 /engines | |
parent | 65c6984635849f451d2137a37407813a3ada105e (diff) | |
download | scummvm-rg350-53a81d11b8e5e34478e75a8797b094ec53976c68.tar.gz scummvm-rg350-53a81d11b8e5e34478e75a8797b094ec53976c68.tar.bz2 scummvm-rg350-53a81d11b8e5e34478e75a8797b094ec53976c68.zip |
NEVERHOOD: Don't allow main menu until _canRequestMainMenu is set
- Clean up GameModule
Diffstat (limited to 'engines')
-rw-r--r-- | engines/neverhood/gamemodule.cpp | 27 | ||||
-rw-r--r-- | engines/neverhood/gamemodule.h | 5 |
2 files changed, 8 insertions, 24 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index 48462a2282..493d16d7dd 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -75,7 +75,8 @@ enum { GameModule::GameModule(NeverhoodEngine *vm) : Module(vm, NULL), _moduleNum(-1), _prevChildObject(NULL), _prevModuleNum(-1), - _restoreGameRequested(false), _restartGameRequested(false), _mainMenuRequested(false), _gameWasLoaded(false) { + _restoreGameRequested(false), _restartGameRequested(false), _canRequestMainMenu(true), + _mainMenuRequested(false) { // Other initializations moved to actual engine class _vm->_soundMan->playSoundThree(0x002D0031, 0x8861079); @@ -147,7 +148,7 @@ void GameModule::handleKeyDown(Common::KeyCode keyCode) { void GameModule::handleEscapeKey() { if (_vm->isDemo()) _vm->quitGame(); - else if (!_prevChildObject /* && _canRequestMainMenu TODO?*/) + else if (!_prevChildObject && _canRequestMainMenu) _mainMenuRequested = true; else if (_childObject) sendMessage(_childObject, 0x000C, 0); @@ -334,7 +335,7 @@ uint32 GameModule::handleMessage(int messageNum, const MessageParam ¶m, Enti uint32 messageResult = Module::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x0800: - _someFlag1 = true; + _canRequestMainMenu = true; break; case 0x1009: _moduleResult = param.asInteger(); @@ -344,15 +345,12 @@ uint32 GameModule::handleMessage(int messageNum, const MessageParam ¶m, Enti case 0x1023: // Unused resource preloading messages break; - case 0x101F: - _field2C = true; - break; } return messageResult; } void GameModule::startup() { -#if 0 +#if 1 createModule(1500, 0); // Logos and intro video // Real game start #else // DEBUG>>> @@ -524,7 +522,7 @@ void GameModule::createModule(int moduleNum, int which) { _childObject = new Module1400(_vm, this, which); break; case 1500: - _someFlag1 = false; + _canRequestMainMenu = false; setGlobalVar(V_MODULE_NAME, 0x00F10114); _childObject = new Module1500(_vm, this, which); break; @@ -876,21 +874,10 @@ void GameModule::updateMenuModule() { // TODO Restore FPS? _childObject = _prevChildObject; // TODO Restore Smacker handle, screen offsets - sendMessage(_childObject, 0x101E, 0); // TODO CHECKME Is this needed? + sendMessage(_childObject, 0x101E, 0); _prevChildObject = NULL; _moduleNum = _prevModuleNum; SetUpdateHandler(&GameModule::updateModule); - } else if (_gameWasLoaded) { -#if 0 // TODO Handle this in some other way... - _gameWasLoaded = false; - delete _childObject; - delete _prevChildObject; - _childObject = NULL; - _prevChildObject = NULL; - _prevModuleNum = 0; - // TODO Create module from savegame values... - // TODO createModuleByHash(...); -#endif } } diff --git a/engines/neverhood/gamemodule.h b/engines/neverhood/gamemodule.h index 04fc780b02..df8f015659 100644 --- a/engines/neverhood/gamemodule.h +++ b/engines/neverhood/gamemodule.h @@ -58,13 +58,10 @@ public: protected: Entity *_prevChildObject; int _prevModuleNum; - bool _gameWasLoaded; bool _restoreGameRequested; bool _restartGameRequested; + bool _canRequestMainMenu; bool _mainMenuRequested; - bool _someFlag1; - bool _field2C; - uint32 _counter; int _moduleNum; uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); void createModule(int moduleNum, int which); |