aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/neverhood/gamemodule.cpp44
-rw-r--r--engines/neverhood/gamemodule.h5
-rw-r--r--engines/neverhood/gamevars.cpp20
-rw-r--r--engines/neverhood/klayman.cpp254
-rw-r--r--engines/neverhood/klayman.h21
-rw-r--r--engines/neverhood/module.mk1
-rw-r--r--engines/neverhood/module1200.cpp772
-rw-r--r--engines/neverhood/module1200.h141
-rw-r--r--engines/neverhood/scene.cpp7
-rw-r--r--engines/neverhood/scene.h1
10 files changed, 1245 insertions, 21 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 4800923d2d..95a6a5f48a 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -24,6 +24,7 @@
#include "neverhood/graphics.h"
#include "neverhood/module1000.h"
+#include "neverhood/module1200.h"
#include "neverhood/module1500.h"
#include "neverhood/module2300.h"
@@ -108,8 +109,9 @@ uint32 GameModule::handleMessage(int messageNum, const MessageParam &param, Enti
void GameModule::startup() {
// TODO: Displaying of error text probably not needed in ScummVM
// createModule1500(0); // Logos and intro video //Real
-// createModule1000(0);
- createModule2300(0);
+// createModule1000(-1);
+// createModule2300(0);
+ createModule1200(0);
}
void GameModule::createModule1000(int which) {
@@ -132,6 +134,30 @@ void GameModule::updateModule1000() {
}
}
+void GameModule::createModule1200(int which) {
+ setGlobalVar(0x91080831, 0x00478311);
+ _childObject = new Module1200(_vm, this, which);
+ SetUpdateHandler(&GameModule::updateModule1200);
+}
+
+void GameModule::updateModule1200() {
+ if (!_childObject)
+ return;
+ _childObject->handleUpdate();
+ if (_done) {
+ _done = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_field20 == 1) {
+ // TODO createModule2600(0);
+ // TODO _childObject->handleUpdate();
+ } else {
+ createModule2300(2);
+ _childObject->handleUpdate();
+ }
+ }
+}
+
void GameModule::createModule1500(int which) {
_someFlag1 = false;
setGlobalVar(0x91080831, 0x00F10114);
@@ -170,8 +196,8 @@ void GameModule::updateModule2300() {
// TODO createModule2200(0);
// TODO _childObject->handleUpdate();
} else if (_field20 == 2) {
- // TODO createModule1200(0);
- // TODO _childObject->handleUpdate();
+ createModule1200(0);
+ _childObject->handleUpdate();
} else if (_field20 == 3) {
// TODO createModule2400(0);
// TODO _childObject->handleUpdate();
@@ -196,4 +222,14 @@ void GameModule::updateModule2300() {
}
}
+void GameModule::createModule2400(int which) {
+ debug("createModule2400");
+ _vm->_system->quit();
+}
+
+void GameModule::createModule3000(int which) {
+ debug("createModule3000");
+ _vm->_system->quit();
+}
+
} // End of namespace Neverhood
diff --git a/engines/neverhood/gamemodule.h b/engines/neverhood/gamemodule.h
index 7977ea51a0..d95c31e47d 100644
--- a/engines/neverhood/gamemodule.h
+++ b/engines/neverhood/gamemodule.h
@@ -51,10 +51,15 @@ protected:
void startup();
void createModule1000(int which);
void updateModule1000();
+ void createModule1200(int which);
+ void updateModule1200();
void createModule1500(int which);
void updateModule1500();
+ void createModule2200(int which);
void createModule2300(int which);
void updateModule2300();
+ void createModule2400(int which);
+ void createModule3000(int which);
};
} // End of namespace Neverhood
diff --git a/engines/neverhood/gamevars.cpp b/engines/neverhood/gamevars.cpp
index 98ae709cfd..caf79b2ad9 100644
--- a/engines/neverhood/gamevars.cpp
+++ b/engines/neverhood/gamevars.cpp
@@ -57,7 +57,16 @@ uint32 GameVars::getSubVar(uint32 nameHash, uint32 subNameHash) {
void GameVars::setSubVar(uint32 nameHash, uint32 subNameHash, uint32 value) {
debug("GameVars::setSubVar(%08X, %08X, %d)", nameHash, subNameHash, value);
- _vars[getSubVarIndex(getSubVarIndex(0, nameHash), subNameHash)].value = value;
+
+ int16 varIndex = getSubVarIndex(0, nameHash);
+ debug(" varIndex = %d", varIndex);
+
+ int16 subVarIndex = getSubVarIndex(varIndex, subNameHash);
+ debug(" subVarIndex = %d", subVarIndex);
+
+ _vars[subVarIndex].value = value;
+
+ //_vars[getSubVarIndex(getSubVarIndex(0, nameHash), subNameHash)].value = value;
}
int16 GameVars::addVar(uint32 nameHash, uint32 value) {
@@ -89,16 +98,19 @@ int16 GameVars::addSubVar(int16 varIndex, uint32 subNameHash, uint32 value) {
} else {
while (_vars[nextIndex].nextIndex != -1)
nextIndex = _vars[nextIndex].nextIndex;
- _vars[nextIndex].nextIndex = addVar(subNameHash, value);
- return _vars[nextIndex].nextIndex;
+ int16 index = addVar(subNameHash, value);
+ _vars[nextIndex].nextIndex = index;
+ return index;
}
}
int16 GameVars::getSubVarIndex(int16 varIndex, uint32 subNameHash) {
debug("GameVars::getSubVarIndex(%d, %08X)", varIndex, subNameHash);
int16 subVarIndex = findSubVarIndex(varIndex, subNameHash);
- if (subVarIndex == -1)
+ if (subVarIndex == -1) {
subVarIndex = addSubVar(varIndex, subNameHash, 0);
+ debug("need to create: subVarIndex = %d", subVarIndex);
+ }
return subVarIndex;
}
diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp
index d5c320536f..145d645e01 100644
--- a/engines/neverhood/klayman.cpp
+++ b/engines/neverhood/klayman.cpp
@@ -84,8 +84,7 @@ uint32 Klayman::xHandleMessage(int messageNum, const MessageParam &param) {
setCallback2(AnimationCallback(&Klayman::sub41FC80));
break;
case 0x4818:
- debug("TODO sub41C930");
- // TODO sub41C930(_rectResource.getRectangle1(param.asInteger()).x, false);
+ sub41C930(_dataResource.getPoint(param.asInteger()).x, false);
break;
}
return 0;
@@ -461,6 +460,7 @@ uint32 Klayman::handleMessage41F140(int messageNum, const MessageParam &param, E
void Klayman::sub41C930(int16 x, bool flag) {
debug("Klayman::sub41C930(%d, %d)", x, flag);
int16 xdiff = ABS(x - _x);
+ debug("xdiff = %d", xdiff);
if (x == _x) {
_x4 = x;
if (!_flagE1 && !_flagE2 && !_flagE3) {
@@ -485,6 +485,7 @@ void Klayman::sub41C930(int16 x, bool flag) {
error("// TODO AnimatedSprite_setCallback2(AnimationCallback(&Klayman::sub421550));");
// TODO AnimatedSprite_setCallback2(AnimationCallback(&Klayman::sub421550));
} else {
+ debug("##################################################################");
_x4 = x;
setCallback2(AnimationCallback(&Klayman::sub41F950));
}
@@ -688,6 +689,9 @@ void Klayman::sub41F950() {
_status2 = 0;
_flagE1 = true;
_flagE5 = true;
+
+ debug("222222222222222222222 x = %d; x4 = %d", _x, _x4);
+
setDoDeltaX(_x4 < _x);
setFileHash(0x242C0198, 0, -1);
SetUpdateHandler(&Klayman::update);
@@ -821,9 +825,12 @@ void Klayman::spriteUpdate41F320() {
sendMessage(0x1019, 0, this);
} else {
HitRect *hitRectPrev = _vm->_collisionMan->findHitRectAtPos(_x, _y);
+
+ debug("xxxxxxxxxxxxxxxxxxxxxxxxx xdelta = %d", xdelta);
+
_x += xdelta;
if (_field114) {
- debug("_field114");
+ error("_field114");
// TODO Klayman_sub_41CF70
} else {
HitRect *hitRectNext = _vm->_collisionMan->findHitRectAtPos(_x, _y);
@@ -980,22 +987,28 @@ void Klayman::sub41CD00(int16 x) {
void Klayman::sub41CC40(int16 x1, int16 x2) {
if (_x > x1) {
if (_x == x1 + x2) {
+ debug("sub41CC40 #1");
_x4 = x1 + x2;
setCallback2(NULL);
sub41C7B0();
} else if (_x < x1 + x2) {
+ debug("sub41CC40 #2");
sub41CAC0(x1 + x2);
} else {
+ debug("sub41CC40 #3");
sub41C930(x1 + x2, false);
}
} else {
if (_x == x1 - x2) {
+ debug("sub41CC40 #4");
_x4 = x1 - x2;
setCallback2(NULL);
sub41C7B0();
} else if (_x > x1 - x2) {
+ debug("sub41CC40 #5");
sub41CAC0(x1 - x2);
} else {
+ debug("sub41CC40 #6");
sub41C930(x1 - x2, false);
}
}
@@ -1593,6 +1606,26 @@ uint32 Klayman::handleMessage41E2F0(int messageNum, const MessageParam &param, E
return messageResult;
}
+void Klayman::sub4207A0() {
+ if (!sub41CEB0(AnimationCallback(&Klayman::sub4207A0))) {
+ _status2 = 2;
+ _flagE5 = false;
+ setFileHash(0x9B250AD2, 0, -1);
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteCallback(&Klayman::spriteUpdate41F230);
+ SetMessageHandler(&Klayman::handleMessage41EEF0);
+ }
+}
+
+void Klayman::sub4207F0() {
+ _status2 = 2;
+ _flagE5 = false;
+ setFileHash(0x98F88391, 0, -1);
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteCallback(&Klayman::spriteUpdate41F230);
+ SetMessageHandler(&Klayman::handleMessage41EEF0);
+}
+
//##############################################################################
// KmScene1001
@@ -1635,16 +1668,14 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam &param) {
setDoDeltaX(param.asInteger());
sub41C7B0();
break;
-
case 0x481B:
// TODO: It's not really a point but an x1/x2 pair
- if (param.asPoint().x != 0) {
- sub41CC40(param.asPoint().x, param.asPoint().y);
+ if (param.asPoint().y != 0) {
+ sub41CC40(param.asPoint().y, param.asPoint().x);
} else {
- sub41CCE0(param.asPoint().y);
+ sub41CCE0(param.asPoint().x);
}
break;
-
case 0x481F:
if (param.asInteger() == 0) {
setCallback2(AnimationCallback(&Klayman::sub420870));
@@ -1658,28 +1689,23 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam &param) {
setCallback2(AnimationCallback(&Klayman::sub420830));
}
break;
-
case 0x482D:
setDoDeltaX(_x > (int16)param.asInteger());
sub41C7B0();
break;
-
case 0x4836:
if (param.asInteger() == 1) {
_parentScene->sendMessage(0x2002, 0, this);
setCallback2(AnimationCallback(&Klayman::sub4211F0));
}
break;
-
case 0x483F:
sub41CD00(param.asInteger());
break;
-
case 0x4840:
sub41CD70(param.asInteger());
break;
}
-
return 0;
}
@@ -2325,4 +2351,206 @@ void KmScene1004::sub478170() {
SetSpriteCallback(&AnimatedSprite::updateDeltaXY);
}
+// KmScene1201
+
+KmScene1201::KmScene1201(NeverhoodEngine *vm, Entity *parentScene, Entity *class464, int16 x, int16 y)
+ : Klayman(vm, parentScene, x, y, 1000, 1000), _class464(class464), _countdown(0) {
+
+ // TODO setKlaymanTable(dword_4AEF10, 3);
+ _flagF6 = true;
+
+}
+
+uint32 KmScene1201::xHandleMessage(int messageNum, const MessageParam &param) {
+ switch (messageNum) {
+ case 0x4001:
+ case 0x4800:
+ sub41C930(param.asPoint().x, false);
+ break;
+ case 0x4004:
+ setCallback2(AnimationCallback(&Klayman::sub41FC80));
+ break;
+ case 0x480A:
+ setCallback2(AnimationCallback(&KmScene1201::sub40DF00));
+ break;
+ case 0x4812:
+ setCallback2(AnimationCallback(&Klayman::sub41FF80));
+ break;
+ case 0x4813:
+ setCallback2(AnimationCallback(&KmScene1201::sub40DD20));
+ break;
+ case 0x4814:
+ setCallback2(AnimationCallback(&KmScene1201::sub40DFA0));
+ break;
+ case 0x4815:
+ setCallback2(AnimationCallback(&KmScene1201::sub40E040));
+ break;
+ case 0x4816:
+ if (param.asInteger() == 0) {
+ setCallback2(AnimationCallback(&Klayman::sub4200D0));
+ }
+ break;
+ case 0x4817:
+ setDoDeltaX(param.asInteger() != 0 ? 1 : 0);
+ sub41C7B0();
+ break;
+ case 0x481B:
+ if (param.asPoint().y != 0) {
+ sub41CC40(param.asPoint().y, param.asPoint().x);
+ } else {
+ sub41CCE0(param.asPoint().x);
+ }
+ break;
+ case 0x481D:
+ setCallback2(AnimationCallback(&Klayman::sub4207A0));
+ break;
+ case 0x481E:
+ setCallback2(AnimationCallback(&Klayman::sub4207F0));
+ break;
+ case 0x481F:
+ setCallback2(AnimationCallback(&Klayman::sub420830));
+ break;
+ case 0x482D:
+ setDoDeltaX(_x > (int16)param.asInteger() ? 1 : 0);
+ sub41C7B0();
+ break;
+ case 0x483F:
+ sub41CD00(param.asInteger());
+ break;
+ case 0x4840:
+ sub41CD70(param.asInteger());
+ break;
+ }
+ return 0;
+}
+
+void KmScene1201::update40DBE0() {
+ if (_x >= 380)
+ sub41C7B0();
+ Klayman::update();
+}
+
+uint32 KmScene1201::handleMessage40DC00(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Klayman::handleMessage41D480(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x51281850) {
+ setGlobalVar(0x20A0C516, 1);
+ } else if (param.asInteger() == 0x43000538) {
+ _soundResource1.play(0x21043059);
+ } else if (param.asInteger() == 0x02B20220) {
+ _soundResource1.play(0xC5408620);
+ } else if (param.asInteger() == 0x0A720138) {
+ _soundResource1.play(0xD4C08010);
+ } else if (param.asInteger() == 0xB613A180) {
+ _soundResource1.play(0x44051000);
+ }
+ break;
+ }
+ return messageResult;
+}
+
+void KmScene1201::sub40DD20() {
+ if (!sub41CEB0(AnimationCallback(&KmScene1201::sub40DD20))) {
+ _status2 = 0;
+ _flagE5 = false;
+ setDoDeltaX(((Sprite*)_attachedSprite)->getX() < _x ? 1 : 0);
+ setFileHash(0x9CAA0218, 0, -1);
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteCallback(NULL);
+ SetMessageHandler(&KmScene1201::handleMessage40DC00);
+ SetAnimationCallback3(&KmScene1201::sub40DD90);
+ }
+}
+
+void KmScene1201::sub40DD90() {
+ _status2 = 1;
+ _flagE5 = false;
+ setDoDeltaX(((Sprite*)_attachedSprite)->getX() < _x ? 1 : 0);
+ setFileHash(0x1222A513, 0, -1);
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteCallback(NULL);
+ SetMessageHandler(&KmScene1201::handleMessage40DC00);
+}
+
+uint32 KmScene1201::handleMessage40DDF0(int messageNum, const MessageParam &param, Entity *sender) {
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x01084280) {
+ _soundResource1.play(0x405002D8);
+ if (_attachedSprite) {
+ _attachedSprite->sendMessage(0x480B, 0, this);
+ }
+ } else if (param.asInteger() == 0x02421405) {
+ if (_countdown != 0) {
+ _countdown--;
+ sub40DF60();
+ } else {
+ SetMessageHandler(&Klayman::handleMessage41D480);
+ }
+ }
+ break;
+ }
+ return Klayman::handleMessage41D480(messageNum, param, sender);
+}
+
+uint32 KmScene1201::handleMessage40DEA0(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Klayman::handleMessage41D480(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x000F0082) {
+ _soundResource1.play(0x74E2810F);
+ }
+ break;
+ }
+ return messageResult;
+}
+
+void KmScene1201::sub40DF00() {
+ if (!sub41CEB0(AnimationCallback(&KmScene1201::sub40DF00))) {
+ _status2 = 2;
+ _flagE5 = false;
+ _countdown = 8;
+ setDoDeltaX(0);
+ setFileHash(0x0C1CA072, 0, -1);
+ SetUpdateHandler(&KmScene1201::update40DBE0);
+ SetSpriteCallback(&AnimatedSprite::updateDeltaXY);
+ SetMessageHandler(&KmScene1201::handleMessage40DDF0);
+ }
+}
+
+void KmScene1201::sub40DF60() {
+ _flagE5 = false;
+ setFileHash2(0x0C1CA072, 0x01084280, 0);
+ SetUpdateHandler(&KmScene1201::update40DBE0);
+ SetSpriteCallback(&AnimatedSprite::updateDeltaXY);
+ SetMessageHandler(&KmScene1201::handleMessage40DDF0);
+}
+
+void KmScene1201::sub40DFA0() {
+ if (!sub41CF10(AnimationCallback(&KmScene1201::sub40DFA0))) {
+ _status2 = 1;
+ _flagE5 = false;
+ setDoDeltaX(0);
+ setFileHash(0x2821C590, 0, -1);
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteCallback(&AnimatedSprite::updateDeltaXY);
+ SetMessageHandler(&KmScene1201::handleMessage40DEA0);
+ SetAnimationCallback3(&Klayman::sub41FC80);
+ _class464->sendMessage(0x2006, 0, this);
+ _soundResource1.play(0x62E0A356);
+ }
+}
+
+void KmScene1201::sub40E040() {
+ if (!sub41CF10(AnimationCallback(&KmScene1201::sub40E040))) {
+ _status2 = 1;
+ _flagE5 = false;
+ setFileHash(0x5420E254, 0, -1);
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteCallback(NULL);
+ SetMessageHandler(&Klayman::handleMessage41D360);
+ }
+}
+
} // End of namespace Neverhood
diff --git a/engines/neverhood/klayman.h b/engines/neverhood/klayman.h
index 8ec33bceab..3c87104125 100644
--- a/engines/neverhood/klayman.h
+++ b/engines/neverhood/klayman.h
@@ -82,6 +82,8 @@ public:
void sub421070();
void sub420420();
void sub420ED0();
+ void sub4207A0();
+ void sub4207F0();
void spriteUpdate41F250();
void spriteUpdate41F5F0();
@@ -264,6 +266,25 @@ protected:
void sub478170();
};
+class KmScene1201 : public Klayman {
+public:
+ KmScene1201(NeverhoodEngine *vm, Entity *parentScene, Entity *class464, int16 x, int16 y);
+protected:
+ Entity *_class464;
+ int _countdown;
+ uint32 xHandleMessage(int messageNum, const MessageParam &param);
+ void update40DBE0();
+ uint32 handleMessage40DC00(int messageNum, const MessageParam &param, Entity *sender);
+ void sub40DD20();
+ void sub40DD90();
+ uint32 handleMessage40DDF0(int messageNum, const MessageParam &param, Entity *sender);
+ uint32 handleMessage40DEA0(int messageNum, const MessageParam &param, Entity *sender);
+ void sub40DF00();
+ void sub40DF60();
+ void sub40DFA0();
+ void sub40E040();
+};
+
} // End of namespace Neverhood
#endif /* NEVERHOOD_KLAYMAN_H */
diff --git a/engines/neverhood/module.mk b/engines/neverhood/module.mk
index ed7077e337..17424765e0 100644
--- a/engines/neverhood/module.mk
+++ b/engines/neverhood/module.mk
@@ -11,6 +11,7 @@ MODULE_OBJS = \
klayman.o \
module.o \
module1000.o \
+ module1200.o \
module1500.o \
module2300.o \
mouse.o \
diff --git a/engines/neverhood/module1200.cpp b/engines/neverhood/module1200.cpp
new file mode 100644
index 0000000000..8075c5c391
--- /dev/null
+++ b/engines/neverhood/module1200.cpp
@@ -0,0 +1,772 @@
+/* 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/module1200.h"
+#include "neverhood/smackerscene.h"
+
+namespace Neverhood {
+
+Module1200::Module1200(NeverhoodEngine *vm, Module *parentModule, int which)
+ : Module(vm, parentModule), _moduleDone(false) {
+
+ // TODO _resourceTable.setResourceList(0x004B3E68);
+ SetMessageHandler(&Module1200::handleMessage);
+
+ if (which < 0) {
+ switch (_vm->gameState().sceneNum) {
+ case 0:
+ createScene1201(-1);
+ break;
+ case 1:
+ createScene1202(-1);
+ break;
+ case 2:
+ createScene1203(-1);
+ break;
+ }
+ } else if (which == 1) {
+ createScene1201(2);
+ } else {
+ createScene1201(0);
+ }
+
+ // TODO Music18hList_add(0x00478311, 0x62222CAE);
+ // TODO Music18hList_play(0x62222CAE, 0, 0, 1);
+}
+
+Module1200::~Module1200() {
+ // TODO Music18hList_deleteGroup(0x00478311);
+}
+
+uint32 Module1200::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Module::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x1009:
+ _moduleDone = true;
+ _moduleDoneStatus = param.asInteger();
+ break;
+ }
+ return messageResult;
+}
+
+void Module1200::createScene1201(int which) {
+ _vm->gameState().sceneNum = 0;
+ _childObject = new Scene1201(_vm, this, which);
+ SetUpdateHandler(&Module1200::updateScene1201);
+}
+
+void Module1200::createScene1202(int which) {
+ _vm->gameState().sceneNum = 1;
+ //_childObject = new Scene1202(_vm, this, which);
+ //SetUpdateHandler(&Module1200::updateScene1202);
+}
+
+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;
+ setGlobalVar(0x2A02C07B, 1);
+ SetUpdateHandler(&Module1200::updateScene1203);
+}
+
+void Module1200::updateScene1201() {
+ _childObject->handleUpdate();
+ if (_moduleDone) {
+ _moduleDone = false;
+ delete _childObject;
+ _childObject = NULL;
+ if (_moduleDoneStatus == 1) {
+ createScene1202(0);
+ _childObject->handleUpdate();
+ } else if (_moduleDoneStatus == 2) {
+ _parentModule->sendMessage(0x1009, 0, this);
+ } else if (getGlobalVar(0x0A18CA33) && !getGlobalVar(0x2A02C07B)) {
+ createScene1203(-1);
+ } else {
+ _parentModule->sendMessage(0x1009, 1, this);
+ }
+ }
+}
+
+void Module1200::updateScene1202() {
+ _childObject->handleUpdate();
+ if (_moduleDone) {
+ _moduleDone = false;
+ delete _childObject;
+ _childObject = NULL;
+ createScene1201(1);
+ _childObject->handleUpdate();
+ }
+}
+
+void Module1200::updateScene1203() {
+ _childObject->handleUpdate();
+ if (_moduleDone) {
+ _moduleDone = false;
+ delete _childObject;
+ _childObject = NULL;
+ createScene1201(3);
+ _childObject->handleUpdate();
+ // TODO Music18hList_play(0x62222CAE, 0, 0, 1);
+ }
+}
+
+// Scene1201
+
+static const uint32 kScene1201InitArray[] = {
+ 1, 0, 2, 4, 5, 3, 6, 7, 8, 10, 9, 11, 13, 14, 12, 16, 17, 15
+};
+
+static const NPoint kScene1201PointArray[] = {
+ {218, 193},
+ {410, 225},
+ {368, 277},
+ {194, 227},
+ {366, 174},
+ {458, 224},
+ {242, 228},
+ {512, 228},
+ {458, 277},
+ {217, 233},
+ {458, 173},
+ {410, 276},
+ {203, 280},
+ {371, 226},
+ {508, 279},
+ {230, 273},
+ {410, 171},
+ {493, 174}
+};
+
+static const uint32 kScene1201SsScene1201TntFileHashList1[] = {
+ 0x2098212D,
+ 0x1600437E,
+ 0x1600437E,
+ 0x00A840E3,
+ 0x1A1830F6,
+ 0x1A1830F6,
+ 0x00212062,
+ 0x384010B6,
+ 0x384010B6,
+ 0x07A01080,
+ 0xD80C2837,
+ 0xD80C2837,
+ 0x03A22092,
+ 0xD8802CB6,
+ 0xD8802CB6,
+ 0x03A93831,
+ 0xDA460476,
+ 0xDA460476
+};
+
+static const uint32 kScene1201SsScene1201TntFileHashList2[] = {
+ 0x3040C676,
+ 0x10914448,
+ 0x10914448,
+ 0x3448A066,
+ 0x1288C049,
+ 0x1288C049,
+ 0x78C0E026,
+ 0x3098D05A,
+ 0x3098D05A,
+ 0x304890E6,
+ 0x1284E048,
+ 0x1284E048,
+ 0xB140A1E6,
+ 0x5088A068,
+ 0x5088A068,
+ 0x74C4C866,
+ 0x3192C059,
+ 0x3192C059
+};
+
+SsScene1201Tnt::SsScene1201Tnt(NeverhoodEngine *vm, uint32 elemIndex, uint32 pointIndex, int16 clipY2)
+ : StaticSprite(vm, 900), _field7A(-1) {
+
+ int16 x = kScene1201PointArray[pointIndex].x;
+ int16 y = kScene1201PointArray[pointIndex].y;
+ if (x < 300) {
+ _spriteResource.load2(kScene1201SsScene1201TntFileHashList1[elemIndex]);
+ _x = _spriteResource.getPosition().x;
+ _y = _spriteResource.getPosition().y;
+ _drawRect.x = 0;
+ _drawRect.y = 0;
+ _drawRect.width = _spriteResource.getDimensions().width;
+ _drawRect.height = _spriteResource.getDimensions().height;
+ } else {
+ _spriteResource.load2(kScene1201SsScene1201TntFileHashList2[elemIndex]);
+ _x = x;
+ _y = y;
+ _drawRect.x = -(_spriteResource.getDimensions().width / 2);
+ _drawRect.y = -_spriteResource.getDimensions().height;
+ _drawRect.width = _spriteResource.getDimensions().width;
+ _drawRect.height = _spriteResource.getDimensions().height;
+
+ }
+ createSurface(50, _spriteResource.getDimensions().width, _spriteResource.getDimensions().height);
+ _surface->getClipRect().x1 = 0;
+ _surface->getClipRect().y1 = 0;
+ _surface->getClipRect().x2 = 640;
+ _surface->getClipRect().y2 = clipY2;
+ _needRefresh = true;
+ StaticSprite::update();
+}
+
+AsScene1201Tape::AsScene1201Tape(NeverhoodEngine *vm, Scene *parentScene, uint32 nameHash, int surfacePriority, int16 x, int16 y, uint32 fileHash)
+ : AnimatedSprite(vm, fileHash, surfacePriority, x, y), _parentScene(parentScene), _nameHash(nameHash) {
+
+ if (!getSubVar(0x02038314, _nameHash) && !getSubVar(0x02720344, _nameHash)) {
+ SetMessageHandler(&AsScene1201Tape::handleMessage);
+ } else {
+ _surface->setVisible(false);
+ SetMessageHandler(NULL);
+ }
+}
+
+uint32 AsScene1201Tape::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x1011:
+ _parentScene->sendMessage(0x4826, 0, this);
+ messageResult = 1;
+ break;
+ case 0x4806:
+ setSubVar(0x02038314, _nameHash, 1);
+ _surface->setVisible(false);
+ SetMessageHandler(NULL);
+ break;
+ }
+ return messageResult;
+}
+
+Class466::Class466(NeverhoodEngine *vm, bool flag)
+ : AnimatedSprite(vm, 1200), _soundResource(vm) {
+
+ SetUpdateHandler(&AnimatedSprite::update);
+ SetMessageHandler(&Class466::handleMessage);
+ createSurface(10, 34, 149);
+ _x = 202;
+ _y = -32;
+ if (flag) {
+ sub40D380();
+ } else {
+ sub40D340();
+ }
+}
+
+uint32 Class466::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x02060018) {
+ _soundResource.play(0x47900E06);
+ }
+ break;
+ case 0x2006:
+ sub40D360();
+ break;
+ }
+ return messageResult;
+}
+
+void Class466::sub40D340() {
+ setFileHash(0x928F0C10, 0, -1);
+ _newHashListIndex = 0;
+}
+
+void Class466::sub40D360() {
+ setFileHash(0x928F0C10, 1, -1);
+ _newHashListIndex = -2;
+}
+
+void Class466::sub40D380() {
+ setFileHash(0x928F0C10, 15, -1);
+ _newHashListIndex = -2;
+}
+
+Class468::Class468(NeverhoodEngine *vm, Sprite *klayman, bool flag)
+ : AnimatedSprite(vm, 1100), _soundResource(vm), _klayman(klayman), _countdown(0) {
+
+ createSurface1(100, 0xD088AC30);
+ _x = 320;
+ _y = 240;
+ SetUpdateHandler(&Class468::update);
+ SetMessageHandler(&Class468::handleMessage);
+ _newHashListIndex = -2;
+ if (flag) {
+ setFileHash(0xD088AC30, -1, -1);
+ _newHashListIndex = -2;
+ _countdown = 25;
+ } else {
+ setFileHash1();
+ _surface->setVisible(false);
+ }
+}
+
+void Class468::update() {
+ if (_countdown != 0 && (--_countdown == 0)) {
+ sub40D830();
+ }
+ AnimatedSprite::update();
+}
+
+uint32 Class468::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x3002:
+ removeCallbacks();
+ break;
+ case 0x4829:
+ sub40D7E0();
+ break;
+ }
+ return messageResult;
+}
+
+void Class468::sub40D7E0() {
+ setFileHash(0xD088AC30, 0, -1);
+ _newHashListIndex = -2;
+ _surface->setVisible(true);
+ _soundResource.play(calcHash("fxDoorOpen20"));
+}
+
+void Class468::sub40D830() {
+ setFileHash(0xD088AC30, -1, -1);
+ _playBackwards = true;
+ _surface->setVisible(true);
+ _soundResource.play(calcHash("fxDoorClose20"));
+ SetAnimationCallback3(&Class468::sub40D880);
+}
+
+void Class468::sub40D880() {
+ setFileHash1();
+ _surface->setVisible(false);
+}
+
+Class464::Class464(NeverhoodEngine *vm)
+ : AnimatedSprite(vm, 1200) {
+
+ createSurface(1200, 69, 98);
+ SetUpdateHandler(&AnimatedSprite::update);
+ SetMessageHandler(&Class464::handleMessage);
+ SetSpriteCallback(&AnimatedSprite::updateDeltaXY);
+ _surface->setVisible(false);
+}
+
+uint32 Class464::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x2006:
+ _x = 436;
+ _y = 339;
+ setFileHash(0xA060C599, 0, -1);
+ _surface->setVisible(true);
+ break;
+ case 0x3002:
+ setFileHash1();
+ _surface->setVisible(false);
+ removeCallbacks();
+ break;
+ }
+ return messageResult;
+}
+
+Class463::Class463(NeverhoodEngine *vm, Scene *parentScene, Sprite *class466, bool flag)
+ : AnimatedSprite(vm, 1100), _soundResource(vm), _parentScene(parentScene), _class466(class466),
+ _flag(false) {
+
+ //TODO_field_F0 = -1;
+
+ SetUpdateHandler(&AnimatedSprite::update);
+ SetMessageHandler(&Class463::handleMessage);
+ createSurface(990, 106, 181);
+ _x = 201;
+ if (flag) {
+ _y = 297;
+ sub40CD60();
+ } else {
+ _y = 334;
+ sub40CD30();
+ }
+}
+
+Class463::~Class463() {
+ // TODO Sound1ChList_sub_407AF0(0x01D00560);
+}
+
+uint32 Class463::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Sprite::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x092870C0) {
+ _class466->sendMessage(0x2006, 0, this);
+ } else if (param.asInteger() == 0x11CA0144) {
+ _soundResource.play(0x51800A04);
+ }
+ break;
+ case 0x1011:
+ _parentScene->sendMessage(0x2002, 0, this);
+ messageResult = 1;
+ case 0x480B:
+ if (!_flag) {
+ _sprite = (Sprite*)sender;
+ sub40CD90();
+ }
+ break;
+ }
+ return messageResult;
+
+}
+
+uint32 Class463::handleMessage40CCD0(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = Class463::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x3002:
+ removeCallbacks();
+ break;
+ }
+ return messageResult;
+}
+
+void Class463::spriteUpdate40CD10() {
+ _x = _sprite->getX() + 100;
+}
+
+void Class463::sub40CD30() {
+ setFileHash(0x654913D0, 0, -1);
+ SetMessageHandler(&Class463::handleMessage);
+ SetSpriteCallback(NULL);
+}
+
+void Class463::sub40CD60() {
+ setFileHash(0x356803D0, 0, -1);
+ SetMessageHandler(&Class463::handleMessage40CCD0);
+ SetSpriteCallback(&AnimatedSprite::updateDeltaXY);
+ SetAnimationCallback3(&Class463::sub40CD30);
+}
+
+void Class463::sub40CD90() {
+ // TODO Sound1ChList_addSoundResource(0x01D00560, 0x4B044624, true);
+ // TODO Sound1ChList_playLooping(0x4B044624);
+ _flag = true;
+ setFileHash(0x85084190, 0, -1);
+ SetMessageHandler(&Class463::handleMessage);
+ SetSpriteCallback(&Class463::spriteUpdate40CD10);
+ _newHashListIndex = -2;
+}
+
+
+Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which)
+ : Scene(vm, parentModule, true), _flag(false) {
+
+ int16 topY1, topY2, topY3, topY4;
+ int16 x1, x2;
+ Sprite *tempSprite, *class464;
+
+ // TODO _resourceTable2.setResourceList(ex_sub_41C730(), true);
+ if (getGlobalVar(0x0A18CA33)) {
+ // TODO _resourceTable1.setResourceList(0x004AEA10, true);
+ } else if (getGlobalVar(0x0A310817)) {
+ // TODO _resourceTable1.setResourceList(0x004AEA70, true);
+ } else {
+ // TODO _resourceTable1.setResourceList(0x004AEB18, true);
+ }
+
+ SetUpdateHandler(&Scene1201::update);
+ SetMessageHandler(&Scene1201::handleMessage);
+
+ _vm->_collisionMan->setHitRects(0x004AEBD0);
+
+ _surfaceFlag = true;
+
+ if (!getSubVar(0x40050052, 0xE8058B52)) {
+ setSubVar(0x40050052, 0xE8058B52, 1);
+ for (uint32 index = 0; index < 18; index++) {
+ setSubVar(0x10055D14, index, kScene1201InitArray[index]);
+ }
+ }
+
+ _mouseCursor = addSprite(new Mouse433(_vm, 0x9A2C0409, NULL));
+
+ _asTape = addSprite(new AsScene1201Tape(_vm, this, 3, 1100, 243, 340, 0x9148A011));
+ _vm->_collisionMan->addSprite(_asTape);
+
+ tempSprite = addSprite(new StaticSprite(_vm, 0x03C82530, 100));
+ topY1 = tempSprite->getY() + tempSprite->getSurface()->getDrawRect().height;
+
+ tempSprite = addSprite(new StaticSprite(_vm, 0x88182069, 200));
+ topY2 = tempSprite->getY() + tempSprite->getSurface()->getDrawRect().height;
+
+ tempSprite = addSprite(new StaticSprite(_vm, 0x476014E0, 300));
+ topY3 = tempSprite->getY() + tempSprite->getSurface()->getDrawRect().height;
+
+ tempSprite = addSprite(new StaticSprite(_vm, 0x04063110, 500));
+ topY4 = tempSprite->getY() + 1;
+
+ _class466 = addSprite(new Class466(_vm, getGlobalVar(0x000CF819) && which != 1 ? 1 : 0));
+ _class466->getSurface()->getClipRect().x1 = 0;
+ _class466->getSurface()->getClipRect().y1 = topY4;
+ _class466->getSurface()->getClipRect().x2 = 640;
+ _class466->getSurface()->getClipRect().y2 = 480;
+
+ addSprite(new StaticSprite(_vm, 0x400B04B0, 1200));
+
+ tempSprite = addSprite(new StaticSprite(_vm, 0x40295462, 1200));
+ x1 = tempSprite->getX();
+
+ tempSprite = addSprite(new StaticSprite(_vm, 0xA29223FA, 1200));
+ x2 = tempSprite->getX() + tempSprite->getSurface()->getDrawRect().width;
+
+ class464 = addSprite(new Class464(_vm));
+
+ if (which < 0) {
+ _klayman = new KmScene1201(_vm, this, class464, 364, 333);
+ setMessageList(0x004AEC08);
+ } else if (which == 3) {
+ _klayman = new KmScene1201(_vm, this, class464, 400, 329);
+ setMessageList(0x004AEC08);
+ } else if (which == 2) {
+ if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) {
+ _klayman = new KmScene1201(_vm, this, class464, 374, 333);
+ setMessageList(0x004AEC08);
+ } else {
+ _klayman = new KmScene1201(_vm, this, class464, 640, 329);
+ setMessageList(0x004AEC20);
+ }
+ } else if (which == 1) {
+ if (getGlobalVar(0xC0418A02)) {
+ _klayman = new KmScene1201(_vm, this, class464, 364, 333);
+ _klayman->setDoDeltaX(1);
+ } else {
+ _klayman = new KmScene1201(_vm, this, class464, 246, 333);
+ }
+ setMessageList(0x004AEC30);
+ } else {
+ _klayman = new KmScene1201(_vm, this, class464, 0, 336);
+ setMessageList(0x004AEC10);
+ }
+
+ _klayman->getSurface()->getClipRect().x1 = x1;
+ _klayman->getSurface()->getClipRect().y1 = 0;
+ _klayman->getSurface()->getClipRect().x2 = x2;
+ _klayman->getSurface()->getClipRect().y2 = 480;
+ _klayman->setRepl(64, 0);
+
+ addSprite(_klayman);
+
+ if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) {
+ _background = addBackground(new DirtyBackground(_vm, 0x4019A2C4, 0, 0));
+ _palette = new Palette(_vm, 0x4019A2C4);
+ _palette->usePalette();
+ _class468 = NULL;
+ } else {
+ _background = addBackground(new DirtyBackground(_vm, 0x40206EC5, 0, 0));
+ _palette = new Palette(_vm, 0x40206EC5);
+ _palette->usePalette();
+ _class468 = addSprite(new Class468(_vm, _klayman, which - 2 != 1)); // CHECKME???
+ }
+
+ if (getGlobalVar(0x000CF819)) {
+ addSprite(new StaticSprite(_vm, 0x10002ED8, 500));
+ if (!getGlobalVar(0x0A18CA33)) {
+ Class463 *class463;
+ class463 = new Class463(_vm, this, _class466, which - 1 != 1);
+ class463->getSurface()->getClipRect().x1 = x1;
+ class463->getSurface()->getClipRect().y1 = 0;
+ class463->getSurface()->getClipRect().x2 = x2;
+ class463->getSurface()->getClipRect().y2 = 480;
+ _vm->_collisionMan->addSprite(_class463);
+ _class463 = addSprite(class463);
+#if 0
+ tempSprite = addSprite(new Class465(_vm, _class463));
+ tempSprite->getSurface()->getClipRect().x1 = x1;
+ tempSprite->getSurface()->getClipRect().y1 = 0;
+ tempSprite->getSurface()->getClipRect().x2 = x2;
+ tempSprite->getSurface()->getClipRect().y2 = 480;
+#endif
+ class463->setRepl(64, 0);
+ }
+
+ uint32 tntIndex = 1;
+ while (tntIndex < 18) {
+ uint32 elemIndex = getSubVar(0x10055D14, tntIndex);
+ int16 clipY2;
+ if (kScene1201PointArray[elemIndex].y < 175)
+ clipY2 = topY1;
+ else if (kScene1201PointArray[elemIndex].y < 230)
+ clipY2 = topY2;
+ else
+ clipY2 = topY3;
+ addSprite(new SsScene1201Tnt(_vm, tntIndex, getSubVar(0x10055D14, tntIndex), clipY2));
+ elemIndex = getSubVar(0x10055D14, tntIndex + 1);
+ if (kScene1201PointArray[elemIndex].y < 175)
+ clipY2 = topY1;
+ else if (kScene1201PointArray[elemIndex].y < 230)
+ clipY2 = topY2;
+ else
+ clipY2 = topY3;
+ addSprite(new SsScene1201Tnt(_vm, tntIndex + 1, getSubVar(0x10055D14, tntIndex + 1), clipY2));
+ tntIndex += 3;
+ }
+
+ if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) {
+ setRectList(0x004AEE58);
+ } else {
+ setRectList(0x004AEDC8);
+ }
+
+ } else {
+
+ addSprite(new StaticSprite(_vm, 0x8E8A1981, 900));
+
+ uint32 tntIndex = 0;
+ while (tntIndex < 18) {
+ uint32 elemIndex = getSubVar(0x10055D14, tntIndex);
+ int16 clipY2;
+ if (kScene1201PointArray[elemIndex].x < 300) {
+ clipY2 = 480;
+ } else {
+ if (kScene1201PointArray[elemIndex].y < 175)
+ clipY2 = topY1;
+ else if (kScene1201PointArray[elemIndex].y < 230)
+ clipY2 = topY2;
+ else
+ clipY2 = topY3;
+ }
+ addSprite(new SsScene1201Tnt(_vm, tntIndex, getSubVar(0x10055D14, tntIndex), clipY2));
+ tntIndex++;
+ }
+
+ if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) {
+ setRectList(0x004AEE18);
+ } else {
+ setRectList(0x004AED88);
+ }
+
+ }
+
+ tempSprite = addSprite(new StaticSprite(_vm, 0x63D400BC, 900));
+
+#if 0
+ _class467 = addSprite(new Class467(_vm, _klayman));
+ _class467->getSurface()->getClipRect().x1 = x1;
+ _class467->getSurface()->getClipRect().y1 = tempSprite->getSurface()->getDrawRect().y;
+ _class467->getSurface()->getClipRect().x2 = tempSprite->getSurface()->getDrawRect().x + tempSprite->getSurface()->getDrawRect().width;
+ _class467->getSurface()->getClipRect().y2 = 480;
+#endif
+
+ if (getGlobalVar(0x0A310817) && ! getGlobalVar(0x0112090A)) {
+ setGlobalVar(0x0112090A, 1);
+ }
+
+ _class461 = NULL;
+
+#if 0
+ if (getGlobalVar(0x0112090A) < 3) {
+ _class461 = addSprite(new Class461(_vm, this));
+ _vm->_collisionMan->addSprite(_class461);
+ }
+
+ if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) {
+ _class462 = addSprite(new Class462(_vm, this, _klayman));
+ _class462->getSurface()->getClipRect().x1 = x1;
+ _class462->getSurface()->getClipRect().y1 = 0;
+ _class462->getSurface()->getClipRect().x2 = x2;
+ _class462->getSurface()->getClipRect().y2 = 480;
+ }
+#endif
+
+}
+
+Scene1201::~Scene1201() {
+}
+
+void Scene1201::update() {
+ Scene::update();
+ if (_class461 && getGlobalVar(0x0112090A)) {
+ deleteSprite(&_class461);
+ }
+}
+
+uint32 Scene1201::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ debug("Scene1201::handleMessage(%04X)", messageNum);
+ uint32 messageResult = Scene::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x07053000) {
+ _flag = true;
+ _class462->sendMessage(0x2004, 0, this);
+ } else if (param.asInteger() == 0x140E5744) {
+ _class462->sendMessage(0x2005, 0, this);
+ } else if (param.asInteger() == 0x40253C40) {
+ _messageListFlag = false;
+ _class462->sendMessage(0x2006, 0, this);
+ } else if (param.asInteger() == 0x090EB048) {
+ if (_klayman->getX() < 572) {
+ setMessageList2(0x004AEC90);
+ } else {
+ setMessageList2(0x004AEC20);
+ }
+ }
+ break;
+ case 0x2001:
+ if (!getGlobalVar(0x0112090A)) {
+ setMessageList2(0x004AECB0);
+ } else {
+ _klayman->sendEntityMessage(0x1014, _class461, this);
+ setMessageList2(0x004AECC0);
+ }
+ break;
+ case 0x2002:
+ if (getGlobalVar(0x20A0C516)) {
+ _klayman->sendEntityMessage(0x1014, _class463, this);
+ setMessageList2(0x004AECF0);
+ } else if (getGlobalVar(0x0112090A) == 3) {
+ _klayman->sendEntityMessage(0x1014, _class463, this);
+ if (_klayman->getX() > _class463->getX()) {
+ setMessageList(0x004AECD0);
+ } else {
+ setMessageList(0x004AECE0);
+ }
+ }
+ break;
+ case 0x4814:
+ messageList402220();
+ break;
+ case 0x4826:
+ if (sender == _asTape) {
+ _klayman->sendEntityMessage(0x1014, _asTape, this);
+ setMessageList(0x004AED38);
+ }
+ break;
+ case 0x4829:
+ _class468->sendMessage(0x4829, 0, this);
+ break;
+ }
+ return messageResult;
+}
+
+} // End of namespace Neverhood
diff --git a/engines/neverhood/module1200.h b/engines/neverhood/module1200.h
new file mode 100644
index 0000000000..bbdfaeb634
--- /dev/null
+++ b/engines/neverhood/module1200.h
@@ -0,0 +1,141 @@
+/* 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_MODULE1200_H
+#define NEVERHOOD_MODULE1200_H
+
+#include "neverhood/neverhood.h"
+#include "neverhood/module.h"
+#include "neverhood/scene.h"
+
+namespace Neverhood {
+
+// Module1200
+
+class Module1200 : public Module {
+public:
+ Module1200(NeverhoodEngine *vm, Module *parentModule, int which);
+ virtual ~Module1200();
+protected:
+ // TODO ResourceTable _resourceTable;
+ bool _moduleDone;
+ uint32 _moduleDoneStatus;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ void createScene1201(int which);
+ void createScene1202(int which);
+ void createScene1203(int which);
+ void updateScene1201();
+ void updateScene1202();
+ void updateScene1203();
+};
+
+// Scene1201
+
+class AsScene1201Tape : public AnimatedSprite {
+public:
+ AsScene1201Tape(NeverhoodEngine *vm, Scene *parentScene, uint32 nameHash, int surfacePriority, int16 x, int16 y, uint32 fileHash);
+protected:
+ Scene *_parentScene;
+ uint32 _nameHash;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class Class466 : public AnimatedSprite {
+public:
+ Class466(NeverhoodEngine *vm, bool flag);
+protected:
+ SoundResource _soundResource;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ void sub40D340();
+ void sub40D360();
+ void sub40D380();
+};
+
+class Class468 : public AnimatedSprite {
+public:
+ Class468(NeverhoodEngine *vm, Sprite *klayman, bool flag);
+protected:
+ SoundResource _soundResource;
+ Sprite *_klayman;
+ int _countdown;
+ void update();
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ void sub40D7E0();
+ void sub40D830();
+ void sub40D880();
+};
+
+class Class464 : public AnimatedSprite {
+public:
+ Class464(NeverhoodEngine *vm);
+protected:
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+class Class463 : public AnimatedSprite {
+public:
+ Class463(NeverhoodEngine *vm, Scene *parentScene, Sprite *class466, bool flag);
+ virtual ~Class463();
+protected:
+ Scene *_parentScene;
+ Sprite *_class466;
+ Sprite *_sprite;
+ SoundResource _soundResource;
+ bool _flag;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+ uint32 handleMessage40CCD0(int messageNum, const MessageParam &param, Entity *sender);
+ void spriteUpdate40CD10();
+ void sub40CD30();
+ void sub40CD60();
+ void sub40CD90();
+};
+
+class SsScene1201Tnt : public StaticSprite {
+public:
+ SsScene1201Tnt(NeverhoodEngine *vm, uint32 elemIndex, uint32 pointIndex, int16 clipY2);
+protected:
+ uint32 _elemIndex;
+ int16 _field7A;
+};
+
+class Scene1201 : public Scene {
+public:
+ Scene1201(NeverhoodEngine *vm, Module *parentModule, int which);
+ virtual ~Scene1201();
+protected:
+ // TODO ResourceTable _resourceTable1;
+ // TODO ResourceTable _resourceTable2;
+ Sprite *_class461;
+ Sprite *_class463;
+ Sprite *_class462;
+ Sprite *_class466;
+ Sprite *_class467;
+ Sprite *_class468;
+ Sprite *_asTape;
+ bool _flag;
+ void update();
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
+} // End of namespace Neverhood
+
+#endif /* NEVERHOOD_MODULE1200_H */
diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp
index 8f49a0033d..43f1ca79bc 100644
--- a/engines/neverhood/scene.cpp
+++ b/engines/neverhood/scene.cpp
@@ -485,6 +485,13 @@ void Scene::runMessageList() {
}
+void Scene::messageList402220() {
+ _messageListFlag1 = false;
+ _messageList = NULL;
+ _messageListFlag = true;
+ _klayman->sendMessage(0x4004, 0, this);
+}
+
void Scene::setRectList(uint32 id) {
setRectList(_vm->_staticData->getRectList(id));
}
diff --git a/engines/neverhood/scene.h b/engines/neverhood/scene.h
index 8f0b79a5ee..47114053b0 100644
--- a/engines/neverhood/scene.h
+++ b/engines/neverhood/scene.h
@@ -102,6 +102,7 @@ protected:
void runMessageList();
void setRectList(uint32 id);
void setRectList(RectList *rectList);
+ void messageList402220();
void loadDataResource(uint32 fileHash);
};