diff options
-rw-r--r-- | engines/neverhood/module.cpp | 14 | ||||
-rw-r--r-- | engines/neverhood/module.h | 2 | ||||
-rw-r--r-- | engines/neverhood/module1200.cpp | 7 | ||||
-rw-r--r-- | engines/neverhood/module1400.cpp | 1 | ||||
-rw-r--r-- | engines/neverhood/module1500.cpp | 8 | ||||
-rw-r--r-- | engines/neverhood/module1700.cpp | 17 | ||||
-rw-r--r-- | engines/neverhood/module1800.cpp | 40 | ||||
-rw-r--r-- | engines/neverhood/module2300.cpp | 18 |
8 files changed, 37 insertions, 70 deletions
diff --git a/engines/neverhood/module.cpp b/engines/neverhood/module.cpp index 8f0b55625a..15960e8e44 100644 --- a/engines/neverhood/module.cpp +++ b/engines/neverhood/module.cpp @@ -21,6 +21,8 @@ */ #include "neverhood/module.h" +#include "neverhood/navigationscene.h" +#include "neverhood/smackerscene.h" namespace Neverhood { @@ -70,4 +72,16 @@ uint32 Module::handleMessage(int messageNum, const MessageParam ¶m, Entity * return 0; } +void Module::createNavigationScene(uint32 navigationListId, int navigationIndex, const byte *itemsTypes) { + _childObject = new NavigationScene(_vm, this, navigationListId, navigationIndex, itemsTypes); +} + +void Module::createSmackerScene(uint32 fileHash, bool doubleSurface, bool flag1, bool canAbort) { + SmackerScene *smackerScene; + smackerScene = new SmackerScene(_vm, this, doubleSurface, flag1, canAbort); + smackerScene->setFileHash(fileHash); + smackerScene->nextVideo(); + _childObject = smackerScene; +} + } // End of namespace Neverhood diff --git a/engines/neverhood/module.h b/engines/neverhood/module.h index 790130a3e4..fd35f0d135 100644 --- a/engines/neverhood/module.h +++ b/engines/neverhood/module.h @@ -48,6 +48,8 @@ protected: int16 _field24, _field26, _field28; uint32 _field20; uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); + void createNavigationScene(uint32 navigationListId, int navigationIndex, const byte *itemsTypes = NULL); + void createSmackerScene(uint32 fileHash, bool doubleSurface, bool flag1, bool canAbort); }; } // End of namespace Neverhood diff --git a/engines/neverhood/module1200.cpp b/engines/neverhood/module1200.cpp index 7a09b5f060..ff494e7ed5 100644 --- a/engines/neverhood/module1200.cpp +++ b/engines/neverhood/module1200.cpp @@ -21,7 +21,6 @@ */ #include "neverhood/module1200.h" -#include "neverhood/smackerscene.h" namespace Neverhood { @@ -81,13 +80,9 @@ void Module1200::createScene1202(int which) { } void Module1200::createScene1203(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 2; // TODO Music18hList_stop(0x62222CAE, 0, 0); - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x31890001); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x31890001, true, true, false); setGlobalVar(0x2A02C07B, 1); SetUpdateHandler(&Module1200::updateScene1203); } diff --git a/engines/neverhood/module1400.cpp b/engines/neverhood/module1400.cpp index 4da5faa2ff..52e5ae73c2 100644 --- a/engines/neverhood/module1400.cpp +++ b/engines/neverhood/module1400.cpp @@ -24,7 +24,6 @@ #include "neverhood/module1000.h" #include "neverhood/diskplayerscene.h" #include "neverhood/gamemodule.h" -#include "neverhood/navigationscene.h" namespace Neverhood { diff --git a/engines/neverhood/module1500.cpp b/engines/neverhood/module1500.cpp index 95b3925245..9506f8032e 100644 --- a/engines/neverhood/module1500.cpp +++ b/engines/neverhood/module1500.cpp @@ -91,19 +91,13 @@ void Module1500::createScene1502() { } void Module1500::createScene1503() { - debug("createScene1503"); - SmackerScene *smackerScene; _parentModule->sendMessage(0x0800, 0, this); _vm->gameState().sceneNum = 2; - smackerScene = new SmackerScene(_vm, this, true, true, true); - smackerScene->setFileHash(0x001A0005); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x001A0005, true, true, true); SetUpdateHandler(&Module1500::update); } void Module1500::createScene1504() { - debug("createScene1504"); _vm->gameState().sceneNum = 3; _childObject = new Scene1501(_vm, this, 0x0CA04202, 0, 110, 48); SetUpdateHandler(&Module1500::update); diff --git a/engines/neverhood/module1700.cpp b/engines/neverhood/module1700.cpp index 3289173dfb..e6cbe62b10 100644 --- a/engines/neverhood/module1700.cpp +++ b/engines/neverhood/module1700.cpp @@ -21,7 +21,6 @@ */ #include "neverhood/module1700.h" -#include "neverhood/navigationscene.h" namespace Neverhood { @@ -67,36 +66,28 @@ Module1700::~Module1700() { } void Module1700::createScene1701(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 0; // TODO Sound1ChList_setSoundValuesMulti(dword_4AE930, 0, 0, 0, 0, 0); - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x3028A005); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x3028A005, true, true, false); SetUpdateHandler(&Module1700::updateScene1701); } void Module1700::createScene1702(int which) { _vm->gameState().sceneNum = 1; - _childObject = new NavigationScene(_vm, this, 0x004AE8B8, which, NULL); + createNavigationScene(0x004AE8B8, which); SetUpdateHandler(&Module1700::updateScene1702); } void Module1700::createScene1703(int which) { _vm->gameState().sceneNum = 2; - _childObject = new NavigationScene(_vm, this, 0x004AE8E8, which, NULL); + createNavigationScene(0x004AE8E8, which); SetUpdateHandler(&Module1700::updateScene1703); } void Module1700::createScene1704(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 3; // TODO Sound1ChList_setSoundValuesMulti(dword_4AE930, 0, 0, 0, 0, 0); - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x01190041); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x01190041, true, true, false); SetUpdateHandler(&Module1700::updateScene1701); } diff --git a/engines/neverhood/module1800.cpp b/engines/neverhood/module1800.cpp index 2a4d89cead..1ce2d0f116 100644 --- a/engines/neverhood/module1800.cpp +++ b/engines/neverhood/module1800.cpp @@ -22,9 +22,6 @@ #include "neverhood/module1800.h" #include "neverhood/navigationscene.h" -#include "neverhood/smackerscene.h" - -#include "neverhood/diskplayerscene.h" namespace Neverhood { @@ -85,77 +82,58 @@ Module1800::~Module1800() { void Module1800::createScene1801(int which) { static const byte kNavigationTypes[] = {1, 0, 2, 0}; _vm->gameState().sceneNum = 0; -#if 0 - _childObject = new NavigationScene(_vm, this, 0x004AFD38, which, kNavigationTypes); -#endif - _childObject = new DiskplayerScene(_vm, this, 3); + createNavigationScene(0x004AFD38, which, kNavigationTypes); SetUpdateHandler(&Module1800::updateScene1801); } void Module1800::createScene1802(int which) { static const byte kNavigationTypes[] = {5}; _vm->gameState().sceneNum = 1; - _childObject = new NavigationScene(_vm, this, 0x004AFD98, which, kNavigationTypes); + createNavigationScene(0x004AFD98, which, kNavigationTypes); SetUpdateHandler(&Module1800::updateScene1802); } void Module1800::createScene1803(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 2; - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x006C0085); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x006C0085, true, true, false); SetUpdateHandler(&Module1800::updateScene1803); } void Module1800::createScene1804(int which) { _vm->gameState().sceneNum = 3; - _childObject = new NavigationScene(_vm, this, 0x004AFDB0, which, NULL); + createNavigationScene(0x004AFDB0, which); SetUpdateHandler(&Module1800::updateScene1804); } void Module1800::createScene1804b(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 3; - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x0A840C01); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x0A840C01, true, true, false); SetUpdateHandler(&Module1800::updateScene1803); } void Module1800::createScene1805(int which) { _vm->gameState().sceneNum = 4; - _childObject = new NavigationScene(_vm, this, 0x004AFDE0, which, NULL); + createNavigationScene(0x004AFDE0, which); SetUpdateHandler(&Module1800::updateScene1805); } void Module1800::createScene1806(int which) { _vm->gameState().sceneNum = 5; - _childObject = new NavigationScene(_vm, this, 0x004AFE40, which, NULL); + createNavigationScene(0x004AFE40, which); SetUpdateHandler(&Module1800::updateScene1806); } void Module1800::createScene1807(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 6; - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x08D84010); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x08D84010, true, true, false); SetUpdateHandler(&Module1800::updateScene1803); // TODO Sound1ChList_sub_407A50(0x04A14718); } void Module1800::createScene1808(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 7; // TODO Sound1ChList_setSoundValuesMulti(dword_4AFE70, 0, 0, 0, 0, 0); - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x0168B121); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x0168B121, true, true, false); SetUpdateHandler(&Module1800::updateScene1803); } diff --git a/engines/neverhood/module2300.cpp b/engines/neverhood/module2300.cpp index 32ce2a18ba..6bd10bbf12 100644 --- a/engines/neverhood/module2300.cpp +++ b/engines/neverhood/module2300.cpp @@ -21,8 +21,6 @@ */ #include "neverhood/module2300.h" -#include "neverhood/navigationscene.h" -#include "neverhood/smackerscene.h" namespace Neverhood { @@ -84,13 +82,13 @@ Module2300::~Module2300() { void Module2300::createScene2301(int which) { _vm->gameState().sceneNum = 0; - _childObject = new NavigationScene(_vm, this, 0x004B67B8, which, NULL); + createNavigationScene(0x004B67B8, which); SetUpdateHandler(&Module2300::updateScene2301); } void Module2300::createScene2302(int which) { _vm->gameState().sceneNum = 1; - _childObject = new NavigationScene(_vm, this, 0x004B67E8, which, NULL); + createNavigationScene(0x004B67E8, which); SetUpdateHandler(&Module2300::updateScene2302); if (_flag) { _volume = 15; @@ -100,17 +98,17 @@ void Module2300::createScene2302(int which) { void Module2300::createScene2303(int which) { _vm->gameState().sceneNum = 2; - _childObject = new NavigationScene(_vm, this, 0x004B6878, which, NULL); + createNavigationScene(0x004B6878, which); SetUpdateHandler(&Module2300::updateScene2303); } void Module2300::createScene2304(int which) { _vm->gameState().sceneNum = 3; if (getGlobalVar(0x10938830)) { - _childObject = new NavigationScene(_vm, this, 0x004B68F0, which, NULL); + createNavigationScene(0x004B68F0, which); } else { // TODO Sound1ChList_setVolume(0x90F0D1C3, _volume); - _childObject = new NavigationScene(_vm, this, 0x004B68A8, which, NULL); + createNavigationScene(0x004B68A8, which); if (_flag) { _volume = 87; // TODO Sound1ChList_setVolume(0x90F0D1C3, 87); @@ -120,13 +118,9 @@ void Module2300::createScene2304(int which) { } void Module2300::createScene2305(int which) { - SmackerScene *smackerScene; _vm->gameState().sceneNum = 4; // TODO Sound1ChList_sub_4080B0(true); - smackerScene = new SmackerScene(_vm, this, true, true, false); - smackerScene->setFileHash(0x20080A0B); - smackerScene->nextVideo(); - _childObject = smackerScene; + createSmackerScene(0x20080A0B, true, true, false); SetUpdateHandler(&Module2300::updateScene2305); } |