aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohndoe1232011-09-13 12:57:06 +0000
committerWillem Jan Palenstijn2013-05-08 20:39:37 +0200
commitd4030b7a9ffc2a907c80948024f3ee369a08c760 (patch)
tree9f55a9e1a258df6830395b351a68eb9b9bbd34a2
parent5214284271d0ae050e5f33fe66d0fc0b8cbb94af (diff)
downloadscummvm-rg350-d4030b7a9ffc2a907c80948024f3ee369a08c760.tar.gz
scummvm-rg350-d4030b7a9ffc2a907c80948024f3ee369a08c760.tar.bz2
scummvm-rg350-d4030b7a9ffc2a907c80948024f3ee369a08c760.zip
NEVERHOOD: Start with Module1300 and implement Scene1302
-rw-r--r--engines/neverhood/gamemodule.cpp31
-rw-r--r--engines/neverhood/gamemodule.h2
-rw-r--r--engines/neverhood/module.mk1
-rw-r--r--engines/neverhood/module1000.cpp5
-rw-r--r--engines/neverhood/module1300.cpp664
-rw-r--r--engines/neverhood/module1300.h132
6 files changed, 831 insertions, 4 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 31330f97f5..f4159f3087 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -25,6 +25,7 @@
#include "neverhood/graphics.h"
#include "neverhood/module1000.h"
#include "neverhood/module1200.h"
+#include "neverhood/module1300.h"
#include "neverhood/module1400.h"
#include "neverhood/module1500.h"
#include "neverhood/module1700.h"
@@ -241,10 +242,14 @@ void GameModule::startup() {
_vm->gameState().sceneNum = 0;
createModule2000(-1);
#endif
-#if 1
+#if 0
_vm->gameState().sceneNum = 46;
createModule2200(-1);
#endif
+#if 1
+ _vm->gameState().sceneNum = 1;
+ createModule1300(-1);
+#endif
}
void GameModule::createModule1000(int which) {
@@ -292,6 +297,30 @@ void GameModule::updateModule1200() {
}
}
+void GameModule::createModule1300(int which) {
+ setGlobalVar(0x91080831, 0x0061C090);
+ _childObject = new Module1300(_vm, this, which);
+ SetUpdateHandler(&GameModule::updateModule1300);
+}
+
+void GameModule::updateModule1300() {
+ if (!_childObject)
+ return;
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 1) {
+ // TODO _gameState.clear();
+ // TODO GameModule_handleKeyEscape
+ } else {
+ // TODO createModule2900(0);
+ _childObject->handleUpdate();
+ }
+ }
+}
+
void GameModule::createModule1400(int which) {
setGlobalVar(0x91080831, 0x00AD0012);
_childObject = new Module1400(_vm, this, which);
diff --git a/engines/neverhood/gamemodule.h b/engines/neverhood/gamemodule.h
index 9ef1b92464..ef199f772a 100644
--- a/engines/neverhood/gamemodule.h
+++ b/engines/neverhood/gamemodule.h
@@ -55,6 +55,8 @@ protected:
void updateModule1000();
void createModule1200(int which);
void updateModule1200();
+ void createModule1300(int which);
+ void updateModule1300();
void createModule1400(int which);
void updateModule1400();
void createModule1500(int which);
diff --git a/engines/neverhood/module.mk b/engines/neverhood/module.mk
index 9122eaffab..1b4d6e4dc3 100644
--- a/engines/neverhood/module.mk
+++ b/engines/neverhood/module.mk
@@ -13,6 +13,7 @@ MODULE_OBJS = \
module.o \
module1000.o \
module1200.o \
+ module1300.o \
module1400.o \
module1500.o \
module1700.o \
diff --git a/engines/neverhood/module1000.cpp b/engines/neverhood/module1000.cpp
index 3387e2e74e..5e1ae6fde3 100644
--- a/engines/neverhood/module1000.cpp
+++ b/engines/neverhood/module1000.cpp
@@ -1045,7 +1045,7 @@ AsScene1002VenusFlyTrap::AsScene1002VenusFlyTrap(NeverhoodEngine *vm, Scene *par
SetMessageHandler(&AsScene1002VenusFlyTrap::handleMessage448000);
SetSpriteCallback(&AnimatedSprite::updateDeltaXY);
- if (!flag) {
+ if (!_flag) {
if (getGlobalVar(0x8306F218)) {
setDoDeltaX(1);
_x = 366;
@@ -1110,7 +1110,7 @@ uint32 AsScene1002VenusFlyTrap::handleMessage448000(int messageNum, const Messag
break;
case 0x480B:
setDoDeltaX(param.asInteger() != 0 ? 1 : 0);
- if (_flag) {
+ if (!_flag) {
if (getGlobalVar(0x8306F218)) {
sub448560();
} else {
@@ -1143,7 +1143,6 @@ uint32 AsScene1002VenusFlyTrap::handleMessage448000(int messageNum, const Messag
}
break;
case 0x4810:
- debug("trap collision");
sub448780();
break;
case 0x482A:
diff --git a/engines/neverhood/module1300.cpp b/engines/neverhood/module1300.cpp
new file mode 100644
index 0000000000..7c7beb7cd4
--- /dev/null
+++ b/engines/neverhood/module1300.cpp
@@ -0,0 +1,664 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "neverhood/module1300.h"
+#include "neverhood/module1000.h"
+#include "neverhood/diskplayerscene.h"
+#include "neverhood/navigationscene.h"
+#include "neverhood/smackerscene.h"
+
+namespace Neverhood {
+
+Module1300::Module1300(NeverhoodEngine *vm, Module *parentModule, int which)
+ : Module(vm, parentModule) {
+
+ debug("Create Module1300(%d)", which);
+
+ // TODO Music18hList_add(0x61C090, 0x203197);
+ // TODO Sound1ChList_addSoundResources(0x61C090, dword_4B2868, true);
+ // TODO Sound1ChList_setSoundValuesMulti(dword_4B2868, 0, 50, 600, 20, 150);
+ // TODO Sound1ChList_sub_407C70(0x61C090, 0x48498E46, 0x50399F64, 0);
+ // TODO Sound1ChList_setVolume(0x48498E46, 70);
+ // TODO Sound1ChList_setVolume(0x50399F64, 70);
+
+ if (which < 0) {
+ switch (_vm->gameState().sceneNum) {
+ case 1:
+ createScene1302(-1);
+ break;
+ case 2:
+ createScene1303(-1);
+ break;
+ case 3:
+ createScene1304(-1);
+ break;
+ case 4:
+ createScene1305(-1);
+ break;
+ case 5:
+ createScene1306(-1);
+ break;
+ case 6:
+ createScene1307(-1);
+ break;
+ case 7:
+ createScene1308(-1);
+ break;
+ case 8:
+ createScene1309(-1);
+ break;
+ case 9:
+ createScene1310(-1);
+ break;
+ case 10:
+ createScene1311(-1);
+ break;
+ case 11:
+ createScene1312(-1);
+ break;
+ case 12:
+ createScene1313(-1);
+ break;
+ case 13:
+ createScene1314(-1);
+ break;
+ case 14:
+ createScene1315(-1);
+ break;
+ case 15:
+ createScene1316(-1);
+ break;
+ case 16:
+ createScene1317(-1);
+ break;
+ case 17:
+ createScene1318(-1);
+ break;
+ default:
+ createScene1312(0);
+ }
+ } else {
+ switch (which) {
+ case 0:
+ createScene1312(0);
+ break;
+ case 1:
+ createScene1314(0);
+ break;
+ case 2:
+ createScene1315(0);
+ break;
+ case 3:
+ createScene1316(0);
+ break;
+ case 4:
+ createScene1308(0);
+ break;
+ case 5:
+ createScene1306(1);
+ break;
+ case 6:
+ createScene1306(5);
+ break;
+ case 7:
+ createScene1304(0);
+ break;
+ case 8:
+ createScene1302(0);
+ break;
+ case 9:
+ createScene1303(0);
+ break;
+ case 10:
+ createScene1307(0);
+ break;
+ case 11:
+ createScene1305(0);
+ break;
+ default:
+ createScene1313(0);
+ break;
+ }
+ }
+
+}
+
+Module1300::~Module1300() {
+ // TODO Sound1ChList_sub_407A50(0x61C090);
+}
+
+void Module1300::createScene1302(int which) {
+ _vm->gameState().sceneNum = 1;
+ // TODO Sound1ChList_setSoundValuesMulti(dword_4B2868, false, 0, 0, 0, 0);
+ // TODO Music18hList_play(0x203197, 0, 2, 1);
+ _childObject = new Scene1302(_vm, this, which);
+ SetUpdateHandler(&Module1300::updateScene1302);
+}
+
+void Module1300::createScene1303(int which) {
+}
+
+void Module1300::createScene1304(int which) {
+}
+
+void Module1300::createScene1305(int which) {
+}
+
+void Module1300::createScene1306(int which) {
+}
+
+void Module1300::createScene1307(int which) {
+}
+
+void Module1300::createScene1308(int which) {
+}
+
+void Module1300::createScene1309(int which) {
+}
+
+void Module1300::createScene1310(int which) {
+}
+
+void Module1300::createScene1311(int which) {
+}
+
+void Module1300::createScene1312(int which) {
+ _vm->gameState().sceneNum = 11;
+ createNavigationScene(0x004B27A8, which);
+ SetUpdateHandler(&Module1300::updateScene1312);
+ // TODO Sound1ChList_setSoundValuesMulti(0xdword_4B2868, true, 0, 0, 0, 0);
+ // TODO Music18hList_stop(0x203197, 0, 2);
+}
+
+void Module1300::createScene1313(int which) {
+ _vm->gameState().sceneNum = 12;
+ createNavigationScene(0x004B2718, which);
+ SetUpdateHandler(&Module1300::updateScene1313);
+ // TODO Sound1ChList_setSoundValuesMulti(0xdword_4B2868, true, 0, 0, 0, 0);
+ // TODO Music18hList_stop(0x203197, 0, 2);
+}
+
+void Module1300::createScene1314(int which) {
+ _vm->gameState().sceneNum = 13;
+ createNavigationScene(0x004B27D8, which);
+ SetUpdateHandler(&Module1300::updateScene1314);
+ // TODO Sound1ChList_setSoundValuesMulti(0xdword_4B2868, true, 0, 0, 0, 0);
+ // TODO Music18hList_stop(0x203197, 0, 2);
+}
+
+void Module1300::createScene1315(int which) {
+ _vm->gameState().sceneNum = 14;
+ createNavigationScene(0x004B2808, which);
+ SetUpdateHandler(&Module1300::updateScene1315);
+ // TODO Sound1ChList_setSoundValuesMulti(0xdword_4B2868, true, 0, 0, 0, 0);
+ // TODO Music18hList_stop(0x203197, 0, 2);
+}
+
+void Module1300::createScene1316(int which) {
+ _vm->gameState().sceneNum = 15;
+ createNavigationScene(0x004B2838, which);
+ SetUpdateHandler(&Module1300::updateScene1316);
+ // TODO Sound1ChList_setSoundValuesMulti(0xdword_4B2868, true, 0, 0, 0, 0);
+ // TODO Music18hList_stop(0x203197, 0, 2);
+}
+
+void Module1300::createScene1317(int which) {
+}
+
+void Module1300::createScene1318(int which) {
+}
+
+void Module1300::updateScene1302() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 1) {
+ createScene1305(0);
+ } else {
+ createScene1308(1);
+ }
+ _childObject->handleUpdate();
+ }
+}
+
+void Module1300::updateScene1303() {
+}
+
+void Module1300::updateScene1304() {
+}
+
+void Module1300::updateScene1305() {
+}
+
+void Module1300::updateScene1306() {
+}
+
+void Module1300::updateScene1307() {
+}
+
+void Module1300::updateScene1308() {
+}
+
+void Module1300::updateScene1309() {
+}
+
+void Module1300::updateScene1310() {
+}
+
+void Module1300::updateScene1311() {
+}
+
+void Module1300::updateScene1312() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 0) {
+ createScene1313(0);
+ } else if (_field20 == 1) {
+ createScene1312(1);
+ }
+ _childObject->handleUpdate();
+ }
+}
+
+void Module1300::updateScene1313() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ switch (_field20) {
+ case 0:
+ createScene1315(1);
+ break;
+ case 1:
+ createScene1316(1);
+ break;
+ case 3:
+ createScene1312(1);
+ break;
+ case 5:
+ createScene1314(1);
+ break;
+ }
+ _childObject->handleUpdate();
+ }
+}
+
+void Module1300::updateScene1314() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 0) {
+ createScene1313(2);
+ } else if (_field20 == 1) {
+ createScene1308(0);
+ }
+ _childObject->handleUpdate();
+ }
+}
+
+void Module1300::updateScene1315() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 0) {
+ createScene1313(3);
+ } else if (_field20 == 1) {
+ createScene1310(-1);
+ }
+ _childObject->handleUpdate();
+ }
+}
+
+void Module1300::updateScene1316() {
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 0) {
+ createScene1313(4);
+ } else if (_field20 == 1) {
+ createScene1304(0);
+ }
+ _childObject->handleUpdate();
+ }
+}
+
+void Module1300::updateScene1317() {
+}
+
+void Module1300::updateScene1318() {
+}
+
+AsScene1302Bridge::AsScene1302Bridge(NeverhoodEngine *vm, Scene *parentScene)
+ : AnimatedSprite(vm, 1100), _soundResource1(vm), _soundResource2(vm), _parentScene(parentScene) {
+
+ _x = 320;
+ _y = 240;
+ createSurface1(0x88148150, 500);
+ SetUpdateHandler(&AnimatedSprite::update);
+ SetMessageHandler(&AsScene1302Bridge::handleMessage);
+ if (!getGlobalVar(0x13206309)) {
+ setFileHash(0x88148150, 0, -1);
+ _newHashListIndex = 0;
+ } else {
+ setFileHash(0x88148150, -1, -1);
+ _newHashListIndex = -2;
+ }
+ _soundResource1.load(0x68895082);
+ _soundResource2.load(0x689BD0C1);
+}
+
+uint32 AsScene1302Bridge::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x3002:
+ removeCallbacks();
+ break;
+ case 0x4808:
+ stLowerBridge();
+ break;
+ case 0x4809:
+ stRaiseBridge();
+ break;
+ }
+ return messageResult;
+}
+
+void AsScene1302Bridge::stLowerBridge() {
+ setFileHash(0x88148150, 0, -1);
+ SetAnimationCallback3(&AsScene1302Bridge::cbLowerBridgeEvent);
+ _soundResource2.play();
+}
+
+void AsScene1302Bridge::stRaiseBridge() {
+ setFileHash(0x88148150, 7, -1);
+ _playBackwards = true;
+ _newHashListIndex = 0;
+ _soundResource1.play();
+}
+
+void AsScene1302Bridge::cbLowerBridgeEvent() {
+ _parentScene->sendMessage(0x2032, 0, this);
+ setFileHash(0x88148150, -1, -1);
+ _newHashListIndex = -2;
+}
+
+SsScene1302Fence::SsScene1302Fence(NeverhoodEngine *vm)
+ : StaticSprite(vm, 0x11122122, 200), _soundResource1(vm), _soundResource2(vm) {
+
+ SetUpdateHandler(&SsScene1302Fence::update);
+ SetMessageHandler(&SsScene1302Fence::handleMessage);
+ SetSpriteCallback(NULL);
+ _firstY = _y;
+ if (getGlobalVar(0x80101B1E))
+ _y += 152;
+ _soundResource1.load(0x7A00400C);
+ _soundResource2.load(0x78184098);
+}
+
+void SsScene1302Fence::update() {
+ handleSpriteUpdate();
+ StaticSprite::update();
+}
+
+uint32 SsScene1302Fence::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x4808:
+ _soundResource1.play();
+ SetSpriteCallback(&SsScene1302Fence::suMoveDown);
+ SetMessageHandler(NULL);
+ break;
+ case 0x4809:
+ _soundResource2.play();
+ SetSpriteCallback(&SsScene1302Fence::suMoveUp);
+ SetMessageHandler(NULL);
+ break;
+ }
+ return messageResult;
+}
+
+void SsScene1302Fence::suMoveDown() {
+ if (_y < _firstY + 152)
+ _y += 8;
+ else {
+ SetMessageHandler(&SsScene1302Fence::handleMessage);
+ SetSpriteCallback(NULL);
+ }
+}
+
+void SsScene1302Fence::suMoveUp() {
+ if (_y > _firstY)
+ _y -= 8;
+ else {
+ SetMessageHandler(&SsScene1302Fence::handleMessage);
+ SetSpriteCallback(NULL);
+ }
+}
+
+Class595::Class595(NeverhoodEngine *vm, Scene *parentScene)
+ : StaticSprite(vm, 0xB0420130, 1015), _parentScene(parentScene) {
+
+ SetMessageHandler(&Class595::handleMessage);
+}
+
+uint32 Class595::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x482A:
+ _parentScene->sendMessage(0x1022, 995, this);
+ break;
+ case 0x482B:
+ _parentScene->sendMessage(0x1022, 1015, this);
+ break;
+ }
+ return messageResult;
+}
+
+Scene1302::Scene1302(NeverhoodEngine *vm, Module *parentModule, int which)
+ : Scene(vm, parentModule, true), _soundResource(vm) {
+
+ SetMessageHandler(&Scene1302::handleMessage);
+ _vm->_collisionMan->setHitRects(0x004B0858);
+ setRectList(0x004B0A38);
+
+ _background = addBackground(new DirtyBackground(_vm, 0x420643C4, 0, 0));
+ _palette = new Palette(_vm, 0x420643C4);
+ _palette->usePalette();
+ _mouseCursor = addSprite(new Mouse433(_vm, 0x643C0428, NULL));
+
+ _class595 = addSprite(new Class595(_vm, this));
+ _sprite1 = addSprite(new StaticSprite(_vm, 0x942FC224, 300));
+ _sprite2 = addSprite(new StaticSprite(_vm, 0x70430830, 1200));
+ _sprite2->getSurface()->setVisible(false);
+ _sprite3 = addSprite(new StaticSprite(_vm, 0x16E01E20, 1100));
+
+ _asRing1 = addSprite(new AsScene1002Ring(_vm, this, false, 218, 122, _class595->getSurface()->getDrawRect().y, false));
+ _asRing2 = addSprite(new AsScene1002Ring(_vm, this, true, 218 + 32, 132, _class595->getSurface()->getDrawRect().y, getGlobalVar(0x13206309)));
+ _asRing3 = addSprite(new AsScene1002Ring(_vm, this, false, 218 + 32 + 32, 122, _class595->getSurface()->getDrawRect().y, false));
+ _asRing4 = addSprite(new AsScene1002Ring(_vm, this, true, 218 + 32 + 32 + 32, 132, _class595->getSurface()->getDrawRect().y, getGlobalVar(0x80101B1E)));
+ _asRing5 = addSprite(new AsScene1002Ring(_vm, this, false, 218 + 32 + 32 + 32 + 32, 115, _class595->getSurface()->getDrawRect().y, false));
+
+ _asBridge = addSprite(new AsScene1302Bridge(_vm, this));
+ _ssFence = addSprite(new SsScene1302Fence(_vm));
+ _ssFence->getSurface()->getClipRect().x1 = 0;
+ _ssFence->getSurface()->getClipRect().y1 = 0;
+ _ssFence->getSurface()->getClipRect().x2 = 640;
+ _ssFence->getSurface()->getClipRect().y2 = _sprite1->getSurface()->getDrawRect().y + _sprite1->getSurface()->getDrawRect().height;
+
+ if (which < 0) {
+ _klayman = new KmScene1002(_vm, this, _class595, NULL, 380, 364);
+ setMessageList(0x004B0868);
+ } else {
+ _klayman = new KmScene1002(_vm, this, _class595, NULL, 293, 330);
+ setMessageList(0x004B0870);
+ }
+ addSprite(_klayman);
+
+ _klayman->getSurface()->getClipRect().x1 = 0;
+ _klayman->getSurface()->getClipRect().y1 = 0;
+ _klayman->getSurface()->getClipRect().x2 = _sprite3->getSurface()->getDrawRect().x + _sprite3->getSurface()->getDrawRect().width;
+ _klayman->getSurface()->getClipRect().y2 = 480;
+
+ _asVenusFlyTrap = addSprite(new AsScene1002VenusFlyTrap(_vm, this, _klayman, true));
+ _vm->_collisionMan->addSprite(_asVenusFlyTrap);
+
+ _klayman->sendEntityMessage(0x2007, _asVenusFlyTrap, this);
+
+}
+
+uint32 Scene1302::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = 0;
+ Scene::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x4A845A00) {
+ _klayman->sendEntityMessage(0x1014, _asRing1, this);
+ } else if (param.asInteger() == 0x43807801) {
+ if (!getGlobalVar(0x13206309)) {
+ _klayman->sendEntityMessage(0x1014, _asRing2, this);
+ if (_asVenusFlyTrap->getX() - 10 < 218 + 32 && _asVenusFlyTrap->getX() + 10 > 218 + 32) {
+ setMessageList(0x004B0940);
+ } else {
+ setMessageList(0x004B0938);
+ }
+ } else {
+ setMessageList(0x004B0950);
+ }
+ messageResult = 1;
+ } else if (param.asInteger() == 0x46C26A01) {
+ _klayman->sendEntityMessage(0x1014, _asRing3, this);
+ } else if (param.asInteger() == 0x468C7B11) {
+ if (!getGlobalVar(0x80101B1E)) {
+ _klayman->sendEntityMessage(0x1014, _asRing4, this);
+ if (_asVenusFlyTrap->getX() - 10 < 218 + 32 + 32 + 32 && _asVenusFlyTrap->getX() + 10 > 218 + 32 + 32 + 32) {
+ setMessageList(0x004B0940);
+ } else {
+ setMessageList(0x004B0938);
+ }
+ } else {
+ setMessageList(0x004B0950);
+ }
+ messageResult = 1;
+ } else if (param.asInteger() == 0x42845B19) {
+ _klayman->sendEntityMessage(0x1014, _asRing5, this);
+ } else if (param.asInteger() == 0x430A6060) {
+ if (getGlobalVar(0x13206309)) {
+ setMessageList2(0x004B0910);
+ } else {
+ messageList402220();
+ }
+ } else if (param.asInteger() == 0x012E2070) {
+ if (getGlobalVar(0x13206309)) {
+ setMessageList2(0x004B0968);
+ } else {
+ messageList402220();
+ }
+ } else if (param.asInteger() == 0x11C40840) {
+ if (_asVenusFlyTrap->getX() >= 260 && _asVenusFlyTrap->getX() <= 342) {
+ setMessageList(0x004B0878);
+ } else {
+ setMessageList(0x004B0978);
+ }
+ }
+ break;
+ case 0x2000:
+ if (_klayman->getY() > 360) {
+ _klayman->sendEntityMessage(0x1014, _asVenusFlyTrap, this);
+ setMessageList2(0x004B08F0);
+ } else {
+ setMessageList2(0x004B0920);
+ }
+ break;
+ case 0x2002:
+ if (_klayman->getX() > 545) {
+ _parentModule->sendMessage(0x1009, 1, this);
+ }
+ break;
+ case 0x2032:
+ _sprite2->getSurface()->setVisible(true);
+ break;
+ case 0x4806:
+ _parentModule->sendMessage(0x1024, 2, this);
+ if (sender == _asRing1) {
+ _soundResource.play(0x665198C0);
+ } else if (sender == _asRing2) {
+ _asBridge->sendMessage(0x4808, 0, this);
+ setGlobalVar(0x13206309, 1);
+ } else if (sender == _asRing3) {
+ _soundResource.play(0xE2D389C0);
+ } else if (sender == _asRing4) {
+ _ssFence->sendMessage(0x4808, 0, this);
+ setGlobalVar(0x80101B1E, 1);
+ } else if (sender == _asRing5) {
+ _soundResource.play(0x40428A09);
+ }
+ break;
+ case 0x4807:
+ if (sender == _asRing2) {
+ _asBridge->sendMessage(0x4809, 0, this);
+ setGlobalVar(0x13206309, 0);
+ _sprite2->getSurface()->setVisible(false);
+ } else if (sender == _asRing4) {
+ _ssFence->sendMessage(0x4809, 0, this);
+ setGlobalVar(0x80101B1E, 0);
+ } else if (sender == _asVenusFlyTrap) {
+ if (getGlobalVar(0x13206309)) {
+ _asRing2->sendMessage(0x4807, 0, this);
+ } else {
+ _asRing4->sendMessage(0x4807, 0, this);
+ }
+ }
+ break;
+ case 0x480F:
+ if (sender == _asRing2) {
+ _soundResource.play(0x60755842);
+ _asBridge->sendMessage(0x4808, 0, this);
+ setGlobalVar(0x13206309, 1);
+ } else if (sender == _asRing4) {
+ _soundResource.play(0x60755842);
+ _ssFence->sendMessage(0x4808, 0, this);
+ setGlobalVar(0x80101B1E, 1);
+ }
+ break;
+ case 0x482A:
+ _asVenusFlyTrap->sendMessage(0x482B, 0, this);
+ break;
+ case 0x482B:
+ _asVenusFlyTrap->sendMessage(0x482A, 0, this);
+ break;
+ }
+ return messageResult;
+}
+
+} // End of namespace Neverhood
diff --git a/engines/neverhood/module1300.h b/engines/neverhood/module1300.h
new file mode 100644
index 0000000000..25dde469b9
--- /dev/null
+++ b/engines/neverhood/module1300.h
@@ -0,0 +1,132 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef NEVERHOOD_MODULE1300_H
+#define NEVERHOOD_MODULE1300_H
+
+#include "neverhood/neverhood.h"
+#include "neverhood/module.h"
+#include "neverhood/scene.h"
+
+namespace Neverhood {
+
+// Module1300
+
+class Module1300 : public Module {
+public:
+ Module1300(NeverhoodEngine *vm, Module *parentModule, int which);
+ virtual ~Module1300();
+protected:
+ uint32 _musicFileHash;
+ void createScene1302(int which);
+ void createScene1303(int which);
+ void createScene1304(int which);
+ void createScene1305(int which);
+ void createScene1306(int which);
+ void createScene1307(int which);
+ void createScene1308(int which);
+ void createScene1309(int which);
+ void createScene1310(int which);
+ void createScene1311(int which);
+ void createScene1312(int which);
+ void createScene1313(int which);
+ void createScene1314(int which);
+ void createScene1315(int which);
+ void createScene1316(int which);
+ void createScene1317(int which);
+ void createScene1318(int which);
+ void updateScene1302();
+ void updateScene1303();
+ void updateScene1304();
+ void updateScene1305();
+ void updateScene1306();
+ void updateScene1307();
+ void updateScene1308();
+ void updateScene1309();
+ void updateScene1310();
+ void updateScene1311();
+ void updateScene1312();
+ void updateScene1313();
+ void updateScene1314();
+ void updateScene1315();
+ void updateScene1316();
+ void updateScene1317();
+ void updateScene1318();
+};
+
+class AsScene1302Bridge : public AnimatedSprite {
+public:
+ AsScene1302Bridge(NeverhoodEngine *vm, Scene *parentScene);
+protected:
+ Scene *_parentScene;
+ SoundResource _soundResource1;
+ SoundResource _soundResource2;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ void stLowerBridge();
+ void stRaiseBridge();
+ void cbLowerBridgeEvent();
+};
+
+class SsScene1302Fence : public StaticSprite {
+public:
+ SsScene1302Fence(NeverhoodEngine *vm);
+protected:
+ SoundResource _soundResource1;
+ SoundResource _soundResource2;
+ int16 _firstY;
+ void update();
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ void suMoveDown();
+ void suMoveUp();
+};
+
+class Class595 : public StaticSprite {
+public:
+ Class595(NeverhoodEngine *vm, Scene *parentScene);
+protected:
+ Scene *_parentScene;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class Scene1302 : public Scene {
+public:
+ Scene1302(NeverhoodEngine *vm, Module *parentModule, int which);
+protected:
+ SoundResource _soundResource;
+ Sprite *_asVenusFlyTrap;
+ Sprite *_asBridge;
+ Sprite *_ssFence;
+ Sprite *_asRing1;
+ Sprite *_asRing2;
+ Sprite *_asRing3;
+ Sprite *_asRing4;
+ Sprite *_asRing5;
+ Sprite *_class595;
+ Sprite *_sprite1;
+ Sprite *_sprite2;
+ Sprite *_sprite3;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+} // End of namespace Neverhood
+
+#endif /* NEVERHOOD_MODULE1300_H */