aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232012-08-16 17:40:22 +0000
committerWillem Jan Palenstijn2013-05-08 20:43:38 +0200
commit646790489886aa8adb9a5bfc6e6ec6c57e5aa62b (patch)
treef61b2002c78354844e00b225cddf8d3b06f4098d /engines
parent0abba004fe4a6b172269f09cfe55d7d683736867 (diff)
downloadscummvm-rg350-646790489886aa8adb9a5bfc6e6ec6c57e5aa62b.tar.gz
scummvm-rg350-646790489886aa8adb9a5bfc6e6ec6c57e5aa62b.tar.bz2
scummvm-rg350-646790489886aa8adb9a5bfc6e6ec6c57e5aa62b.zip
NEVERHOOD: Implement Scene2805
Diffstat (limited to 'engines')
-rw-r--r--engines/neverhood/gamemodule.cpp2
-rw-r--r--engines/neverhood/klayman.cpp86
-rw-r--r--engines/neverhood/klayman.h11
-rw-r--r--engines/neverhood/module2800.cpp70
-rw-r--r--engines/neverhood/module2800.h9
5 files changed, 177 insertions, 1 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp
index 781a9c305a..37e87431bf 100644
--- a/engines/neverhood/gamemodule.cpp
+++ b/engines/neverhood/gamemodule.cpp
@@ -303,7 +303,7 @@ void GameModule::startup() {
createModule(2700, -1);
#endif
#if 1
- _vm->gameState().sceneNum = 0;
+ _vm->gameState().sceneNum = 4;
createModule(2800, -1);
#endif
}
diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp
index 303e3fe364..247c946bc3 100644
--- a/engines/neverhood/klayman.cpp
+++ b/engines/neverhood/klayman.cpp
@@ -4916,4 +4916,90 @@ uint32 KmScene2801::xHandleMessage(int messageNum, const MessageParam &param) {
return 0;
}
+KmScene2805::KmScene2805(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y)
+ : Klayman(vm, parentScene, x, y, 1000, 1000), _isSittingInTeleporter(false) {
+ // Empty
+}
+
+uint32 KmScene2805::xHandleMessage(int messageNum, const MessageParam &param) {
+ switch (messageNum) {
+ case 0x2000:
+ _isSittingInTeleporter = param.asInteger() != 0;
+ break;
+ case 0x4001:
+ case 0x4800:
+ startWalkToX(param.asPoint().x, false);
+ break;
+ case 0x4004:
+ if (_isSittingInTeleporter)
+ GotoState(&Klayman::sub421350);
+ else
+ GotoState(&Klayman::stTryStandIdle);
+ break;
+ case 0x4817:
+ setDoDeltaX(param.asInteger());
+ gotoNextStateExt();
+ break;
+ case 0x481D:
+ if (_isSittingInTeleporter)
+ GotoState(&Klayman::stTurnToUseInTeleporter);
+ break;
+ case 0x481E:
+ if (_isSittingInTeleporter)
+ GotoState(&Klayman::stReturnFromUseInTeleporter);
+ break;
+ case 0x4834:
+ GotoState(&Klayman::stStepOver);
+ break;
+ case 0x4835:
+ sendMessage(_parentScene, 0x2000, 1);
+ _isSittingInTeleporter = true;
+ GotoState(&Klayman::stSitInTeleporter);
+ break;
+ case 0x4836:
+ sendMessage(_parentScene, 0x2000, 0);
+ _isSittingInTeleporter = false;
+ GotoState(&Klayman::stGetUpFromTeleporter);
+ break;
+ case 0x483D:
+ sub404890();
+ break;
+ case 0x483E:
+ sub4048D0();
+ break;
+ }
+ return 0;
+}
+
+uint32 KmScene2805::handleMessage404800(int messageNum, const MessageParam &param, Entity *sender) {
+ uint32 messageResult = handleMessage41D480(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x100D:
+ if (param.asInteger() == 0x4E0A2C24)
+ _soundResource1.play(0x85B10BB8);
+ else if (param.asInteger() == 0x4E6A0CA0)
+ _soundResource1.play(0xC5B709B0);
+ break;
+ }
+ return messageResult;
+}
+
+void KmScene2805::sub404890() {
+ _status2 = 0;
+ _acceptInput = false;
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteUpdate(NULL);
+ SetMessageHandler(&KmScene2805::handleMessage404800);
+ startAnimation(0xDE284B74, 0, -1);
+}
+
+void KmScene2805::sub4048D0() {
+ _status2 = 0;
+ _acceptInput = false;
+ SetUpdateHandler(&Klayman::update);
+ SetSpriteUpdate(NULL);
+ SetMessageHandler(&KmScene2805::handleMessage404800);
+ startAnimation(0xD82A4094, 0, -1);
+}
+
} // End of namespace Neverhood
diff --git a/engines/neverhood/klayman.h b/engines/neverhood/klayman.h
index 355c6d6f15..5f4076e303 100644
--- a/engines/neverhood/klayman.h
+++ b/engines/neverhood/klayman.h
@@ -549,6 +549,17 @@ protected:
uint32 xHandleMessage(int messageNum, const MessageParam &param);
};
+class KmScene2805 : public Klayman {
+public:
+ KmScene2805(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y);
+protected:
+ bool _isSittingInTeleporter;
+ uint32 xHandleMessage(int messageNum, const MessageParam &param);
+ uint32 handleMessage404800(int messageNum, const MessageParam &param, Entity *sender);
+ void sub404890();
+ void sub4048D0();
+};
+
} // End of namespace Neverhood
#endif /* NEVERHOOD_KLAYMAN_H */
diff --git a/engines/neverhood/module2800.cpp b/engines/neverhood/module2800.cpp
index 6643d5a50e..c1e70483a6 100644
--- a/engines/neverhood/module2800.cpp
+++ b/engines/neverhood/module2800.cpp
@@ -73,6 +73,10 @@ void Module2800::createScene(int sceneNum, int which) {
}
#endif
break;
+ case 4:
+ // TODO Music18hList_stop(0xD2FA4D14, 0, 2);
+ _childObject = new Scene2805(_vm, this, which);
+ break;
//
case 1001:
break;
@@ -104,6 +108,13 @@ void Module2800::updateScene() {
createScene(1001, -1);
}
break;
+ case 4:
+ if (_moduleResult == 1) {
+ leaveModule(1);
+ } else {
+ createScene(11, 1);
+ }
+ break;
//
case 1001:
break;
@@ -228,4 +239,63 @@ uint32 Scene2801::handleMessage(int messageNum, const MessageParam &param, Entit
return messageResult;
}
+Scene2805::Scene2805(NeverhoodEngine *vm, Module *parentModule, int which)
+ : Scene(vm, parentModule, true) {
+
+ _surfaceFlag = true;
+ SetMessageHandler(&Scene2805::handleMessage);
+
+ setBackground(0x08021E04);
+ setPalette(0x08021E04);
+ _palette->addPalette(0x8A6B1F91, 0, 65, 0);
+ insertMouse433(0x21E00088);
+
+ _sprite1 = insertStaticSprite(0x008261E7, 1100);
+ _sprite2 = insertStaticSprite(0x020CE421, 1100);
+
+ if (which < 0) {
+ insertKlayman<KmScene2805>(380, 338);
+ setMessageList(0x004AE1C8);
+ sendMessage(this, 0x2000, 0);
+ } else if (which == 1) {
+ insertKlayman<KmScene2805>(493, 338);
+ sendMessage(_klayman, 0x2000, 1);
+ setMessageList(0x004AE1D0);
+ sendMessage(this, 0x2000, 1);
+ } else if (which == 2) {
+ insertKlayman<KmScene2805>(493, 338);
+ sendMessage(_klayman, 0x2000, 1);
+ setMessageList(0x004AE288);
+ sendMessage(this, 0x2000, 1);
+ } else if (which == 3) {
+ insertKlayman<KmScene2805>(493, 338);
+ sendMessage(_klayman, 0x2000, 1);
+ setMessageList(0x004AE1E0);
+ sendMessage(this, 0x2000, 1);
+ } else {
+ insertKlayman<KmScene2805>(340, 338);
+ setMessageList(0x004AE1C0);
+ sendMessage(this, 0x2000, 0);
+ }
+
+ _klayman->setClipRect(_sprite1->getDrawRect().x, 0, _sprite2->getDrawRect().x2(), 480);
+
+}
+
+uint32 Scene2805::handleMessage(int messageNum, const MessageParam &param, Entity *sender) {
+ Scene::handleMessage(messageNum, param, sender);
+ switch (messageNum) {
+ case 0x2000:
+ if (param.asInteger()) {
+ setRectList(0x004AE318);
+ _klayman->setKlaymanIdleTable3();
+ } else {
+ setRectList(0x004AE308);
+ _klayman->setKlaymanIdleTable1();
+ }
+ break;
+ }
+ return 0;
+}
+
} // End of namespace Neverhood
diff --git a/engines/neverhood/module2800.h b/engines/neverhood/module2800.h
index cdfcdbe802..06d818cc74 100644
--- a/engines/neverhood/module2800.h
+++ b/engines/neverhood/module2800.h
@@ -54,6 +54,15 @@ protected:
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
};
+class Scene2805 : public Scene {
+public:
+ Scene2805(NeverhoodEngine *vm, Module *parentModule, int which);
+protected:
+ Sprite *_sprite1;
+ Sprite *_sprite2;
+ uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
+};
+
} // End of namespace Neverhood
#endif /* NEVERHOOD_MODULE2800_H */