diff options
author | johndoe123 | 2012-05-11 11:03:40 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:43:38 +0200 |
commit | 0683ed9eee35a465b7b3fd5b36f55011123aee65 (patch) | |
tree | eeca173b764013ad6b64d4511963f757e4efd999 /engines/neverhood | |
parent | 9c2341678ef4984bf92b3878295250faf980b066 (diff) | |
download | scummvm-rg350-0683ed9eee35a465b7b3fd5b36f55011123aee65.tar.gz scummvm-rg350-0683ed9eee35a465b7b3fd5b36f55011123aee65.tar.bz2 scummvm-rg350-0683ed9eee35a465b7b3fd5b36f55011123aee65.zip |
NEVERHOOD: Rename SetSpriteCallback to SetSpriteUpdate
- Started replace message numbers with constants
- Add NRect::contains
- Some cleanup
Diffstat (limited to 'engines/neverhood')
-rw-r--r-- | engines/neverhood/blbarchive.cpp | 2 | ||||
-rw-r--r-- | engines/neverhood/collisionman.cpp | 11 | ||||
-rw-r--r-- | engines/neverhood/graphics.h | 8 | ||||
-rw-r--r-- | engines/neverhood/klayman.cpp | 311 | ||||
-rw-r--r-- | engines/neverhood/messages.h | 37 | ||||
-rw-r--r-- | engines/neverhood/module1000.cpp | 14 | ||||
-rw-r--r-- | engines/neverhood/module1200.cpp | 12 | ||||
-rw-r--r-- | engines/neverhood/module1300.cpp | 38 | ||||
-rw-r--r-- | engines/neverhood/module1300.h | 2 | ||||
-rw-r--r-- | engines/neverhood/module1400.cpp | 36 | ||||
-rw-r--r-- | engines/neverhood/module1600.cpp | 20 | ||||
-rw-r--r-- | engines/neverhood/module1900.cpp | 20 | ||||
-rw-r--r-- | engines/neverhood/module2200.cpp | 22 | ||||
-rw-r--r-- | engines/neverhood/module3000.cpp | 10 | ||||
-rw-r--r-- | engines/neverhood/neverhood.h | 1 | ||||
-rw-r--r-- | engines/neverhood/scene.cpp | 10 | ||||
-rw-r--r-- | engines/neverhood/smackerplayer.cpp | 40 | ||||
-rw-r--r-- | engines/neverhood/smackerplayer.h | 2 | ||||
-rw-r--r-- | engines/neverhood/smackerscene.cpp | 4 | ||||
-rw-r--r-- | engines/neverhood/sprite.h | 2 |
20 files changed, 309 insertions, 293 deletions
diff --git a/engines/neverhood/blbarchive.cpp b/engines/neverhood/blbarchive.cpp index 4e138b01a2..f003728e4f 100644 --- a/engines/neverhood/blbarchive.cpp +++ b/engines/neverhood/blbarchive.cpp @@ -98,7 +98,7 @@ void BlbArchive::load(uint index, byte *buffer, uint32 size) { Common::decompressDCL(&_fd, buffer, entry.diskSize, entry.size); break; default: - ; + error("BlbArchive::load() Unknown compression type %d", entry.comprType); } } diff --git a/engines/neverhood/collisionman.cpp b/engines/neverhood/collisionman.cpp index a1314bfe0f..bacf18bd30 100644 --- a/engines/neverhood/collisionman.cpp +++ b/engines/neverhood/collisionman.cpp @@ -56,13 +56,10 @@ void CollisionMan::clearHitRects() { } HitRect *CollisionMan::findHitRectAtPos(int16 x, int16 y) { - if (_hitRects) { - for (HitRectList::iterator it = _hitRects->begin(); it != _hitRects->end(); it++) { - HitRect *hitRect = &(*it); - if (x >= hitRect->rect.x1 && x <= hitRect->rect.x2 && y >= hitRect->rect.y1 && y <= hitRect->rect.y2) - return hitRect; - } - } + if (_hitRects) + for (HitRectList::iterator it = _hitRects->begin(); it != _hitRects->end(); it++) + if ((*it).rect.contains(x, y)) + return &(*it); return &defaultHitRect; } diff --git a/engines/neverhood/graphics.h b/engines/neverhood/graphics.h index c2adb11913..7725e73289 100644 --- a/engines/neverhood/graphics.h +++ b/engines/neverhood/graphics.h @@ -42,14 +42,22 @@ struct NDimensions { struct NRect { int16 x1, y1, x2, y2; + NRect() : x1(0), y1(0), x2(0), y2(0) {} + NRect(int16 x01, int16 y01, int16 x02, int16 y02) : x1(x01), y1(y01), x2(x02), y2(y02) {} + void set(int16 x01, int16 y01, int16 x02, int16 y02) { x1 = x01; y1 = y01; x2 = x02; y2 = y02; } + + bool contains(int16 x, int16 y) const { + return x >= x1 && x <= x2 && y >= y1 && y <= y2; + } + }; typedef Common::Array<NRect> NRectArray; diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp index 6873e505fa..303e3fe364 100644 --- a/engines/neverhood/klayman.cpp +++ b/engines/neverhood/klayman.cpp @@ -132,7 +132,7 @@ void Klayman::stIdlePickEar() { startAnimation(0x5B20C814, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmIdlePickEar); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Klayman::stStandAround); FinalizeState(&Klayman::evIdlePickEarDone); } @@ -163,7 +163,7 @@ void Klayman::sub41FDB0() { startAnimation(0xD122C137, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41E980); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Klayman::stStandAround); } @@ -189,7 +189,7 @@ void Klayman::sub41FE00() { startAnimation(0x543CD054, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41E9E0); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Klayman::stStandAround); FinalizeState(&Klayman::sub41FE50); } @@ -224,7 +224,7 @@ void Klayman::stIdleChest() { startAnimation(0x40A0C034, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmIdleChest); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Klayman::stStandAround); } @@ -250,7 +250,7 @@ void Klayman::sub41FEC0() { startAnimation(0x5120E137, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41EFE0); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Klayman::stStandAround); } @@ -277,7 +277,7 @@ void Klayman::sub421350() { _acceptInput = true; startAnimation(0x582EC138, 0, -1); _counter = 0; - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetUpdateHandler(&Klayman::update41D1C0); SetMessageHandler(&Klayman::handleMessage41D360); _counter3 = 0; @@ -317,7 +317,7 @@ void Klayman::stIdleSitBlink() { startAnimation(0x5C24C018, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Klayman::stIdleSitBlinkSecond); } @@ -327,7 +327,7 @@ void Klayman::stIdleSitBlinkSecond() { startAnimation(0x5C24C018, 0, -1); SetUpdateHandler(&Klayman::update41D1C0); SetMessageHandler(&Klayman::handleMessage41D360); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stPickUpNeedle() { @@ -338,7 +338,7 @@ void Klayman::stPickUpNeedle() { startAnimation(0x1449C169, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmPickUpGeneric); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -350,7 +350,7 @@ void Klayman::sub41FFF0() { startAnimation(0x0018C032, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D640); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -383,7 +383,7 @@ void Klayman::stTurnToUseInTeleporter() { startAnimation(0xD229823D, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stReturnFromUseInTeleporter() { @@ -392,7 +392,7 @@ void Klayman::stReturnFromUseInTeleporter() { startAnimation(0x9A2801E0, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stStepOver() { @@ -402,7 +402,7 @@ void Klayman::stStepOver() { startAnimation(0x004AA310, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmStartWalking); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } } @@ -413,7 +413,7 @@ void Klayman::stSitInTeleporter() { startAnimation(0x392A0330, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmSitInTeleporter); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } } @@ -435,7 +435,7 @@ void Klayman::stGetUpFromTeleporter() { startAnimation(0x913AB120, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } ///////////////////////////////////////////////////////////////// @@ -477,7 +477,7 @@ bool Klayman::stStartActionFromIdle(AnimationCb callback) { startAnimation(0x9A7020B8, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmStartAction); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(callback); return true; } @@ -523,7 +523,7 @@ void Klayman::stTryStandIdle() { _counter3Max = _vm->_rnd->getRandomNumber(64) + 24; SetUpdateHandler(&Klayman::update41D0F0); SetMessageHandler(&Klayman::handleMessage41D360); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -591,7 +591,7 @@ void Klayman::stStand() { startAnimation(0x5900C41E, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Klayman::stStandAround); } @@ -611,7 +611,7 @@ void Klayman::stStandAround() { startAnimation(0x5420E254, 0, -1); SetUpdateHandler(&Klayman::update41D0F0); SetMessageHandler(&Klayman::handleMessage41D360); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } uint32 Klayman::hmStartAction(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -666,7 +666,7 @@ void Klayman::stWakeUp() { startAnimation(0x527AC970, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stSleeping() { @@ -675,7 +675,7 @@ void Klayman::stSleeping() { startAnimation(0x5A38C110, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmSleeping); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } uint32 Klayman::hmSleeping(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -697,7 +697,7 @@ bool Klayman::stStartAction(AnimationCb callback3) { startAnimation(0x5C7080D4, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmStartAction); - SetSpriteCallback(&Klayman::spriteUpdate41F250); + SetSpriteUpdate(&Klayman::spriteUpdate41F250); NextState(callback3); return true; } else { @@ -793,7 +793,7 @@ void Klayman::stSneak() { startAnimation(0x5C48C506, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmWalking); - SetSpriteCallback(&Klayman::suWalking); + SetSpriteUpdate(&Klayman::suWalking); FinalizeState(&Klayman::stWalkingDone); } @@ -832,7 +832,7 @@ void Klayman::stStartWalking() { startAnimation(0x242C0198, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmStartWalking); - SetSpriteCallback(&Klayman::suWalkingTestExit); + SetSpriteUpdate(&Klayman::suWalkingTestExit); FinalizeState(&Klayman::stStartWalkingDone); NextState(&Klayman::stWalking); } @@ -863,13 +863,13 @@ void Klayman::stWalking() { startAnimation(0x1A249001, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41EB70); - SetSpriteCallback(&Klayman::spriteUpdate41F300); + SetSpriteUpdate(&Klayman::spriteUpdate41F300); FinalizeState(&Klayman::stStartWalkingDone); NextState(&Klayman::stUpdateWalking); } void Klayman::spriteUpdate41F300() { - SetSpriteCallback(&Klayman::suWalkingTestExit); + SetSpriteUpdate(&Klayman::suWalkingTestExit); _deltaX = 0; } @@ -914,7 +914,7 @@ void Klayman::stUpdateWalking() { } SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmWalking); - SetSpriteCallback(&Klayman::suWalking); + SetSpriteUpdate(&Klayman::suWalking); FinalizeState(&Klayman::stWalkingDone); } } @@ -987,7 +987,7 @@ void Klayman::stPickUpGeneric() { startAnimation(0x1C28C178, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmPickUpGeneric); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -1024,7 +1024,7 @@ void Klayman::stTurnPressButton() { startAnimation(0x1C02B03D, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmPressButton); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -1053,7 +1053,7 @@ void Klayman::stStampFloorButton() { startAnimation(0x1C16B033, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmPressButton); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -1064,7 +1064,7 @@ void Klayman::stPressButtonSide() { startAnimation(0x1CD89029, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmPressButton); - SetSpriteCallback(&Klayman::spriteUpdate41F250); + SetSpriteUpdate(&Klayman::spriteUpdate41F250); } } @@ -1155,7 +1155,7 @@ void Klayman::stLargeStep() { startAnimation(0x08B28116, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmLargeStep); - SetSpriteCallback(&Klayman::suLargeStep); + SetSpriteUpdate(&Klayman::suLargeStep); FinalizeState(&Klayman::stLargeStepDone); } @@ -1225,7 +1225,7 @@ void Klayman::stWonderAboutHalf() { startAnimation(0xD820A114, 0, 10); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stWonderAboutAfter() { @@ -1234,7 +1234,7 @@ void Klayman::stWonderAboutAfter() { startAnimation(0xD820A114, 30, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stTurnToUseHalf() { @@ -1243,7 +1243,7 @@ void Klayman::stTurnToUseHalf() { startAnimation(0x9B250AD2, 0, 7); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmTurnToUse); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } uint32 Klayman::hmTurnToUse(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1266,7 +1266,7 @@ void Klayman::stTurnAwayFromUse() { startAnimation(0x98F88391, 4, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmTurnToUse); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stWonderAbout() { @@ -1275,7 +1275,7 @@ void Klayman::stWonderAbout() { startAnimation(0xD820A114, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stPeekWall() { @@ -1284,7 +1284,7 @@ void Klayman::stPeekWall() { startAnimation(0xAC20C012, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmPeekWall); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } uint32 Klayman::hmPeekWall(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1318,7 +1318,7 @@ void Klayman::setupJumpToRing() { _acceptInput = false; SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmJumpToRing); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); NextState(&Klayman::sub420340); sendMessage(_attachedSprite, 0x482B, 0); } @@ -1355,7 +1355,7 @@ void Klayman::sub420340() { startAnimation(0x4829E0B8, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D360); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stJumpToRing2() { @@ -1372,7 +1372,7 @@ void Klayman::stJumpToRing3() { _acceptInput = false; startAnimation(0xBA1910B2, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::hmJumpToRing3); NextState(&Klayman::stHoldRing); sendMessage(_attachedSprite, 0x482B, 0); @@ -1405,7 +1405,7 @@ void Klayman::stHoldRing() { startAnimation(0x4A293FB0, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmHoldRing); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } uint32 Klayman::hmHoldRing(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1426,7 +1426,7 @@ void Klayman::stReleaseRing() { startAnimation(0xB869A4B9, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Klayman::stJumpToRing4() { @@ -1449,7 +1449,7 @@ void Klayman::stContinueClimbLadderUp() { _newStickFrameHash = 0x01084280; SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D360); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); gotoNextStateExt(); } @@ -1469,14 +1469,14 @@ void Klayman::stStartClimbLadderDown() { startAnimation(0x122D1505, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmClimbLadderUpDown); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } else if (_ladderStatus == 3) { _ladderStatus = 2; _acceptInput = true; startAnimationByHash(0x122D1505, 0x01084280, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmClimbLadderUpDown); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } else if (_ladderStatus == 1) { _ladderStatus = 2; _acceptInput = true; @@ -1493,14 +1493,14 @@ void Klayman::stClimbLadderHalf() { startAnimationByHash(0x3A292504, 0x02421405, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41DFD0); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } else if (_ladderStatus == 2) { _ladderStatus = 0; _acceptInput = false; startAnimationByHash(0x122D1505, 0x02421405, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41DFD0); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } else { gotoNextStateExt(); } @@ -1561,14 +1561,14 @@ void Klayman::stStartClimbLadderUp() { startAnimation(0x3A292504, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmClimbLadderUpDown); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } else if (_ladderStatus == 3) { _ladderStatus = 1; _acceptInput = true; startAnimationByHash(0x3A292504, 0x01084280, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmClimbLadderUpDown); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } else if (_ladderStatus == 2) { _ladderStatus = 1; _acceptInput = true; @@ -1583,7 +1583,7 @@ void Klayman::stWalkToFrontNoStep() { startAnimationByHash(0xF229C003, 0x14884392, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmWalkToFront); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } uint32 Klayman::hmWalkToFront(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1611,7 +1611,7 @@ void Klayman::stWalkToFront() { startAnimation(0xF229C003, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmWalkToFront); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } } @@ -1622,7 +1622,7 @@ void Klayman::stTurnToFront() { startAnimationByHash(0xCA221107, 0x8520108C, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmWalkToFront); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } } @@ -1633,7 +1633,7 @@ void Klayman::stTurnToBack() { startAnimation(0xCA221107, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmWalkToFront); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } } @@ -1643,7 +1643,7 @@ void Klayman::stLandOnFeet() { startAnimation(0x18118554, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmLandOnFeet); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } uint32 Klayman::hmLandOnFeet(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1665,7 +1665,7 @@ void Klayman::stTurnToBackToUse() { startAnimation(0x91540140, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::hmTurnToBackToUse); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); } } @@ -1691,7 +1691,7 @@ void Klayman::stClayDoorOpen() { _acceptInput = false; startAnimation(0x5CCCB330, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::hmClayDoorOpen); } } @@ -1716,7 +1716,7 @@ void Klayman::stTurnToUse() { _acceptInput = false; startAnimation(0x9B250AD2, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::hmTurnToUse); } } @@ -1726,7 +1726,7 @@ void Klayman::stReturnFromUse() { _acceptInput = false; startAnimation(0x98F88391, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::hmTurnToUse); } @@ -1735,7 +1735,7 @@ void Klayman::stWalkingOpenDoor() { _acceptInput = false; startAnimation(0x11A8E012, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::suWalkingOpenDoor); + SetSpriteUpdate(&Klayman::suWalkingOpenDoor); SetMessageHandler(&Klayman::hmStartWalking); } @@ -1753,7 +1753,7 @@ void Klayman::stMoveObjectSkipTurnFaceObject() { _acceptInput = true; startAnimationByHash(0x0C1CA072, 0x01084280, 0); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::hmMoveObjectTurn); } @@ -1792,7 +1792,7 @@ void Klayman::stMoveObjectSkipTurn() { _acceptInput = true; startAnimationByHash(0x0C1CA072, 0x01084280, 0); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::hmMoveObjectTurn); } @@ -1804,7 +1804,7 @@ void Klayman::stMoveObjectFaceObject() { _acceptInput = true; startAnimation(0x0C1CA072, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::hmMoveObjectTurn); } } @@ -1818,7 +1818,7 @@ void Klayman::stUseLever() { sendMessage(_attachedSprite, 0x482B, 0); startAnimation(0x0C303040, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::handleMessage41E210); NextState(&Klayman::stPullLeverDown); _acceptInput = false; @@ -1836,7 +1836,7 @@ void Klayman::stPullLeverDown() { void Klayman::stHoldLeverDown() { startAnimation(0x4464A440, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::handleMessage41D360); _isLeverDown = true; _acceptInput = true; @@ -1845,7 +1845,7 @@ void Klayman::stHoldLeverDown() { void Klayman::stUseLeverRelease() { startAnimation(0x09018068, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::handleMessage41E210); sendMessage(_attachedSprite, 0x4807, 0); NextState(&Klayman::stPullLeverDown); @@ -1857,7 +1857,7 @@ void Klayman::stReleaseLever() { _status2 = 2; startAnimation(0x09018068, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::handleMessage41E210); sendMessage(_attachedSprite, 0x4807, 0); NextState(&Klayman::stLetGoOfLever); @@ -1894,7 +1894,7 @@ void Klayman::stInsertDisk() { } else { startAnimation(0xD8C8D100, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F250); + SetSpriteUpdate(&Klayman::spriteUpdate41F250); SetMessageHandler(&Klayman::hmInsertDisk); _acceptInput = false; _counter2--; @@ -1952,10 +1952,10 @@ uint32 KmScene1001::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x480D: GotoState(&KmScene1001::sub44FA50); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: GotoState(&Klayman::stPickUpGeneric); break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 1) { GotoState(&Klayman::stTurnPressButton); } else if (param.asInteger() == 2) { @@ -2016,7 +2016,7 @@ void KmScene1001::sub44FA50() { startAnimation(0x00648953, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1001::handleMessage44FA00); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); } } @@ -2101,7 +2101,7 @@ uint32 KmScene1002::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x480D: GotoState(&KmScene1002::sub449E20); break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 0) { GotoState(&KmScene1002::stPressDoorButton); } @@ -2329,7 +2329,7 @@ void KmScene1002::sub449E20() { _acceptInput = false; startAnimation(0x584984B4, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); SetMessageHandler(&KmScene1002::handleMessage449800); NextState(&Klayman::stLandOnFeet); sendMessage(_attachedSprite, 0x482B, 0); @@ -2343,7 +2343,7 @@ void KmScene1002::sub449E90() { _surface->setVisible(false); startAnimation(0x5420E254, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1002::handleMessage4498E0); } @@ -2356,7 +2356,7 @@ void KmScene1002::sub449EF0() { // Weird stuff happening SetMessageHandler(&Klayman::handleMessage41D360); //SetMessageHandler(&Klayman::handleMessage41D480); - SetSpriteCallback(&KmScene1002::suFallDown); + SetSpriteUpdate(&KmScene1002::suFallDown); NextState(&KmScene1002::sub449F70); sendMessage(_class599, 0x482A, 0); sendMessage(_ssLadderArch, 0x482A, 0); @@ -2370,7 +2370,7 @@ void KmScene1002::sub449F70() { _isWalking = false; startAnimationByHash(0x000BAB02, 0x88003000, 0); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1002::handleMessage41D480); NextState(&KmScene1002::sub44A230); sendMessage(_parentScene, 0x2002, 0); @@ -2386,7 +2386,7 @@ void KmScene1002::stSpitOutFall() { _acceptInput = false; startAnimation(0x9308C132, 0, -1); SetUpdateHandler(&KmScene1002::update4497D0); - SetSpriteCallback(&KmScene1002::suFallDown); + SetSpriteUpdate(&KmScene1002::suFallDown); SetMessageHandler(&Klayman::handleMessage41D480); NextState(&KmScene1002::sub449F70); sendMessage(_class599, 0x482A, 0); @@ -2400,7 +2400,7 @@ void KmScene1002::sub44A0D0() { startAnimation(0x0013A206, 0, -1); SetUpdateHandler(&KmScene1002::update4497D0); SetMessageHandler(&Klayman::handleMessage41D360); - SetSpriteCallback(&KmScene1002::suFallDown); + SetSpriteUpdate(&KmScene1002::suFallDown); NextState(&KmScene1002::sub44A150); sendMessage(_class599, 0x482A, 0); sendMessage(_ssLadderArch, 0x482A, 0); @@ -2415,7 +2415,7 @@ void KmScene1002::sub44A150() { startAnimationByHash(0x0013A206, 0x88003000, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1002::handleMessage41D480); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&KmScene1002::sub44A230); sendMessage(_parentScene, 0x2002, 0); // TODO _callbackList = NULL; @@ -2437,7 +2437,7 @@ void KmScene1002::stJumpAndFall() { startAnimation(0xB93AB151, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1002::handleMessage449D60); - SetSpriteCallback(&KmScene1002::suFallDown); + SetSpriteUpdate(&KmScene1002::suFallDown); NextState(&Klayman::stLandOnFeet); } } @@ -2453,7 +2453,7 @@ void KmScene1002::stDropFromRing() { startAnimation(0x586984B1, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1002::handleMessage41D360); - SetSpriteCallback(&KmScene1002::suFallDown); + SetSpriteUpdate(&KmScene1002::suFallDown); NextState(&Klayman::stLandOnFeet); } @@ -2464,7 +2464,7 @@ void KmScene1002::stPressDoorButton() { startAnimation(0x1CD89029, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1002::hmPressDoorButton); - SetSpriteCallback(&Klayman::spriteUpdate41F250); + SetSpriteUpdate(&Klayman::spriteUpdate41F250); } void KmScene1002::stHitByBoxingGlove() { @@ -2473,7 +2473,7 @@ void KmScene1002::stHitByBoxingGlove() { startAnimation(0x35AA8059, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1002::handleMessage449C90); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); FinalizeState(&KmScene1002::stHitByBoxingGloveDone); } @@ -2490,7 +2490,7 @@ void KmScene1002::stMoveVenusFlyTrap() { startAnimation(0x5C01A870, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1002::hmMoveVenusFlyTrap); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); FinalizeState(&KmScene1002::stMoveVenusFlyTrapDone); } } @@ -2501,7 +2501,7 @@ void KmScene1002::stContinueMovingVenusFlyTrap() { startAnimationByHash(0x5C01A870, 0x01084280, 0); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1002::hmMoveVenusFlyTrap); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); FinalizeState(&KmScene1002::stMoveVenusFlyTrapDone); } @@ -2596,7 +2596,7 @@ void KmScene1004::stReadNote() { startAnimation(0x123E9C9F, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&KmScene1004::hmReadNote); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); } KmScene1109::KmScene1109(NeverhoodEngine *vm, Entity *parentScene, int16 x, int16 y) @@ -2681,7 +2681,7 @@ void KmScene1109::sub461F30() { _status2 = 0; _acceptInput = false; SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1109::handleMessage461EA0); startAnimation(0x2C2A4A1C, 0, -1); } @@ -2690,7 +2690,7 @@ void KmScene1109::sub461F70() { _status2 = 0; _acceptInput = false; SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1109::handleMessage461EA0); startAnimation(0x3C2E4245, 0, -1); } @@ -2717,7 +2717,7 @@ uint32 KmScene1201::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x480A: GotoState(&KmScene1201::stMoveObject); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: GotoState(&Klayman::stPickUpGeneric); break; case 0x4813: @@ -2729,7 +2729,7 @@ uint32 KmScene1201::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4815: GotoState(&KmScene1201::sub40E040); break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 0) { GotoState(&Klayman::stPressButtonSide); } @@ -2801,7 +2801,7 @@ void KmScene1201::stFetchMatch() { setDoDeltaX(_attachedSprite->getX() < _x ? 1 : 0); startAnimation(0x9CAA0218, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1201::hmMatch); NextState(&KmScene1201::stLightMatch); } @@ -2813,7 +2813,7 @@ void KmScene1201::stLightMatch() { setDoDeltaX(_attachedSprite->getX() < _x ? 1 : 0); startAnimation(0x1222A513, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1201::hmMatch); } @@ -2858,7 +2858,7 @@ void KmScene1201::stMoveObject() { setDoDeltaX(0); startAnimation(0x0C1CA072, 0, -1); SetUpdateHandler(&KmScene1201::update40DBE0); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); SetMessageHandler(&KmScene1201::hmMoveObject); } } @@ -2867,7 +2867,7 @@ void KmScene1201::stMoveObjectSkipTurn() { _acceptInput = false; startAnimationByHash(0x0C1CA072, 0x01084280, 0); SetUpdateHandler(&KmScene1201::update40DBE0); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); SetMessageHandler(&KmScene1201::hmMoveObject); } @@ -2878,7 +2878,7 @@ void KmScene1201::stTumbleHeadless() { setDoDeltaX(0); startAnimation(0x2821C590, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); SetMessageHandler(&KmScene1201::hmTumbleHeadless); NextState(&Klayman::stTryStandIdle); sendMessage(_class464, 0x2006, 0); @@ -2892,7 +2892,7 @@ void KmScene1201::sub40E040() { _acceptInput = false; startAnimation(0x5420E254, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Klayman::handleMessage41D360); } } @@ -2948,7 +2948,7 @@ void KmScene1303::stPeekWall1() { _acceptInput = true; startAnimation(0xAC20C012, 8, 37); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Klayman::handleMessage41D480); NextState(&KmScene1303::stPeekWall3); } @@ -2958,7 +2958,7 @@ void KmScene1303::stPeekWall2() { _acceptInput = false; startAnimation(0xAC20C012, 43, 49); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Klayman::handleMessage41D480); } @@ -2969,7 +2969,7 @@ void KmScene1303::stPeekWall3() { _counter3Max = _vm->_rnd->getRandomNumber(64) + 24; startAnimation(0xAC20C012, 38, 42); SetUpdateHandler(&KmScene1303::update4161A0); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Klayman::handleMessage41D360); _newStickFrameIndex = 42; } @@ -2979,7 +2979,7 @@ void KmScene1303::stPeekWallReturn() { _acceptInput = false; startAnimation(0x2426932E, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1303::hmPeekWallReturn); } @@ -2998,7 +2998,7 @@ uint32 KmScene1304::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4004: GotoState(&Klayman::stTryStandIdle); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -3069,7 +3069,7 @@ void KmScene1305::stCrashDown() { _acceptInput = false; startAnimationByHash(0x000BAB02, 0x88003000, 0); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Klayman::handleMessage41D480); NextState(&KmScene1305::cbCrashDownEvent); } @@ -3101,7 +3101,7 @@ uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam ¶m) { else GotoState(&Klayman::stTryStandIdle); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -3110,7 +3110,7 @@ uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stPickUpGeneric); } break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 1) { GotoState(&Klayman::stTurnPressButton); } else if (param.asInteger() == 2) { @@ -3123,7 +3123,7 @@ uint32 KmScene1306::xHandleMessage(int messageNum, const MessageParam ¶m) { setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; - case 0x481A: + case NM_KLAYMAN_INSERT_DISK: GotoState(&Klayman::stInsertDisk); break; case 0x481B: @@ -3210,7 +3210,7 @@ void KmScene1306::sub417D40() { _acceptInput = false; startAnimation(0xEE084A04, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1306::handleMessage417CB0); } @@ -3219,7 +3219,7 @@ void KmScene1306::sub417D80() { _acceptInput = false; startAnimation(0xB86A4274, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1306::handleMessage417CB0); } @@ -3261,7 +3261,7 @@ uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x480D: GotoState(&KmScene1001::stUseLever); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -3274,7 +3274,7 @@ uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam ¶m) { setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; - case 0x481A: + case NM_KLAYMAN_INSERT_DISK: if (param.asInteger() == 1) { GotoState(&KmScene1308::sub456150); } else { @@ -3294,7 +3294,7 @@ uint32 KmScene1308::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x481E: GotoState(&Klayman::stReturnFromUse); break; - case 0x4827: + case NM_KLAYMAN_RELEASE_LEVER: GotoState(&Klayman::stReleaseLever); break; case 0x4834: @@ -3364,7 +3364,7 @@ void KmScene1308::sub456150() { _acceptInput = false; startAnimation(0xDC409440, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F250); + SetSpriteUpdate(&Klayman::spriteUpdate41F250); SetMessageHandler(&KmScene1308::handleMessage); _flag1 = false; } @@ -3395,7 +3395,7 @@ uint32 KmScene1401::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stMoveObjectFaceObject); } break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 1) { GotoState(&Klayman::stTurnPressButton); } else if (param.asInteger() == 2) { @@ -3518,7 +3518,7 @@ uint32 KmScene1403::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x480D: GotoState(&KmScene1001::stUseLever); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -3538,7 +3538,7 @@ uint32 KmScene1403::xHandleMessage(int messageNum, const MessageParam ¶m) { sub41CCE0(param.asPoint().x); } break; - case 0x4827: + case NM_KLAYMAN_RELEASE_LEVER: GotoState(&Klayman::stReleaseLever); break; case 0x483F: @@ -3575,7 +3575,7 @@ uint32 KmScene1404::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stMoveObjectFaceObject); } break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -3588,7 +3588,7 @@ uint32 KmScene1404::xHandleMessage(int messageNum, const MessageParam ¶m) { setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; - case 0x481A: + case NM_KLAYMAN_INSERT_DISK: GotoState(&Klayman::stInsertDisk); break; case 0x481B: @@ -3650,7 +3650,7 @@ uint32 KmScene1608::xHandleMessage(int messageNum, const MessageParam ¶m) { else GotoState(&Klayman::stTryStandIdle); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -3747,7 +3747,7 @@ uint32 KmScene1705::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4803: GotoState(&KmScene1705::stFallSkipJump); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -3842,7 +3842,7 @@ void KmScene1705::stFallSkipJump() { _acceptInput = false; startAnimationByHash(0xB93AB151, 0x40A100F8, 0); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&KmScene1705::spriteUpdate468A30); + SetSpriteUpdate(&KmScene1705::spriteUpdate468A30); SetMessageHandler(&Klayman::handleMessage41D360); NextState(&Klayman::stLandOnFeet); } @@ -3852,7 +3852,7 @@ void KmScene1705::sub468AD0() { _acceptInput = false; startAnimation(0x5E0A4905, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1705::handleMessage4689A0); } @@ -3861,7 +3861,7 @@ void KmScene1705::sub468B10() { _acceptInput = false; startAnimation(0xD86E4477, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene1705::handleMessage4689A0); } @@ -3922,26 +3922,23 @@ uint32 KmScene2001::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4004: if (_isSittingInTeleporter) { GotoState(&Klayman::sub421350); - } else { + } else GotoState(&Klayman::stTryStandIdle); - } break; case 0x4804: if (param.asInteger() != 0) { _destX = param.asInteger(); GotoState(&Klayman::stWalking); - } else { + } else GotoState(&Klayman::stPeekWall); - } break; case 0x4817: setDoDeltaX(param.asInteger()); gotoNextStateExt(); break; case 0x481D: - if (_isSittingInTeleporter) { + if (_isSittingInTeleporter) GotoState(&Klayman::stTurnToUseInTeleporter); - } break; case 0x481E: if (_isSittingInTeleporter) { @@ -3990,7 +3987,7 @@ void KmScene2001::sub440230() { _acceptInput = false; startAnimation(0xBE68CC54, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene2001::handleMessage4401A0); } @@ -3999,7 +3996,7 @@ void KmScene2001::stDoTeleport() { _acceptInput = false; startAnimation(0x18AB4ED4, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene2001::handleMessage4401A0); } @@ -4029,7 +4026,7 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4811: GotoState(&KmScene2101::sub4862C0); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -4038,7 +4035,7 @@ uint32 KmScene2101::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stPickUpGeneric); } break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 1) { GotoState(&Klayman::stTurnPressButton); } else if (param.asInteger() == 2) { @@ -4131,7 +4128,7 @@ void KmScene2101::sub4862C0() { _acceptInput = false; startAnimation(0x35AA8059, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); SetMessageHandler(&KmScene2101::handleMessage486160); _soundResource1.play(0x402E82D4); } @@ -4141,7 +4138,7 @@ void KmScene2101::sub486320() { _acceptInput = false; startAnimation(0xFF290E30, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene2101::handleMessage486230); } @@ -4150,7 +4147,7 @@ void KmScene2101::sub486360() { _acceptInput = false; startAnimation(0x9A28CA1C, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&KmScene2101::handleMessage486230); } @@ -4171,10 +4168,10 @@ uint32 KmScene2201::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4004: GotoState(&Klayman::stTryStandIdle); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: GotoState(&Klayman::stPickUpGeneric); break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 0) { GotoState(&Klayman::stPressButtonSide); } @@ -4241,7 +4238,7 @@ uint32 KmScene2203::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4004: GotoState(&Klayman::stTryStandIdle); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -4250,7 +4247,7 @@ uint32 KmScene2203::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stPickUpGeneric); } break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 1) { GotoState(&Klayman::stTurnPressButton); } else if (param.asInteger() == 2) { @@ -4269,7 +4266,7 @@ uint32 KmScene2203::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4819: GotoState(&Klayman::stClayDoorOpen); break; - case 0x481A: + case NM_KLAYMAN_INSERT_DISK: GotoState(&Klayman::stInsertDisk); break; case 0x481B: @@ -4325,7 +4322,7 @@ uint32 KmScene2205::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stPeekWall); } break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 0) { GotoState(&Klayman::stPressButtonSide); } @@ -4357,7 +4354,7 @@ void KmScene2205::sub423980() { startAnimation(0x1A249001, frameIndex, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41EB70); - SetSpriteCallback(&Klayman::spriteUpdate41F300); + SetSpriteUpdate(&Klayman::spriteUpdate41F300); NextState(&Klayman::stUpdateWalking); FinalizeState(&Klayman::stStartWalkingDone); } @@ -4396,14 +4393,14 @@ uint32 KmScene2206::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stPeekWall); } break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 1) { GotoState(&Klayman::sub41FFF0); } else { GotoState(&Klayman::stPickUpGeneric); } break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 1) { GotoState(&Klayman::stTurnPressButton); } else if (param.asInteger() == 2) { @@ -4483,7 +4480,7 @@ void KmScene2206::sub482490() { startAnimation(0x5420E254, 0, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41D360); - SetSpriteCallback(&KmScene2206::spriteUpdate482450); + SetSpriteUpdate(&KmScene2206::spriteUpdate482450); // TODO Sound1ChList_playLooping(0xD3B02847); } } @@ -4498,7 +4495,7 @@ void KmScene2206::sub482530() { startAnimation(0x1A249001, frameIndex, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41EB70); - SetSpriteCallback(&Klayman::spriteUpdate41F300); + SetSpriteUpdate(&Klayman::spriteUpdate41F300); NextState(&Klayman::stUpdateWalking); FinalizeState(&Klayman::stStartWalkingDone); } @@ -4527,10 +4524,10 @@ uint32 KmScene2207::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x480D: GotoState(&KmScene2207::sub4424B0); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: GotoState(&Klayman::stPickUpGeneric); break; - case 0x4816: + case NM_KLAYMAN_PRESS_BUTTON: if (param.asInteger() == 1) { GotoState(&Klayman::stTurnPressButton); } else if (param.asInteger() == 2) { @@ -4550,7 +4547,7 @@ uint32 KmScene2207::xHandleMessage(int messageNum, const MessageParam ¶m) { sub41CCE0(param.asPoint().x); } break; - case 0x4827: + case NM_KLAYMAN_RELEASE_LEVER: GotoState(&Klayman::stReleaseLever); break; case 0x482D: @@ -4579,7 +4576,7 @@ void KmScene2207::sub442460() { _acceptInput = true; startAnimation(0x5420E254, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&KmScene2207::spriteUpdate442430); + SetSpriteUpdate(&KmScene2207::spriteUpdate442430); SetMessageHandler(&Klayman::handleMessage41D360); } } @@ -4593,7 +4590,7 @@ void KmScene2207::sub4424B0() { _acceptInput = false; startAnimation(0x0C303040, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&KmScene2207::spriteUpdate41F230); + SetSpriteUpdate(&KmScene2207::spriteUpdate41F230); SetMessageHandler(&Klayman::handleMessage41E210); NextState(&KmScene2207::sub442520); } @@ -4609,7 +4606,7 @@ void KmScene2207::sub442520() { void KmScene2207::sub442560() { startAnimation(0x1564A2C0, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); NextState(&KmScene2207::sub4425A0); _acceptInput = true; _isLeverDown = true; @@ -4618,7 +4615,7 @@ void KmScene2207::sub442560() { void KmScene2207::sub4425A0() { startAnimation(0x4464A440, 0, -1); SetUpdateHandler(&Klayman::update); - SetSpriteCallback(&Klayman::spriteUpdate41F230); + SetSpriteUpdate(&Klayman::spriteUpdate41F230); SetMessageHandler(&Klayman::handleMessage41D360); _acceptInput = true; _isLeverDown = true; @@ -4650,7 +4647,7 @@ uint32 KmScene2242::xHandleMessage(int messageNum, const MessageParam ¶m) { GotoState(&Klayman::stPeekWall); } break; - case 0x4812: + case NM_KLAYMAN_PICKUP: if (param.asInteger() == 2) { GotoState(&Klayman::stPickUpNeedle); } else if (param.asInteger() == 1) { @@ -4704,7 +4701,7 @@ void KmScene2242::sub444D20() { startAnimation(0x1A249001, frameIndex, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41EB70); - SetSpriteCallback(&Klayman::spriteUpdate41F300); + SetSpriteUpdate(&Klayman::spriteUpdate41F300); NextState(&Klayman::stUpdateWalking); FinalizeState(&Klayman::stStartWalkingDone); } @@ -4773,7 +4770,7 @@ void KmHallOfRecords::sub43B130() { startAnimation(0x1A249001, frameIndex, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41EB70); - SetSpriteCallback(&Klayman::spriteUpdate41F300); + SetSpriteUpdate(&Klayman::spriteUpdate41F300); NextState(&Klayman::stUpdateWalking); FinalizeState(&Klayman::stStartWalkingDone); } @@ -4842,7 +4839,7 @@ void KmScene2247::sub453520() { startAnimation(0x1A249001, frameIndex, -1); SetUpdateHandler(&Klayman::update); SetMessageHandler(&Klayman::handleMessage41EB70); - SetSpriteCallback(&Klayman::spriteUpdate41F300); + SetSpriteUpdate(&Klayman::spriteUpdate41F300); NextState(&Klayman::stUpdateWalking); FinalizeState(&Klayman::stStartWalkingDone); } @@ -4861,7 +4858,7 @@ uint32 KmScene2801::xHandleMessage(int messageNum, const MessageParam ¶m) { case 0x4004: GotoState(&Klayman::stTryStandIdle); break; - case 0x4812: + case NM_KLAYMAN_PICKUP: GotoState(&Klayman::stPickUpGeneric); break; case 0x4817: diff --git a/engines/neverhood/messages.h b/engines/neverhood/messages.h new file mode 100644 index 0000000000..5a2139db2c --- /dev/null +++ b/engines/neverhood/messages.h @@ -0,0 +1,37 @@ +/* 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_MESSAGES_H +#define NEVERHOOD_MESSAGES_H + +namespace Neverhood { + +enum NeverhoodMessage { + NM_KLAYMAN_PICKUP = 0x4812, + NM_KLAYMAN_PRESS_BUTTON = 0x4816, + NM_KLAYMAN_INSERT_DISK = 0x481A, + NM_KLAYMAN_RELEASE_LEVER = 0x4827 +}; + +} // End of namespace Neverhood + +#endif /* NEVERHOOD_MESSAGES_H */ diff --git a/engines/neverhood/module1000.cpp b/engines/neverhood/module1000.cpp index 176708be3d..edd9860c11 100644 --- a/engines/neverhood/module1000.cpp +++ b/engines/neverhood/module1000.cpp @@ -668,7 +668,7 @@ AsScene1002Door::AsScene1002Door(NeverhoodEngine *vm, NRect &clipRect) SetUpdateHandler(&AsScene1002Door::update); SetMessageHandler(&AsScene1002Door::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); StaticSprite::update(); } @@ -683,11 +683,11 @@ uint32 AsScene1002Door::handleMessage(int messageNum, const MessageParam ¶m, switch (messageNum) { case 0x4808: setGlobalVar(0x8306F218, 1); - SetSpriteCallback(&AsScene1002Door::suOpenDoor); + SetSpriteUpdate(&AsScene1002Door::suOpenDoor); break; case 0x4809: setGlobalVar(0x8306F218, 0); - SetSpriteCallback(&AsScene1002Door::suCloseDoor); + SetSpriteUpdate(&AsScene1002Door::suCloseDoor); break; } return messageResult; @@ -697,7 +697,7 @@ void AsScene1002Door::suOpenDoor() { if (_y > 49) { _y -= 8; if (_y < 49) { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); _y = 49; } _needRefresh = true; @@ -708,7 +708,7 @@ void AsScene1002Door::suCloseDoor() { if (_y < 239) { _y += 8; if (_y > 239) { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); _y = 239; } _needRefresh = true; @@ -747,7 +747,7 @@ AsScene1002DoorSpy::AsScene1002DoorSpy(NeverhoodEngine *vm, NRect &clipRect, Sce SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene1002DoorSpy::handleMessage); - SetSpriteCallback(&AsScene1002DoorSpy::suDoorSpy); + SetSpriteUpdate(&AsScene1002DoorSpy::suDoorSpy); createSurface(800, 136, 147); setClipRect(clipRect); suDoorSpy(); @@ -909,7 +909,7 @@ AsScene1002VenusFlyTrap::AsScene1002VenusFlyTrap(NeverhoodEngine *vm, Scene *par SetUpdateHandler(&AsScene1002VenusFlyTrap::update); SetMessageHandler(&AsScene1002VenusFlyTrap::handleMessage); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); if (!_flag) { if (getGlobalVar(0x8306F218)) { diff --git a/engines/neverhood/module1200.cpp b/engines/neverhood/module1200.cpp index fc28917734..96ed46f4d6 100644 --- a/engines/neverhood/module1200.cpp +++ b/engines/neverhood/module1200.cpp @@ -329,7 +329,7 @@ Class464::Class464(NeverhoodEngine *vm) createSurface(1200, 69, 98); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&Class464::handleMessage); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); setVisible(false); } @@ -415,13 +415,13 @@ void AsScene1201TntMan::spriteUpdate40CD10() { void AsScene1201TntMan::sub40CD30() { startAnimation(0x654913D0, 0, -1); SetMessageHandler(&AsScene1201TntMan::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void AsScene1201TntMan::sub40CD60() { startAnimation(0x356803D0, 0, -1); SetMessageHandler(&AsScene1201TntMan::handleMessage40CCD0); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); NextState(&AsScene1201TntMan::sub40CD30); } @@ -431,7 +431,7 @@ void AsScene1201TntMan::sub40CD90() { _flag = true; startAnimation(0x85084190, 0, -1); SetMessageHandler(&AsScene1201TntMan::handleMessage); - SetSpriteCallback(&AsScene1201TntMan::spriteUpdate40CD10); + SetSpriteUpdate(&AsScene1201TntMan::spriteUpdate40CD10); _newStickFrameIndex = -2; } @@ -441,7 +441,7 @@ Class465::Class465(NeverhoodEngine *vm, Sprite *asTntMan) createSurface1(0x828C0411, 995); SetUpdateHandler(&Class465::update); SetMessageHandler(&Sprite::handleMessage); - SetSpriteCallback(&Class465::spriteUpdate40D150); + SetSpriteUpdate(&Class465::spriteUpdate40D150); startAnimation(0x828C0411, 0, -1); setVisible(false); } @@ -471,7 +471,7 @@ AsScene1201Match::AsScene1201Match(NeverhoodEngine *vm, Scene *parentScene) createSurface(1100, 57, 60); SetUpdateHandler(&AsScene1201Match::update); SetMessageHandler(&AsScene1201Match::handleMessage40C2D0); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); switch (getGlobalVar(0x0112090A)) { case 0: diff --git a/engines/neverhood/module1300.cpp b/engines/neverhood/module1300.cpp index 38dd356946..2c7a5c8443 100644 --- a/engines/neverhood/module1300.cpp +++ b/engines/neverhood/module1300.cpp @@ -346,7 +346,7 @@ SsScene1302Fence::SsScene1302Fence(NeverhoodEngine *vm) SetUpdateHandler(&SsScene1302Fence::update); SetMessageHandler(&SsScene1302Fence::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); _firstY = _y; if (getGlobalVar(0x80101B1E)) _y += 152; @@ -364,12 +364,12 @@ uint32 SsScene1302Fence::handleMessage(int messageNum, const MessageParam ¶m switch (messageNum) { case 0x4808: _soundResource1.play(); - SetSpriteCallback(&SsScene1302Fence::suMoveDown); + SetSpriteUpdate(&SsScene1302Fence::suMoveDown); SetMessageHandler(NULL); break; case 0x4809: _soundResource2.play(); - SetSpriteCallback(&SsScene1302Fence::suMoveUp); + SetSpriteUpdate(&SsScene1302Fence::suMoveUp); SetMessageHandler(NULL); break; } @@ -381,7 +381,7 @@ void SsScene1302Fence::suMoveDown() { _y += 8; else { SetMessageHandler(&SsScene1302Fence::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -390,7 +390,7 @@ void SsScene1302Fence::suMoveUp() { _y -= 8; else { SetMessageHandler(&SsScene1302Fence::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -590,7 +590,7 @@ AsScene1303Balloon::AsScene1303Balloon(NeverhoodEngine *vm, Scene *parentScene) _y = 390; SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene1303Balloon::handleMessage); - SetSpriteCallback(&AnimatedSprite::updateDeltaXY); + SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); startAnimation(0x800278D2, 0, -1); } @@ -1179,7 +1179,7 @@ void AsScene1307Key::suRemoveKey() { processDelta(); _pointIndex++; } else { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -1192,7 +1192,7 @@ void AsScene1307Key::suInsertKey() { if (_pointIndex == 7) _soundResource1.play(); } else { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); sendMessage(_parentScene, 0x2002, 0); } } @@ -1215,7 +1215,7 @@ void AsScene1307Key::suMoveKey() { void AsScene1307Key::stRemoveKey() { const uint32 *fileHashes = kAsScene1307KeyResourceLists[_index]; _pointIndex = 0; - SetSpriteCallback(&AsScene1307Key::suRemoveKey); + SetSpriteUpdate(&AsScene1307Key::suRemoveKey); startAnimation(fileHashes[0], 0, -1); _soundResource2.play(); } @@ -1224,7 +1224,7 @@ void AsScene1307Key::stInsertKey() { _pointIndex = 0; sendMessage(_parentScene, 0x1022, kAsScene1307KeySurfacePriorities[getSubVar(0xA010B810, _index) % 4]); setClipRect(_clipRects[getSubVar(0xA010B810, _index) % 4]); - SetSpriteCallback(&AsScene1307Key::suInsertKey); + SetSpriteUpdate(&AsScene1307Key::suInsertKey); _newStickFrameIndex = -2; } @@ -1244,7 +1244,7 @@ void AsScene1307Key::stMoveKey() { _currFrameIndex = 0; _deltaX = newX - _x; _deltaY = newY - _y; - SetSpriteCallback(&AsScene1307Key::suMoveKey); + SetSpriteUpdate(&AsScene1307Key::suMoveKey); startAnimation(fileHashes[0], 0, -1); } } @@ -1778,12 +1778,12 @@ Scene1317::Scene1317(NeverhoodEngine *vm, Module *parentModule, int which) insertMouse433(0x08284011); showMouse(false); _smackerFileHash = 0; - _smackerFlag1 = false; + _keepLastSmackerFrame = false; } void Scene1317::update() { if (_smackerFileHash) { - _smackerPlayer->open(_smackerFileHash, _smackerFlag1); + _smackerPlayer->open(_smackerFileHash, _keepLastSmackerFrame); _smackerFileHash = 0; } Scene::update(); @@ -1805,7 +1805,7 @@ void Scene1317::upChooseKing() { stNoDecisionYet(); if (_smackerFileHash) { - _smackerPlayer->open(_smackerFileHash, _smackerFlag1); + _smackerPlayer->open(_smackerFileHash, _keepLastSmackerFrame); _smackerFileHash = 0; } @@ -1887,7 +1887,7 @@ void Scene1317::stChooseKing() { SetMessageHandler(&Scene1317::hmChooseKing); SetUpdateHandler(&Scene1317::upChooseKing); _smackerFileHash = 0x10982841; - _smackerFlag1 = true; + _keepLastSmackerFrame = true; _decisionCountdown = 450; _klaymanBlinks = false; _klaymanBlinkCountdown = _vm->_rnd->getRandomNumber(30 - 1) + 15; @@ -1898,7 +1898,7 @@ void Scene1317::stNoDecisionYet() { SetMessageHandler(&Scene1317::hmNoDecisionYet); SetUpdateHandler(&Scene1317::update); _smackerFileHash = 0x20982841; - _smackerFlag1 = false; + _keepLastSmackerFrame = false; } void Scene1317::stHoborgAsKing() { @@ -1906,7 +1906,7 @@ void Scene1317::stHoborgAsKing() { SetMessageHandler(&Scene1317::hmHoborgAsKing); SetUpdateHandler(&Scene1317::update); _smackerFileHash = 0x40982841; - _smackerFlag1 = false; + _keepLastSmackerFrame = false; } void Scene1317::stKlaymanAsKing() { @@ -1914,7 +1914,7 @@ void Scene1317::stKlaymanAsKing() { SetMessageHandler(&Scene1317::hmKlaymanAsKing); SetUpdateHandler(&Scene1317::update); _smackerFileHash = 0x80982841; - _smackerFlag1 = false; + _keepLastSmackerFrame = false; } void Scene1317::stEndMovie() { @@ -1922,7 +1922,7 @@ void Scene1317::stEndMovie() { SetMessageHandler(&Scene1317::hmEndMovie); SetUpdateHandler(&Scene1317::update); _smackerFileHash = 0x40800711; - _smackerFlag1 = false; + _keepLastSmackerFrame = false; } } // End of namespace Neverhood diff --git a/engines/neverhood/module1300.h b/engines/neverhood/module1300.h index 27e2540407..e404127655 100644 --- a/engines/neverhood/module1300.h +++ b/engines/neverhood/module1300.h @@ -300,7 +300,7 @@ protected: int _klaymanBlinkCountdown; int _decisionCountdown; uint32 _smackerFileHash; - bool _smackerFlag1; + bool _keepLastSmackerFrame; void update(); void upChooseKing(); uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); diff --git a/engines/neverhood/module1400.cpp b/engines/neverhood/module1400.cpp index ecf6326f9b..76bf41bca9 100644 --- a/engines/neverhood/module1400.cpp +++ b/engines/neverhood/module1400.cpp @@ -258,7 +258,7 @@ void Class526::spriteUpdate466720() { if (_rect.y1 <= 150) { _soundResource.play(0x0E32247F); stopAnimation(); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(NULL); setVisible(false); } @@ -266,7 +266,7 @@ void Class526::spriteUpdate466720() { void Class526::sub466770() { startAnimation(0x34880040, 0, -1); - SetSpriteCallback(&Class526::spriteUpdate466720); + SetSpriteUpdate(&Class526::spriteUpdate466720); } Class527::Class527(NeverhoodEngine *vm, Sprite *class526) @@ -296,7 +296,7 @@ void Class527::spriteUpdate466920() { if (_rect.y1 <= 150) { _soundResource.play(0x18020439); stopAnimation(); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(NULL); setVisible(false); } @@ -304,7 +304,7 @@ void Class527::spriteUpdate466920() { void Class527::sub466970() { startAnimation(0x103B8020, 0, -1); - SetSpriteCallback(&Class527::spriteUpdate466920); + SetSpriteUpdate(&Class527::spriteUpdate466920); } Class528::Class528(NeverhoodEngine *vm, Sprite *klayman, bool flag) @@ -577,13 +577,13 @@ void Class489::sub434D80() { sendMessage(_class525, 0x483A, 0); stopAnimation(); SetMessageHandler(&Sprite::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); setVisible(false); } } void Class489::sub434DD0() { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Class489::handleMessage); startAnimation(0x10E3042B, 0, -1); } @@ -591,20 +591,20 @@ void Class489::sub434DD0() { void Class489::sub434DF0() { _remX = getGlobalVar(0x04A10F33) * 108 + _class489Item->point.x; startAnimation(0x14A10137, 0, -1); - SetSpriteCallback(&Class489::spriteUpdate434B60); + SetSpriteUpdate(&Class489::spriteUpdate434B60); SetMessageHandler(&Class489::handleMessage); _soundResource2.play(0xEC008474); } void Class489::sub434E60() { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Class489::handleMessage434B20); startAnimation(0x80C32213, 0, -1); NextState(&Class489::sub434E90); } void Class489::sub434E90() { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Class489::handleMessage4348E0); startAnimation(0xD23B207F, 0, -1); } @@ -612,7 +612,7 @@ void Class489::sub434E90() { void Class489::sub434EC0() { startAnimation(0x50A80517, 0, -1); SetMessageHandler(&Class489::handleMessage434B20); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); NextState(&Class489::sub434F40); setGlobalVar(0x12A10DB3, 1); _soundResource1.play(0xCC4A8456); @@ -623,13 +623,13 @@ void Class489::sub434EC0() { void Class489::sub434F40() { sendMessage(_parentScene, 0x480F, 0); startAnimation(0xD833207F, 0, -1); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Class489::handleMessage4348E0); } void Class489::sub434F80() { startAnimation(0x50A94417, 0, -1); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&Class489::handleMessage434B20); NextState(&Class489::sub434E90); setGlobalVar(0x12A10DB3, 0); @@ -640,7 +640,7 @@ void Class489::sub434F80() { void Class489::sub434FF0() { _remX = getGlobalVar(0x04A10F33) * 108 + _class489Item->point.x; startAnimation(0x22CB4A33, 0, -1); - SetSpriteCallback(&Class489::spriteUpdate434B60); + SetSpriteUpdate(&Class489::spriteUpdate434B60); SetMessageHandler(&Class489::handleMessage434B20); NextState(&Class489::sub434DF0); } @@ -648,7 +648,7 @@ void Class489::sub434FF0() { void Class489::sub435040() { setGlobalVar(0x04A105B3, 4); setGlobalVar(0x04A10F33, 0); - SetSpriteCallback(&Class489::sub434D80); + SetSpriteUpdate(&Class489::sub434D80); SetMessageHandler(&Sprite::handleMessage); startAnimation(0x708D4712, 0, -1); _soundResource3.play(); @@ -1208,7 +1208,7 @@ uint32 AsScene1407Mouse::handleMessage(int messageNum, const MessageParam ¶m void AsScene1407Mouse::stIdleLookAtGoodHole() { setDoDeltaX(kScene1407MouseHoles[kScene1407MouseSections[_currSectionIndex].goodHoleIndex].x < _x ? 1 : 0); startAnimation(0x72215194, 0, -1); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(&AsScene1407Mouse::handleMessage); } @@ -1216,7 +1216,7 @@ void AsScene1407Mouse::stWalkToDest() { if (_walkDestX != _x) { setDoDeltaX(_walkDestX < _x ? 1 : 0); startAnimation(0x22291510, 0, -1); - SetSpriteCallback(&AsScene1407Mouse::suWalkTo); + SetSpriteUpdate(&AsScene1407Mouse::suWalkTo); SetMessageHandler(&AsScene1407Mouse::handleMessage); NextState(&AsScene1407Mouse::stIdleLookAtGoodHole); } @@ -1225,14 +1225,14 @@ void AsScene1407Mouse::stWalkToDest() { void AsScene1407Mouse::stWalkToHole() { setDoDeltaX(_walkDestX < _x ? 1 : 0); startAnimation(0x22291510, 0, -1); - SetSpriteCallback(&AsScene1407Mouse::suWalkTo); + SetSpriteUpdate(&AsScene1407Mouse::suWalkTo); SetMessageHandler(&AsScene1407Mouse::handleMessage); NextState(&AsScene1407Mouse::stGoThroughHole); } void AsScene1407Mouse::stGoThroughHole() { startAnimation(0x72215194, 0, -1); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); SetMessageHandler(NULL); SetUpdateHandler(&AsScene1407Mouse::upGoThroughHole); NextState(&AsScene1407Mouse::stArriveAtHole); diff --git a/engines/neverhood/module1600.cpp b/engines/neverhood/module1600.cpp index 44c8721d6d..6519efaf38 100644 --- a/engines/neverhood/module1600.cpp +++ b/engines/neverhood/module1600.cpp @@ -175,7 +175,7 @@ Class521::Class521(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y) SetUpdateHandler(&Class521::update); SetMessageHandler(&Class521::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); // TODO createSurface2(200, dword_4AF4C0); createSurface(200, 640, 480); //TODO: Remove once the line above is done @@ -244,7 +244,7 @@ uint32 Class521::handleMessage(int messageNum, const MessageParam ¶m, Entity uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1019: - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); break; /* NOTE: Implemented in setPathPoints case 0x2000: @@ -317,7 +317,7 @@ uint32 Class521::handleMessage(int messageNum, const MessageParam ¶m, Entity if (_currPointIndex == 0) { moveToPrevPoint(); } else { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } else { if (minMatchIndex > _currPointIndex) { @@ -336,14 +336,14 @@ uint32 Class521::handleMessage(int messageNum, const MessageParam ¶m, Entity _moreY = param.asInteger(); _steps = 0; _flag10E = 0; - SetSpriteCallback(&Class521::suMoveToPrevPoint); + SetSpriteUpdate(&Class521::suMoveToPrevPoint); _lastDistance = 640; break; case 0x2008: _moreY = param.asInteger(); _steps = 0; _flag10E = 0; - SetSpriteCallback(&Class521::suMoveToNextPoint); + SetSpriteUpdate(&Class521::suMoveToNextPoint); _lastDistance = 640; break; case 0x2009: @@ -397,7 +397,7 @@ uint32 Class521::handleMessage45CCA0(int messageNum, const MessageParam ¶m, void Class521::sub45CD00() { bool doDeltaX = _doDeltaX; - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); _againDestPtFlag = 0; _againDestPointFlag = 0; _flag10E = 0; @@ -425,12 +425,12 @@ void Class521::sub45CDC0() { _lastDistance = 640; _flag113 = 0; _flag10E = 0; - SetSpriteCallback(&Class521::suMoveToNextPoint); + SetSpriteUpdate(&Class521::suMoveToNextPoint); } else if (_value112 == 2) { _lastDistance = 640; _flag113 = 0; _flag10E = 0; - SetSpriteCallback(&Class521::suMoveToPrevPoint); + SetSpriteUpdate(&Class521::suMoveToPrevPoint); } } @@ -581,7 +581,7 @@ void Class521::moveToNextPoint() { NextState(&Class521::sub45D100); } _flag10E = 0; - SetSpriteCallback(&Class521::suMoveToNextPoint); + SetSpriteUpdate(&Class521::suMoveToNextPoint); _lastDistance = 640; } } @@ -643,7 +643,7 @@ void Class521::moveToPrevPoint() { NextState(&Class521::sub45D100); } _flag10E = 0; - SetSpriteCallback(&Class521::suMoveToPrevPoint); + SetSpriteUpdate(&Class521::suMoveToPrevPoint); _lastDistance = 640; } } diff --git a/engines/neverhood/module1900.cpp b/engines/neverhood/module1900.cpp index f91513fe57..45d3b834a5 100644 --- a/engines/neverhood/module1900.cpp +++ b/engines/neverhood/module1900.cpp @@ -262,7 +262,7 @@ void AsScene1907Symbol::suTryToPlugIn() { if (_currStep == 16) { _x -= _smallDeltaX; _y -= _smallDeltaY; - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -313,7 +313,7 @@ void AsScene1907Symbol::suMoveDown() { if (_y >= kAsScene1907SymbolPluggedInDownPositions[_elementIndex].y) { _y = kAsScene1907SymbolPluggedInDownPositions[_elementIndex].y; _isMoving = false; - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -335,7 +335,7 @@ void AsScene1907Symbol::suMoveUp() { if (_y < kAsScene1907SymbolPluggedInPositions[_elementIndex].y) { _y = kAsScene1907SymbolPluggedInPositions[_elementIndex].y; _isMoving = false; - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -348,7 +348,7 @@ void AsScene1907Symbol::tryToPlugIn() { startAnimation(kAsScene1907SymbolFileHashes[_elementIndex], 0, -1); SetUpdateHandler(&AsScene1907Symbol::update); SetMessageHandler(&AsScene1907Symbol::hmTryToPlugIn); - SetSpriteCallback(&AsScene1907Symbol::suTryToPlugIn); + SetSpriteUpdate(&AsScene1907Symbol::suTryToPlugIn); _currStep = 0; _deltaX = (_x - kAsScene1907SymbolPluggedInPositions[_newPositionIndex].x) / 16; _smallDeltaX = _x - _deltaX * 16 - kAsScene1907SymbolPluggedInPositions[_newPositionIndex].x; @@ -378,7 +378,7 @@ void AsScene1907Symbol::fallOff(int newPositionIndex, int fallOffDelay) { _yAccel = 1; SetUpdateHandler(&AsScene1907Symbol::update); SetMessageHandler(&AsScene1907Symbol::handleMessage); - SetSpriteCallback(&AsScene1907Symbol::suFallOff); + SetSpriteUpdate(&AsScene1907Symbol::suFallOff); } void AsScene1907Symbol::stFallOffHitGround() { @@ -388,7 +388,7 @@ void AsScene1907Symbol::stFallOffHitGround() { Entity::_priority = 1000 - _newPositionIndex; _vm->_collisionMan->removeSprite(this); _vm->_collisionMan->addSprite(this); - SetSpriteCallback(&AsScene1907Symbol::suFallOffHitGround); + SetSpriteUpdate(&AsScene1907Symbol::suFallOffHitGround); NextState(&AsScene1907Symbol::cbFallOffHitGroundEvent); _newStickFrameIndex = 0; _currStep = 0; @@ -409,7 +409,7 @@ void AsScene1907Symbol::cbFallOffHitGroundEvent() { _newStickFrameIndex = 0; SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene1907Symbol::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); processDelta(); _soundResource3.play(); } @@ -419,7 +419,7 @@ void AsScene1907Symbol::stPlugIn() { _currPositionIndex = _newPositionIndex; stopAnimation(); SetMessageHandler(&AsScene1907Symbol::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); if (_elementIndex == 8) sendMessage(_parentScene, 0x2001, 0); } @@ -434,7 +434,7 @@ void AsScene1907Symbol::moveUp() { startAnimation(kAsScene1907SymbolFileHashes[_elementIndex], -1, -1);//???? stopAnimation(); SetMessageHandler(&AsScene1907Symbol::handleMessage); - SetSpriteCallback(&AsScene1907Symbol::suMoveUp); + SetSpriteUpdate(&AsScene1907Symbol::suMoveUp); _yIncr = 1; _isMoving = true; } @@ -443,7 +443,7 @@ void AsScene1907Symbol::moveDown() { startAnimation(kAsScene1907SymbolFileHashes[_elementIndex], -1, -1);//???? stopAnimation(); SetMessageHandler(&AsScene1907Symbol::handleMessage); - SetSpriteCallback(&AsScene1907Symbol::suMoveDown); + SetSpriteUpdate(&AsScene1907Symbol::suMoveDown); _yIncr = 4; _isMoving = true; } diff --git a/engines/neverhood/module2200.cpp b/engines/neverhood/module2200.cpp index e886accfef..9846bc5cd4 100644 --- a/engines/neverhood/module2200.cpp +++ b/engines/neverhood/module2200.cpp @@ -841,7 +841,7 @@ void SsScene2202PuzzleTile::moveTile(int16 newTileIndex) { } if (_xDelta > _yDelta) { - SetSpriteCallback(&SsScene2202PuzzleTile::suMoveTileX); + SetSpriteUpdate(&SsScene2202PuzzleTile::suMoveTileX); if (_xIncr > 0) { if (_newX - _x >= 180) _xFlagPos = _newX - 90; @@ -855,7 +855,7 @@ void SsScene2202PuzzleTile::moveTile(int16 newTileIndex) { } _soundResource1.play(); } else { - SetSpriteCallback(&SsScene2202PuzzleTile::suMoveTileY); + SetSpriteUpdate(&SsScene2202PuzzleTile::suMoveTileY); if (_yIncr > 0) { if (_newY - _y >= 180) _xFlagPos = _newY - 90; @@ -879,7 +879,7 @@ void SsScene2202PuzzleTile::stopMoving() { _drawRect.width = _spriteResource.getDimensions().width; _drawRect.height = _spriteResource.getDimensions().height; _needRefresh = true; - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); _isMoving = false; sendMessage(_parentScene, 0x2002, _tileIndex); } @@ -1413,7 +1413,7 @@ Class603::Class603(NeverhoodEngine *vm, uint32 fileHash) _x -= 63; SetUpdateHandler(&Class603::update); SetMessageHandler(&Class603::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Class603::update() { @@ -1427,13 +1427,13 @@ uint32 Class603::handleMessage(int messageNum, const MessageParam ¶m, Entity case 0x4808: _index = 0; SetMessageHandler(NULL); - SetSpriteCallback(&Class603::spriteUpdate481E60); + SetSpriteUpdate(&Class603::spriteUpdate481E60); _soundResource.play(0x032746E0); break; case 0x4809: _index = 0; SetMessageHandler(NULL); - SetSpriteCallback(&Class603::spriteUpdate481E90); + SetSpriteUpdate(&Class603::spriteUpdate481E90); _soundResource.play(0x002642C0); break; } @@ -1446,7 +1446,7 @@ void Class603::spriteUpdate481E60() { _index++; } else { SetMessageHandler(&Class603::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -1456,7 +1456,7 @@ void Class603::spriteUpdate481E90() { _index++; } else { SetMessageHandler(&Class603::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } } @@ -1465,7 +1465,7 @@ Class604::Class604(NeverhoodEngine *vm, uint32 fileHash) SetUpdateHandler(&Class604::update); SetMessageHandler(&Class604::handleMessage); - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); } void Class604::update() { @@ -1478,7 +1478,7 @@ uint32 Class604::handleMessage(int messageNum, const MessageParam ¶m, Entity switch (messageNum) { case 0x4803: SetMessageHandler(NULL); - SetSpriteCallback(&Class604::spriteUpdate482020); + SetSpriteUpdate(&Class604::spriteUpdate482020); _yDelta = 0; break; } @@ -1708,7 +1708,7 @@ AsScene2207Elevator::AsScene2207Elevator(NeverhoodEngine *vm, Scene *parentScene createSurface(1100, 129, 103); startAnimation(getGlobalVar(0x4D080E54) ? 0xC858CC19 : 0x294B3377, 0, 0); SetUpdateHandler(&AsScene2207Elevator::update); - SetSpriteCallback(&AsScene2207Elevator::suSetPosition); + SetSpriteUpdate(&AsScene2207Elevator::suSetPosition); SetMessageHandler(&AsScene2207Elevator::handleMessage); _newStickFrameIndex = 0; } diff --git a/engines/neverhood/module3000.cpp b/engines/neverhood/module3000.cpp index 8c5fd6c59d..8c797f3e61 100644 --- a/engines/neverhood/module3000.cpp +++ b/engines/neverhood/module3000.cpp @@ -670,7 +670,7 @@ AsScene3009HorizontalIndicator::AsScene3009HorizontalIndicator(NeverhoodEngine * SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene3009HorizontalIndicator::handleMessage); if (varValue == 8 || varValue == 9 || varValue == 10) { - SetSpriteCallback(&AsScene3009HorizontalIndicator::suMoveRight); + SetSpriteUpdate(&AsScene3009HorizontalIndicator::suMoveRight); _x = 280; } } @@ -691,7 +691,7 @@ uint32 AsScene3009HorizontalIndicator::handleMessage(int messageNum, const Messa void AsScene3009HorizontalIndicator::suMoveLeft() { _x -= 6; if (_x < 92) { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); _x = 92; } } @@ -699,7 +699,7 @@ void AsScene3009HorizontalIndicator::suMoveLeft() { void AsScene3009HorizontalIndicator::suMoveRight() { _x += 6; if (_x > 533) { - SetSpriteCallback(NULL); + SetSpriteUpdate(NULL); _x = 533; } } @@ -713,12 +713,12 @@ void AsScene3009HorizontalIndicator::show() { void AsScene3009HorizontalIndicator::stMoveLeft() { _x = 533; - SetSpriteCallback(&AsScene3009HorizontalIndicator::suMoveLeft); + SetSpriteUpdate(&AsScene3009HorizontalIndicator::suMoveLeft); } void AsScene3009HorizontalIndicator::stMoveRight() { _x = 330; - SetSpriteCallback(&AsScene3009HorizontalIndicator::suMoveRight); + SetSpriteUpdate(&AsScene3009HorizontalIndicator::suMoveRight); } AsScene3009Symbol::AsScene3009Symbol(NeverhoodEngine *vm, Scene3009 *parentScene, int index) diff --git a/engines/neverhood/neverhood.h b/engines/neverhood/neverhood.h index adc46198d6..b7c276efd7 100644 --- a/engines/neverhood/neverhood.h +++ b/engines/neverhood/neverhood.h @@ -31,6 +31,7 @@ #include "common/system.h" #include "audio/mixer.h" #include "engines/engine.h" +#include "neverhood/messages.h" namespace Neverhood { diff --git a/engines/neverhood/scene.cpp b/engines/neverhood/scene.cpp index 9a588f283f..457d5866d0 100644 --- a/engines/neverhood/scene.cpp +++ b/engines/neverhood/scene.cpp @@ -387,13 +387,11 @@ bool Scene::queryPositionRectList(int16 mouseX, int16 mouseY) { if (_rectType == 1) { RectList &rectList = *_rectList; for (uint i = 0; i < rectList.size(); i++) { - debug("(%d, %d) ? (%d, %d, %d, %d)", klaymanX, klaymanY, rectList[i].rect.x1, rectList[i].rect.y1, rectList[i].rect.x2, rectList[i].rect.y2); - if (klaymanX >= rectList[i].rect.x1 && klaymanX <= rectList[i].rect.x2 && - klaymanY >= rectList[i].rect.y1 && klaymanY <= rectList[i].rect.y2) { + debug(2, "(%d, %d) ? (%d, %d, %d, %d)", klaymanX, klaymanY, rectList[i].rect.x1, rectList[i].rect.y1, rectList[i].rect.x2, rectList[i].rect.y2); + if (rectList[i].rect.contains(klaymanX, klaymanY)) { for (uint j = 0; j < rectList[i].subRects.size(); j++) { - debug(" (%d, %d) ? (%d, %d, %d, %d)", mouseX, mouseY, rectList[i].subRects[j].rect.x1, rectList[i].subRects[j].rect.y1, rectList[i].subRects[j].rect.x2, rectList[i].subRects[j].rect.y2); - if (mouseX >= rectList[i].subRects[j].rect.x1 && mouseX <= rectList[i].subRects[j].rect.x2 && - mouseY >= rectList[i].subRects[j].rect.y1 && mouseY <= rectList[i].subRects[j].rect.y2) { + debug(2, " (%d, %d) ? (%d, %d, %d, %d)", mouseX, mouseY, rectList[i].subRects[j].rect.x1, rectList[i].subRects[j].rect.y1, rectList[i].subRects[j].rect.x2, rectList[i].subRects[j].rect.y2); + if (rectList[i].subRects[j].rect.contains(mouseX, mouseY)) { debug("Scene::queryPositionRectList() -> %08X", rectList[i].subRects[j].messageListId); return setMessageList2(rectList[i].subRects[j].messageListId); } diff --git a/engines/neverhood/smackerplayer.cpp b/engines/neverhood/smackerplayer.cpp index 9ae7e14eed..1b40c8f1f6 100644 --- a/engines/neverhood/smackerplayer.cpp +++ b/engines/neverhood/smackerplayer.cpp @@ -35,9 +35,8 @@ SmackerSurface::SmackerSurface(NeverhoodEngine *vm) } void SmackerSurface::draw() { - if (_smackerFrame && _visible && _drawRect.width > 0 && _drawRect.height > 0) { + if (_smackerFrame && _visible && _drawRect.width > 0 && _drawRect.height > 0) _vm->_screen->drawSurface2(_smackerFrame, _drawRect, _clipRect, false); - } } void SmackerSurface::setSmackerFrame(const Graphics::Surface *smackerFrame) { @@ -60,15 +59,14 @@ SmackerDoubleSurface::SmackerDoubleSurface(NeverhoodEngine *vm) } void SmackerDoubleSurface::draw() { - if (_smackerFrame && _visible && _drawRect.width > 0 && _drawRect.height > 0) { + if (_smackerFrame && _visible && _drawRect.width > 0 && _drawRect.height > 0) _vm->_screen->drawDoubleSurface2(_smackerFrame, _drawRect); - } } // SmackerPlayer SmackerPlayer::SmackerPlayer(NeverhoodEngine *vm, Scene *scene, uint32 fileHash, bool doubleSurface, bool flag) - : Entity(vm, 0), _scene(scene), _doubleSurface(doubleSurface), _dirtyFlag(false), _flag2(false), + : Entity(vm, 0), _scene(scene), _doubleSurface(doubleSurface), _dirtyFlag(false), _videoDone(false), _palette(NULL), _smackerDecoder(NULL), _smackerSurface(NULL), _stream(NULL), _smackerFirst(true), _drawX(-1), _drawY(-1) { @@ -146,6 +144,8 @@ void SmackerPlayer::setDrawPos(int16 x, int16 y) { void SmackerPlayer::rewind() { + // TODO Quite dirty, try to implement this in the decoder + delete _smackerDecoder; _smackerDecoder = NULL; _stream = NULL; @@ -170,37 +170,17 @@ void SmackerPlayer::update() { _dirtyFlag = false; } -#if 0 - if (!_smackerDecoder->endOfVideo()) { - updateFrame(); - if (_smackerDecoder->endOfVideo() && !_keepLastFrame) { - // Inform the scene about the end of the video playback - if (_scene) { - sendMessage(_scene, 0x3002, 0); - } - _flag2 = true; - } else { - if (_smackerDecoder->endOfVideo()) { - rewind(); - updateFrame(); - } - _flag2 = false; - } - } -#endif - if (!_smackerDecoder->endOfVideo()) { updateFrame(); } else if (!_keepLastFrame) { // Inform the scene about the end of the video playback - if (_scene) { + if (_scene) sendMessage(_scene, 0x3002, 0); - } - _flag2 = true; + _videoDone = true; } else { rewind(); updateFrame(); - _flag2 = false; + _videoDone = false; } } @@ -231,9 +211,9 @@ void SmackerPlayer::updateFrame() { // TODO _vm->_screen->_skipUpdate = true; _dirtyFlag = true; - if (_smackerDecoder->hasDirtyPalette()) { + if (_smackerDecoder->hasDirtyPalette()) updatePalette(); - } + } void SmackerPlayer::updatePalette() { diff --git a/engines/neverhood/smackerplayer.h b/engines/neverhood/smackerplayer.h index 883cb52245..65c0c84e11 100644 --- a/engines/neverhood/smackerplayer.h +++ b/engines/neverhood/smackerplayer.h @@ -70,7 +70,7 @@ protected: bool _doubleSurface; Common::SeekableReadStream *_stream; bool _keepLastFrame; - bool _flag2; + bool _videoDone; bool _dirtyFlag; int _drawX, _drawY; void update(); diff --git a/engines/neverhood/smackerscene.cpp b/engines/neverhood/smackerscene.cpp index fe78e5021e..9982043dea 100644 --- a/engines/neverhood/smackerscene.cpp +++ b/engines/neverhood/smackerscene.cpp @@ -82,7 +82,6 @@ void SmackerScene::nextVideo() { } if (_fileHashListIndex == 0) { _smackerPlayer = addSmackerPlayer(new SmackerPlayer(_vm, this, smackerFileHash, _doubleSurface, false)); - // TODO? Screen.hSmack = _smackerPlayer; } else { _smackerPlayer->open(smackerFileHash, false); } @@ -108,9 +107,8 @@ uint32 SmackerScene::handleMessage(int messageNum, const MessageParam ¶m, En _playNextVideoFlag = true; break; case 0x000C: - if (_canAbort) { + if (_canAbort) sendMessage(_parentModule, 0x1009, 0); - } break; case 0x3002: _playNextVideoFlag = true; diff --git a/engines/neverhood/sprite.h b/engines/neverhood/sprite.h index b9decefd0a..bc7c0a5247 100644 --- a/engines/neverhood/sprite.h +++ b/engines/neverhood/sprite.h @@ -30,7 +30,7 @@ namespace Neverhood { -#define SetSpriteCallback(callback) _spriteUpdateCb = static_cast <void (Sprite::*)(void)> (callback); debug(2, "SetSpriteCallback(" #callback ")"); _spriteUpdateCbName = #callback +#define SetSpriteUpdate(callback) _spriteUpdateCb = static_cast <void (Sprite::*)(void)> (callback); debug(2, "SetSpriteUpdate(" #callback ")"); _spriteUpdateCbName = #callback #define SetFilterX(callback) _filterXCb = static_cast <int16 (Sprite::*)(int16)> (callback); debug(2, "SetFilterX(" #callback ")") #define SetFilterY(callback) _filterYCb = static_cast <int16 (Sprite::*)(int16)> (callback); debug(2, "SetFilterY(" #callback ")") |