diff options
author | johndoe123 | 2012-10-05 21:55:51 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2013-05-08 20:43:47 +0200 |
commit | b320c9f5a00c6009091cfd8121aa8deaa2624d8d (patch) | |
tree | 73c39ce8b87aa02deee7dfc885f7b4e2b8f4cd6b /engines/neverhood | |
parent | cb5ca835787a11d9ff99bcd8a35578586507a61c (diff) | |
download | scummvm-rg350-b320c9f5a00c6009091cfd8121aa8deaa2624d8d.tar.gz scummvm-rg350-b320c9f5a00c6009091cfd8121aa8deaa2624d8d.tar.bz2 scummvm-rg350-b320c9f5a00c6009091cfd8121aa8deaa2624d8d.zip |
NEVERHOOD: Work on Module1600:
- Rename stuff (also in related files)
Diffstat (limited to 'engines/neverhood')
-rw-r--r-- | engines/neverhood/gamemodule.cpp | 5 | ||||
-rw-r--r-- | engines/neverhood/module1400.cpp | 2 | ||||
-rw-r--r-- | engines/neverhood/module1500.cpp | 4 | ||||
-rw-r--r-- | engines/neverhood/module1600.cpp | 519 | ||||
-rw-r--r-- | engines/neverhood/module1600.h | 78 | ||||
-rw-r--r-- | engines/neverhood/module2500.cpp | 66 | ||||
-rw-r--r-- | engines/neverhood/module2500.h | 2 | ||||
-rw-r--r-- | engines/neverhood/module2700.cpp | 188 | ||||
-rw-r--r-- | engines/neverhood/module2700.h | 26 |
9 files changed, 449 insertions, 441 deletions
diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index e6564f3436..df001c4cc0 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -304,12 +304,13 @@ void GameModule::startup() { setGlobalVar(0x0A18CA33, 0); setGlobalVar(0x0112090A, 0); //setGlobalVar(0x000CF819, 1); + setGlobalVar(0x04A105B3, 2); // <<<DEBUG #if 1 - _vm->gameState().sceneNum = 7; - createModule(1300, -1); + _vm->gameState().sceneNum = 8; + createModule(1600, -1); #endif #if 0 _vm->gameState().sceneNum = 0; diff --git a/engines/neverhood/module1400.cpp b/engines/neverhood/module1400.cpp index 59ed0c470f..88b576ac39 100644 --- a/engines/neverhood/module1400.cpp +++ b/engines/neverhood/module1400.cpp @@ -1608,6 +1608,7 @@ Scene1405::Scene1405(NeverhoodEngine *vm, Module *parentModule, int which) setPalette(0x0C0C007D); insertMouse435(0xC00790C8, 20, 620); + // DEBUG>>> // TODO: Some debug code: Leave two matching tiles open for (int i = 0; i < 48; i++) setSubVar(0xCCE0280F, i, 1); @@ -1619,6 +1620,7 @@ Scene1405::Scene1405(NeverhoodEngine *vm, Module *parentModule, int which) break; } } + // <<<DEBUG for (uint32 tileIndex = 0; tileIndex < 48; tileIndex++) { _tiles[tileIndex] = insertSprite<AsScene1405Tile>(this, tileIndex); diff --git a/engines/neverhood/module1500.cpp b/engines/neverhood/module1500.cpp index 88b7e73da5..a46b8fc716 100644 --- a/engines/neverhood/module1500.cpp +++ b/engines/neverhood/module1500.cpp @@ -132,8 +132,10 @@ void Scene1501::update() { uint32 Scene1501::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Scene::handleMessage(messageNum, param, sender); - if (messageNum == 0x0009) { + switch (messageNum) { + case 0x0009: _flag = true; + break; } return messageResult; } diff --git a/engines/neverhood/module1600.cpp b/engines/neverhood/module1600.cpp index 5c890e0653..92c566e485 100644 --- a/engines/neverhood/module1600.cpp +++ b/engines/neverhood/module1600.cpp @@ -179,11 +179,11 @@ void Module1600::updateScene() { } } -Class521::Class521(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y) +AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y) : AnimatedSprite(vm, 1000), _parentScene(parentScene) { - SetUpdateHandler(&Class521::update); - SetMessageHandler(&Class521::handleMessage); + SetUpdateHandler(&AsCommonCar::update); + SetMessageHandler(&AsCommonCar::handleMessage); SetSpriteUpdate(NULL); // TODO createSurface2(200, dword_4AF4C0); @@ -214,17 +214,17 @@ Class521::Class521(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y) } -Class521::~Class521() { - if (_finalizeStateCb == AnimationCallback(&Class521::sub45D620)) { +AsCommonCar::~AsCommonCar() { + if (_finalizeStateCb == AnimationCallback(&AsCommonCar::sub45D620)) { setGlobalVar(0x21E60190, !getGlobalVar(0x21E60190)); } } -void Class521::setPathPoints(NPointArray *pathPoints) { +void AsCommonCar::setPathPoints(NPointArray *pathPoints) { _pathPoints = pathPoints; } -void Class521::update() { +void AsCommonCar::update() { if (_newDeltaXType >= 0) { setDoDeltaX(_newDeltaXType); _newDeltaXType = -1; @@ -242,14 +242,14 @@ void Class521::update() { sub45E0A0(); } -void Class521::update45C790() { - Class521::update(); +void AsCommonCar::update45C790() { + AsCommonCar::update(); if (++_idleCounter >= _idleCounterMax) sub45D050(); sub45E0A0(); } -uint32 Class521::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { +uint32 AsCommonCar::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1019: @@ -345,14 +345,14 @@ uint32 Class521::handleMessage(int messageNum, const MessageParam ¶m, Entity _moreY = param.asInteger(); _steps = 0; _flag10E = 0; - SetSpriteUpdate(&Class521::suMoveToPrevPoint); + SetSpriteUpdate(&AsCommonCar::suMoveToPrevPoint); _lastDistance = 640; break; case 0x2008: _moreY = param.asInteger(); _steps = 0; _flag10E = 0; - SetSpriteUpdate(&Class521::suMoveToNextPoint); + SetSpriteUpdate(&AsCommonCar::suMoveToNextPoint); _lastDistance = 640; break; case 0x2009: @@ -376,8 +376,8 @@ uint32 Class521::handleMessage(int messageNum, const MessageParam ¶m, Entity return messageResult; } -uint32 Class521::handleMessage45CC30(int messageNum, const MessageParam ¶m, Entity *sender) { - uint32 messageResult = Class521::handleMessage(messageNum, param, sender); +uint32 AsCommonCar::handleMessage45CC30(int messageNum, const MessageParam ¶m, Entity *sender) { + uint32 messageResult = AsCommonCar::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (_flag10F && param.asInteger() == 0x025424A2) { @@ -391,20 +391,20 @@ uint32 Class521::handleMessage45CC30(int messageNum, const MessageParam ¶m, return messageResult; } -uint32 Class521::handleMessage45CCA0(int messageNum, const MessageParam ¶m, Entity *sender) { +uint32 AsCommonCar::handleMessage45CCA0(int messageNum, const MessageParam ¶m, Entity *sender) { switch (messageNum) { case 0x2009: sub45CF80(); break; case 0x3002: sendMessage(_parentScene, 0x200A, 0); - SetMessageHandler(&Class521::handleMessage); + SetMessageHandler(&AsCommonCar::handleMessage); break; } return 0; } -void Class521::sub45CD00() { +void AsCommonCar::sub45CD00() { bool doDeltaX = _doDeltaX; SetSpriteUpdate(NULL); _againDestPtFlag = 0; @@ -415,12 +415,12 @@ void Class521::sub45CD00() { _flag114 = 0; _flag11A = 0; _rectList = NULL; - SetMessageHandler(&Class521::handleMessage45CC30); - NextState(&Class521::sub45CFE0); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + NextState(&AsCommonCar::sub45CFE0); startAnimation(0x35698F78, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update45C790); - FinalizeState(&Class521::sub45D040); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update45C790); + FinalizeState(&AsCommonCar::sub45D040); setDoDeltaX(doDeltaX ? 1 : 0); _currMoveDirection = 0; _newMoveDirection = 0; @@ -429,36 +429,36 @@ void Class521::sub45CD00() { _idleCounterMax = _vm->_rnd->getRandomNumber(64 - 1) + 24; } -void Class521::sub45CDC0() { +void AsCommonCar::sub45CDC0() { if (_value112 == 1) { _lastDistance = 640; _flag113 = 0; _flag10E = 0; - SetSpriteUpdate(&Class521::suMoveToNextPoint); + SetSpriteUpdate(&AsCommonCar::suMoveToNextPoint); } else if (_value112 == 2) { _lastDistance = 640; _flag113 = 0; _flag10E = 0; - SetSpriteUpdate(&Class521::suMoveToPrevPoint); + SetSpriteUpdate(&AsCommonCar::suMoveToPrevPoint); } } -void Class521::sub45CE10() { +void AsCommonCar::sub45CE10() { if (_flag10E && !_flag113 && !_flag10F) { gotoNextState(); _flag114 = 0; _flag113 = 1; startAnimation(0x192ADD30, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45CFE0); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45CFE0); } else if (!_flag10E && _steps && _flag113) { gotoNextState(); _flag113 = 0; startAnimation(0x9966B138, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45D100); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45D100); } else { bool flag = false; uint index = 0; @@ -483,25 +483,25 @@ void Class521::sub45CE10() { } } -void Class521::sub45CF80() { +void AsCommonCar::sub45CF80() { startAnimation(0xA86A9538, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45CFE0); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45CFE0); } -void Class521::sub45CFB0() { +void AsCommonCar::sub45CFB0() { startAnimation(0xA86A9538, -1, -1); _playBackwards = true; - SetMessageHandler(&Class521::handleMessage45CCA0); - SetUpdateHandler(&Class521::update); + SetMessageHandler(&AsCommonCar::handleMessage45CCA0); + SetUpdateHandler(&AsCommonCar::update); } -void Class521::sub45CFE0() { +void AsCommonCar::sub45CFE0() { startAnimation(0x35698F78, 0, -1); - SetMessageHandler(&Class521::handleMessage); - SetUpdateHandler(&Class521::update45C790); - FinalizeState(&Class521::sub45D040); + SetMessageHandler(&AsCommonCar::handleMessage); + SetUpdateHandler(&AsCommonCar::update45C790); + FinalizeState(&AsCommonCar::sub45D040); _idleCounter = 0; _currMoveDirection = 0; _newMoveDirection = 0; @@ -509,35 +509,35 @@ void Class521::sub45CFE0() { _idleCounterMax = _vm->_rnd->getRandomNumber(64 - 1) + 24; } -void Class521::sub45D040() { - SetUpdateHandler(&Class521::update); +void AsCommonCar::sub45D040() { + SetUpdateHandler(&AsCommonCar::update); } -void Class521::sub45D050() { +void AsCommonCar::sub45D050() { startAnimation(0xB579A77C, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45CFE0); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45CFE0); _idleCounter = 0; _idleCounterMax = _vm->_rnd->getRandomNumber(64 - 1) + 24; } -void Class521::sub45D0A0() { +void AsCommonCar::sub45D0A0() { _flag10F = 1; gotoNextState(); startAnimation(0x9C220DA4, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - FinalizeState(&Class521::sub45D0E0); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + FinalizeState(&AsCommonCar::sub45D0E0); } -void Class521::sub45D0E0() { +void AsCommonCar::sub45D0E0() { _flag10F = 0; _newMoveDirection = 0; sub45D100(); } -void Class521::sub45D100() { +void AsCommonCar::sub45D100() { _flag114 = 1; if (_currMoveDirection == 1) { startAnimation(0xD4AA03A4, 0, -1); @@ -551,18 +551,18 @@ void Class521::sub45D100() { setGlobalVar(0x21E60190, _doDeltaX ? 1 : 0); } -void Class521::sub45D180() { +void AsCommonCar::sub45D180() { _flag10F = 1; gotoNextState(); startAnimation(0xF46A0324, 0, -1); _value112 = 0; - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - FinalizeState(&Class521::sub45D620); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + FinalizeState(&AsCommonCar::sub45D620); sub45CDC0(); } -void Class521::moveToNextPoint() { +void AsCommonCar::moveToNextPoint() { if (_currPointIndex >= (int)_pathPoints->size() - 1) { _moreY = 0; sendMessage(this, 0x1019, 0); @@ -585,39 +585,39 @@ void Class521::moveToNextPoint() { gotoNextState(); _flag113 = 0; startAnimation(0x9966B138, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45D100); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45D100); } _flag10E = 0; - SetSpriteUpdate(&Class521::suMoveToNextPoint); + SetSpriteUpdate(&AsCommonCar::suMoveToNextPoint); _lastDistance = 640; } } } -void Class521::sub45D350() { +void AsCommonCar::sub45D350() { gotoNextState(); _flag10F = 1; _flag10E = 1; startAnimation(0x192ADD30, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45D390); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45D390); } -void Class521::sub45D390() { +void AsCommonCar::sub45D390() { gotoNextState(); _flag10F = 1; startAnimation(0xF46A0324, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - FinalizeState(&Class521::sub45D620); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + FinalizeState(&AsCommonCar::sub45D620); _value112 = 1; sub45CDC0(); } -void Class521::moveToPrevPoint() { +void AsCommonCar::moveToPrevPoint() { if (_currPointIndex == 0 && _stepError == 0) { _moreY = 0; sendMessage(this, 0x1019, 0); @@ -647,46 +647,46 @@ void Class521::moveToPrevPoint() { gotoNextState(); _flag113 = 0; startAnimation(0x9966B138, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45D100); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45D100); } _flag10E = 0; - SetSpriteUpdate(&Class521::suMoveToPrevPoint); + SetSpriteUpdate(&AsCommonCar::suMoveToPrevPoint); _lastDistance = 640; } } } -void Class521::sub45D580() { +void AsCommonCar::sub45D580() { _flag10F = 1; _flag10E = 1; FinalizeState(NULL); startAnimation(0x192ADD30, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - NextState(&Class521::sub45D5D0); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + NextState(&AsCommonCar::sub45D5D0); } -void Class521::sub45D5D0() { +void AsCommonCar::sub45D5D0() { _flag10F = 1; FinalizeState(NULL); startAnimation(0xF46A0324, 0, -1); - SetMessageHandler(&Class521::handleMessage45CC30); - SetUpdateHandler(&Class521::update); - FinalizeState(&Class521::sub45D620); + SetMessageHandler(&AsCommonCar::handleMessage45CC30); + SetUpdateHandler(&AsCommonCar::update); + FinalizeState(&AsCommonCar::sub45D620); _value112 = 2; sub45CDC0(); } -void Class521::sub45D620() { +void AsCommonCar::sub45D620() { _flag10F = 0; _newMoveDirection = 0; setDoDeltaX(2); sub45D100(); } -void Class521::suMoveToNextPoint() { +void AsCommonCar::suMoveToNextPoint() { int16 newX = _x, newY = _y; if (_currPointIndex >= (int)_pathPoints->size()) { @@ -831,7 +831,7 @@ void Class521::suMoveToNextPoint() { } -void Class521::suMoveToPrevPoint() { +void AsCommonCar::suMoveToPrevPoint() { int16 newX = _x, newY = _y; if (_currPointIndex == 0 && _stepError == 0) { @@ -978,60 +978,60 @@ void Class521::suMoveToPrevPoint() { } -void Class521::sub45E0A0() { +void AsCommonCar::sub45E0A0() { // TODO } -Class546::Class546(NeverhoodEngine *vm, Scene *parentScene) +AsScene1608Door::AsScene1608Door(NeverhoodEngine *vm, Scene *parentScene) : AnimatedSprite(vm, 0x08C80144, 900, 320, 240), _parentScene(parentScene) { setVisible(false); - SetMessageHandler(&Class546::handleMessage); + SetMessageHandler(&AsScene1608Door::handleMessage); stopAnimation(); } -uint32 Class546::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { +uint32 AsScene1608Door::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x3002: gotoNextState(); break; case 0x4808: - sub44D710(); + stOpenDoor(); break; case 0x4809: - sub44D790(); + stCloseDoor(); break; } return messageResult; } -void Class546::sub44D710() { +void AsScene1608Door::stOpenDoor() { startAnimation(0x08C80144, 0, -1); setVisible(true); - NextState(&Class546::sub44D760); + NextState(&AsScene1608Door::stOpenDoorDone); playSound(0, calcHash("fxDoorOpen23")); } -void Class546::sub44D760() { +void AsScene1608Door::stOpenDoorDone() { sendMessage(_parentScene, 0x2033, 0); stopAnimation(); setVisible(false); } -void Class546::sub44D790() { +void AsScene1608Door::stCloseDoor() { startAnimation(0x08C80144, -1, -1); setVisible(true); - NextState(&Class546::sub44D7F0); + NextState(&AsScene1608Door::stCloseDoorDone); playSound(0, calcHash("fxDoorClose23")); } -void Class546::sub44D7F0() { +void AsScene1608Door::stCloseDoorDone() { sendMessage(_parentScene, 0x2034, 0); stopAnimation(); } -Class547::Class547(NeverhoodEngine *vm, int16 x, int16 y) +AsScene1608IdleCarLower::AsScene1608IdleCarLower(NeverhoodEngine *vm, int16 x, int16 y) : AnimatedSprite(vm, 0x1209E09F, 1100, x, y) { setDoDeltaX(1); @@ -1039,35 +1039,39 @@ Class547::Class547(NeverhoodEngine *vm, int16 x, int16 y) _newStickFrameIndex = 1; } -Class548::Class548(NeverhoodEngine *vm, int16 x, int16 y) +AsScene1608IdleCarFull::AsScene1608IdleCarFull(NeverhoodEngine *vm, int16 x, int16 y) : AnimatedSprite(vm, 0x1209E09F, 100, x, y) { setDoDeltaX(1); _newStickFrameIndex = 0; } -Class518::Class518(NeverhoodEngine *vm, Class521 *class521) - : AnimatedSprite(vm, 1100), _class521(class521) { +AsCommonCarConnector::AsCommonCarConnector(NeverhoodEngine *vm, AsCommonCar *asCar) + : AnimatedSprite(vm, 1100), _asCar(asCar) { - SetUpdateHandler(&Class518::update); + SetUpdateHandler(&AsCommonCarConnector::update); createSurface1(0x60281C10, 150); startAnimation(0x60281C10, -1, -1); _newStickFrameIndex = -2; } -void Class518::update() { - _x = _class521->getX(); - _y = _class521->getY(); +void AsCommonCarConnector::update() { + _x = _asCar->getX(); + _y = _asCar->getY(); AnimatedSprite::update(); } Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) - : Scene(vm, parentModule, true), _class521(NULL), _countdown1(0) { + : Scene(vm, parentModule, true), _asCar(NULL), _countdown1(0) { + + /* TODO: Find out which of the message/update handlers are used for + the upper/lower floors and rename them accordingly. + */ setGlobalVar(0x21E60190, 1); _surfaceFlag = true; - SetMessageHandler(&Scene1608::handleMessage44D2A0); + SetMessageHandler(&Scene1608::hmLowerFloor); _class545 = insertSprite<Class545>(this, 1, 1100, 198, 220); _vm->_collisionMan->addSprite(_class545); @@ -1078,9 +1082,9 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) else { setRectList(0x004B47D0); insertKlayman<KmScene1608>(380, 438); - _klayman2 = _klayman; - _flag4 = false; - _class546 = insertSprite<Class546>(this); + _kmScene1608 = _klayman; + _klaymanInCar = false; + _asDoor = insertSprite<AsScene1608Door>(this); _sprite1 = insertStaticSprite(0x7D0404E8, 1100); setMessageList(0x004B46A8); setBackground(0x10080E01); @@ -1088,7 +1092,7 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) _asTape = insertSprite<AsScene1201Tape>(this, 13, 1100, 412, 443, 0x9148A011); _vm->_collisionMan->addSprite(_asTape); _klayman->setClipRect(_sprite1->getDrawRect().x, 0, 640, 480); - SetUpdateHandler(&Scene1608::update44CE90); + SetUpdateHandler(&Scene1608::upLowerFloor); insertMouse433(0x80E05108); insertStaticSprite(0x4B18F868, 1200); } @@ -1096,8 +1100,8 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) _vm->gameState().which = 0; setRectList(0x004B47D0); insertKlayman<KmScene1608>(0, 438); - _klayman2 = _klayman; - _flag4 = false; + _kmScene1608 = _klayman; + _klaymanInCar = false; setMessageList(0x004B46B0); setBackground(0x10080E01); setPalette(0x10080E01); @@ -1105,10 +1109,10 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) _vm->_collisionMan->addSprite(_asTape); insertMouse433(0x80E05108); _sprite1 = insertStaticSprite(0x7D0404E8, 1100); - _class546 = insertSprite<Class546>(this); + _asDoor = insertSprite<AsScene1608Door>(this); _klayman->setClipRect(_sprite1->getDrawRect().x, 0, 640, 480); - SetUpdateHandler(&Scene1608::update44CE90); - sendMessage(_class546, 0x4808, 0); + SetUpdateHandler(&Scene1608::upLowerFloor); + sendMessage(_asDoor, 0x4808, 0); insertStaticSprite(0x4B18F868, 1200); } else if (which == 2) { _vm->gameState().which = 1; @@ -1119,38 +1123,38 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) _palette->addPalette("paPodRed", 65, 31, 65); insertMouse433(0x01600988); _sprite2 = insertStaticSprite(0x491F38A8, 1100); - _class521 = createSprite<Class521>(this, 375, 227); // Create but don't add to the sprite list yet - _class547 = insertSprite<Class547>(375, 227); - _class548 = insertSprite<Class548>(375, 227); - _class521->setVisible(false); + _asCar = createSprite<AsCommonCar>(this, 375, 227); // Create but don't add to the sprite list yet + _asIdleCarLower = insertSprite<AsScene1608IdleCarLower>(375, 227); + _asIdleCarFull = insertSprite<AsScene1608IdleCarFull>(375, 227); + _asCar->setVisible(false); if (getGlobalVar(0xC0418A02)) { insertKlayman<KmScene1608>(373, 220); _klayman->setDoDeltaX(1); } else { insertKlayman<KmScene1608>(283, 220); } - _klayman2 = _klayman; + _kmScene1608 = _klayman; setMessageList(0x004B47A8); - SetMessageHandler(&Scene1608::handleMessage44D3C0); - SetUpdateHandler(&Scene1608::update44CED0); + SetMessageHandler(&Scene1608::hmUpperFloor); + SetUpdateHandler(&Scene1608::upUpperFloor); // NOTE: Setting the point array was handled by messages 0x2000 (array) and 0x2001 (count) in the original - _class521->setPathPoints(_roomPathPoints); - sendMessage(_class521, 0x2002, _roomPathPoints->size() - 1); + _asCar->setPathPoints(_roomPathPoints); + sendMessage(_asCar, 0x2002, _roomPathPoints->size() - 1); _sprite3 = insertStaticSprite(0xB47026B0, 1100); _rect1.set(_sprite3->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2()); _rect3.set(_sprite2->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2()); _rect2 = _rect1; _rect2.y2 = 215; _klayman->setClipRect(_rect1); - _class521->setClipRect(_rect1); - _class547->setClipRect(_rect1); - _class548->setClipRect(_rect1); + _asCar->setClipRect(_rect1); + _asIdleCarLower->setClipRect(_rect1); + _asIdleCarFull->setClipRect(_rect1); _asTape = insertSprite<AsScene1201Tape>(this, 13, 1100, 412, 443, 0x9148A011); _vm->_collisionMan->addSprite(_asTape); - insertSprite<Class518>(_class521)->setClipRect(_rect1); - _flag4 = false; - _flag2 = false; - _flag1 = 0; + insertSprite<AsCommonCarConnector>(_asCar)->setClipRect(_rect1); + _klaymanInCar = false; + _carClipFlag = false; + _carStatus = 0; setRectList(0x004B4810); } @@ -1163,36 +1167,36 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) setPalette(0x98001604); _palette->addPalette("paPodRed", 65, 31, 65); insertMouse433(0x01600988); - _class521 = insertSprite<Class521>(this, 375, 227); - _class547 = insertSprite<Class547>(375, 227); - _class548 = insertSprite<Class548>(375, 227); + _asCar = insertSprite<AsCommonCar>(this, 375, 227); + _asIdleCarLower = insertSprite<AsScene1608IdleCarLower>(375, 227); + _asIdleCarFull = insertSprite<AsScene1608IdleCarFull>(375, 227); _sprite2 = insertStaticSprite(0x491F38A8, 1100); - _klayman2 = createSprite<KmScene1608>(this, 439, 220); // Special Klayman handling... - sendMessage(_klayman2, 0x2032, 1); - _klayman2->setDoDeltaX(1); - SetMessageHandler(&Scene1608::handleMessage44D470); - SetUpdateHandler(&Scene1608::update44D1E0); - _class547->setVisible(false); - _class548->setVisible(false); + _kmScene1608 = createSprite<KmScene1608>(this, 439, 220); // Special Klayman handling... + sendMessage(_kmScene1608, 0x2032, 1); + _kmScene1608->setDoDeltaX(1); + SetMessageHandler(&Scene1608::hmRidingCar); + SetUpdateHandler(&Scene1608::upRidingCar); + _asIdleCarLower->setVisible(false); + _asIdleCarFull->setVisible(false); // NOTE: Setting the point array was handled by messages 0x2000 (array) and 0x2001 (count) in the original - _class521->setPathPoints(_roomPathPoints); - sendMessage(_class521, 0x2002, 0); - sendMessage(_class521, 0x2008, 90); + _asCar->setPathPoints(_roomPathPoints); + sendMessage(_asCar, 0x2002, 0); + sendMessage(_asCar, 0x2008, 90); _sprite3 = insertStaticSprite(0xB47026B0, 1100); _rect1.set(_sprite3->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2()); _rect3.set(_sprite2->getDrawRect().x, _sprite3->getDrawRect().y, 640, _sprite2->getDrawRect().y2()); _rect2 = _rect1; _rect2.y2 = 215; - _klayman2->setClipRect(_rect1); - _class521->setClipRect(_rect1); - _class547->setClipRect(_rect1); - _class548->setClipRect(_rect1); + _kmScene1608->setClipRect(_rect1); + _asCar->setClipRect(_rect1); + _asIdleCarLower->setClipRect(_rect1); + _asIdleCarFull->setClipRect(_rect1); _asTape = insertSprite<AsScene1201Tape>(this, 13, 1100, 412, 443, 0x9148A011); // ... _vm->_collisionMan->addSprite(_asTape); - insertSprite<Class518>(_class521)->setClipRect(_rect1); - _flag4 = true; - _flag2 = true; - _flag1 = 0; + insertSprite<AsCommonCarConnector>(_asCar)->setClipRect(_rect1); + _klaymanInCar = true; + _carClipFlag = true; + _carStatus = 0; } _palette->addPalette("paKlayRed", 0, 64, 0); @@ -1200,113 +1204,100 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) } Scene1608::~Scene1608() { - setGlobalVar(0xC0418A02, _klayman2->isDoDeltaX() ? 1 : 0); - // Weird - if (_flag4) { - delete _klayman2; + setGlobalVar(0xC0418A02, _kmScene1608->isDoDeltaX() ? 1 : 0); + if (_klaymanInCar) { + delete _kmScene1608; } else { - delete _class521; + delete _asCar; } } -void Scene1608::update44CE90() { +void Scene1608::upLowerFloor() { Scene::update(); if (_countdown1 != 0 && (--_countdown1 == 0)) { leaveScene(0); } } -void Scene1608::update44CED0() { +void Scene1608::upUpperFloor() { Scene::update(); - if (_flag1 == 1) { + if (_carStatus == 1) { removeSurface(_klayman->getSurface()); removeEntity(_klayman); - addSprite(_class521); - _flag4 = true; + addSprite(_asCar); + _klaymanInCar = true; clearRectList(); - SetUpdateHandler(&Scene1608::update44CFE0); - SetMessageHandler(&Scene1608::handleMessage44D510); - _class547->setVisible(false); - _class548->setVisible(false); - _class521->setVisible(true); - sendMessage(_class521, 0x2009, 0); - _class521->handleUpdate(); + SetUpdateHandler(&Scene1608::upCarAtHome); + SetMessageHandler(&Scene1608::hmCarAtHome); + _asIdleCarLower->setVisible(false); + _asIdleCarFull->setVisible(false); + _asCar->setVisible(true); + sendMessage(_asCar, 0x2009, 0); + _asCar->handleUpdate(); _klayman = NULL; - _flag1 = 0; - } - if (_klayman2->getX() <= 375) { - _klayman2->setClipRect(_rect1); - } else { - _klayman2->setClipRect(_rect2); + _carStatus = 0; } + updateKlaymanCliprect(); } -void Scene1608::update44CFE0() { +void Scene1608::upCarAtHome() { Scene::update(); if (_mouseClicked) { - if (_mouseClickPos.x <= 329 && _class521->getX() == 375 && _class521->getY() == 227) { - sendMessage(_class521, 0x200A, 0); - SetUpdateHandler(&Scene1608::update44D0C0); + if (_mouseClickPos.x <= 329 && _asCar->getX() == 375 && _asCar->getY() == 227) { + sendMessage(_asCar, 0x200A, 0); + SetUpdateHandler(&Scene1608::upGettingOutOfCar); } else { - sendPointMessage(_class521, 0x2004, _mouseClickPos); - SetMessageHandler(&Scene1608::handleMessage44D470); - SetUpdateHandler(&Scene1608::update44D1E0); + sendPointMessage(_asCar, 0x2004, _mouseClickPos); + SetMessageHandler(&Scene1608::hmRidingCar); + SetUpdateHandler(&Scene1608::upRidingCar); } _mouseClicked = false; } - if (_klayman2->getX() <= 375) { - _klayman2->setClipRect(_rect1); - } else { - _klayman2->setClipRect(_rect2); - } + updateKlaymanCliprect(); } -void Scene1608::update44D0C0() { +void Scene1608::upGettingOutOfCar() { Scene::update(); - if (_flag1 == 2) { - _klayman = _klayman2; - removeSurface(_class521->getSurface()); - removeEntity(_class521); + if (_carStatus == 2) { + _klayman = _kmScene1608; + removeSurface(_asCar->getSurface()); + removeEntity(_asCar); addSprite(_klayman); - _flag4 = false; - SetMessageHandler(&Scene1608::handleMessage44D3C0); - SetUpdateHandler(&Scene1608::update44CED0); + _klaymanInCar = false; + SetMessageHandler(&Scene1608::hmUpperFloor); + SetUpdateHandler(&Scene1608::update); setRectList(0x004B4810); - _class547->setVisible(true); - _class548->setVisible(true); - _class521->setVisible(false); + _asIdleCarLower->setVisible(true); + _asIdleCarFull->setVisible(true); + _asCar->setVisible(false); setMessageList(0x004B4748); runMessageList(); _klayman->handleUpdate(); - _flag1 = 0; - } - if (_klayman2->getX() <= 375) { - _klayman2->setClipRect(_rect1); - } else { - _klayman2->setClipRect(_rect2); + _carStatus = 0; } + updateKlaymanCliprect(); } -void Scene1608::update44D1E0() { +void Scene1608::upRidingCar() { Scene::update(); if (_mouseClicked) { - sendPointMessage(_class521, 0x2004, _mouseClickPos); + sendPointMessage(_asCar, 0x2004, _mouseClickPos); _mouseClicked = false; } - if (_class521->getX() < 300) { - if (_flag2) { - _flag2 = false; - _class521->setClipRect(_rect1); - if (!_class521->isDoDeltaX()) - sendMessage(_class521, 0x200E, 0); + if (_asCar->getX() < 300) { + if (_carClipFlag) { + _carClipFlag = false; + _asCar->setClipRect(_rect1); + if (!_asCar->isDoDeltaX()) + sendMessage(_asCar, 0x200E, 0); } - } else if (!_flag2) { - _flag2 = true; - _class521->setClipRect(_rect3); + } else if (!_carClipFlag) { + _carClipFlag = true; + _asCar->setClipRect(_rect3); } } -uint32 Scene1608::handleMessage44D2A0(int messageNum, const MessageParam ¶m, Entity *sender) { +uint32 Scene1608::hmLowerFloor(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: @@ -1315,7 +1306,7 @@ uint32 Scene1608::handleMessage44D2A0(int messageNum, const MessageParam ¶m, _klayman->setVisible(false); showMouse(false); _sprite1->setVisible(false); - sendMessage(_class546, 0x4809, 0); + sendMessage(_asDoor, 0x4809, 0); _countdown1 = 28; } break; @@ -1324,7 +1315,7 @@ uint32 Scene1608::handleMessage44D2A0(int messageNum, const MessageParam ¶m, break; case 0x4826: if (sender == _asTape) { - sendEntityMessage(_klayman2, 0x1014, _asTape); + sendEntityMessage(_kmScene1608, 0x1014, _asTape); setMessageList(0x004B4770); } else if (sender == _class545) { setMessageList(0x004B46C8); @@ -1334,12 +1325,12 @@ uint32 Scene1608::handleMessage44D2A0(int messageNum, const MessageParam ¶m, return 0; } -uint32 Scene1608::handleMessage44D3C0(int messageNum, const MessageParam ¶m, Entity *sender) { +uint32 Scene1608::hmUpperFloor(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x100D: if (param.asInteger() == 0x60842040) { - _flag1 = true; + _carStatus = 1; } break; case 0x200D: @@ -1347,7 +1338,7 @@ uint32 Scene1608::handleMessage44D3C0(int messageNum, const MessageParam ¶m, break; case 0x4826: if (sender == _class545) { - sendEntityMessage(_klayman2, 0x1014, _class545); + sendEntityMessage(_kmScene1608, 0x1014, _class545); setMessageList(0x004B4760); } break; @@ -1355,16 +1346,16 @@ uint32 Scene1608::handleMessage44D3C0(int messageNum, const MessageParam ¶m, return 0; } -uint32 Scene1608::handleMessage44D470(int messageNum, const MessageParam ¶m, Entity *sender) { +uint32 Scene1608::hmRidingCar(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2005: leaveScene(1); break; case 0x2006: - SetMessageHandler(&Scene1608::handleMessage44D510); - SetUpdateHandler(&Scene1608::update44CFE0); - sendMessage(_class521, 0x200F, 1); + SetMessageHandler(&Scene1608::hmCarAtHome); + SetUpdateHandler(&Scene1608::upCarAtHome); + sendMessage(_asCar, 0x200F, 1); break; case 0x200D: sendMessage(_parentModule, 0x200D, 0); @@ -1373,11 +1364,11 @@ uint32 Scene1608::handleMessage44D470(int messageNum, const MessageParam ¶m, return 0; } -uint32 Scene1608::handleMessage44D510(int messageNum, const MessageParam ¶m, Entity *sender) { +uint32 Scene1608::hmCarAtHome(int messageNum, const MessageParam ¶m, Entity *sender) { Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x200A: - _flag1 = 2; + _carStatus = 2; break; case 0x200D: sendMessage(_parentModule, 0x200D, 0); @@ -1386,11 +1377,18 @@ uint32 Scene1608::handleMessage44D510(int messageNum, const MessageParam ¶m, return 0; } +void Scene1608::updateKlaymanCliprect() { + if (_kmScene1608->getX() <= 375) + _kmScene1608->setClipRect(_rect1); + else + _kmScene1608->setClipRect(_rect2); +} + Scene1609::Scene1609(NeverhoodEngine *vm, Module *parentModule, int which) - : Scene(vm, parentModule, true), _countdown1(1), _index1(0), _index3(0), _flag5(true), _flag6(false) { + : Scene(vm, parentModule, true), _countdown1(1), _currentSymbolIndex(0), _symbolPosition(0), _changeCurrentSymbol(true), _isSolved(false) { // TODO _vm->gameModule()->initScene3011Vars(); - _index2 = getGlobalVar(0x2414C2F2); + _noisySymbolIndex = getGlobalVar(0x2414C2F2); _surfaceFlag = true; SetMessageHandler(&Scene1609::handleMessage); @@ -1399,8 +1397,8 @@ Scene1609::Scene1609(NeverhoodEngine *vm, Module *parentModule, int which) setBackground(0x92124A14); setPalette(0x92124A14); - for (int i = 0; i < 12; i++) - _asSymbols[i] = insertSprite<AsScene3011Symbol>(i, false); + for (int symbolPosition = 0; symbolPosition < 12; symbolPosition++) + _asSymbols[symbolPosition] = insertSprite<AsScene3011Symbol>(symbolPosition, false); _ssButton = insertSprite<SsScene3011Button>(this, true); _vm->_collisionMan->addSprite(_ssButton); @@ -1412,21 +1410,21 @@ Scene1609::Scene1609(NeverhoodEngine *vm, Module *parentModule, int which) } void Scene1609::update() { - if (!_flag6 && _countdown1 != 0 && (--_countdown1 == 0)) { - if (_flag5) { - _index1++; - if (_index1 >= 12) - _index1 = 0; - _asSymbols[_index3]->change(_index1 + 12, _index1 == (int)getSubVar(0x04909A50, _index2)); - _flag5 = false; + if (!_isSolved && _countdown1 != 0 && (--_countdown1 == 0)) { + if (_changeCurrentSymbol) { + _currentSymbolIndex++; + if (_currentSymbolIndex >= 12) + _currentSymbolIndex = 0; + _asSymbols[_symbolPosition]->change(_currentSymbolIndex + 12, _currentSymbolIndex == (int)getSubVar(0x04909A50, _noisySymbolIndex)); + _changeCurrentSymbol = false; _countdown1 = 36; } else { - _asSymbols[_index3]->hide(); - _flag5 = true; + _asSymbols[_symbolPosition]->hide(); + _changeCurrentSymbol = true; _countdown1 = 12; } } - if (_flag6 && !isSoundPlaying(0)) { + if (_isSolved && !isSoundPlaying(0)) { leaveScene(1); } Scene::update(); @@ -1442,23 +1440,23 @@ uint32 Scene1609::handleMessage(int messageNum, const MessageParam ¶m, Entit break; // TODO: Debug stuff case 0x2000: - if (!_flag6) { - if (_flag5) - _asSymbols[_index3]->change(_index1 + 12, false); - _asSymbols[_index3]->stopSymbolSound(); - _index3++; - if (_index3 >= 12) { + if (!_isSolved) { + if (_changeCurrentSymbol) + _asSymbols[_symbolPosition]->change(_currentSymbolIndex + 12, false); + _asSymbols[_symbolPosition]->stopSymbolSound(); + _symbolPosition++; + if (_symbolPosition >= 12) { if (testVars()) { playSound(0); setGlobalVar(0x2C531AF8, 1); - _flag6 = true; + _isSolved = true; } else { - _index3 = 0; + _symbolPosition = 0; for (int i = 0; i < 12; i++) _asSymbols[i]->hide(); } } - _flag5 = true; + _changeCurrentSymbol = true; _countdown1 = 1; } break; @@ -1468,6 +1466,8 @@ uint32 Scene1609::handleMessage(int messageNum, const MessageParam ¶m, Entit bool Scene1609::testVars() { int index1 = 0; + + // Find the position of the first symbol do { int cmpIndex = _asSymbols[0]->getIndex(); if (!_asSymbols[0]->getFlag1()) @@ -1476,17 +1476,20 @@ bool Scene1609::testVars() { break; index1++; } while(1); + + // Check if the entered symbols match for (int index2 = 0; index2 < 12; index2++) { int cmpIndex = _asSymbols[index2]->getIndex(); if (!_asSymbols[index2]->getFlag1()) cmpIndex -= 12; if ((int)getSubVar(0x04909A50, index1) != cmpIndex) return false; - _index1++; - if (_index1 >= 12) - _index1 = 0; - _index2++; + index1++; + if (index1 >= 12) + index1 = 0; + index2++; } + return true; } diff --git a/engines/neverhood/module1600.h b/engines/neverhood/module1600.h index b5b8e6b7fc..ec31b68a0f 100644 --- a/engines/neverhood/module1600.h +++ b/engines/neverhood/module1600.h @@ -41,10 +41,10 @@ protected: void updateScene(); }; -class Class521 : public AnimatedSprite { +class AsCommonCar : public AnimatedSprite { public: - Class521(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y); - ~Class521(); + AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 y); + ~AsCommonCar(); void setPathPoints(NPointArray *pathPoints); protected: Scene *_parentScene; @@ -105,33 +105,33 @@ protected: void sub45E0A0(); }; -class Class546 : public AnimatedSprite { +class AsScene1608Door : public AnimatedSprite { public: - Class546(NeverhoodEngine *vm, Scene *parentScene); + AsScene1608Door(NeverhoodEngine *vm, Scene *parentScene); protected: Scene *_parentScene; uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); - void sub44D710(); - void sub44D760(); - void sub44D790(); - void sub44D7F0(); + void stOpenDoor(); + void stOpenDoorDone(); + void stCloseDoor(); + void stCloseDoorDone(); }; -class Class547 : public AnimatedSprite { +class AsScene1608IdleCarLower : public AnimatedSprite { public: - Class547(NeverhoodEngine *vm, int16 x, int16 y); + AsScene1608IdleCarLower(NeverhoodEngine *vm, int16 x, int16 y); }; -class Class548 : public AnimatedSprite { +class AsScene1608IdleCarFull : public AnimatedSprite { public: - Class548(NeverhoodEngine *vm, int16 x, int16 y); + AsScene1608IdleCarFull(NeverhoodEngine *vm, int16 x, int16 y); }; -class Class518 : public AnimatedSprite { +class AsCommonCarConnector : public AnimatedSprite { public: - Class518(NeverhoodEngine *vm, Class521 *class521); + AsCommonCarConnector(NeverhoodEngine *vm, AsCommonCar *asCar); protected: - Class521 *_class521; + AsCommonCar *_asCar; void update(); }; @@ -140,34 +140,34 @@ public: Scene1608(NeverhoodEngine *vm, Module *parentModule, int which); ~Scene1608(); protected: - Class521 *_class521; + AsCommonCar *_asCar; Sprite *_class545; - Sprite *_class546; - Sprite *_class547; - Sprite *_class548; + Sprite *_asDoor; + Sprite *_asIdleCarLower; + Sprite *_asIdleCarFull; Sprite *_sprite1; Sprite *_sprite2; Sprite *_sprite3; Sprite *_asTape; - Klayman *_klayman2; + Klayman *_kmScene1608; NRect _rect1; NRect _rect2; NRect _rect3; - int _flag1; - bool _flag2; - bool _flag3; - bool _flag4; + int _carStatus; + bool _carClipFlag; + bool _klaymanInCar; int _countdown1; NPointArray *_roomPathPoints; - void update44CE90(); - void update44CED0(); - void update44CFE0(); - void update44D0C0(); - void update44D1E0(); - uint32 handleMessage44D2A0(int messageNum, const MessageParam ¶m, Entity *sender); - uint32 handleMessage44D3C0(int messageNum, const MessageParam ¶m, Entity *sender); - uint32 handleMessage44D470(int messageNum, const MessageParam ¶m, Entity *sender); - uint32 handleMessage44D510(int messageNum, const MessageParam ¶m, Entity *sender); + void upLowerFloor(); + void upUpperFloor(); + void upCarAtHome(); + void upGettingOutOfCar(); + void upRidingCar(); + uint32 hmLowerFloor(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 hmUpperFloor(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 hmRidingCar(int messageNum, const MessageParam ¶m, Entity *sender); + uint32 hmCarAtHome(int messageNum, const MessageParam ¶m, Entity *sender); + void updateKlaymanCliprect(); }; class Scene1609 : public Scene { @@ -176,12 +176,12 @@ public: protected: Sprite *_ssButton; AsScene3011Symbol *_asSymbols[12]; - int _index1; - int _index2; - int _index3; + int _currentSymbolIndex; + int _noisySymbolIndex; + int _symbolPosition; int _countdown1; - bool _flag5; - bool _flag6; + bool _changeCurrentSymbol; + bool _isSolved; void update(); uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender); bool testVars(); diff --git a/engines/neverhood/module2500.cpp b/engines/neverhood/module2500.cpp index cc0dda9837..26d0d88de1 100644 --- a/engines/neverhood/module2500.cpp +++ b/engines/neverhood/module2500.cpp @@ -249,7 +249,7 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which) _class437 = createSprite<Class437>(0x99BE9015); // Don't add this to the sprite list addEntity(_class437); - _class521 = createSprite<Class521>(this, 211, 400); // Create but don't add to the sprite list yet + _asCar = createSprite<AsCommonCar>(this, 211, 400); // Create but don't add to the sprite list yet _class541 = insertSprite<Class541>(211, 400); _class542 = insertSprite<Class542>(211, 400); insertStaticSprite(0xC42AC521, 1500); @@ -262,11 +262,11 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which) setRectList(0x004B2608); SetMessageHandler(&Scene2501::handleMessage); SetUpdateHandler(&Scene2501::update); - sendMessage(_class521, 0x2009, 0); - _class521->setVisible(false); + sendMessage(_asCar, 0x2009, 0); + _asCar->setVisible(false); _currTrackIndex = 0; } else if (which == 1 || which == 2) { - addSprite(_class521); + addSprite(_asCar); _kmScene2501 = (Klayman*)new KmScene2501(_vm, this, 275, 393); _klaymanInCar = true; sendMessage(_kmScene2501, 0x2000, 1); @@ -284,33 +284,33 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which) setRectList(0x004B2608); SetMessageHandler(&Scene2501::handleMessage); SetUpdateHandler(&Scene2501::update); - sendMessage(_class521, 0x2009, 0); - _class521->setVisible(false); + sendMessage(_asCar, 0x2009, 0); + _asCar->setVisible(false); _currTrackIndex = 0; } - _class517 = insertSprite<Class517>(_class521, _class437->getSurface(), 4); - _class520 = insertSprite<Class520>(_class521, _class437->getSurface(), 4); - _class519 = insertSprite<Class519>(_class521, _class437->getSurface(), 4); - insertSprite<Class518>(_class521); + _class517 = insertSprite<Class517>(_asCar, _class437->getSurface(), 4); + _class520 = insertSprite<Class520>(_asCar, _class437->getSurface(), 4); + _class519 = insertSprite<Class519>(_asCar, _class437->getSurface(), 4); + insertSprite<AsCommonCarConnector>(_asCar); _pointListsCount = 3; _newTrackIndex = -1; _dataResource.load(calcHash("Ashooded")); _trackPoints = _dataResource.getPointArray(_sceneInfos[_currTrackIndex]->pointListName); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (which >= 0 && _sceneInfos[_currTrackIndex]->which2 == which) { NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1]; - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480) - sendMessage(_class521, 0x2007, 150); + sendMessage(_asCar, 0x2007, 150); } else { NPoint testPoint = (*_trackPoints)[0]; - sendMessage(_class521, 0x2002, 0); + sendMessage(_asCar, 0x2002, 0); if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480) - sendMessage(_class521, 0x2008, 150); + sendMessage(_asCar, 0x2008, 150); } _carStatus = 0; @@ -322,23 +322,23 @@ Scene2501::~Scene2501() { if (_klaymanInCar) delete _kmScene2501; else - delete _class521; + delete _asCar; } void Scene2501::update() { Scene::update(); if (_carStatus == 1) { removeSprite(_klayman); - addSprite(_class521); + addSprite(_asCar); clearRectList(); _klaymanInCar = true; SetMessageHandler(&Scene2501::hmCarAtHome); SetUpdateHandler(&Scene2501::upCarAtHome); _class541->setVisible(false); _class542->setVisible(false); - _class521->setVisible(true); - sendMessage(_class521, 0x2009, 0); - _class521->handleUpdate(); + _asCar->setVisible(true); + sendMessage(_asCar, 0x2009, 0); + _asCar->handleUpdate(); _klayman = NULL; _carStatus = 0; } @@ -348,8 +348,8 @@ void Scene2501::update() { void Scene2501::upCarAtHome() { Scene::update(); if (_mouseClicked) { - if (_mouseClickPos.x <= 210 && _class521->getX() == 211 && _class521->getY() == 400) { - sendMessage(_class521, 0x200A, 0); + if (_mouseClickPos.x <= 210 && _asCar->getX() == 211 && _asCar->getY() == 400) { + sendMessage(_asCar, 0x200A, 0); SetUpdateHandler(&Scene2501::upGettingOutOfCar); } else { findClosestTrack(_mouseClickPos); @@ -365,7 +365,7 @@ void Scene2501::upGettingOutOfCar() { Scene::update(); if (_carStatus == 2) { _klayman = _kmScene2501; - removeSprite(_class521); + removeSprite(_asCar); addSprite(_klayman); _klaymanInCar = false; SetMessageHandler(&Scene2501::handleMessage); @@ -373,7 +373,7 @@ void Scene2501::upGettingOutOfCar() { setRectList(0x004B2608); _class541->setVisible(true); _class542->setVisible(true); - _class521->setVisible(false); + _asCar->setVisible(false); setMessageList(0x004B2570); runMessageList(); _klayman->handleUpdate(); @@ -413,7 +413,7 @@ uint32 Scene2501::hmRidingCar(int messageNum, const MessageParam ¶m, Entity } else if (_sceneInfos[_currTrackIndex]->which1 == 0) { SetMessageHandler(&Scene2501::hmCarAtHome); SetUpdateHandler(&Scene2501::upCarAtHome); - sendMessage(_class521, 0x200F, 1); + sendMessage(_asCar, 0x200F, 1); } else if (_sceneInfos[_currTrackIndex]->which1 > 0) { leaveScene(_sceneInfos[_currTrackIndex]->which1); } @@ -424,7 +424,7 @@ uint32 Scene2501::hmRidingCar(int messageNum, const MessageParam ¶m, Entity } else if (_sceneInfos[_currTrackIndex]->which2 == 0) { SetMessageHandler(&Scene2501::hmCarAtHome); SetUpdateHandler(&Scene2501::upCarAtHome); - sendMessage(_class521, 0x200F, 1); + sendMessage(_asCar, 0x200F, 1); } else if (_sceneInfos[_currTrackIndex]->which2 > 0) { leaveScene(_sceneInfos[_currTrackIndex]->which2); } @@ -452,13 +452,13 @@ uint32 Scene2501::hmCarAtHome(int messageNum, const MessageParam ¶m, Entity void Scene2501::changeTrack() { _currTrackIndex = _newTrackIndex; _trackPoints = _dataResource.getPointArray(_sceneInfos[_currTrackIndex]->pointListName); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (_currTrackIndex == 0) { - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); } else { - sendMessage(_class521, 0x2002, 0); + sendMessage(_asCar, 0x2002, 0); } - sendPointMessage(_class521, 0x2004, _clickPoint); + sendPointMessage(_asCar, 0x2004, _clickPoint); _newTrackIndex = -1; } @@ -482,12 +482,12 @@ void Scene2501::findClosestTrack(NPoint &pt) { _newTrackIndex = minMatchTrackIndex; _clickPoint = pt; if (_currTrackIndex == 0) - sendMessage(_class521, 0x2003, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2003, _trackPoints->size() - 1); else - sendMessage(_class521, 0x2003, 0); + sendMessage(_asCar, 0x2003, 0); } else { _newTrackIndex = -1; - sendMessage(_class521, 0x2004, pt); + sendMessage(_asCar, 0x2004, pt); } } diff --git a/engines/neverhood/module2500.h b/engines/neverhood/module2500.h index fb61ba5010..e5b915761a 100644 --- a/engines/neverhood/module2500.h +++ b/engines/neverhood/module2500.h @@ -61,7 +61,7 @@ public: Scene2501(NeverhoodEngine *vm, Module *parentModule, int which); virtual ~Scene2501(); protected: - Class521 *_class521; + AsCommonCar *_asCar; Sprite *_class437; Sprite *_class517; Sprite *_class519; diff --git a/engines/neverhood/module2700.cpp b/engines/neverhood/module2700.cpp index f9a5c2abce..7c93aa7c9a 100644 --- a/engines/neverhood/module2700.cpp +++ b/engines/neverhood/module2700.cpp @@ -523,8 +523,8 @@ Class437::Class437(NeverhoodEngine *vm, uint32 fileHash) StaticSprite::update(); } -Class517::Class517(NeverhoodEngine *vm, AnimatedSprite *class521, BaseSurface *shadowSurface, uint index) - : AnimatedSprite(vm, 1100), _class521(class521), _index(index), _animFileHash(0) { +Class517::Class517(NeverhoodEngine *vm, AnimatedSprite *asCar, BaseSurface *shadowSurface, uint index) + : AnimatedSprite(vm, 1100), _asCar(asCar), _index(index), _animFileHash(0) { SetUpdateHandler(&Class517::update); createShadowSurface(shadowSurface, 320, 240, 100); // TODO Use actual dimensions from resource @@ -537,28 +537,28 @@ void Class517::update() { } void Class517::updateShadow() { - if (_class521->getFrameIndex() != _currFrameIndex || _class521->getCurrAnimFileHash() != _animFileHash) { - uint32 fileHash = _class521->getCurrAnimFileHash(); + if (_asCar->getFrameIndex() != _currFrameIndex || _asCar->getCurrAnimFileHash() != _animFileHash) { + uint32 fileHash = _asCar->getCurrAnimFileHash(); if (fileHash == 0x35698F78 || fileHash == 0x192ADD30 || fileHash == 0x9C220DA4 || fileHash == 0x9966B138 || fileHash == 0xB579A77C || fileHash == 0xA86A9538 || fileHash == 0xD4220027 || fileHash == 0xD00A1364 || fileHash == 0xD4AA03A4 || fileHash == 0xF46A0324) { - startAnimation(fileHash, _class521->getFrameIndex(), -1); - _newStickFrameIndex = _class521->getFrameIndex(); + startAnimation(fileHash, _asCar->getFrameIndex(), -1); + _newStickFrameIndex = _asCar->getFrameIndex(); } _animFileHash = fileHash; } - _x = _class521->getX() + kClass517Points[_index].x; - _y = _class521->getY() + kClass517Points[_index].y; - if (!_class521->getVisible()) { + _x = _asCar->getX() + kClass517Points[_index].x; + _y = _asCar->getY() + kClass517Points[_index].y; + if (!_asCar->getVisible()) { startAnimation(0x1209E09F, 0, -1); _newStickFrameIndex = 0; } - setDoDeltaX(_class521->isDoDeltaX() ? 1 : 0); + setDoDeltaX(_asCar->isDoDeltaX() ? 1 : 0); } -Class519::Class519(NeverhoodEngine *vm, Sprite *class521, BaseSurface *shadowSurface, uint index) - : AnimatedSprite(vm, 1100), _class521(class521), _index(index) { +Class519::Class519(NeverhoodEngine *vm, Sprite *asCar, BaseSurface *shadowSurface, uint index) + : AnimatedSprite(vm, 1100), _asCar(asCar), _index(index) { SetUpdateHandler(&Class519::update); createShadowSurface1(shadowSurface, 0x60281C10, 150); @@ -567,13 +567,13 @@ Class519::Class519(NeverhoodEngine *vm, Sprite *class521, BaseSurface *shadowSur } void Class519::update() { - _x = _class521->getX() + kClass517Points[_index].x; - _y = _class521->getY() + kClass517Points[_index].y; + _x = _asCar->getX() + kClass517Points[_index].x; + _y = _asCar->getY() + kClass517Points[_index].y; AnimatedSprite::update(); } -Class520::Class520(NeverhoodEngine *vm, Sprite *class521, BaseSurface *shadowSurface, int16 frameIndex) - : AnimatedSprite(vm, 1100), _class521(class521) { +Class520::Class520(NeverhoodEngine *vm, Sprite *asCar, BaseSurface *shadowSurface, int16 frameIndex) + : AnimatedSprite(vm, 1100), _asCar(asCar) { SetUpdateHandler(&Class520::update); createShadowSurface1(shadowSurface, 0x0759129C, 100); @@ -582,8 +582,8 @@ Class520::Class520(NeverhoodEngine *vm, Sprite *class521, BaseSurface *shadowSur } void Class520::update() { - _x = _class521->getX(); - _y = _class521->getY(); + _x = _asCar->getX(); + _y = _asCar->getY(); AnimatedSprite::update(); } @@ -613,43 +613,43 @@ Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which) _class437 = createSprite<Class437>(sceneInfo->class437Filename); addEntity(_class437); - _class521 = insertSprite<Class521>(this, 320, 240); - _class517 = insertSprite<Class517>(_class521, _class437->getSurface(), 4); - _class520 = insertSprite<Class520>(_class521, _class437->getSurface(), 4); - _class519 = insertSprite<Class519>(_class521, _class437->getSurface(), 4); + _asCar = insertSprite<AsCommonCar>(this, 320, 240); + _class517 = insertSprite<Class517>(_asCar, _class437->getSurface(), 4); + _class520 = insertSprite<Class520>(_asCar, _class437->getSurface(), 4); + _class519 = insertSprite<Class519>(_asCar, _class437->getSurface(), 4); } else { _class437 = NULL; - _class521 = insertSprite<Class521>(this, 320, 240); + _asCar = insertSprite<AsCommonCar>(this, 320, 240); } - _class518 = insertSprite<Class518>(_class521); + _asCarConnector = insertSprite<AsCommonCarConnector>(_asCar); _which1 = sceneInfo->which1; _which2 = sceneInfo->which2; _dataResource.load(sceneInfo->dataResourceFilename); _trackPoints = _dataResource.getPointArray(sceneInfo->pointListName); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (which == _which2) { NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1]; - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480) - sendMessage(_class521, 0x2007, 150); + sendMessage(_asCar, 0x2007, 150); } else { NPoint testPoint = (*_trackPoints)[0]; - sendMessage(_class521, 0x2002, 0); + sendMessage(_asCar, 0x2002, 0); if (testPoint.x < 0 || testPoint.x >= 640 || testPoint.y < 0 || testPoint.y >= 480) - sendMessage(_class521, 0x2008, 150); + sendMessage(_asCar, 0x2008, 150); } - _class521->setClipRect(clipRect); - _class518->setClipRect(clipRect); + _asCar->setClipRect(clipRect); + _asCarConnector->setClipRect(clipRect); if (which == 1) { SetMessageHandler(&Scene2701::handleMessage42F500); } else { - sendMessage(_class521, 0x2009, 0); + sendMessage(_asCar, 0x2009, 0); SetMessageHandler(&Scene2701::handleMessage42F600); } @@ -659,7 +659,7 @@ uint32 Scene2701::handleMessage42F500(int messageNum, const MessageParam ¶m, Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x0001: - sendPointMessage(_class521, 0x2004, param.asPoint()); + sendPointMessage(_asCar, 0x2004, param.asPoint()); break; case 0x2005: if (_which1 >= 0) @@ -683,7 +683,7 @@ uint32 Scene2701::handleMessage42F600(int messageNum, const MessageParam ¶m, if (param.asPoint().x >= 385) { leaveScene(0); } else { - sendPointMessage(_class521, 0x2004, param.asPoint()); + sendPointMessage(_asCar, 0x2004, param.asPoint()); SetMessageHandler(&Scene2701::handleMessage42F500); } break; @@ -723,11 +723,11 @@ Scene2702::Scene2702(NeverhoodEngine *vm, Module *parentModule, int which) _class437 = createSprite<Class437>(0x12002035); addEntity(_class437); - _class521 = insertSprite<Class521>(this, 320, 240); - _class517 = insertSprite<Class517>(_class521, _class437->getSurface(), 4); - insertSprite<Class518>(_class521); - _class520 = insertSprite<Class520>(_class521, _class437->getSurface(), 4); - _class519 = insertSprite<Class519>(_class521, _class437->getSurface(), 4); + _asCar = insertSprite<AsCommonCar>(this, 320, 240); + _class517 = insertSprite<Class517>(_asCar, _class437->getSurface(), 4); + insertSprite<AsCommonCarConnector>(_asCar); + _class520 = insertSprite<Class520>(_asCar, _class437->getSurface(), 4); + _class519 = insertSprite<Class519>(_asCar, _class437->getSurface(), 4); _dataResource.load(0x04310014); @@ -761,14 +761,14 @@ Scene2702::Scene2702(NeverhoodEngine *vm, Module *parentModule, int which) } _trackPoints = _dataResource.getPointArray(_currSceneInfos[_currTrackIndex]->pointListName); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (which == _currSceneInfos[_currTrackIndex]->which2) { - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); - sendMessage(_class521, 0x2007, 150); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2007, 150); } else { - sendMessage(_class521, 0x2002, 0); - sendMessage(_class521, 0x2008, 150); + sendMessage(_asCar, 0x2002, 0); + sendMessage(_asCar, 0x2008, 150); } _palette->copyBasePalette(0, 256, 0); @@ -777,13 +777,13 @@ Scene2702::Scene2702(NeverhoodEngine *vm, Module *parentModule, int which) void Scene2702::update() { Scene::update(); - if (_flag1 && _class521->getX() > 422) { + if (_flag1 && _asCar->getX() > 422) { debug("fade #1"); _palette->addBasePalette(calcHash("paPodShade"), 65, 31, 65); _palette->addBasePalette(calcHash("paKlayShade"), 0, 65, 0); _palette->startFadeToPalette(12); _flag1 = false; - } else if (!_flag1 && _class521->getX() <= 422) { + } else if (!_flag1 && _asCar->getX() <= 422) { debug("fade #2"); _palette->addBasePalette(calcHash("paPodFloor"), 65, 31, 65); _palette->addBasePalette(calcHash("paKlayFloor"), 0, 65, 0); @@ -839,35 +839,35 @@ void Scene2702::findClosestTrack(NPoint pt) { _newTrackDestX = pt.x; if (_currSceneInfos == _sceneInfos[0]) { if (_currTrackIndex == 0) - sendMessage(_class521, 0x2003, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2003, _trackPoints->size() - 1); else - sendMessage(_class521, 0x2003, 0); + sendMessage(_asCar, 0x2003, 0); } else if (_currTrackIndex == 2) { - sendMessage(_class521, 0x2003, 0); + sendMessage(_asCar, 0x2003, 0); } else { - sendMessage(_class521, 0x2003, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2003, _trackPoints->size() - 1); } } else { _newTrackIndex = -1; - sendMessage(_class521, 0x2004, pt.x); + sendMessage(_asCar, 0x2004, pt.x); } } void Scene2702::changeTrack() { _currTrackIndex = _newTrackIndex; _trackPoints = _dataResource.getPointArray(_currSceneInfos[_currTrackIndex]->pointListName); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (_currSceneInfos == _sceneInfos[0]) { if (_currTrackIndex == 0) - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); else - sendMessage(_class521, 0x2002, 0); + sendMessage(_asCar, 0x2002, 0); } else if (_currTrackIndex == 2) { - sendMessage(_class521, 0x2002, 0); + sendMessage(_asCar, 0x2002, 0); } else { - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); } - sendMessage(_class521, 0x2004, _newTrackDestX); + sendMessage(_asCar, 0x2004, _newTrackDestX); _newTrackIndex = -1; } @@ -900,56 +900,56 @@ Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint3 _class437 = createSprite<Class437>(sceneInfo->class437Filename); addEntity(_class437); - _class521 = insertSprite<Class521>(this, 320, 240); - _class517 = insertSprite<Class517>(_class521, _class437->getSurface(), 4); - _class520 = insertSprite<Class520>(_class521, _class437->getSurface(), 4); - _class519 = insertSprite<Class519>(_class521, _class437->getSurface(), 4); + _asCar = insertSprite<AsCommonCar>(this, 320, 240); + _class517 = insertSprite<Class517>(_asCar, _class437->getSurface(), 4); + _class520 = insertSprite<Class520>(_asCar, _class437->getSurface(), 4); + _class519 = insertSprite<Class519>(_asCar, _class437->getSurface(), 4); } else { _class437 = NULL; _class517 = NULL; - _class521 = insertSprite<Class521>(this, 320, 240); + _asCar = insertSprite<AsCommonCar>(this, 320, 240); } - _class518 = insertSprite<Class518>(_class521); + _asCarConnector = insertSprite<AsCommonCarConnector>(_asCar); _which1 = sceneInfo->which1; _which2 = sceneInfo->which2; _dataResource.load(sceneInfo->dataResourceFilename); _trackPoints = _dataResource.getPointArray(sceneInfo->pointListName); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (sceneInfo->rectListName) { _rectList = _dataResource.getRectArray(sceneInfo->rectListName); - // TODO _class521->setPathRects(_rectList); + // TODO _asCar->setPathRects(_rectList); } if (which == _which2) { NPoint testPoint = (*_trackPoints)[_trackPoints->size() - 1]; - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); if (testPoint.x > 0 && testPoint.x < 640 && testPoint.y > 0 && testPoint.y < 480) - sendMessage(_class521, 0x2009, 0); + sendMessage(_asCar, 0x2009, 0); else - sendMessage(_class521, 0x2007, 0); + sendMessage(_asCar, 0x2007, 0); } else { NPoint testPoint = (*_trackPoints)[0]; - sendMessage(_class521, 0x2002, 0); + sendMessage(_asCar, 0x2002, 0); if (testPoint.x > 0 && testPoint.x < 640 && testPoint.y > 0 && testPoint.y < 480) - sendMessage(_class521, 0x2009, 0); + sendMessage(_asCar, 0x2009, 0); else - sendMessage(_class521, 0x2008, 0); + sendMessage(_asCar, 0x2008, 0); } if (clipRect) { - _class521->getClipRect() = *clipRect; + _asCar->getClipRect() = *clipRect; if (_class517) _class517->getClipRect() = *clipRect; if (_class520) _class520->getClipRect() = *clipRect; if (_class519) _class519->getClipRect() = *clipRect; - if (_class518) - _class518->getClipRect() = *clipRect; + if (_asCarConnector) + _asCarConnector->getClipRect() = *clipRect; } } @@ -957,7 +957,7 @@ Scene2704::Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint3 void Scene2704::update() { Scene::update(); if (_mouseClicked) { - sendPointMessage(_class521, 0x2004, _mouseClickPos); + sendPointMessage(_asCar, 0x2004, _mouseClickPos); _mouseClicked = false; } } @@ -1004,11 +1004,11 @@ Scene2706::Scene2706(NeverhoodEngine *vm, Module *parentModule, int which) _class437 = createSprite<Class437>(0x18808B88); addEntity(_class437); - _class521 = insertSprite<Class521>(this, 320, 240); - _class517 = insertSprite<Class517>(_class521, _class437->getSurface(), 4); - _class518 = insertSprite<Class518>(_class521); - _class520 = insertSprite<Class520>(_class521, _class437->getSurface(), 4); - _class519 = insertSprite<Class519>(_class521, _class437->getSurface(), 4); + _asCar = insertSprite<AsCommonCar>(this, 320, 240); + _class517 = insertSprite<Class517>(_asCar, _class437->getSurface(), 4); + _asCarConnector = insertSprite<AsCommonCarConnector>(_asCar); + _class520 = insertSprite<Class520>(_asCar, _class437->getSurface(), 4); + _class519 = insertSprite<Class519>(_asCar, _class437->getSurface(), 4); _dataResource.load(0x06000162); @@ -1020,20 +1020,20 @@ Scene2706::Scene2706(NeverhoodEngine *vm, Module *parentModule, int which) _currTrackIndex = 0; _trackPoints = _dataResource.getPointArray(calcHash(kSceneInfo2706[_currTrackIndex].pointListName)); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (which == kSceneInfo2706[_currTrackIndex].which2) { - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); if (which == 5) - sendMessage(_class521, 0x2007, 50); + sendMessage(_asCar, 0x2007, 50); else - sendMessage(_class521, 0x2007, 150); + sendMessage(_asCar, 0x2007, 150); } else { - sendMessage(_class521, 0x2002, 0); + sendMessage(_asCar, 0x2002, 0); if (which == 5) - sendMessage(_class521, 0x2008, 50); + sendMessage(_asCar, 0x2008, 50); else - sendMessage(_class521, 0x2008, 150); + sendMessage(_asCar, 0x2008, 150); } } @@ -1084,24 +1084,24 @@ void Scene2706::findClosestTrack(NPoint pt) { _newTrackIndex = minMatchTrackIndex; _newTrackDestX = pt.x; if (_currTrackIndex == 0) - sendMessage(_class521, 0x2003, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2003, _trackPoints->size() - 1); else - sendMessage(_class521, 0x2003, 0); + sendMessage(_asCar, 0x2003, 0); } else { _newTrackIndex = -1; - sendMessage(_class521, 0x2004, pt.x); + sendMessage(_asCar, 0x2004, pt.x); } } void Scene2706::changeTrack() { _currTrackIndex = _newTrackIndex; _trackPoints = _dataResource.getPointArray(calcHash(kSceneInfo2706[_currTrackIndex].pointListName)); - _class521->setPathPoints(_trackPoints); + _asCar->setPathPoints(_trackPoints); if (_currTrackIndex == 0) - sendMessage(_class521, 0x2002, _trackPoints->size() - 1); + sendMessage(_asCar, 0x2002, _trackPoints->size() - 1); else - sendMessage(_class521, 0x2002, 0); - sendMessage(_class521, 0x2004, _newTrackDestX); + sendMessage(_asCar, 0x2002, 0); + sendMessage(_asCar, 0x2004, _newTrackDestX); _newTrackIndex = -1; } diff --git a/engines/neverhood/module2700.h b/engines/neverhood/module2700.h index 70c1a802bb..b2210c5d49 100644 --- a/engines/neverhood/module2700.h +++ b/engines/neverhood/module2700.h @@ -56,10 +56,10 @@ public: class Class517 : public AnimatedSprite { public: - Class517(NeverhoodEngine *vm, AnimatedSprite *class521, BaseSurface *shadowSurface, uint index); + Class517(NeverhoodEngine *vm, AnimatedSprite *asCar, BaseSurface *shadowSurface, uint index); protected: uint _index; - AnimatedSprite *_class521; + AnimatedSprite *_asCar; uint32 _animFileHash; void update(); void updateShadow(); @@ -67,18 +67,18 @@ protected: class Class519 : public AnimatedSprite { public: - Class519(NeverhoodEngine *vm, Sprite *class521, BaseSurface *shadowSurface, uint index); + Class519(NeverhoodEngine *vm, Sprite *asCar, BaseSurface *shadowSurface, uint index); protected: uint _index; - Sprite *_class521; + Sprite *_asCar; void update(); }; class Class520 : public AnimatedSprite { public: - Class520(NeverhoodEngine *vm, Sprite *class521, BaseSurface *shadowSurface, int16 frameIndex); + Class520(NeverhoodEngine *vm, Sprite *asCar, BaseSurface *shadowSurface, int16 frameIndex); protected: - Sprite *_class521; + Sprite *_asCar; void update(); }; @@ -86,12 +86,12 @@ class Scene2701 : public Scene { public: Scene2701(NeverhoodEngine *vm, Module *parentModule, int which); protected: - Class521 *_class521; + AsCommonCar *_asCar; Sprite *_class437; Sprite *_class517; Sprite *_class520; Sprite *_class519; - Sprite *_class518; + Sprite *_asCarConnector; Sprite *_sprite1; int _which1, _which2; NPointArray *_trackPoints; @@ -103,7 +103,7 @@ class Scene2702 : public Scene { public: Scene2702(NeverhoodEngine *vm, Module *parentModule, int which); protected: - Class521 *_class521; + AsCommonCar *_asCar; Sprite *_class437; Sprite *_class517; Sprite *_class520; @@ -126,10 +126,10 @@ public: Scene2704(NeverhoodEngine *vm, Module *parentModule, int which, uint32 sceneInfoId, int16 value, const uint32 *staticSprites = NULL, const NRect *clipRect = NULL); protected: - Class521 *_class521; + AsCommonCar *_asCar; Sprite *_class437; Sprite *_class517; - Sprite *_class518; + Sprite *_asCarConnector; Sprite *_class520; Sprite *_class519; int _which1, _which2; @@ -143,10 +143,10 @@ class Scene2706 : public Scene { public: Scene2706(NeverhoodEngine *vm, Module *parentModule, int which); protected: - Class521 *_class521; + AsCommonCar *_asCar; Sprite *_class437; Sprite *_class517; - Sprite *_class518; + Sprite *_asCarConnector; Sprite *_class520; Sprite *_class519; int16 _newTrackDestX; |