diff options
author | johndoe123 | 2011-07-11 09:37:00 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:38:47 +0200 |
commit | c39fb81951dd1a442c9811ba7ce202fa3619be70 (patch) | |
tree | cce663b270e836e16d02de316b432b7f42c916d9 /engines/neverhood | |
parent | 6d81ef0199e3213a97c4ff8856322341ac231022 (diff) | |
download | scummvm-rg350-c39fb81951dd1a442c9811ba7ce202fa3619be70.tar.gz scummvm-rg350-c39fb81951dd1a442c9811ba7ce202fa3619be70.tar.bz2 scummvm-rg350-c39fb81951dd1a442c9811ba7ce202fa3619be70.zip |
NEVERHOOD: More work on Scene1001/Klayman
- Looking through the open window now works (mostly).
Diffstat (limited to 'engines/neverhood')
-rw-r--r-- | engines/neverhood/klayman.cpp | 60 | ||||
-rw-r--r-- | engines/neverhood/klayman.h | 7 | ||||
-rw-r--r-- | engines/neverhood/module1000.cpp | 72 | ||||
-rw-r--r-- | engines/neverhood/module1000.h | 12 |
4 files changed, 144 insertions, 7 deletions
diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp index a256495da5..db88daf7ae 100644 --- a/engines/neverhood/klayman.cpp +++ b/engines/neverhood/klayman.cpp @@ -1102,4 +1102,64 @@ uint32 Klayman::handleMessage41DF10(int messageNum, const MessageParam ¶m, E return messageResult; } +void Klayman::sub420870() { + _status2 = 0; + _flagE5 = true; + setFileHash(0xD820A114, 0, 10); + SetUpdateHandler(&Klayman::update); + SetMessageHandler(&Klayman::handleMessage41D480); + SetSpriteCallback(NULL); +} + +void Klayman::sub4208B0() { + _status2 = 1; + _flagE5 = true; + setFileHash(0xD820A114, 30, -1); + SetUpdateHandler(&Klayman::update); + SetMessageHandler(&Klayman::handleMessage41D480); + SetSpriteCallback(NULL); +} + +void Klayman::sub4208F0() { + _status2 = 0; + _flagE5 = true; + setFileHash(0x9B250AD2, 0, 7); + SetUpdateHandler(&Klayman::update); + SetMessageHandler(&Klayman::handleMessage41EEF0); + SetSpriteCallback(NULL); +} + +uint32 Klayman::handleMessage41EEF0(int messageNum, const MessageParam ¶m, Entity *sender) { + debug("Klayman::handleMessage41EEF0(%04X)", messageNum); + uint32 messageResult = handleMessage41D480(messageNum, param, sender); + switch (messageNum) { + case 0x100D: + if (param.asInteger() == 0x32180101) { + _soundResource1.play(0x4924AAC4); + } else if (param.asInteger() == 0x0A2A9098) { + _soundResource1.play(0x0A2AA8E0); + } + break; + } + return messageResult; +} + +void Klayman::sub420930() { + _status2 = 1; + _flagE5 = true; + setFileHash(0x98F88391, 4, -1); + SetUpdateHandler(&Klayman::update); + SetMessageHandler(&Klayman::handleMessage41EEF0); + SetSpriteCallback(NULL); +} + +void Klayman::sub420830() { + _status2 = 1; + _flagE5 = true; + setFileHash(0xD820A114, 0, -1); + SetUpdateHandler(&Klayman::update); + SetMessageHandler(&Klayman::handleMessage41D480); + SetSpriteCallback(NULL); +} + } // End of namespace Neverhood diff --git a/engines/neverhood/klayman.h b/engines/neverhood/klayman.h index 860368a764..4d883c3462 100644 --- a/engines/neverhood/klayman.h +++ b/engines/neverhood/klayman.h @@ -58,6 +58,11 @@ public: void sub420170(); void sub4200D0(); void sub41FBC0(); + void sub420870(); + void sub4208B0(); + void sub4208F0(); + void sub420930(); + void sub420830(); void spriteUpdate41F250(); void spriteUpdate41F5F0(); @@ -170,6 +175,8 @@ protected: uint32 handleMessage41DF10(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 handleMessage41EEF0(int messageNum, const MessageParam ¶m, Entity *sender); + }; } // End of namespace Neverhood diff --git a/engines/neverhood/module1000.cpp b/engines/neverhood/module1000.cpp index b3c07c9b51..d31044c517 100644 --- a/engines/neverhood/module1000.cpp +++ b/engines/neverhood/module1000.cpp @@ -65,7 +65,6 @@ Module1000::~Module1000() { } void Module1000::createScene1001(int which) { - debug("createScene1501"); _vm->gameState().sceneNum = 0; _childObject = new Scene1001(_vm, this, which); // TODO ResourceTable_multiLoad(&_resourceTable1, &_resourceTable2, &_resourceTable3); @@ -77,6 +76,10 @@ void Module1000::createScene1002(int which) { } void Module1000::createScene1003(int which) { + _vm->gameState().sceneNum = 2; + _childObject = new Class152(_vm, this, 0xC084110C, 0x41108C00); + SetUpdateHandler(&Module1000::updateScene1003); + // TODO Music18hList_play(0x061880C6, 0, 0); } void Module1000::createScene1004(int which) { @@ -89,12 +92,15 @@ void Module1000::updateScene1001() { _childObject->handleUpdate(); if (_done) { + + debug("SCENE 1001 DONE; _field20 = %d", _field20); + _done = false; delete _childObject; _childObject = NULL; if (_field20 == 2) { - // TODO createScene1003(); - // TODO _childObject->handleUpdate(); + createScene1003(0); + _childObject->handleUpdate(); } else { // TODO createScene1002(); // TODO _childObject->handleUpdate(); @@ -122,6 +128,14 @@ void Module1000::updateScene1002() { } void Module1000::updateScene1003() { + _childObject->handleUpdate(); + if (_done) { + _done = false; + delete _childObject; + _childObject = NULL; + createScene1001(2); + _childObject->handleUpdate(); + } } void Module1000::updateScene1004() { @@ -181,6 +195,25 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam ¶m) { } break; + case 0x481F: + if (param.asInteger() == 0) { + setCallback2(AnimationCallback(&Klayman::sub420870)); + } else if (param.asInteger() == 1) { + setCallback2(AnimationCallback(&Klayman::sub4208B0)); + } else if (param.asInteger() == 3) { + setCallback2(AnimationCallback(&Klayman::sub4208F0)); + } else if (param.asInteger() == 4) { + setCallback2(AnimationCallback(&Klayman::sub420930)); + } else { + 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); @@ -197,8 +230,6 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam ¶m) { break; } - // TODO - return 0; } @@ -461,9 +492,8 @@ Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which) _background = addBackground(new DirtyBackground(_vm, 0x4086520E, 0, 0)); _palette = new Palette(_vm, 0x4086520E); _palette->usePalette(); + // TODO _mouseCursor = addSprite(new Class433(_vm, 6520A400, 0)); - // TODO Mouse - if (which < 0) { setRectList(0x004B49F0); _klayman = new KmScene1001(_vm, this, 200, 433); @@ -587,4 +617,32 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam ¶m, Entit return messageResult; } +// Class152 + +Class152::Class152(NeverhoodEngine *vm, Module *parentModule, uint32 backgroundFileHash, uint32 cursorFileHash) + : Scene(vm, parentModule, true), _fieldD0(-1), _fieldD2(-1) { + + _surfaceFlag = false; + + SetMessageHandler(&Class152::handleMessage); + + _background = addBackground(new DirtyBackground(_vm, backgroundFileHash, 0, 0)); + _palette = new Palette(_vm, backgroundFileHash); + _palette->usePalette(); + // TODO _mouseCursor = addSprite(new Class435(_vm, cursorFileHash, 20, 620)); + +} + +uint32 Class152::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { + Scene::handleMessage(messageNum, param, sender); + switch (messageNum) { + case 0x0001: + if (param.asPoint().x <= 20 || param.asPoint().x >= 620) { + _parentModule->sendMessage(0x1009, 0, this); + } + break; + } + return 0; +} + } // End of namespace Neverhood diff --git a/engines/neverhood/module1000.h b/engines/neverhood/module1000.h index d74a0e189d..c1c7c8e4a0 100644 --- a/engines/neverhood/module1000.h +++ b/engines/neverhood/module1000.h @@ -130,6 +130,18 @@ protected: uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); }; +// TODO: Move this to some common file since it's used several times + +class Class152 : public Scene { +public: + Class152(NeverhoodEngine *vm, Module *parentModule, uint32 backgroundFileHash, uint32 cursorFileHash); +protected: + // TODO: Are these used? + int16 _fieldD0; + int16 _fieldD2; + uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); +}; + } // End of namespace Neverhood #endif /* NEVERHOOD_MODULE1000_H */ |