diff options
author | johndoe123 | 2011-07-07 20:26:12 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:30:59 +0200 |
commit | c694ce8505529478c60d23603bd9dc217dd7afb0 (patch) | |
tree | 79118ba6d6b5e34f1c504143ba81dfe3095a63d4 /engines/neverhood/klayman.cpp | |
parent | 3131cc6f1899b3eaa5f234d95801a8bff77144e0 (diff) | |
download | scummvm-rg350-c694ce8505529478c60d23603bd9dc217dd7afb0.tar.gz scummvm-rg350-c694ce8505529478c60d23603bd9dc217dd7afb0.tar.bz2 scummvm-rg350-c694ce8505529478c60d23603bd9dc217dd7afb0.zip |
NEVERHOOD: More work on Klayman
- Rename Scene::_playerSprite to _klayman
- Send mouse clicks to the scene object (has not effect yet)
Diffstat (limited to 'engines/neverhood/klayman.cpp')
-rw-r--r-- | engines/neverhood/klayman.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp index 836b2e0bb0..7a775bcf12 100644 --- a/engines/neverhood/klayman.cpp +++ b/engines/neverhood/klayman.cpp @@ -67,9 +67,22 @@ Klayman::Klayman(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y, int } void Klayman::xUpdate() { + // Empty } uint32 Klayman::xHandleMessage(int messageNum, const MessageParam ¶m) { + switch (messageNum) { + case 0x4001: + case 0x4800: + sub41C930(param._point.x, false); + break; + case 0x4004: + // TODO AnimatedSprite_setCallback2(AnimationCallback(&sub41FC80)); + break; + case 0x4818: + // TODO sub41C930(_rectResource.getRectangle1(param._integer).x, false); + break; + } return 0; } @@ -455,5 +468,57 @@ void Klayman::sub41FCF0() { SetSpriteCallback(NULL); } +uint32 Klayman::handleMessage41F140(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = handleMessage41D480(messageNum, param, sender); + switch (messageNum) { + case 0x100D: + if (param._integer == 0x271AA210) { +#if 0 + _soundResource1.set(0x4924AAC4); + _soundResource1.load(); + _soundResource1.play(false); +#endif + } else if (param._integer == 0x2B22AA81) { +#if 0 + _soundResource1.set(0x0A2AA8E0); + _soundResource1.load(); + _soundResource1.play(false); +#endif + } + break; + } + return messageResult; +} + + +void Klayman::sub41C930(int16 x, bool flag) { + int16 xdiff = ABS(x - _x); + if (xdiff == 0) { + _x4 = x; + if (_flagE1 || _flagE2 || _flagE3) { + // TODO AnimatedSprite_setCallback2(NULL); + sub41C7B0(); + } + } else if (xdiff <= 36 && !_flagE1 && !_flagE2 && !_flagE3) { + _x4 = x; + // TODO AnimatedSprite_setCallback2(NULL); + sub41C7B0(); + } else if (xdiff <= 42 && _status != 3) { + if (_flagE2 && ((!_doDeltaX && x - _x > 0) || (_doDeltaX && x - _x < 0)) && ABS(_x4 - _x) > xdiff) { + _x4 = x; + } else { + _x4 = x; + // TODO AnimatedSprite_setCallback2(AnimationCallback(&Klayman::sub41FB40)); + } + } else if (_flagE1 && ((!_doDeltaX && x - _x > 0) || (_doDeltaX && x - _x < 0))) { + _x4 = x; + } else if (flag) { + _x4 = x; + // TODO AnimatedSprite_setCallback2(AnimationCallback(&Klayman::sub421550)); + } else { + _x4 = x; + // TODO AnimatedSprite_setCallback2(AnimationCallback(&Klayman::sub41F950)); + } +} } // End of namespace Neverhood |