diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/neverhood/gamemodule.cpp | 4 | ||||
-rw-r--r-- | engines/neverhood/module1500.cpp | 34 | ||||
-rw-r--r-- | engines/neverhood/module1500.h | 6 |
3 files changed, 20 insertions, 24 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index 732cff7d93..b9ad01ee57 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -319,7 +319,7 @@ void GameModule::startup() { _vm->gameState().which = 2; _vm->gameState().sceneNum = 3; - createModule(1400, -1); + createModule(1500, 0); #endif #if 0 _vm->gameState().sceneNum = 0; @@ -411,7 +411,7 @@ void GameModule::createModule(int moduleNum, int which) { case 1500: _someFlag1 = false; setGlobalVar(V_MODULE_NAME, 0x00F10114); - _childObject = new Module1500(_vm, this, which, true); + _childObject = new Module1500(_vm, this, which); break; case 1600: setGlobalVar(V_MODULE_NAME, 0x01A008D8); diff --git a/engines/neverhood/module1500.cpp b/engines/neverhood/module1500.cpp index 0b55209b9f..98c55bcc13 100644 --- a/engines/neverhood/module1500.cpp +++ b/engines/neverhood/module1500.cpp @@ -24,32 +24,35 @@ namespace Neverhood { -Module1500::Module1500(NeverhoodEngine *vm, Module *parentModule, int which, bool flag) - : Module(vm, parentModule), _flag(flag) { +Module1500::Module1500(NeverhoodEngine *vm, Module *parentModule, int which) + : Module(vm, parentModule) { - if (which < 0) { + if (which < 0) createScene(_vm->gameState().sceneNum, -1); - } else { + else createScene(3, -1); - } } void Module1500::createScene(int sceneNum, int which) { debug("Module1500::createScene(%d, %d)", sceneNum, which); - _vm->gameState().sceneNum = sceneNum; - switch (_vm->gameState().sceneNum) { + _sceneNum = sceneNum; + switch (_sceneNum) { case 0: + _vm->gameState().sceneNum = 0; _childObject = new Scene1501(_vm, this, 0x8420221D, 0xA61024C4, 150, 48); break; case 1: + _vm->gameState().sceneNum = 1; _childObject = new Scene1501(_vm, this, 0x30050A0A, 0x58B45E58, 110, 48); break; case 2: + _vm->gameState().sceneNum = 2; sendMessage(_parentModule, 0x0800, 0); createSmackerScene(0x001A0005, true, true, true); break; case 3: + _vm->gameState().sceneNum = 3; _childObject = new Scene1501(_vm, this, 0x0CA04202, 0, 110, 48); break; } @@ -59,16 +62,12 @@ void Module1500::createScene(int sceneNum, int which) { void Module1500::updateScene() { if (!updateChild()) { - switch (_vm->gameState().sceneNum) { + switch (_sceneNum) { case 0: createScene(1, -1); break; case 1: - if (_flag) { - createScene(2, -1); - } else { - leaveModule(0); - } + createScene(2, -1); break; case 3: createScene(0, -1); @@ -83,13 +82,12 @@ void Module1500::updateScene() { // Scene1501 Scene1501::Scene1501(NeverhoodEngine *vm, Module *parentModule, uint32 backgroundFileHash, uint32 soundFileHash, int countdown2, int countdown3) - : Scene(vm, parentModule, true), _countdown3(countdown3), _countdown2(countdown2), _countdown1(0), _flag(false) { + : Scene(vm, parentModule, true), _countdown3(countdown3), _countdown2(countdown2), _countdown1(0), _skip(false) { SetUpdateHandler(&Scene1501::update); SetMessageHandler(&Scene1501::handleMessage); setBackground(backgroundFileHash); - setPalette(); addEntity(_palette); _palette->addBasePalette(backgroundFileHash, 0, 256, 0); @@ -101,9 +99,7 @@ Scene1501::Scene1501(NeverhoodEngine *vm, Module *parentModule, uint32 backgroun } void Scene1501::update() { - Scene::update(); - if (_countdown1 != 0) { _countdown1--; if (_countdown1 == 0) { @@ -118,7 +114,7 @@ void Scene1501::update() { if (_countdown3 != 0) _countdown3--; - if (_countdown3 == 0 && _flag && _countdown1 == 0) { + if (_countdown3 == 0 && _skip && _countdown1 == 0) { _countdown1 = 12; _palette->startFadeToBlack(11); } @@ -129,7 +125,7 @@ uint32 Scene1501::handleMessage(int messageNum, const MessageParam ¶m, Entit uint32 messageResult = Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x0009: - _flag = true; + _skip = true; break; } return messageResult; diff --git a/engines/neverhood/module1500.h b/engines/neverhood/module1500.h index c562a24615..c17cb4516c 100644 --- a/engines/neverhood/module1500.h +++ b/engines/neverhood/module1500.h @@ -34,9 +34,9 @@ namespace Neverhood { class Module1500 : public Module { public: - Module1500(NeverhoodEngine *vm, Module *parentModule, int which, bool flag); + Module1500(NeverhoodEngine *vm, Module *parentModule, int which); protected: - bool _flag; + int _sceneNum; void createScene(int sceneNum, int which); void updateScene(); }; @@ -48,7 +48,7 @@ protected: int _countdown1; int _countdown2; int _countdown3; - bool _flag; + bool _skip; void update(); uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); }; |