diff --git a/engines/neverhood/diskplayerscene.cpp b/engines/neverhood/diskplayerscene.cpp index e20dec05299..54c33ddcaea 100644 --- a/engines/neverhood/diskplayerscene.cpp +++ b/engines/neverhood/diskplayerscene.cpp @@ -366,7 +366,7 @@ DiskplayerScene::DiskplayerScene(NeverhoodEngine *vm, Module *parentModule, int _hasAllDisks = availableDisksCount == 20; - if (_hasAllDisks && !getGlobalVar(0xC0780812)) + if (_hasAllDisks && !getGlobalVar(V_HAS_FINAL_KEY)) _dropKey = true; _finalDiskSlot = new DiskplayerSlot(_vm, this, 20, 0); @@ -421,7 +421,7 @@ void DiskplayerScene::update() { } else if (_updateStatus == kUSPlayingFinal) { if (_diskSmackerPlayer->getFrameNumber() == 133) { _asKey->stDropKey(); - setGlobalVar(0xC0780812, 1); + setGlobalVar(V_HAS_FINAL_KEY, 1); } else if (_diskSmackerPlayer->isDone()) { for (int i = 0; i < 20; i++) { _diskSlots[i]->setLocked(false); diff --git a/engines/neverhood/gamemodule.cpp b/engines/neverhood/gamemodule.cpp index 4be87854ae6..ac20138a5e8 100644 --- a/engines/neverhood/gamemodule.cpp +++ b/engines/neverhood/gamemodule.cpp @@ -301,19 +301,20 @@ void GameModule::startup() { // DEBUG>>> /* - setGlobalVar(0x0A310817, 1); + setGlobalVar(V_SEEN_MUSIC_BOX, 1); setGlobalVar(0x0A18CA33, 0); setGlobalVar(0x0112090A, 0); //setGlobalVar(0x000CF819, 1); - setGlobalVar(0x04A105B3, 2); + setGlobalVar(V_PROJECTOR_LOCATION, 2); */ + //setGlobalVar(V_ENTRANCE_OPEN, 0); + //setGlobalVar(V_DOOR_SPIKES_OPEN, 1); // <<gameState().which = 0; - _vm->gameState().sceneNum = 3; - createModule(1300, -1); + _vm->gameState().sceneNum = 5; + createModule(2200, -1); #endif #if 0 _vm->gameState().sceneNum = 0; @@ -358,7 +359,7 @@ void GameModule::startup() { createModule(2700, -1); #endif #if 0 - setGlobalVar(0x1860C990, 1); // DEBUG Make Klayman small + setGlobalVar(V_KLAYMAN_SMALL, 1); // DEBUG Make Klayman small _vm->gameState().sceneNum = 2; createModule(2800, -1); #endif @@ -378,84 +379,84 @@ void GameModule::createModule(int moduleNum, int which) { _moduleNum = moduleNum; switch (_moduleNum) { case 1000: - setGlobalVar(0x91080831, 0x03294419); + setGlobalVar(V_MODULE_NAME, 0x03294419); _childObject = new Module1000(_vm, this, which); break; case 1100: - setGlobalVar(0x91080831, 0x0002C818); + setGlobalVar(V_MODULE_NAME, 0x0002C818); _childObject = new Module1100(_vm, this, which); break; case 1200: - setGlobalVar(0x91080831, 0x00478311); + setGlobalVar(V_MODULE_NAME, 0x00478311); _childObject = new Module1200(_vm, this, which); break; case 1300: - setGlobalVar(0x91080831, 0x0061C090); + setGlobalVar(V_MODULE_NAME, 0x0061C090); _childObject = new Module1300(_vm, this, which); break; case 1400: - setGlobalVar(0x91080831, 0x00AD0012); + setGlobalVar(V_MODULE_NAME, 0x00AD0012); _childObject = new Module1400(_vm, this, which); break; case 1500: _someFlag1 = false; - setGlobalVar(0x91080831, 0x00F10114); + setGlobalVar(V_MODULE_NAME, 0x00F10114); _childObject = new Module1500(_vm, this, which, true); break; case 1600: - setGlobalVar(0x91080831, 0x01A008D8); + setGlobalVar(V_MODULE_NAME, 0x01A008D8); _childObject = new Module1600(_vm, this, which); break; case 1700: - setGlobalVar(0x91080831, 0x04212331); + setGlobalVar(V_MODULE_NAME, 0x04212331); _childObject = new Module1700(_vm, this, which); break; case 1800: - setGlobalVar(0x91080831, 0x04A14718); + setGlobalVar(V_MODULE_NAME, 0x04A14718); _childObject = new Module1800(_vm, this, which); break; case 1900: - setGlobalVar(0x91080831, 0x04E1C09C); + setGlobalVar(V_MODULE_NAME, 0x04E1C09C); _childObject = new Module1900(_vm, this, which); break; case 2000: - setGlobalVar(0x91080831, 0x08250000); + setGlobalVar(V_MODULE_NAME, 0x08250000); _childObject = new Module2000(_vm, this, which); break; case 2100: - setGlobalVar(0x91080831, 0x10A10C14); + setGlobalVar(V_MODULE_NAME, 0x10A10C14); _childObject = new Module2100(_vm, this, which); break; case 2200: - setGlobalVar(0x91080831, 0x11391412); + setGlobalVar(V_MODULE_NAME, 0x11391412); _childObject = new Module2200(_vm, this, which); break; case 2300: - setGlobalVar(0x91080831, 0x1A214010); + setGlobalVar(V_MODULE_NAME, 0x1A214010); _childObject = new Module2300(_vm, this, which); break; case 2400: - setGlobalVar(0x91080831, 0x202D1010); + setGlobalVar(V_MODULE_NAME, 0x202D1010); _childObject = new Module2400(_vm, this, which); break; case 2500: - setGlobalVar(0x91080831, 0x29220120); + setGlobalVar(V_MODULE_NAME, 0x29220120); _childObject = new Module2500(_vm, this, which); break; case 2600: - setGlobalVar(0x91080831, 0x40271018); + setGlobalVar(V_MODULE_NAME, 0x40271018); _childObject = new Module2600(_vm, this, which); break; case 2700: - setGlobalVar(0x91080831, 0x42212411); + setGlobalVar(V_MODULE_NAME, 0x42212411); _childObject = new Module2700(_vm, this, which); break; case 2800: - setGlobalVar(0x91080831, 0x64210814); + setGlobalVar(V_MODULE_NAME, 0x64210814); _childObject = new Module2800(_vm, this, which); break; case 3000: - setGlobalVar(0x91080831, 0x81293110); + setGlobalVar(V_MODULE_NAME, 0x81293110); _childObject = new Module3000(_vm, this, which); break; default: @@ -482,7 +483,7 @@ void GameModule::updateModule() { if (_moduleResult == 0) { createModule(2900, 2); } else { - setGlobalVar(0xD0A14D10, 1); + setGlobalVar(V_ENTRANCE_OPEN, 1); createModule(1300, 0); } break; diff --git a/engines/neverhood/gamevars.h b/engines/neverhood/gamevars.h index 863aa1b2c17..a99459fb6af 100644 --- a/engines/neverhood/gamevars.h +++ b/engines/neverhood/gamevars.h @@ -28,6 +28,102 @@ namespace Neverhood { +enum { + // Misc + V_MODULE_NAME = 0x91080831, // Currently active module name hash + V_DEBUG = 0xA4014072, // Original debug-flag, can probably be removed + V_SMACKER_CAN_ABORT = 0x06C02850, // Not set anywhere (yet), seems like a debug flag + V_KEY3_LOCATION = 0x13382860, // Location of the third key + V_TEXT_FLAG1 = 0x8440001F, + V_TEXT_INDEX = 0x01830201, + V_TEXT_COUNTING_INDEX1 = 0x29408F00, + V_TEXT_COUNTING_INDEX2 = 0x8A140C21, + V_TALK_COUNTING_INDEX = 0xA0808898, + V_FRUIT_COUNTING_INDEX = 0x40040831, + V_NOISY_SYMBOL_INDEX = 0x2414C2F2, + V_COLUMN_BACK_NAME = 0x4CE79018, + V_COLUMN_TEXT_NAME = 0xC8C28808, + V_CLICKED_COLUMN_INDEX = 0x48A68852, + V_CLICKED_COLUMN_ROW = 0x49C40058, + V_MUSIC_NAME = 0x89A82A15, + // Klayman + V_KLAYMAN_SMALL = 0x1860C990, // Is Klayman small? + V_KLAYMAN_FRAMEINDEX = 0x18288913, + V_KLAYMAN_IS_DELTA_X = 0xC0418A02, + V_KLAYMAN_SAVED_X = 0x00D30138, + V_CAR_DELTA_X = 0x21E60190, + // Flags + V_CRYSTAL_COLORS_INIT = 0xDE2EC914, + V_TV_JOKE_TOLD = 0x92603A79, + V_NOTES_DOOR_UNLOCKED = 0x0045D021, + V_WATER_RUNNING = 0x4E0BE910, + V_CREATURE_ANGRY = 0x0A310817, // After having played with the music box + V_BEEN_SHRINKING_ROOM = 0x1C1B8A9A, + V_BEEN_STATUE_ROOM = 0xCB45DE03, + V_MOUSE_PUZZLE_SOLVED = 0x70A1189C, + V_NOTES_PUZZLE_SOLVED = 0x86615030, + V_TILE_PUZZLE_SOLVED = 0x404290D5, + V_STAIRS_PUZZLE_SOLVED = 0xA9035F60, + V_SPIKES_RETRACTED = 0x18890C91, + V_LARGE_DOOR_NUMBER = 0x9A500914, // Number of the currently "large" door + V_LIGHTS_ON = 0x4D080E54, + V_SHRINK_LIGHTS_ON = 0x190A1D18, // Lights on in the room with the shrinking device + V_STAIRS_DOWN = 0x09221A62, + V_LADDER_DOWN = 0x0018CA22, // Is the ladder in the statue room down? + V_LADDER_DOWN_ACTION = 0x00188211, + V_WALL_BROKEN = 0x10938830, + V_BOLT_DOOR_OPEN = 0x01BA1A52, + V_BOLT_DOOR_UNLOCKED = 0x00040153, + V_SEEN_SYMBOLS_NO_LIGHT = 0x81890D14, + V_FELL_DOWN_HOLE = 0xE7498218, + V_DOOR_PASSED = 0x2090590C, // Auto-closing door was passed + V_ENTRANCE_OPEN = 0xD0A14D10, // Is the entrance to Module1300 open (after the robot got his teddy) + V_WINDOW_OPEN = 0x03C698DA, + V_DOOR_STATUS = 0x52371C95, + V_DOOR_BUSTED = 0xD217189D, + V_WORLDS_JOINED = 0x98109F12, // Are the worlds joined? + V_KEYDOOR_UNLOCKED = 0x80455A41, // Is the keyboard-door unlocked? + V_MOUSE_SUCKED_IN = 0x01023818, // Are mouse/cheese in Scene1308? + V_BALLOON_POPPED = 0xAC00C0D0, // Has the balloon with the key been popped? + V_TNT_DUMMY_BUILT = 0x000CF819, // Are all TNT parts on the dummy? + V_TNT_DUMMY_FUSE_LIT = 0x20A0C516, + V_RING5_PULLED = 0x4DE80AC0, + V_CREATURE_EXPLODED = 0x2A02C07B, + // Match + V_MATCH_STATUS = 0x0112090A, + // Venus fly trap + V_FLYTRAP_RING_EATEN = 0x2B514304, + V_FLYTRAP_RING_DOOR = 0x8306F218, + V_FLYTRAP_RING_FENCE = 0x80101B1E, + V_FLYTRAP_RING_BRIDGE = 0x13206309, + V_FLYTRAP_POSITION_1 = 0x1B144052, + V_FLYTRAP_POSITION_2 = 0x86341E88, + // Navigation + V_NAVIGATION_INDEX = 0x4200189E, // Navigation scene: Current navigation index + // Cannon + V_CANNON_RAISED = 0x000809C2, // Is the cannon raised? + V_CANNON_TURNED = 0x9040018A, // Is the cannon turned? + V_ROBOT_HIT = 0x0C0288F4, // Was the robot hit by the cannon? + V_ROBOT_TARGET = 0x610210B7, // Is the robot at the cannon target position? (teddy) + V_CANNON_SMACKER_NAME = 0xF0402B0A, + V_CANNON_TARGET_STATUS = 0x20580A86, + // Projector + V_PROJECTOR_SLOT = 0x04A10F33, // Projector x slot index + V_PROJECTOR_LOCATION = 0x04A105B3, // Projector scene location + V_PROJECTOR_ACTIVE = 0x12A10DB3, // Is the projecor projecting? + // Inventory + V_HAS_NEEDLE = 0x31C63C51, // Has Klayman the needle? + V_HAS_FINAL_KEY = 0xC0780812, // Has Klayman the key from the diskplayer? + V_HAS_TEST_TUBE = 0x45080C38, +#if 0 +Arrays: +0x0800547C Water pipes water level (index equals pipe number; 0 to 4) +0x0090EA95 Has Klayman the key (index equals the key number; 0 to 2) +0x08D0AB11 Has Klayman inserted the key (index equals the key number; 0 to 2) +#endif + V_END_ +}; + struct GameVar { uint32 nameHash; uint32 value; diff --git a/engines/neverhood/klayman.cpp b/engines/neverhood/klayman.cpp index 7343b0a120e..0342b02f3c4 100644 --- a/engines/neverhood/klayman.cpp +++ b/engines/neverhood/klayman.cpp @@ -3048,7 +3048,7 @@ uint32 Klayman::hmMatch(int messageNum, const MessageParam ¶m, Entity *sende switch (messageNum) { case 0x100D: if (param.asInteger() == 0x51281850) { - setGlobalVar(0x20A0C516, 1); + setGlobalVar(V_TNT_DUMMY_FUSE_LIT, 1); } else if (param.asInteger() == 0x43000538) { playSound(0, 0x21043059); } else if (param.asInteger() == 0x02B20220) { @@ -3283,7 +3283,7 @@ void Klayman::stWaitLeverDown() { } void Klayman::stStartWalkingResume() { - int16 frameIndex = getGlobalVar(0x18288913) + _walkResumeFrameIncr; + int16 frameIndex = getGlobalVar(V_KLAYMAN_FRAMEINDEX) + _walkResumeFrameIncr; if (frameIndex < 0 || frameIndex > 13) frameIndex = 0; _status2 = 0; @@ -4788,7 +4788,7 @@ KmScene2205::KmScene2205(NeverhoodEngine *vm, Entity *parentScene, int16 x, int1 } void KmScene2205::xUpdate() { - setGlobalVar(0x18288913, _currFrameIndex); + setGlobalVar(V_KLAYMAN_FRAMEINDEX, _currFrameIndex); } uint32 KmScene2205::xHandleMessage(int messageNum, const MessageParam ¶m) { @@ -4842,7 +4842,7 @@ KmScene2206::~KmScene2206() { } void KmScene2206::xUpdate() { - setGlobalVar(0x18288913, _currFrameIndex); + setGlobalVar(V_KLAYMAN_FRAMEINDEX, _currFrameIndex); } uint32 KmScene2206::xHandleMessage(int messageNum, const MessageParam ¶m) { @@ -5006,7 +5006,7 @@ KmScene2242::KmScene2242(NeverhoodEngine *vm, Entity *parentScene, int16 x, int1 } void KmScene2242::xUpdate() { - setGlobalVar(0x18288913, _currFrameIndex); + setGlobalVar(V_KLAYMAN_FRAMEINDEX, _currFrameIndex); } uint32 KmScene2242::xHandleMessage(int messageNum, const MessageParam ¶m) { @@ -5076,7 +5076,7 @@ KmHallOfRecords::KmHallOfRecords(NeverhoodEngine *vm, Entity *parentScene, int16 } void KmHallOfRecords::xUpdate() { - setGlobalVar(0x18288913, _currFrameIndex); + setGlobalVar(V_KLAYMAN_FRAMEINDEX, _currFrameIndex); } uint32 KmHallOfRecords::xHandleMessage(int messageNum, const MessageParam ¶m) { @@ -5130,7 +5130,7 @@ KmScene2247::KmScene2247(NeverhoodEngine *vm, Entity *parentScene, int16 x, int1 } void KmScene2247::xUpdate() { - setGlobalVar(0x18288913, _currFrameIndex); + setGlobalVar(V_KLAYMAN_FRAMEINDEX, _currFrameIndex); } uint32 KmScene2247::xHandleMessage(int messageNum, const MessageParam ¶m) { @@ -5274,7 +5274,7 @@ uint32 KmScene2402::xHandleMessage(int messageNum, const MessageParam ¶m) { startWalkToX(param.asPoint().x, false); break; case 0x4004: - if (!getGlobalVar(0x92603A79)) + if (!getGlobalVar(V_TV_JOKE_TOLD)) GotoState(&Klayman::stStandWonderAbout); else GotoState(&Klayman::stTryStandIdle); diff --git a/engines/neverhood/module1000.cpp b/engines/neverhood/module1000.cpp index 878a0e7ef79..2c528429eab 100644 --- a/engines/neverhood/module1000.cpp +++ b/engines/neverhood/module1000.cpp @@ -29,7 +29,7 @@ Module1000::Module1000(NeverhoodEngine *vm, Module *parentModule, int which) debug("Create Module1000(%d)", which); - _musicFileHash = getGlobalVar(0xD0A14D10) ? 0x81106480 : 0x00103144; + _musicFileHash = getGlobalVar(V_ENTRANCE_OPEN) ? 0x81106480 : 0x00103144; _vm->_soundMan->addMusic(0x03294419, 0x061880C6); _vm->_soundMan->addMusic(0x03294419, _musicFileHash); @@ -140,7 +140,7 @@ uint32 AsScene1001Door::handleMessage(int messageNum, const MessageParam ¶m, } void AsScene1001Door::hammerHitsDoor() { - switch (getGlobalVar(0x52371C95)) { + switch (getGlobalVar(V_DOOR_STATUS)) { case 0: case 1: playSound(0, 0x65482F03); @@ -156,11 +156,11 @@ void AsScene1001Door::hammerHitsDoor() { // Nothing break; } - incGlobalVar(0x52371C95, 1); + incGlobalVar(V_DOOR_STATUS, 1); } void AsScene1001Door::stShowIdleDoor() { - switch (getGlobalVar(0x52371C95)) { + switch (getGlobalVar(V_DOOR_STATUS)) { case 1: startAnimation(0x624C0498, 4, -1); _newStickFrameIndex = 4; @@ -181,7 +181,7 @@ void AsScene1001Door::stShowIdleDoor() { } void AsScene1001Door::stBustedDoorMove() { - setGlobalVar(0xD217189D, 1); + setGlobalVar(V_DOOR_BUSTED, 1); startAnimation(0x624C0498, 6, 6); NextState(&AsScene1001Door::stBustedDoorGone); _x = 30; @@ -249,7 +249,7 @@ uint32 AsScene1001Window::handleMessage(int messageNum, const MessageParam ¶ break; case 0x3002: SetMessageHandler(NULL); - setGlobalVar(0x03C698DA, 1); + setGlobalVar(V_WINDOW_OPEN, 1); setVisible(false); break; } @@ -354,7 +354,7 @@ Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004B4898); } else if (which == 2) { setRectList(0x004B49F0); - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(390, 433); _klayman->setDoDeltaX(1); } else { @@ -371,7 +371,7 @@ Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which) _klayman->setClipRect(0, 0, tempSprite->getDrawRect().x2(), 480); - if (getGlobalVar(0xD217189D) == 0) { + if (getGlobalVar(V_DOOR_BUSTED) == 0) { _asDoor = insertSprite(); _asDoor->setClipRect(0, 0, tempSprite->getDrawRect().x2(), 480); } else { @@ -385,7 +385,7 @@ Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which) _ssButton = insertSprite(this, 0x15288120, 100, 0); - if (getGlobalVar(0x03C698DA) == 0) { + if (getGlobalVar(V_WINDOW_OPEN) == 0) { tempSprite = insertStaticSprite(0x8C066150, 200); _asWindow = insertSprite(); _asWindow->setClipRect(tempSprite->getDrawRect()); @@ -398,7 +398,7 @@ Scene1001::Scene1001(NeverhoodEngine *vm, Module *parentModule, int which) } Scene1001::~Scene1001() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX()); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX()); } uint32 Scene1001::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -407,7 +407,7 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam ¶m, Entit Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x0001: - if (param.asPoint().x == 0 && getGlobalVar(0xA4014072)) { + if (param.asPoint().x == 0 && getGlobalVar(V_DEBUG)) { leaveScene(0); } break; @@ -423,7 +423,7 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam ¶m, Entit setMessageList2(0x004B4910); messageResult = 1; } else if (param.asInteger() == 0x21E64A00) { - if (getGlobalVar(0xD217189D)) { + if (getGlobalVar(V_DOOR_BUSTED)) { setMessageList(0x004B48A8); } else { setMessageList(0x004B48C8); @@ -432,7 +432,7 @@ uint32 Scene1001::handleMessage(int messageNum, const MessageParam ¶m, Entit } else if (param.asInteger() == 0x040424D0) { sendEntityMessage(_klayman, 0x1014, _ssButton); } else if (param.asInteger() == 0x80006358) { - if (getGlobalVar(0x03C698DA)) { + if (getGlobalVar(V_WINDOW_OPEN)) { setMessageList(0x004B4938); } else { setMessageList(0x004B4960); @@ -615,7 +615,7 @@ AsScene1002Door::AsScene1002Door(NeverhoodEngine *vm, NRect &clipRect) _x = 526; - if (getGlobalVar(0x8306F218)) { + if (getGlobalVar(V_FLYTRAP_RING_DOOR)) { _y = 49; } else { _y = 239; @@ -644,11 +644,11 @@ uint32 AsScene1002Door::handleMessage(int messageNum, const MessageParam ¶m, uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x4808: - setGlobalVar(0x8306F218, 1); + setGlobalVar(V_FLYTRAP_RING_DOOR, 1); SetSpriteUpdate(&AsScene1002Door::suOpenDoor); break; case 0x4809: - setGlobalVar(0x8306F218, 0); + setGlobalVar(V_FLYTRAP_RING_DOOR, 0); SetSpriteUpdate(&AsScene1002Door::suCloseDoor); break; } @@ -872,20 +872,20 @@ AsScene1002VenusFlyTrap::AsScene1002VenusFlyTrap(NeverhoodEngine *vm, Scene *par SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); if (!_flag) { - if (getGlobalVar(0x8306F218)) { + if (getGlobalVar(V_FLYTRAP_RING_DOOR)) { setDoDeltaX(1); _x = 366; _y = 435; stRingGrabbed(); } else { - _x = 174 + getGlobalVar(0x1B144052) * 32; + _x = 174 + getGlobalVar(V_FLYTRAP_POSITION_1) * 32; _y = 435; stIdle(); } } else { - _x = 186 + getGlobalVar(0x86341E88) * 32; + _x = 186 + getGlobalVar(V_FLYTRAP_POSITION_2) * 32; _y = 364; - if (getGlobalVar(0x13206309) || getGlobalVar(0x80101B1E)) { + if (getGlobalVar(V_FLYTRAP_RING_BRIDGE) || getGlobalVar(V_FLYTRAP_RING_FENCE)) { stRingGrabbed(); } else { stIdle(); @@ -937,13 +937,13 @@ uint32 AsScene1002VenusFlyTrap::handleMessage(int messageNum, const MessageParam case 0x480B: setDoDeltaX(param.asInteger() != 0 ? 1 : 0); if (!_flag) { - if (getGlobalVar(0x8306F218)) { + if (getGlobalVar(V_FLYTRAP_RING_DOOR)) { stRelease(); } else { stWalk(); } } else { - if (getGlobalVar(0x13206309) || getGlobalVar(0x80101B1E)) { + if (getGlobalVar(V_FLYTRAP_RING_BRIDGE) || getGlobalVar(V_FLYTRAP_RING_FENCE)) { stRelease(); } else { stWalk(); @@ -1079,14 +1079,14 @@ void AsScene1002VenusFlyTrap::stIdle() { SetMessageHandler(&AsScene1002VenusFlyTrap::handleMessage); if (_flag) { if (_x >= 154 && _x <= 346) { - setGlobalVar(0x86341E88, (_x - 186) / 32); + setGlobalVar(V_FLYTRAP_POSITION_2, (_x - 186) / 32); } else { NextState(&AsScene1002VenusFlyTrap::stWalkBack); _countdown = 12; } } else { if (_x >= 174 && _x <= 430) { - setGlobalVar(0x1B144052, (_x - 174) / 32); + setGlobalVar(V_FLYTRAP_POSITION_1, (_x - 174) / 32); } else { NextState(&AsScene1002VenusFlyTrap::stWalkBack); _countdown = 12; @@ -1129,7 +1129,7 @@ AsScene1002OutsideDoorBackground::AsScene1002OutsideDoorBackground(NeverhoodEngi createSurface(850, 186, 212); _x = 320; _y = 240; - if (getGlobalVar(0x8306F218)) { + if (getGlobalVar(V_FLYTRAP_RING_DOOR)) { startAnimation(0x004A4495, -1, -1); _newStickFrameIndex = -2; } else { @@ -1346,7 +1346,7 @@ Scene1002::Scene1002(NeverhoodEngine *vm, Module *parentModule, int which) _asRing1 = insertSprite(this, false, 258, 191, _class599->getDrawRect().y, false); _asRing2 = insertSprite(this, false, 297, 189, _class599->getDrawRect().y, false); - _asRing3 = insertSprite(this, true, 370, 201, _class599->getDrawRect().y, getGlobalVar(0x8306F218) != 0); + _asRing3 = insertSprite(this, true, 370, 201, _class599->getDrawRect().y, getGlobalVar(V_FLYTRAP_RING_DOOR) != 0); _asRing4 = insertSprite(this, false, 334, 191, _class599->getDrawRect().y, false); _asRing5 = insertSprite(this, false, 425, 184, _class599->getDrawRect().y, false); @@ -1395,24 +1395,24 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit switch (messageNum) { case 0x0001: // Debug stuff (original) - if (param.asPoint().x == 0 && getGlobalVar(0xA4014072)) { - setGlobalVar(0x8306F218, 1); - setGlobalVar(0x1B144052, 3); + if (param.asPoint().x == 0 && getGlobalVar(V_DEBUG)) { + setGlobalVar(V_FLYTRAP_RING_DOOR, 1); + setGlobalVar(V_FLYTRAP_POSITION_1, 3); leaveScene(1); } break; case 0x000D: // Debug stuff (original) if (param.asInteger() == 0x48848178) { - setGlobalVar(0x8306F218, 1); - setGlobalVar(0x1B144052, 3); + setGlobalVar(V_FLYTRAP_RING_DOOR, 1); + setGlobalVar(V_FLYTRAP_POSITION_1, 3); leaveScene(1); } messageResult = 1; break; case 0x100D: if (param.asInteger() == 0xE6EE60E1) { - if (getGlobalVar(0x8306F218)) { + if (getGlobalVar(V_FLYTRAP_RING_DOOR)) { setMessageList(0x004B4428); } else { setMessageList(0x004B4448); @@ -1423,12 +1423,12 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit } else if (param.asInteger() == 0x43807801) { sendEntityMessage(_klayman, 0x1014, _asRing2); } else if (param.asInteger() == 0x46C26A01) { - if (getGlobalVar(0x8306F218)) { + if (getGlobalVar(V_FLYTRAP_RING_DOOR)) { setMessageList(0x004B44B8); } else { sendEntityMessage(_klayman, 0x1014, _asRing3); if (_asVenusFlyTrap->getX() - 10 < 366 && _asVenusFlyTrap->getX() + 10 > 366) { - setGlobalVar(0x2B514304, 1); + setGlobalVar(V_FLYTRAP_RING_EATEN, 1); setMessageList(0x004B44A8); } else { setMessageList(0x004B44A0); @@ -1475,21 +1475,21 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit sendMessage(_parentModule, 0x1024, 2); _flag1BE = true; if (sender == _asRing1) { - setGlobalVar(0x4DE80AC0, 0); + setGlobalVar(V_RING5_PULLED, 0); playSound(0, 0x665198C0); } else if (sender == _asRing2) { - setGlobalVar(0x4DE80AC0, 0); + setGlobalVar(V_RING5_PULLED, 0); playSound(0, 0xE2D389C0); } else if (sender == _asRing3) { - setGlobalVar(0x4DE80AC0, 0); + setGlobalVar(V_RING5_PULLED, 0); playSound(1); sendMessage(_asDoor, 0x4808, 0); sendMessage(_asOutsideDoorBackground, 0x4808, 0); } else if (sender == _asRing4) { - setGlobalVar(0x4DE80AC0, 0); + setGlobalVar(V_RING5_PULLED, 0); playSound(0, 0xE0558848); } else if (sender == _asRing5) { - setGlobalVar(0x4DE80AC0, 1); + setGlobalVar(V_RING5_PULLED, 1); playSound(0, 0x44014282); } break; @@ -1499,7 +1499,7 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit sendMessage(_asDoor, 0x4809, 0); sendMessage(_asOutsideDoorBackground, 0x4809, 0); } else if (sender == _asVenusFlyTrap) { - if (getGlobalVar(0x8306F218)) { + if (getGlobalVar(V_FLYTRAP_RING_DOOR)) { sendMessage(_asRing3, 0x4807, 0); } } @@ -1508,7 +1508,7 @@ uint32 Scene1002::handleMessage(int messageNum, const MessageParam ¶m, Entit sendEntityMessage(_klayman, 0x1014, _asDoorSpy); break; case 0x480F: - setGlobalVar(0x4DE80AC0, 0); + setGlobalVar(V_RING5_PULLED, 0); playSound(1); sendMessage(_asDoor, 0x4808, 0); sendMessage(_asOutsideDoorBackground, 0x4808, 0); @@ -1595,7 +1595,7 @@ Scene1004::Scene1004(NeverhoodEngine *vm, Module *parentModule, int which) setBackground(0x50C03005); - if (getGlobalVar(0x0D0A14D10)) { + if (getGlobalVar(V_ENTRANCE_OPEN)) { setPalette(0xA30BA329); _palette->addBasePalette(0xA30BA329, 0, 256, 0); } else { @@ -1689,7 +1689,7 @@ Scene1005::Scene1005(NeverhoodEngine *vm, Module *parentModule, int which) _surfaceFlag = true; - if (getGlobalVar(0xD0A14D10)) { + if (getGlobalVar(V_ENTRANCE_OPEN)) { setBackground(0x2800E011); setPalette(0x2800E011); insertStaticSprite(0x492D5AD7, 100); @@ -1745,7 +1745,7 @@ FontSurface *Scene1005::createFontSurface() { uint16 charHeight = fontData.getPoint(calcHash("meCharHeight")).x; NPointArray *tracking = fontData.getPointArray(calcHash("meTracking")); fontSurface = new FontSurface(_vm, tracking, numRows, firstChar, charWidth, charHeight); - if (getGlobalVar(0xD0A14D10)) { + if (getGlobalVar(V_ENTRANCE_OPEN)) { fontSprite.load2(0x283CE401); } else { fontSprite.load2(0xC6604282); @@ -1757,71 +1757,71 @@ FontSurface *Scene1005::createFontSurface() { uint32 Scene1005::getTextIndex() { uint32 textIndex; textIndex = getTextIndex1(); - if (getGlobalVar(0xD0A14D10)) { + if (getGlobalVar(V_ENTRANCE_OPEN)) { textIndex = getTextIndex2(); } - if (getGlobalVar(0x8440001F) && getGlobalVar(0x01830201) == textIndex) { + if (getGlobalVar(V_TEXT_FLAG1) && getGlobalVar(V_TEXT_INDEX) == textIndex) { textIndex = getTextIndex3(); } else { - setGlobalVar(0x8440001F, 1); - setGlobalVar(0x01830201, textIndex); + setGlobalVar(V_TEXT_FLAG1, 1); + setGlobalVar(V_TEXT_INDEX, textIndex); } return textIndex; } uint32 Scene1005::getTextIndex1() { uint32 textIndex; - if (getGlobalVar(0x98109F12)) { - if (!getGlobalVar(0x2090590C)) + if (getGlobalVar(V_WORLDS_JOINED)) { + if (!getGlobalVar(V_DOOR_PASSED)) textIndex = 18; - else if (!getGlobalVar(0x610210B7)) + else if (!getGlobalVar(V_ROBOT_TARGET)) textIndex = 19; - else if (getGlobalVar(0x0C0288F4)) { - if (!getGlobalVar(0xD0A14D10)) + else if (getGlobalVar(V_ROBOT_HIT)) { + if (!getGlobalVar(V_ENTRANCE_OPEN)) textIndex = 23; else if (!getSubVar(0x0090EA95, 0) && !getSubVar(0x08D0AB11, 0)) textIndex = 24; - else if (!getGlobalVar(0xC0780812)) + else if (!getGlobalVar(V_HAS_FINAL_KEY)) textIndex = 26; else if (!getSubVar(0x0090EA95, 1) && !getSubVar(0x08D0AB11, 1)) textIndex = 27; - else if (!getGlobalVar(0xC0780812)) + else if (!getGlobalVar(V_HAS_FINAL_KEY)) textIndex = 28; else textIndex = 29; - } else if (!getGlobalVar(0xE7498218)) + } else if (!getGlobalVar(V_FELL_DOWN_HOLE)) textIndex = 20; - else if (!getGlobalVar(0x081890D14)) + else if (!getGlobalVar(V_SEEN_SYMBOLS_NO_LIGHT)) textIndex = 21; else textIndex = 22; - } else if (getGlobalVar(0x00040153)) { - if (!getGlobalVar(0x10938830)) + } else if (getGlobalVar(V_BOLT_DOOR_UNLOCKED)) { + if (!getGlobalVar(V_WALL_BROKEN)) textIndex = 12; else if (!getGlobalVar(0x2050861A)) textIndex = 13; - else if (!getGlobalVar(0x4DE80AC0)) + else if (!getGlobalVar(V_RING5_PULLED)) textIndex = 50; else if (!getGlobalVar(0x89C669AA)) textIndex = 14; - else if (!getGlobalVar(0x1C1B8A9A)) + else if (!getGlobalVar(V_BEEN_SHRINKING_ROOM)) textIndex = 15; - else if (!getGlobalVar(0xCB45DE03)) + else if (!getGlobalVar(V_BEEN_STATUE_ROOM)) textIndex = 16; else textIndex = 17; - } else if (!getGlobalVar(0x2B514304)) { + } else if (!getGlobalVar(V_FLYTRAP_RING_EATEN)) { textIndex = 0; } else if (getGlobalVar(0x0A18CA33)) { - if (!getGlobalVar(0x404290D5)) + if (!getGlobalVar(V_TILE_PUZZLE_SOLVED)) textIndex = 4; - else if (!getGlobalVar(0x45080C38)) + else if (!getGlobalVar(V_HAS_TEST_TUBE)) textIndex = 5; else if (!getSubVar(0x14800353, 0x40119852)) textIndex = 6; - else if (!getGlobalVar(0x4E0BE910)) + else if (!getGlobalVar(V_WATER_RUNNING)) textIndex = 7; - else if (!getGlobalVar(0x86615030)) + else if (!getGlobalVar(V_NOTES_PUZZLE_SOLVED)) textIndex = 8; else if (!getSubVar(0x14800353, 0x304008D2)) textIndex = 9; @@ -1829,9 +1829,9 @@ uint32 Scene1005::getTextIndex1() { textIndex = 10; else textIndex = 11; - } else if (!getGlobalVar(0x0A310817)) { + } else if (!getGlobalVar(V_CREATURE_ANGRY)) { textIndex = 1; - } else if (getGlobalVar(0x000CF819)) { + } else if (getGlobalVar(V_TNT_DUMMY_BUILT)) { textIndex = 3; } else { textIndex = 2; @@ -1840,23 +1840,23 @@ uint32 Scene1005::getTextIndex1() { } uint32 Scene1005::getTextIndex2() { - uint32 textIndex = getGlobalVar(0x29408F00); + uint32 textIndex = getGlobalVar(V_TEXT_COUNTING_INDEX1); if (textIndex + 1 >= 10) { - setGlobalVar(0x29408F00, 0); + setGlobalVar(V_TEXT_COUNTING_INDEX1, 0); textIndex = 0; } else { - setGlobalVar(0x29408F00, textIndex + 1); + setGlobalVar(V_TEXT_COUNTING_INDEX1, textIndex + 1); } return textIndex + 40; } uint32 Scene1005::getTextIndex3() { - uint32 textIndex = getGlobalVar(0x8A140C21); + uint32 textIndex = getGlobalVar(V_TEXT_COUNTING_INDEX2); if (textIndex + 1 >= 10) { - setGlobalVar(0x8A140C21, 0); + setGlobalVar(V_TEXT_COUNTING_INDEX2, 0); textIndex = 0; } else { - setGlobalVar(0x8A140C21, textIndex + 1); + setGlobalVar(V_TEXT_COUNTING_INDEX2, textIndex + 1); } return textIndex + 30; } diff --git a/engines/neverhood/module1100.cpp b/engines/neverhood/module1100.cpp index 53ede4315d5..44fe70eb88a 100644 --- a/engines/neverhood/module1100.cpp +++ b/engines/neverhood/module1100.cpp @@ -76,14 +76,14 @@ void Module1100::createScene(int sceneNum, int which) { createNavigationScene(0x004B8460, which); break; case 2: - if (getGlobalVar(0x610210B7)) { + if (getGlobalVar(V_ROBOT_TARGET)) { createNavigationScene(0x004B84F0, which); } else { createNavigationScene(0x004B8490, which); } break; case 3: - if (getGlobalVar(0x610210B7)) { + if (getGlobalVar(V_ROBOT_TARGET)) { createNavigationScene(0x004B8580, which); } else { createNavigationScene(0x004B8550, which); @@ -93,7 +93,7 @@ void Module1100::createScene(int sceneNum, int which) { _childObject = new Scene1105(_vm, this, which); break; case 5: - if (getGlobalVar(0x610210B7)) + if (getGlobalVar(V_ROBOT_TARGET)) createSmackerScene(0x04180001, true, false, false); else createSmackerScene(0x04180007, true, false, false); @@ -135,7 +135,7 @@ void Module1100::updateScene() { break; case 1: _vm->_soundMan->playTwoSounds(0x0002C818, 0x41861371, 0x43A2507F, 0); - if (getGlobalVar(0x0C0288F4)) { + if (getGlobalVar(V_ROBOT_HIT)) { if (_moduleResult == 0) { createScene(6, -1); } else if (_moduleResult == 1) { @@ -175,7 +175,7 @@ void Module1100::updateScene() { break; case 5: _vm->_soundMan->setTwoSoundsPlayFlag(false); - if (getGlobalVar(0x610210B7)) { + if (getGlobalVar(V_ROBOT_TARGET)) { createScene(3, 0); } else { createScene(4, 0); @@ -372,7 +372,7 @@ uint32 AsScene1105TeddyBear::handleMessage(int messageNum, const MessageParam &p uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2002: - if (getGlobalVar(0x610210B7)) { + if (getGlobalVar(V_ROBOT_TARGET)) { startAnimation(0x6B0C0432, 0, -1); playSound(0); } else { @@ -505,7 +505,7 @@ uint32 Scene1105::handleMessage(int messageNum, const MessageParam ¶m, Entit if (getSubVar(0x7500993A, 0) == getSubVar(0x61084036, 0) && getSubVar(0x7500993A, 1) == getSubVar(0x61084036, 1) && getSubVar(0x7500993A, 2) == getSubVar(0x61084036, 2)) { - setGlobalVar(0x610210B7, 1); + setGlobalVar(V_ROBOT_TARGET, 1); playSound(2); _flag3 = true; } else { @@ -520,7 +520,7 @@ uint32 Scene1105::handleMessage(int messageNum, const MessageParam ¶m, Entit if (sender == _ssActionButton) { sendMessage(_ssActionButton, 0x480B, 0); _flag1 = false; - } else if (!getGlobalVar(0x610210B7)) { + } else if (!getGlobalVar(V_ROBOT_TARGET)) { if (sender == _ssSymbol1UpButton) { if (getSubVar(0x61084036, 0) < 9) { incSubVar(0x61084036, 0, +1); diff --git a/engines/neverhood/module1200.cpp b/engines/neverhood/module1200.cpp index a20ed94cd0b..041be6f8bdd 100644 --- a/engines/neverhood/module1200.cpp +++ b/engines/neverhood/module1200.cpp @@ -60,7 +60,7 @@ void Module1200::createScene(int sceneNum, int which) { case 2: _vm->_soundMan->stopMusic(0x62222CAE, 0, 0); createSmackerScene(0x31890001, true, true, false); - setGlobalVar(0x2A02C07B, 1); + setGlobalVar(V_CREATURE_EXPLODED, 1); break; } SetUpdateHandler(&Module1200::updateScene); @@ -74,7 +74,7 @@ void Module1200::updateScene() { if (_moduleResult == 1) { createScene(1, 0); } else if (_moduleResult == 2) { - if (getGlobalVar(0x0A18CA33) && !getGlobalVar(0x2A02C07B)) { + if (getGlobalVar(0x0A18CA33) && !getGlobalVar(V_CREATURE_EXPLODED)) { createScene(2, -1); } else { leaveModule(1); @@ -439,7 +439,7 @@ AsScene1201TntManFlame::~AsScene1201TntManFlame() { void AsScene1201TntManFlame::update() { AnimatedSprite::update(); - if (getGlobalVar(0x20A0C516)) { + if (getGlobalVar(V_TNT_DUMMY_FUSE_LIT)) { setVisible(true); SetUpdateHandler(&AnimatedSprite::update); _vm->_soundMan->addSound(0x041080A4, 0x460A1050); @@ -459,7 +459,7 @@ AsScene1201Match::AsScene1201Match(NeverhoodEngine *vm, Scene *parentScene) SetUpdateHandler(&AsScene1201Match::update); SetMessageHandler(&AsScene1201Match::hmOnDoorFrameAboutToMove); SetSpriteUpdate(&AnimatedSprite::updateDeltaXY); - switch (getGlobalVar(0x0112090A)) { + switch (getGlobalVar(V_MATCH_STATUS)) { case 0: _x = 521; _y = 112; @@ -522,7 +522,7 @@ uint32 AsScene1201Match::hmIdle(int messageNum, const MessageParam ¶m, Entit break; case 0x4806: setVisible(false); - setGlobalVar(0x0112090A, 3); + setGlobalVar(V_MATCH_STATUS, 3); break; } return messageResult; @@ -539,7 +539,7 @@ void AsScene1201Match::stOnDoorFrameMoving() { } void AsScene1201Match::stFallingFromDoorFrame() { - setGlobalVar(0x0112090A, 2); + setGlobalVar(V_MATCH_STATUS, 2); _x -= 199; _y += 119; startAnimation(0x018D0240, 0, -1); @@ -752,7 +752,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) tempSprite = insertStaticSprite(0x04063110, 500); topY4 = tempSprite->getY() + 1; - _asTntManRope = insertSprite(getGlobalVar(0x000CF819) && which != 1); + _asTntManRope = insertSprite(getGlobalVar(V_TNT_DUMMY_BUILT) && which != 1); _asTntManRope->setClipRect(0, topY4, 640, 480); insertStaticSprite(0x400B04B0, 1200); @@ -772,7 +772,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) insertKlayman(400, 329); setMessageList(0x004AEC08); } else if (which == 2) { - if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) { + if (getGlobalVar(V_CREATURE_ANGRY) && !getGlobalVar(0x0A18CA33)) { insertKlayman(374, 333); setMessageList(0x004AEC08); } else { @@ -780,7 +780,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004AEC20); } } else if (which == 1) { - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(364, 333); _klayman->setDoDeltaX(1); } else { @@ -795,7 +795,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) _klayman->setClipRect(x1, 0, x2, 480); _klayman->setRepl(64, 0); - if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) { + if (getGlobalVar(V_CREATURE_ANGRY) && !getGlobalVar(0x0A18CA33)) { setBackground(0x4019A2C4); setPalette(0x4019A2C4); _asRightDoor = NULL; @@ -805,7 +805,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) _asRightDoor = insertSprite(_klayman, which == 2); } - if (getGlobalVar(0x000CF819)) { + if (getGlobalVar(V_TNT_DUMMY_BUILT)) { insertStaticSprite(0x10002ED8, 500); if (!getGlobalVar(0x0A18CA33)) { _asTntMan = insertSprite(this, _asTntManRope, which == 1); @@ -838,7 +838,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) tntIndex += 3; } - if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) { + if (getGlobalVar(V_CREATURE_ANGRY) && !getGlobalVar(0x0A18CA33)) { setRectList(0x004AEE58); } else { setRectList(0x004AEDC8); @@ -866,7 +866,7 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) tntIndex++; } - if (getGlobalVar(0x0A310817) && !getGlobalVar(0x0A18CA33)) { + if (getGlobalVar(V_CREATURE_ANGRY) && !getGlobalVar(0x0A18CA33)) { setRectList(0x004AEE18); } else { setRectList(0x004AED88); @@ -879,18 +879,18 @@ Scene1201::Scene1201(NeverhoodEngine *vm, Module *parentModule, int which) _asLeftDoor = insertSprite(_klayman); _asLeftDoor->setClipRect(x1, tempSprite->getDrawRect().y, tempSprite->getDrawRect().x2(), 480); - if (getGlobalVar(0x0A310817) && getGlobalVar(0x0112090A) == 0) { - setGlobalVar(0x0112090A, 1); + if (getGlobalVar(V_CREATURE_ANGRY) && getGlobalVar(V_MATCH_STATUS) == 0) { + setGlobalVar(V_MATCH_STATUS, 1); } _asMatch = NULL; - if (getGlobalVar(0x0112090A) < 3) { + if (getGlobalVar(V_MATCH_STATUS) < 3) { _asMatch = insertSprite(this); _vm->_collisionMan->addSprite(_asMatch); } - if (getGlobalVar(0x0A310817) && getGlobalVar(0x0A18CA33) == 0) { + if (getGlobalVar(V_CREATURE_ANGRY) && getGlobalVar(0x0A18CA33) == 0) { _asCreature = insertSprite(this, _klayman); _asCreature->setClipRect(x1, 0, x2, 480); } @@ -902,7 +902,7 @@ Scene1201::~Scene1201() { void Scene1201::update() { Scene::update(); - if (_asMatch && getGlobalVar(0x0112090A) == 3) + if (_asMatch && getGlobalVar(V_MATCH_STATUS) == 3) deleteSprite(&_asMatch); } @@ -927,7 +927,7 @@ uint32 Scene1201::handleMessage(int messageNum, const MessageParam ¶m, Entit } break; case 0x2001: - if (!getGlobalVar(0x0112090A)) { + if (getGlobalVar(V_MATCH_STATUS) == 0) { setMessageList2(0x004AECB0); } else { sendEntityMessage(_klayman, 0x1014, _asMatch); @@ -935,12 +935,12 @@ uint32 Scene1201::handleMessage(int messageNum, const MessageParam ¶m, Entit } break; case 0x2002: - if (getGlobalVar(0x20A0C516)) { - // Move the TNT dummy + if (getGlobalVar(V_TNT_DUMMY_FUSE_LIT)) { + // Move the TNT dummy if the fuse is burning sendEntityMessage(_klayman, 0x1014, _asTntMan); setMessageList2(0x004AECF0, false); - } else if (getGlobalVar(0x0112090A) == 3) { - // Light the TNT dummy + } else if (getGlobalVar(V_MATCH_STATUS) == 3) { + // Light the TNT dummy if we have the match sendEntityMessage(_klayman, 0x1014, _asTntMan); if (_klayman->getX() > _asTntMan->getX()) { setMessageList(0x004AECD0); @@ -1107,7 +1107,7 @@ Scene1202::Scene1202(NeverhoodEngine *vm, Module *parentModule, int which) insertStaticSprite(0x8E8419C1, 1100); - if (getGlobalVar(0x000CF819)) { + if (getGlobalVar(V_TNT_DUMMY_BUILT)) { SetMessageHandler(&Scene1202::hmSolved); } @@ -1120,7 +1120,7 @@ Scene1202::Scene1202(NeverhoodEngine *vm, Module *parentModule, int which) Scene1202::~Scene1202() { if (isSolved()) { - setGlobalVar(0x000CF819, 1); + setGlobalVar(V_TNT_DUMMY_BUILT, 1); } } @@ -1133,7 +1133,7 @@ void Scene1202::update() { } else if (_counter == 0 && isSolved()) { _clickedIndex = 0; SetMessageHandler(&Scene1202::hmSolved); - setGlobalVar(0x000CF819, 1); + setGlobalVar(V_TNT_DUMMY_BUILT, 1); doPaletteEffect(); playSound(3); _soundFlag = true; diff --git a/engines/neverhood/module1300.cpp b/engines/neverhood/module1300.cpp index 6533e078149..e8cc843b783 100644 --- a/engines/neverhood/module1300.cpp +++ b/engines/neverhood/module1300.cpp @@ -305,7 +305,7 @@ AsScene1302Bridge::AsScene1302Bridge(NeverhoodEngine *vm, Scene *parentScene) createSurface1(0x88148150, 500); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene1302Bridge::handleMessage); - if (!getGlobalVar(0x13206309)) { + if (!getGlobalVar(V_FLYTRAP_RING_BRIDGE)) { startAnimation(0x88148150, 0, -1); _newStickFrameIndex = 0; } else { @@ -358,7 +358,7 @@ SsScene1302Fence::SsScene1302Fence(NeverhoodEngine *vm) SetMessageHandler(&SsScene1302Fence::handleMessage); SetSpriteUpdate(NULL); _firstY = _y; - if (getGlobalVar(0x80101B1E)) + if (getGlobalVar(V_FLYTRAP_RING_FENCE)) _y += 152; loadSound(0, 0x7A00400C); loadSound(1, 0x78184098); @@ -422,9 +422,9 @@ Scene1302::Scene1302(NeverhoodEngine *vm, Module *parentModule, int which) _sprite3 = insertStaticSprite(0x16E01E20, 1100); _asRing1 = insertSprite(this, false, 218, 122, _class595->getDrawRect().y, false); - _asRing2 = insertSprite(this, true, 218 + 32, 132, _class595->getDrawRect().y, getGlobalVar(0x13206309)); + _asRing2 = insertSprite(this, true, 218 + 32, 132, _class595->getDrawRect().y, getGlobalVar(V_FLYTRAP_RING_BRIDGE)); _asRing3 = insertSprite(this, false, 218 + 32 + 32, 122, _class595->getDrawRect().y, false); - _asRing4 = insertSprite(this, true, 218 + 32 + 32 + 32, 132, _class595->getDrawRect().y, getGlobalVar(0x80101B1E)); + _asRing4 = insertSprite(this, true, 218 + 32 + 32 + 32, 132, _class595->getDrawRect().y, getGlobalVar(V_FLYTRAP_RING_FENCE)); _asRing5 = insertSprite(this, false, 218 + 32 + 32 + 32 + 32, 115, _class595->getDrawRect().y, false); _asBridge = insertSprite(this); @@ -456,7 +456,7 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit if (param.asInteger() == 0x4A845A00) { sendEntityMessage(_klayman, 0x1014, _asRing1); } else if (param.asInteger() == 0x43807801) { - if (!getGlobalVar(0x13206309)) { + if (!getGlobalVar(V_FLYTRAP_RING_BRIDGE)) { sendEntityMessage(_klayman, 0x1014, _asRing2); if (_asVenusFlyTrap->getX() - 10 < 218 + 32 && _asVenusFlyTrap->getX() + 10 > 218 + 32) { setMessageList(0x004B0940); @@ -470,7 +470,7 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit } else if (param.asInteger() == 0x46C26A01) { sendEntityMessage(_klayman, 0x1014, _asRing3); } else if (param.asInteger() == 0x468C7B11) { - if (!getGlobalVar(0x80101B1E)) { + if (!getGlobalVar(V_FLYTRAP_RING_FENCE)) { sendEntityMessage(_klayman, 0x1014, _asRing4); if (_asVenusFlyTrap->getX() - 10 < 218 + 32 + 32 + 32 && _asVenusFlyTrap->getX() + 10 > 218 + 32 + 32 + 32) { setMessageList(0x004B0940); @@ -484,13 +484,13 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit } else if (param.asInteger() == 0x42845B19) { sendEntityMessage(_klayman, 0x1014, _asRing5); } else if (param.asInteger() == 0x430A6060) { - if (getGlobalVar(0x13206309)) { + if (getGlobalVar(V_FLYTRAP_RING_BRIDGE)) { setMessageList2(0x004B0910); } else { cancelMessageList(); } } else if (param.asInteger() == 0x012E2070) { - if (getGlobalVar(0x13206309)) { + if (getGlobalVar(V_FLYTRAP_RING_BRIDGE)) { setMessageList2(0x004B0968); } else { cancelMessageList(); @@ -525,12 +525,12 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit playSound(0, 0x665198C0); } else if (sender == _asRing2) { sendMessage(_asBridge, 0x4808, 0); - setGlobalVar(0x13206309, 1); + setGlobalVar(V_FLYTRAP_RING_BRIDGE, 1); } else if (sender == _asRing3) { playSound(0, 0xE2D389C0); } else if (sender == _asRing4) { sendMessage(_ssFence, 0x4808, 0); - setGlobalVar(0x80101B1E, 1); + setGlobalVar(V_FLYTRAP_RING_FENCE, 1); } else if (sender == _asRing5) { playSound(0, 0x40428A09); } @@ -538,13 +538,13 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit case 0x4807: if (sender == _asRing2) { sendMessage(_asBridge, 0x4809, 0); - setGlobalVar(0x13206309, 0); + setGlobalVar(V_FLYTRAP_RING_BRIDGE, 0); _sprite2->setVisible(false); } else if (sender == _asRing4) { sendMessage(_ssFence, 0x4809, 0); - setGlobalVar(0x80101B1E, 0); + setGlobalVar(V_FLYTRAP_RING_FENCE, 0); } else if (sender == _asVenusFlyTrap) { - if (getGlobalVar(0x13206309)) { + if (getGlobalVar(V_FLYTRAP_RING_BRIDGE)) { sendMessage(_asRing2, 0x4807, 0); } else { sendMessage(_asRing4, 0x4807, 0); @@ -555,11 +555,11 @@ uint32 Scene1302::handleMessage(int messageNum, const MessageParam ¶m, Entit if (sender == _asRing2) { playSound(0, 0x60755842); sendMessage(_asBridge, 0x4808, 0); - setGlobalVar(0x13206309, 1); + setGlobalVar(V_FLYTRAP_RING_BRIDGE, 1); } else if (sender == _asRing4) { playSound(0, 0x60755842); sendMessage(_ssFence, 0x4808, 0); - setGlobalVar(0x80101B1E, 1); + setGlobalVar(V_FLYTRAP_RING_FENCE, 1); } break; case 0x482A: @@ -639,7 +639,7 @@ Scene1303::Scene1303(NeverhoodEngine *vm, Module *parentModule, int which) setPalette(0x01581A9C); insertMouse433(0x81A9801D); - if (!getGlobalVar(0xAC00C0D0)) { + if (!getGlobalVar(V_BALLOON_POPPED)) { _asBalloon = insertSprite(this); _vm->_collisionMan->addSprite(_asBalloon); } @@ -657,11 +657,11 @@ uint32 Scene1303::handleMessage(int messageNum, const MessageParam ¶m, Entit Scene::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2000: - setGlobalVar(0xAC00C0D0, 1); + setGlobalVar(V_BALLOON_POPPED, 1); sendMessage(_asBalloon, 0x2000, 0); break; case 0x4826: - if (sender == _asBalloon && getGlobalVar(0x31C63C51)) { + if (sender == _asBalloon && getGlobalVar(V_HAS_NEEDLE)) { setMessageList(0x004AF9B8); } break; @@ -684,7 +684,7 @@ uint32 AsScene1304Needle::handleMessage(int messageNum, const MessageParam ¶ messageResult = 1; break; case 0x4806: - setGlobalVar(0x31C63C51, 1); + setGlobalVar(V_HAS_NEEDLE, 1); setVisible(false); SetMessageHandler(NULL); break; @@ -703,7 +703,7 @@ Scene1304::Scene1304(NeverhoodEngine *vm, Module *parentModule, int which) setPalette(0x062C0214); insertMouse433(0xC021006A); - if (getGlobalVar(0xAC00C0D0)) { + if (getGlobalVar(V_BALLOON_POPPED)) { _asKey = insertSprite(this, 0, 1100, 278, 347); _vm->_collisionMan->addSprite(_asKey); } else { @@ -711,7 +711,7 @@ Scene1304::Scene1304(NeverhoodEngine *vm, Module *parentModule, int which) // TODO _asKey->setUpdateDeltaXY(); } - if (!getGlobalVar(0x31C63C51)) { + if (!getGlobalVar(V_HAS_NEEDLE)) { _asNeedle = insertSprite(this, 1100, 278, 347); _vm->_collisionMan->addSprite(_asNeedle); } else { @@ -739,7 +739,7 @@ uint32 Scene1304::handleMessage(int messageNum, const MessageParam ¶m, Entit switch (messageNum) { case 0x100D: if (param.asInteger() == 0x415634A4) { - if (getGlobalVar(0xAC00C0D0)) { + if (getGlobalVar(V_BALLOON_POPPED)) { cancelMessageList(); } else { setMessageList(0x004B9158); @@ -874,8 +874,8 @@ void AsScene1306Elevator::cbGoingDownEvent() { Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true) { - if (getGlobalVar(0xC0780812) && getGlobalVar(0x13382860) == 0) - setGlobalVar(0x13382860, 4); + if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0) + setGlobalVar(V_KEY3_LOCATION, 4); _surfaceFlag = true; SetMessageHandler(&Scene1306::handleMessage); @@ -884,7 +884,7 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which) setPalette(0x05303114); insertMouse433(0x0311005B); - if (getGlobalVar(0x13382860) == 4) { + if (getGlobalVar(V_KEY3_LOCATION) == 4) { _asKey = insertSprite(this, 2, 1100, 435, 445); _vm->_collisionMan->addSprite(_asKey); } @@ -915,7 +915,7 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which) sendMessage(this, 0x2000, 1); _vm->_collisionMan->addSprite(_asTape); } else if (which == 2) { - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(515, 440); _klayman->setDoDeltaX(1); } else { @@ -955,7 +955,7 @@ Scene1306::Scene1306(NeverhoodEngine *vm, Module *parentModule, int which) } Scene1306::~Scene1306() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } uint32 Scene1306::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1320,7 +1320,7 @@ void Scene1307::update() { } if (_doLeaveScene && !isSoundPlaying(0)) { leaveScene(1); - setGlobalVar(0x80455A41, 1); + setGlobalVar(V_KEYDOOR_UNLOCKED, 1); } } @@ -1593,7 +1593,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which) _asTape = insertSprite(this, 17, 1100, 502, 445, 0x9148A011); _vm->_collisionMan->addSprite(_asTape); - if (getGlobalVar(0x01023818)) { + if (getGlobalVar(V_MOUSE_SUCKED_IN)) { insertSprite(); insertSprite(0x461A1490, 200, 235, 429); } @@ -1613,7 +1613,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which) if (which < 0) { insertKlayman(380, 440); setMessageList(0x004B57C0); - if (getGlobalVar(0x80455A41)) { + if (getGlobalVar(V_KEYDOOR_UNLOCKED)) { _sprite4 = insertStaticSprite(0x0101A624, 1100); setRectList(0x004B5990); } else { @@ -1623,7 +1623,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which) } else if (which == 1) { insertKlayman(640, 440); setMessageList(0x004B57C8); - if (getGlobalVar(0x80455A41)) { + if (getGlobalVar(V_KEYDOOR_UNLOCKED)) { _sprite4 = insertStaticSprite(0x0101A624, 1100); setRectList(0x004B5990); } else { @@ -1633,7 +1633,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which) } else if (which == 2) { insertKlayman(475, 440); setMessageList(0x004B58B0); - if (getGlobalVar(0x80455A41)) { + if (getGlobalVar(V_KEYDOOR_UNLOCKED)) { _sprite5 = insertSprite(this); _sprite4 = insertStaticSprite(0x0101A624, 1100); _sprite4->setVisible(false); @@ -1646,7 +1646,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004B57D0); sendMessage(_asJaggyDoor, 0x4808, 0); _sprite1->setVisible(false); - if (getGlobalVar(0x80455A41)) { + if (getGlobalVar(V_KEYDOOR_UNLOCKED)) { _sprite4 = insertStaticSprite(0x0101A624, 1100); _klayman->setVisible(false); } else { @@ -1661,7 +1661,7 @@ Scene1308::Scene1308(NeverhoodEngine *vm, Module *parentModule, int which) _klayman->setClipRect(_sprite1->getDrawRect().x, 0, 640, 480); } - if (getGlobalVar(0x04A105B3) == 4) { + if (getGlobalVar(V_PROJECTOR_LOCATION) == 4) { _asProjector = insertSprite(this, _klayman, (Sprite*)NULL); _vm->_collisionMan->addSprite(_asProjector); _asProjector->setClipRect(0, 0, 640, _sprite2->getDrawRect().y2()); @@ -1681,7 +1681,7 @@ uint32 Scene1308::handleMessage(int messageNum, const MessageParam ¶m, Entit _flag1 = true; } else if (param.asInteger() == 0x08821382) { sendEntityMessage(_klayman, 0x1014, _asProjector); - if (getGlobalVar(0x80455A41)) { + if (getGlobalVar(V_KEYDOOR_UNLOCKED)) { setRectList(0x004B5990); } else { setRectList(0x004B5980); @@ -1703,7 +1703,7 @@ uint32 Scene1308::handleMessage(int messageNum, const MessageParam ¶m, Entit } break; case 0x2000: - if (getGlobalVar(0x80455A41)) { + if (getGlobalVar(V_KEYDOOR_UNLOCKED)) { setRectList(0x004B5990); } else { setRectList(0x004B5980); diff --git a/engines/neverhood/module1400.cpp b/engines/neverhood/module1400.cpp index 9cfb8268826..d207428d80a 100644 --- a/engines/neverhood/module1400.cpp +++ b/engines/neverhood/module1400.cpp @@ -387,19 +387,18 @@ static const AsCommonProjectorItem kAsCommonProjectorItems[] = { AsCommonProjector::AsCommonProjector(NeverhoodEngine *vm, Scene *parentScene, Sprite *klayman, Sprite *asPipe) : AnimatedSprite(vm, 1100), _parentScene(parentScene), _klayman(klayman), _asPipe(asPipe) { - _asProjectorItem = &kAsCommonProjectorItems[getGlobalVar(0x04A105B3)]; + _asProjectorItem = &kAsCommonProjectorItems[getGlobalVar(V_PROJECTOR_LOCATION)]; // TODO createSurface3(990, dword_4B26D8); createSurface(990, 640, 480); //TODO: Remeove once the line above is done startAnimation(0x10E3042B, 0, -1); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsCommonProjector::handleMessage); - _x = getGlobalVar(0x04A10F33) * 108 + _asProjectorItem->point.x; + _x = getGlobalVar(V_PROJECTOR_SLOT) * 108 + _asProjectorItem->point.x; _lockedInSlot = true; moveProjector(); setDoDeltaX(1); - if ((int8)getGlobalVar(0x04A10F33) == _asProjectorItem->lockSlotIndex) { + if ((int8)getGlobalVar(V_PROJECTOR_SLOT) == _asProjectorItem->lockSlotIndex) stStayLockedInSlot(); - } loadSound(2, 0xC8C2507C); } @@ -415,8 +414,8 @@ uint32 AsCommonProjector::handleMessage(int messageNum, const MessageParam ¶ messageResult = 1; break; case 0x4807: - setGlobalVar(0x04A10F33, (_x - _asProjectorItem->point.x) / 108); - if ((int8)getGlobalVar(0x04A10F33) == _asProjectorItem->lockSlotIndex) { + setGlobalVar(V_PROJECTOR_SLOT, (_x - _asProjectorItem->point.x) / 108); + if ((int8)getGlobalVar(V_PROJECTOR_SLOT) == _asProjectorItem->lockSlotIndex) { stStartLockedInSlot(); } else { stIdle(); @@ -424,20 +423,20 @@ uint32 AsCommonProjector::handleMessage(int messageNum, const MessageParam ¶ break; case 0x480B: if (param.asInteger() != 1) { - if ((int8)getGlobalVar(0x04A10F33) < _asProjectorItem->maxSlotCount) { - incGlobalVar(0x04A10F33, 1); + if ((int8)getGlobalVar(V_PROJECTOR_SLOT) < _asProjectorItem->maxSlotCount) { + incGlobalVar(V_PROJECTOR_SLOT, 1); } - } else if (getGlobalVar(0x04A10F33) > 0) { - incGlobalVar(0x04A10F33, -1); + } else if (getGlobalVar(V_PROJECTOR_SLOT) > 0) { + incGlobalVar(V_PROJECTOR_SLOT, -1); } stMoving(); break; case 0x480C: // Check if the projector can be moved if (param.asInteger() != 1) { - messageResult = (int8)getGlobalVar(0x04A10F33) < _asProjectorItem->maxSlotCount ? 1 : 0; + messageResult = (int8)getGlobalVar(V_PROJECTOR_SLOT) < _asProjectorItem->maxSlotCount ? 1 : 0; } else { - messageResult = getGlobalVar(0x04A10F33) > 0 ? 1 : 0; + messageResult = getGlobalVar(V_PROJECTOR_SLOT) > 0 ? 1 : 0; } break; case 0x482A: @@ -471,20 +470,20 @@ uint32 AsCommonProjector::hmLockedInSlot(int messageNum, const MessageParam &par break; case 0x480B: if (param.asInteger() != 1) { - if ((int8)getGlobalVar(0x04A10F33) < _asProjectorItem->maxSlotCount) { - incGlobalVar(0x04A10F33, 1); + if ((int8)getGlobalVar(V_PROJECTOR_SLOT) < _asProjectorItem->maxSlotCount) { + incGlobalVar(V_PROJECTOR_SLOT, 1); } - } else if (getGlobalVar(0x04A10F33) > 0) { - incGlobalVar(0x04A10F33, -1); + } else if (getGlobalVar(V_PROJECTOR_SLOT) > 0) { + incGlobalVar(V_PROJECTOR_SLOT, -1); } stTurnToFront(); break; case 0x480C: // Check if the projector can be moved if (param.asInteger() != 1) { - messageResult = (int8)getGlobalVar(0x04A10F33) < _asProjectorItem->maxSlotCount ? 1 : 0; + messageResult = (int8)getGlobalVar(V_PROJECTOR_SLOT) < _asProjectorItem->maxSlotCount ? 1 : 0; } else { - messageResult = getGlobalVar(0x04A10F33) > 0 ? 1 : 0; + messageResult = getGlobalVar(V_PROJECTOR_SLOT) > 0 ? 1 : 0; } break; case 0x480F: @@ -517,14 +516,14 @@ void AsCommonProjector::suMoving() { _x = _klayman->getX() + 100; moveProjector(); if (_beforeMoveX == _x) { - if (getGlobalVar(0x04A10F33) == 0 && _asProjectorItem->leftBorderLeaves != 0) { + if (getGlobalVar(V_PROJECTOR_SLOT) == 0 && _asProjectorItem->leftBorderLeaves != 0) { sendMessage(_parentScene, 0x1019, 0); - incGlobalVar(0x04A105B3, -1); - setGlobalVar(0x04A10F33, kAsCommonProjectorItems[getGlobalVar(0x04A105B3)].maxSlotCount); - } else if ((int8)getGlobalVar(0x04A10F33) == _asProjectorItem->maxSlotCount && _asProjectorItem->rightBorderLeaves != 0) { + incGlobalVar(V_PROJECTOR_LOCATION, -1); + setGlobalVar(V_PROJECTOR_SLOT, kAsCommonProjectorItems[getGlobalVar(V_PROJECTOR_LOCATION)].maxSlotCount); + } else if ((int8)getGlobalVar(V_PROJECTOR_SLOT) == _asProjectorItem->maxSlotCount && _asProjectorItem->rightBorderLeaves != 0) { sendMessage(_parentScene, 0x1019, 1); - incGlobalVar(0x04A105B3, +1); - setGlobalVar(0x04A10F33, 0); + incGlobalVar(V_PROJECTOR_LOCATION, +1); + setGlobalVar(V_PROJECTOR_SLOT, 0); } } Sprite::processDelta(); @@ -579,7 +578,7 @@ void AsCommonProjector::stIdle() { } void AsCommonProjector::stMoving() { - _beforeMoveX = getGlobalVar(0x04A10F33) * 108 + _asProjectorItem->point.x; + _beforeMoveX = getGlobalVar(V_PROJECTOR_SLOT) * 108 + _asProjectorItem->point.x; startAnimation(0x14A10137, 0, -1); SetSpriteUpdate(&AsCommonProjector::suMoving); SetMessageHandler(&AsCommonProjector::handleMessage); @@ -604,7 +603,7 @@ void AsCommonProjector::stStartProjecting() { SetMessageHandler(&AsCommonProjector::hmAnimation); SetSpriteUpdate(NULL); NextState(&AsCommonProjector::stLockedInSlot); - setGlobalVar(0x12A10DB3, 1); + setGlobalVar(V_PROJECTOR_ACTIVE, 1); playSound(0, 0xCC4A8456); _vm->_soundMan->addSound(0x05331081, 0xCE428854); _vm->_soundMan->playSoundLooping(0xCE428854); @@ -622,13 +621,13 @@ void AsCommonProjector::stStopProjecting() { SetSpriteUpdate(NULL); SetMessageHandler(&AsCommonProjector::hmAnimation); NextState(&AsCommonProjector::stStayLockedInSlot); - setGlobalVar(0x12A10DB3, 0); + setGlobalVar(V_PROJECTOR_ACTIVE, 0); playSound(0, 0xCC4A8456); _vm->_soundMan->deleteSound(0xCE428854); } void AsCommonProjector::stTurnToFront() { - _beforeMoveX = getGlobalVar(0x04A10F33) * 108 + _asProjectorItem->point.x; + _beforeMoveX = getGlobalVar(V_PROJECTOR_SLOT) * 108 + _asProjectorItem->point.x; startAnimation(0x22CB4A33, 0, -1); SetSpriteUpdate(&AsCommonProjector::suMoving); SetMessageHandler(&AsCommonProjector::hmAnimation); @@ -636,8 +635,8 @@ void AsCommonProjector::stTurnToFront() { } void AsCommonProjector::stStartSuckedIn() { - setGlobalVar(0x04A105B3, 4); - setGlobalVar(0x04A10F33, 0); + setGlobalVar(V_PROJECTOR_LOCATION, 4); + setGlobalVar(V_PROJECTOR_SLOT, 0); SetSpriteUpdate(&AsCommonProjector::stSuckedIn); SetMessageHandler(&Sprite::handleMessage); startAnimation(0x708D4712, 0, -1); @@ -661,7 +660,7 @@ Scene1401::Scene1401(NeverhoodEngine *vm, Module *parentModule, int which) _ssFloorButton = insertSprite(this, 0x980F3124, 0x12192892, 100, 0); _asPipe = insertSprite(); - if (!getGlobalVar(0x01023818)) { + if (!getGlobalVar(V_MOUSE_SUCKED_IN)) { _asMouse = insertSprite(); _asCheese = insertSprite(); } @@ -691,15 +690,15 @@ Scene1401::Scene1401(NeverhoodEngine *vm, Module *parentModule, int which) _sprite1->setVisible(false); } - if (getGlobalVar(0x04A105B3) == 2) { + if (getGlobalVar(V_PROJECTOR_LOCATION) == 2) { _asProjector = insertSprite(this, _klayman, _asPipe); _vm->_collisionMan->addSprite(_asProjector); - if (getGlobalVar(0x04A10F33) == 6) { + if (getGlobalVar(V_PROJECTOR_SLOT) == 6) { sendEntityMessage(_klayman, 0x1014, _asProjector); _klayman->setX(_asProjector->getX() + 100); _klayman->processDelta(); setMessageList(0x004B6670); - } else if (getGlobalVar(0x04A10F33) == 0) { + } else if (getGlobalVar(V_PROJECTOR_SLOT) == 0) { sendEntityMessage(_klayman, 0x1014, _asProjector); _klayman->setX(_asProjector->getX() - 100); _klayman->processDelta(); @@ -754,10 +753,10 @@ uint32 Scene1401::handleMessage(int messageNum, const MessageParam ¶m, Entit case 0x480B: if (sender == _ssFloorButton) { sendMessage(_asPipe, 0x2000, 0); - if (!getGlobalVar(0x01023818)) { + if (!getGlobalVar(V_MOUSE_SUCKED_IN)) { sendMessage(_asMouse, 0x4839, 0); sendMessage(_asCheese, 0x4839, 0); - setGlobalVar(0x01023818, 1); + setGlobalVar(V_MOUSE_SUCKED_IN, 1); } if (_asProjector && _asProjector->getX() > 404 && _asProjector->getX() < 504) sendMessage(_asProjector , 0x4839, 0); @@ -880,7 +879,7 @@ Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which) _ssBridgePart2 = insertSprite(0x10A02120, 1100); _ssBridgePart3 = insertSprite(0x60882BE0, 1100); - if (getGlobalVar(0x70A1189C)) + if (getGlobalVar(V_MOUSE_PUZZLE_SOLVED)) setRectList(0x004B0C48); else setRectList(0x004B0C98); @@ -888,7 +887,7 @@ Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which) if (which < 0) { insertKlayman(377, 391); setMessageList(0x004B0B48); - if (!getGlobalVar(0x70A1189C)) { + if (!getGlobalVar(V_MOUSE_PUZZLE_SOLVED)) { _asPuzzleBox = insertSprite(this, 0); } } else if (which == 1) { @@ -898,7 +897,7 @@ Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which) insertKlayman(377, 391); setMessageList(0x004B0B60); _klayman->setDoDeltaX(1); - if (getGlobalVar(0x70A1189C)) { + if (getGlobalVar(V_MOUSE_PUZZLE_SOLVED)) { _asPuzzleBox = insertSprite(this, 1); clearRectList(); showMouse(false); @@ -909,7 +908,7 @@ Scene1402::Scene1402(NeverhoodEngine *vm, Module *parentModule, int which) } else { insertKlayman(513, 391); setMessageList(0x004B0B58); - if (!getGlobalVar(0x70A1189C)) { + if (!getGlobalVar(V_MOUSE_PUZZLE_SOLVED)) { _asPuzzleBox = insertSprite(this, 2); startShaking(); } @@ -959,7 +958,7 @@ uint32 Scene1402::handleMessage(int messageNum, const MessageParam ¶m, Entit switch (messageNum) { case 0x100D: if (param.asInteger() == 0x00F43389) { - if (getGlobalVar(0x70A1189C)) { + if (getGlobalVar(V_MOUSE_PUZZLE_SOLVED)) { leaveScene(0); } else { clearRectList(); @@ -1301,7 +1300,7 @@ uint32 Scene1407::handleMessage(int messageNum, const MessageParam ¶m, Entit break; case 0x2000: // The mouse got the cheese (nomnom) - setGlobalVar(0x70A1189C, 1); + setGlobalVar(V_MOUSE_PUZZLE_SOLVED, 1); playSound(0, 0x68E25540); showMouse(false); _puzzleSolvedCountdown = 72; @@ -1348,10 +1347,10 @@ Scene1403::Scene1403(NeverhoodEngine *vm, Module *parentModule, int which) } _klayman->setRepl(64, 0); - if (getGlobalVar(0x04A105B3) == 4) { + if (getGlobalVar(V_PROJECTOR_LOCATION) == 4) { _asProjector = insertSprite(this, _klayman, (Sprite*)NULL); _vm->_collisionMan->addSprite(_asProjector); - if (getGlobalVar(0x04A10F33) == 4) { + if (getGlobalVar(V_PROJECTOR_SLOT) == 4) { sendEntityMessage(_klayman, 0x1014, _asProjector); _klayman->setX(_asProjector->getX() + 100); _klayman->processDelta(); @@ -1425,8 +1424,8 @@ uint32 Scene1403::handleMessage(int messageNum, const MessageParam ¶m, Entit Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true), _asProjector(NULL), _asKey(NULL) { - if (getGlobalVar(0xC0780812) && getGlobalVar(0x13382860) == 0) - setGlobalVar(0x13382860, 5); + if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0) + setGlobalVar(V_KEY3_LOCATION, 5); SetMessageHandler(&Scene1404::handleMessage); _surfaceFlag = true; @@ -1438,7 +1437,7 @@ Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which) _palette->addPalette(0x00801510, 0, 65, 0); insertMouse433(0xB006BAC8); - if (getGlobalVar(0x13382860) == 5) { + if (getGlobalVar(V_KEY3_LOCATION) == 5) { _asKey = insertSprite(this, 2, 1100, 267, 411); _vm->_collisionMan->addSprite(_asKey); } @@ -1455,7 +1454,7 @@ Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which) insertKlayman(376, 406); setMessageList(0x004B8C30); } else if (which == 2) { - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(347, 406); _klayman->setDoDeltaX(1); } else { @@ -1467,10 +1466,10 @@ Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004B8C38); } - if (getGlobalVar(0x04A105B3) == 3) { + if (getGlobalVar(V_PROJECTOR_LOCATION) == 3) { _asProjector = insertSprite(this, _klayman, (Sprite*)NULL); _vm->_collisionMan->addSprite(_asProjector); - if (getGlobalVar(0x04A10F33) == 0) { + if (getGlobalVar(V_PROJECTOR_SLOT) == 0) { sendEntityMessage(_klayman, 0x1014, _asProjector); _klayman->setX(_asProjector->getX() - 100); _klayman->processDelta(); @@ -1484,7 +1483,7 @@ Scene1404::Scene1404(NeverhoodEngine *vm, Module *parentModule, int which) } Scene1404::~Scene1404() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } uint32 Scene1404::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { diff --git a/engines/neverhood/module1600.cpp b/engines/neverhood/module1600.cpp index 5d0207b1339..f45f87faca3 100644 --- a/engines/neverhood/module1600.cpp +++ b/engines/neverhood/module1600.cpp @@ -95,17 +95,17 @@ void Module1600::createScene(int sceneNum, int which) { _childObject = new Scene1609(_vm, this, which); break; case 1001: - if (getGlobalVar(0xA0808898) == 1) { + if (getGlobalVar(V_TALK_COUNTING_INDEX) == 1) { createSmackerScene(0x80050200, true, true, false); - } else if (getGlobalVar(0xA0808898) == 2) { + } else if (getGlobalVar(V_TALK_COUNTING_INDEX) == 2) { createSmackerScene(0x80090200, true, true, false); } else { createSmackerScene(0x80000200, true, true, false); } - if (getGlobalVar(0xA0808898) >= 2) - setGlobalVar(0xA0808898, 0); + if (getGlobalVar(V_TALK_COUNTING_INDEX) >= 2) + setGlobalVar(V_TALK_COUNTING_INDEX, 0); else - incGlobalVar(0xA0808898, +1); + incGlobalVar(V_TALK_COUNTING_INDEX, +1); break; } SetUpdateHandler(&Module1600::updateScene); @@ -210,13 +210,13 @@ AsCommonCar::AsCommonCar(NeverhoodEngine *vm, Scene *parentScene, int16 x, int16 _rectList = NULL; startAnimation(0xD4220027, 0, -1); - setDoDeltaX(getGlobalVar(0x21E60190)); + setDoDeltaX(getGlobalVar(V_CAR_DELTA_X)); } AsCommonCar::~AsCommonCar() { if (_finalizeStateCb == AnimationCallback(&AsCommonCar::sub45D620)) { - setGlobalVar(0x21E60190, !getGlobalVar(0x21E60190)); + setGlobalVar(V_CAR_DELTA_X, !getGlobalVar(V_CAR_DELTA_X)); } } @@ -548,7 +548,7 @@ void AsCommonCar::sub45D100() { } else { startAnimation(0xD4220027, 0, -1); } - setGlobalVar(0x21E60190, _doDeltaX ? 1 : 0); + setGlobalVar(V_CAR_DELTA_X, _doDeltaX ? 1 : 0); } void AsCommonCar::sub45D180() { @@ -1068,7 +1068,7 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) the upper/lower floors and rename them accordingly. */ - setGlobalVar(0x21E60190, 1); + setGlobalVar(V_CAR_DELTA_X, 1); _surfaceFlag = true; SetMessageHandler(&Scene1608::hmLowerFloor); @@ -1127,7 +1127,7 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) _asIdleCarLower = insertSprite(375, 227); _asIdleCarFull = insertSprite(375, 227); _asCar->setVisible(false); - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(373, 220); _klayman->setDoDeltaX(1); } else { @@ -1204,7 +1204,7 @@ Scene1608::Scene1608(NeverhoodEngine *vm, Module *parentModule, int which) } Scene1608::~Scene1608() { - setGlobalVar(0xC0418A02, _kmScene1608->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _kmScene1608->isDoDeltaX() ? 1 : 0); if (_klaymanInCar) { delete _kmScene1608; } else { @@ -1388,7 +1388,7 @@ Scene1609::Scene1609(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true), _countdown1(1), _currentSymbolIndex(0), _symbolPosition(0), _changeCurrentSymbol(true), _isSolved(false) { // TODO _vm->gameModule()->initScene3011Vars(); - _noisySymbolIndex = getGlobalVar(0x2414C2F2); + _noisySymbolIndex = getGlobalVar(V_NOISY_SYMBOL_INDEX); _surfaceFlag = true; SetMessageHandler(&Scene1609::handleMessage); diff --git a/engines/neverhood/module1700.cpp b/engines/neverhood/module1700.cpp index b75167fa4d8..f6d140b9048 100644 --- a/engines/neverhood/module1700.cpp +++ b/engines/neverhood/module1700.cpp @@ -186,7 +186,7 @@ Scene1705::Scene1705(NeverhoodEngine *vm, Module *parentModule, int which) Sprite *tempSprite; - setGlobalVar(0xE7498218, 1); + setGlobalVar(V_FELL_DOWN_HOLE, 1); _vm->gameModule()->initScene3009Vars(); SetMessageHandler(&Scene1705::handleMessage); diff --git a/engines/neverhood/module1900.cpp b/engines/neverhood/module1900.cpp index 5bb03d4aa17..7925c46b9a1 100644 --- a/engines/neverhood/module1900.cpp +++ b/engines/neverhood/module1900.cpp @@ -101,9 +101,9 @@ Scene1901::Scene1901(NeverhoodEngine *vm, Module *parentModule, int which) insertStaticSprite(0x42213133, 1100); - if (!getGlobalVar(0xA9035F60)) { + if (!getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) { insertStaticSprite(0x40A40168, 100); - } else if (getGlobalVar(0x09221A62)) { + } else if (getGlobalVar(V_STAIRS_DOWN)) { insertStaticSprite(0x124404C4, 100); setGlobalVar(0x2050861A, 1); } else { @@ -195,10 +195,10 @@ AsScene1907Symbol::AsScene1907Symbol(NeverhoodEngine *vm, Scene1907 *parentScene _symbolFlag1 = 0; _symbolFlag2 = 0; - if (getGlobalVar(0xA9035F60)) { + if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) { _isPluggedIn = true; _currPositionIndex = elementIndex; - if (!getGlobalVar(0x09221A62)) { + if (!getGlobalVar(V_STAIRS_DOWN)) { _x = kAsScene1907SymbolPluggedInPositions[_currPositionIndex].x; _y = kAsScene1907SymbolPluggedInPositions[_currPositionIndex].y; } else { @@ -325,7 +325,7 @@ void AsScene1907Symbol::suMoveDown() { void AsScene1907Symbol::suMoveUp() { _y -= _yIncr; - if (getGlobalVar(0x10938830)) { + if (getGlobalVar(V_WALL_BROKEN)) { if (_y - (9 + (_elementIndex > 5 ? 31 : 0)) < kAsScene1907SymbolPluggedInPositions[_elementIndex].y) { _yIncr--; } else { @@ -470,8 +470,8 @@ SsScene1907UpDownButton::SsScene1907UpDownButton(NeverhoodEngine *vm, Scene1907 loadSound(0, 0x44061000); SetUpdateHandler(&SsScene1907UpDownButton::update); SetMessageHandler(&SsScene1907UpDownButton::handleMessage); - if (getGlobalVar(0xA9035F60)) { - if (getGlobalVar(0x09221A62)) + if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) { + if (getGlobalVar(V_STAIRS_DOWN)) setToDownPosition(); else setToUpPosition(); @@ -490,7 +490,7 @@ uint32 SsScene1907UpDownButton::handleMessage(int messageNum, const MessageParam uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1011: - if (_countdown1 == 0 && !_asScene1907Symbol->isMoving() && getGlobalVar(0xA9035F60)) { + if (_countdown1 == 0 && !_asScene1907Symbol->isMoving() && getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) { setVisible(true); _countdown1 = 4; StaticSprite::update(); @@ -582,7 +582,7 @@ Scene1907::Scene1907(NeverhoodEngine *vm, Module *parentModule, int which) SetMessageHandler(&Scene1907::handleMessage); SetUpdateHandler(&Scene1907::update); - if (getGlobalVar(0xA9035F60)) + if (getGlobalVar(V_STAIRS_PUZZLE_SOLVED)) _pluggedInCount = 9; loadSound(0, 0x72004A10); @@ -640,20 +640,20 @@ uint32 Scene1907::handleMessage(int messageNum, const MessageParam ¶m, Entit break; // TODO Debug stuff case 0x2000: - if (getGlobalVar(0x09221A62)) { + if (getGlobalVar(V_STAIRS_DOWN)) { playSound(0); for (int i = 0; i < 9; i++) _asSymbols[i]->moveUp(); _ssUpDownButton->setToUpPosition(); - setGlobalVar(0x09221A62, 0); + setGlobalVar(V_STAIRS_DOWN, 0); } else { - if (!getGlobalVar(0x10938830)) { + if (!getGlobalVar(V_WALL_BROKEN)) { playSound(2); _countdown3 = 5; } else { playSound(1); _ssUpDownButton->setToDownPosition(); - setGlobalVar(0x09221A62, 1); + setGlobalVar(V_STAIRS_DOWN, 1); } _moveDownCountdown = 1; _currMovingSymbolIndex = 8; @@ -661,7 +661,7 @@ uint32 Scene1907::handleMessage(int messageNum, const MessageParam ¶m, Entit break; case 0x2001: playSound(3); - setGlobalVar(0xA9035F60, 1); + setGlobalVar(V_STAIRS_PUZZLE_SOLVED, 1); break; } return 0; diff --git a/engines/neverhood/module2000.cpp b/engines/neverhood/module2000.cpp index 6ff8a405c35..befcc3414a9 100644 --- a/engines/neverhood/module2000.cpp +++ b/engines/neverhood/module2000.cpp @@ -51,10 +51,10 @@ void Module2000::createScene(int sceneNum, int which) { _childObject = new Scene2001(_vm, this, which); break; case 1: - createNavigationScene(getGlobalVar(0x98109F12) ? 0x004B7B48 : 0x004B7B00, which); + createNavigationScene(getGlobalVar(V_WORLDS_JOINED) ? 0x004B7B48 : 0x004B7B00, which); break; case 2: - setGlobalVar(0x98109F12, 1); + setGlobalVar(V_WORLDS_JOINED, 1); setSubVar(0x2C145A98, 1, 1); createSmackerScene(0x204B2031, true, true, false); break; @@ -75,7 +75,7 @@ void Module2000::updateScene() { break; case 1: if (_moduleResult == 0) { - if (getGlobalVar(0x98109F12)) { + if (getGlobalVar(V_WORLDS_JOINED)) { createScene(1, 0); } else { createScene(2, -1); diff --git a/engines/neverhood/module2100.cpp b/engines/neverhood/module2100.cpp index 44ef868adb0..700f0cdbd88 100644 --- a/engines/neverhood/module2100.cpp +++ b/engines/neverhood/module2100.cpp @@ -65,7 +65,7 @@ void Module2100::updateScene() { switch (_vm->gameState().sceneNum) { case 0: if (_moduleResult == 1) { - setGlobalVar(0x2090590C, 1); + setGlobalVar(V_DOOR_PASSED, 1); leaveModule(0); } else { leaveModule(1); diff --git a/engines/neverhood/module2200.cpp b/engines/neverhood/module2200.cpp index 29b4103bb55..503a1d37c09 100644 --- a/engines/neverhood/module2200.cpp +++ b/engines/neverhood/module2200.cpp @@ -200,13 +200,13 @@ void Module2200::createScene(int sceneNum, int which) { _childObject = new Scene2247(_vm, this, which); break; case 47: - if (!getGlobalVar(0x98109F12)) { - if (getGlobalVar(0x4D080E54)) + if (!getGlobalVar(V_WORLDS_JOINED)) { + if (getGlobalVar(V_LIGHTS_ON)) createStaticScene(0x83110287, 0x10283839); else createStaticScene(0x83412B9D, 0x12B9983C); } else { - if (getGlobalVar(0x4D080E54)) + if (getGlobalVar(V_LIGHTS_ON)) createStaticScene(0x48632087, 0x3208348E); else createStaticScene(0x08C74886, 0x74882084); @@ -533,7 +533,7 @@ Scene2201::Scene2201(NeverhoodEngine *vm, Module *parentModule, int which) _clipRects[1].x2 = 640; _clipRects[1].y2 = 480; - if (!getGlobalVar(0x404290D5)) { + if (!getGlobalVar(V_TILE_PUZZLE_SOLVED)) { insertStaticSprite(0x00026027, 900); } @@ -560,7 +560,7 @@ Scene2201::Scene2201(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004B8130); _asDoor = insertSprite(_klayman, _ssDoorLight, false); } else if (which == 2) { - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(379, 427, _clipRects, 2); _klayman->setDoDeltaX(1); } else { @@ -582,7 +582,7 @@ Scene2201::Scene2201(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2201::~Scene2201() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); _vm->_soundMan->deleteSoundGroup(0x04106220); } @@ -607,7 +607,7 @@ uint32 Scene2201::handleMessage(int messageNum, const MessageParam ¶m, Entit setMessageList(0x004B81B8); } } else if (param.asInteger() == 0x51445010) { - if (getGlobalVar(0x404290D5)) { + if (getGlobalVar(V_TILE_PUZZLE_SOLVED)) { setMessageList(0x004B8108); } else { setMessageList(0x004B8150); @@ -615,7 +615,7 @@ uint32 Scene2201::handleMessage(int messageNum, const MessageParam ¶m, Entit } else if (param.asInteger() == 0x1D203082) { setMessageList(0x004B8180); } else if (param.asInteger() == 0x00049091) { - if (getGlobalVar(0x404290D5)) { + if (getGlobalVar(V_TILE_PUZZLE_SOLVED)) { setMessageList(0x004B8138); } else { setMessageList(0x004B8108); @@ -707,7 +707,7 @@ uint32 SsScene2202PuzzleTile::handleMessage(int messageNum, const MessageParam & uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1011: - if (!_isMoving && !getGlobalVar(0x404290D5)) { + if (!_isMoving && !getGlobalVar(V_TILE_PUZZLE_SOLVED)) { sendMessage(_parentScene, 0x2000, _tileIndex); } messageResult = 1; @@ -956,7 +956,7 @@ void Scene2202::update() { _ssDoneMovingTile = NULL; if (testIsSolved()) { playSound(0); - setGlobalVar(0x404290D5, 1); + setGlobalVar(V_TILE_PUZZLE_SOLVED, 1); _isSolved = true; } } @@ -1061,7 +1061,7 @@ AsScene2203Door::AsScene2203Door(NeverhoodEngine *vm, Scene *parentScene, uint d _x = 320; _y = 240; createSurface1(kAsScene2203DoorFileHashes[_doorIndex], 900); - if (getGlobalVar(0x9A500914) == _doorIndex) { + if (getGlobalVar(V_LARGE_DOOR_NUMBER) == _doorIndex) { startAnimation(kAsScene2203DoorFileHashes[_doorIndex], -1, -1); _newStickFrameIndex = -2; } else { @@ -1074,7 +1074,7 @@ uint32 AsScene2203Door::handleMessage(int messageNum, const MessageParam ¶m, uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x1011: - if (_doorIndex == getGlobalVar(0x9A500914)) + if (_doorIndex == getGlobalVar(V_LARGE_DOOR_NUMBER)) sendMessage(_parentScene, 0x2002, 0); else sendMessage(_parentScene, 0x2001, 0); @@ -1084,12 +1084,12 @@ uint32 AsScene2203Door::handleMessage(int messageNum, const MessageParam ¶m, _otherDoor = (Sprite*)param.asEntity(); break; case 0x3002: - if (_doorIndex == getGlobalVar(0x9A500914)) + if (_doorIndex == getGlobalVar(V_LARGE_DOOR_NUMBER)) sendMessage(_parentScene, 0x4808, 0); stopAnimation(); break; case 0x4808: - setGlobalVar(0x9A500914, _doorIndex); + setGlobalVar(V_LARGE_DOOR_NUMBER, _doorIndex); sendMessage(_otherDoor, 0x4809, 0); openDoor(); break; @@ -1115,8 +1115,8 @@ void AsScene2203Door::closeDoor() { Scene2203::Scene2203(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true) { - if (getGlobalVar(0xC0780812) && getGlobalVar(0x13382860) == 0) - setGlobalVar(0x13382860, 1); + if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0) + setGlobalVar(V_KEY3_LOCATION, 1); SetMessageHandler(&Scene2203::handleMessage); _surfaceFlag = true; @@ -1127,9 +1127,9 @@ Scene2203::Scene2203(NeverhoodEngine *vm, Module *parentModule, int which) setHitRects(0x004B8320); - //DEBUG setGlobalVar(0x13382860, 1);//###//TODO CHECK IF Below... + //DEBUG setGlobalVar(V_KEY3_LOCATION, 1);//###//TODO CHECK IF Below... - if (getGlobalVar(0x13382860) == 1) { + if (getGlobalVar(V_KEY3_LOCATION) == 1) { _asKey = insertSprite(this, 2, 1100, 282, 432); _vm->_collisionMan->addSprite(_asKey); } @@ -1159,7 +1159,7 @@ Scene2203::Scene2203(NeverhoodEngine *vm, Module *parentModule, int which) insertKlayman(640, 427); setMessageList(0x004B8350); } else if (which == 2) { - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(362, 427); _klayman->setDoDeltaX(1); } else { @@ -1171,7 +1171,7 @@ Scene2203::Scene2203(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004B8348); } - if (getGlobalVar(0x9A500914)) { + if (getGlobalVar(V_LARGE_DOOR_NUMBER)) { _ssSmallLeftDoor->setVisible(false); _klayman->setClipRect(_rightDoorClipRect); } else { @@ -1184,7 +1184,7 @@ Scene2203::Scene2203(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2203::~Scene2203() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } uint32 Scene2203::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1238,7 +1238,7 @@ SsScene2205DoorFrame::SsScene2205DoorFrame(NeverhoodEngine *vm) : StaticSprite(vm, 900) { SetMessageHandler(&SsScene2205DoorFrame::handleMessage); - _spriteResource.load2(getGlobalVar(0x4D080E54) ? 0x24306227 : 0xD90032A0); + _spriteResource.load2(getGlobalVar(V_LIGHTS_ON) ? 0x24306227 : 0xD90032A0); createSurface(1100, 45, 206); _drawRect.x = 0; _drawRect.y = 0; @@ -1254,7 +1254,7 @@ uint32 SsScene2205DoorFrame::handleMessage(int messageNum, const MessageParam &p uint32 messageResult = Sprite::handleMessage(messageNum, param, sender); switch (messageNum) { case 0x2000: - _spriteResource.load2(getGlobalVar(0x4D080E54) ? 0x24306227 : 0xD90032A0); + _spriteResource.load2(getGlobalVar(V_LIGHTS_ON) ? 0x24306227 : 0xD90032A0); _drawRect.x = 0; _drawRect.y = 0; _drawRect.width = _spriteResource.getDimensions().width; @@ -1276,7 +1276,7 @@ Scene2205::Scene2205(NeverhoodEngine *vm, Module *parentModule, int which) setHitRects(0x004B0620); _surfaceFlag = true; - if (getGlobalVar(0x4D080E54)) { + if (getGlobalVar(V_LIGHTS_ON)) { _isLightOn = true; setBackground(0x0008028D); setPalette(0x0008028D); @@ -1299,14 +1299,14 @@ Scene2205::Scene2205(NeverhoodEngine *vm, Module *parentModule, int which) if (which < 0) { insertKlayman(320, 417); setMessageList(0x004B0658); - if (!getGlobalVar(0x4D080E54)) { + if (!getGlobalVar(V_LIGHTS_ON)) { _palette->addPalette(0x68033B1C, 0, 65, 0); } _isKlaymanInLight = false; } else if (which == 1) { insertKlayman(640, 417); setMessageList(0x004B0648); - if (!getGlobalVar(0x4D080E54)) { + if (!getGlobalVar(V_LIGHTS_ON)) { _palette->addPalette(0x68033B1C, 0, 65, 0); } _isKlaymanInLight = false; @@ -1326,14 +1326,14 @@ Scene2205::Scene2205(NeverhoodEngine *vm, Module *parentModule, int which) void Scene2205::update() { Scene::update(); - if (!_isLightOn && getGlobalVar(0x4D080E54)) { + if (!_isLightOn && getGlobalVar(V_LIGHTS_ON)) { _palette->addPalette(0x0008028D, 0, 256, 0); changeBackground(0x0008028D); _ssLightSwitch->setFileHashes(0x2D339030, 0x2D309030); sendMessage(_ssDoorFrame, 0x2000, 0); changeMouseCursor(0x80289008); _isLightOn = true; - } else if (_isLightOn && !getGlobalVar(0x4D080E54)) { + } else if (_isLightOn && !getGlobalVar(V_LIGHTS_ON)) { _palette->addPalette(0xD00A028D, 0, 256, 0); changeBackground(0xD00A028D); _ssLightSwitch->setFileHashes(0x2D339030, 0xDAC86E84); @@ -1347,7 +1347,7 @@ void Scene2205::update() { _isLightOn = false; } - if (!getGlobalVar(0x4D080E54)) { + if (!getGlobalVar(V_LIGHTS_ON)) { if (_isKlaymanInLight && _klayman->getX() > 85) { _palette->addBasePalette(0x68033B1C, 0, 65, 0); _palette->startFadeToPalette(12); @@ -1374,7 +1374,7 @@ uint32 Scene2205::handleMessage(int messageNum, const MessageParam ¶m, Entit } break; case 0x480B: - setGlobalVar(0x4D080E54, getGlobalVar(0x4D080E54) ? 0 : 1); + setGlobalVar(V_LIGHTS_ON, getGlobalVar(V_LIGHTS_ON) ? 0 : 1); break; } return 0; @@ -1409,7 +1409,7 @@ static const int16 kAsScene2206DoorSpikesXDeltasClose[] = { AsScene2206DoorSpikes::AsScene2206DoorSpikes(NeverhoodEngine *vm, uint32 fileHash) : StaticSprite(vm, fileHash, 200) { - if (getGlobalVar(0x18890C91)) + if (getGlobalVar(V_SPIKES_RETRACTED)) _x -= 63; SetUpdateHandler(&AsScene2206DoorSpikes::update); SetMessageHandler(&AsScene2206DoorSpikes::handleMessage); @@ -1493,7 +1493,7 @@ void AsScene2206Platform::suMoveDown() { SsScene2206TestTube::SsScene2206TestTube(NeverhoodEngine *vm, Scene *parentScene, int surfacePriority, uint32 fileHash) : StaticSprite(vm, fileHash, surfacePriority), _parentScene(parentScene) { - if (getGlobalVar(0x45080C38)) { + if (getGlobalVar(V_HAS_TEST_TUBE)) { setVisible(false); SetMessageHandler(NULL); } else { @@ -1511,7 +1511,7 @@ uint32 SsScene2206TestTube::handleMessage(int messageNum, const MessageParam &pa messageResult = 1; break; case 0x4806: - setGlobalVar(0x45080C38, 1); + setGlobalVar(V_HAS_TEST_TUBE, 1); setVisible(false); SetMessageHandler(NULL); break; @@ -1528,7 +1528,7 @@ Scene2206::Scene2206(NeverhoodEngine *vm, Module *parentModule, int which) SetMessageHandler(&Scene2206::handleMessage); _surfaceFlag = true; - if (getGlobalVar(0x4D080E54)) { + if (getGlobalVar(V_LIGHTS_ON)) { fileHash = 0x41983216; _sprite1 = insertStaticSprite(0x2201266A, 100); _sprite2 = insertStaticSprite(0x3406A333, 300); @@ -1563,7 +1563,7 @@ Scene2206::Scene2206(NeverhoodEngine *vm, Module *parentModule, int which) _palette->addBasePalette(fileHash, 0, 256, 0); - if (!getGlobalVar(0x4D080E54)) { + if (!getGlobalVar(V_LIGHTS_ON)) { _palette->addPalette(0x0263D144, 0, 65, 0); } @@ -1578,12 +1578,12 @@ Scene2206::Scene2206(NeverhoodEngine *vm, Module *parentModule, int which) } else if (which == 2) { insertKlayman(205, 396); setMessageList(0x004B88C8); - _palette->addPalette(getGlobalVar(0x4D080E54) ? 0xB103B604 : 0x0263D144, 0, 65, 0); + _palette->addPalette(getGlobalVar(V_LIGHTS_ON) ? 0xB103B604 : 0x0263D144, 0, 65, 0); klaymanBehindSpikes(); playSound(0, 0x53B8284A); } else if (which == 3) { - insertKlayman(kScene2206XPositions[getGlobalVar(0x48A68852)], 430); - if (getGlobalVar(0xC0418A02)) + insertKlayman(kScene2206XPositions[getGlobalVar(V_CLICKED_COLUMN_INDEX)], 430); + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) _klayman->setDoDeltaX(1); setMessageList(0x004B8A70); } else { @@ -1597,7 +1597,7 @@ Scene2206::Scene2206(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2206::~Scene2206() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } uint32 Scene2206::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -1609,7 +1609,7 @@ uint32 Scene2206::handleMessage(int messageNum, const MessageParam ¶m, Entit } else if (param.asInteger() == 0x402064D8) { sendEntityMessage(_klayman, 0x1014, _ssButton); } else if (param.asInteger() == 0x11C40840) { - if (getGlobalVar(0x18890C91)) + if (getGlobalVar(V_SPIKES_RETRACTED)) setMessageList(0x004B8948); else setMessageList(0x004B8970); @@ -1620,8 +1620,8 @@ uint32 Scene2206::handleMessage(int messageNum, const MessageParam ¶m, Entit break; case 0x480B: if (sender == _ssButton) { - setGlobalVar(0x18890C91, getGlobalVar(0x18890C91) ? 0 : 1); - if (getGlobalVar(0x18890C91)) + setGlobalVar(V_SPIKES_RETRACTED, getGlobalVar(V_SPIKES_RETRACTED) ? 0 : 1); + if (getGlobalVar(V_SPIKES_RETRACTED)) sendMessage(_asDoorSpikes, 0x4808, 0); else sendMessage(_asDoorSpikes, 0x4809, 0); @@ -1642,7 +1642,7 @@ uint32 Scene2206::handleMessage(int messageNum, const MessageParam ¶m, Entit } void Scene2206::klaymanInFrontSpikes() { - if (getGlobalVar(0x4D080E54)) { + if (getGlobalVar(V_LIGHTS_ON)) { _palette->addBasePalette(0x41983216, 0, 65, 0); _palette->startFadeToPalette(12); } @@ -1654,7 +1654,7 @@ void Scene2206::klaymanInFrontSpikes() { } void Scene2206::klaymanBehindSpikes() { - if (!getGlobalVar(0x4D080E54)) { + if (!getGlobalVar(V_LIGHTS_ON)) { _palette->addBasePalette(0xB103B604, 0, 65, 0); _palette->startFadeToPalette(12); } @@ -1666,16 +1666,16 @@ void Scene2206::klaymanBehindSpikes() { } void Scene2206::readClickedColumn() { - setGlobalVar(0x48A68852, (_mouseClickPos.x - 354) / 96); - if (getGlobalVar(0x48A68852) > 2) - setGlobalVar(0x48A68852, 2); - setGlobalVar(0x49C40058, (_mouseClickPos.y - 183) / 7); - setGlobalVar(0xC8C28808, calcHash("stLineagex")); - setGlobalVar(0x4CE79018, 0); - if (ABS(kScene2206XPositions[getGlobalVar(0x48A68852)] - _klayman->getX()) >= 144) { - setMessageList2(kScene2206MessageIds1[getGlobalVar(0x48A68852)]); + setGlobalVar(V_CLICKED_COLUMN_INDEX, (_mouseClickPos.x - 354) / 96); + if (getGlobalVar(V_CLICKED_COLUMN_INDEX) > 2) + setGlobalVar(V_CLICKED_COLUMN_INDEX, 2); + setGlobalVar(V_CLICKED_COLUMN_ROW, (_mouseClickPos.y - 183) / 7); + setGlobalVar(V_COLUMN_TEXT_NAME, calcHash("stLineagex")); + setGlobalVar(V_COLUMN_BACK_NAME, 0); + if (ABS(kScene2206XPositions[getGlobalVar(V_CLICKED_COLUMN_INDEX)] - _klayman->getX()) >= 144) { + setMessageList2(kScene2206MessageIds1[getGlobalVar(V_CLICKED_COLUMN_INDEX)]); } else { - setMessageList2(kScene2206MessageIds2[getGlobalVar(0x48A68852)]); + setMessageList2(kScene2206MessageIds2[getGlobalVar(V_CLICKED_COLUMN_INDEX)]); } } @@ -1705,7 +1705,7 @@ AsScene2207Elevator::AsScene2207Elevator(NeverhoodEngine *vm, Scene *parentScene _x = pt.x; _y = pt.y; createSurface(1100, 129, 103); - startAnimation(getGlobalVar(0x4D080E54) ? 0xC858CC19 : 0x294B3377, 0, 0); + startAnimation(getGlobalVar(V_LIGHTS_ON) ? 0xC858CC19 : 0x294B3377, 0, 0); SetUpdateHandler(&AsScene2207Elevator::update); SetSpriteUpdate(&AsScene2207Elevator::suSetPosition); SetMessageHandler(&AsScene2207Elevator::handleMessage); @@ -1720,7 +1720,7 @@ void AsScene2207Elevator::update() { if (_destPointIndex + _destPointIndexDelta > _pointIndex) { _pointIndex++; - startAnimation(getGlobalVar(0x4D080E54) ? 0xC858CC19 : 0x294B3377, _pointIndex, _pointIndex); + startAnimation(getGlobalVar(V_LIGHTS_ON) ? 0xC858CC19 : 0x294B3377, _pointIndex, _pointIndex); _newStickFrameIndex = _pointIndex; if (_destPointIndex + _destPointIndexDelta == _pointIndex) { if (_destPointIndexDelta != 0) { @@ -1736,7 +1736,7 @@ void AsScene2207Elevator::update() { _pointIndex--; if (_pointIndex == 0) sendMessage(_parentScene, 0x2003, 0); - startAnimation(getGlobalVar(0x4D080E54) ? 0xC858CC19 : 0x294B3377, _pointIndex, _pointIndex); + startAnimation(getGlobalVar(V_LIGHTS_ON) ? 0xC858CC19 : 0x294B3377, _pointIndex, _pointIndex); _newStickFrameIndex = _pointIndex; if (_destPointIndex + _destPointIndexDelta == _pointIndex) { if (_destPointIndexDelta != 0) { @@ -2012,7 +2012,7 @@ Scene2207::Scene2207(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true), _klaymanAtElevator(true), _elevatorSurfacePriority(0) { //DEBUG>>> - setGlobalVar(0x4D080E54, 1); + //setGlobalVar(V_LIGHTS_ON, 1); //DEBUG<<< _vm->gameModule()->initScene3009Vars(); @@ -2031,7 +2031,7 @@ Scene2207::Scene2207(NeverhoodEngine *vm, Module *parentModule, int which) _asElevator = insertSprite(this); - if (getGlobalVar(0x4D080E54)) { + if (getGlobalVar(V_LIGHTS_ON)) { setBackground(0x88C00241); setPalette(0x88C00241); @@ -2061,7 +2061,7 @@ Scene2207::Scene2207(NeverhoodEngine *vm, Module *parentModule, int which) } else { - setGlobalVar(0x81890D14, 1); + setGlobalVar(V_SEEN_SYMBOLS_NO_LIGHT, 1); setBackground(0x05C02A55); setPalette(0x05C02A55); @@ -2227,18 +2227,18 @@ Scene2208::Scene2208(NeverhoodEngine *vm, Module *parentModule, int which) SpriteResource spriteResource(_vm); const char *textStart, *textEnd; - if (!getGlobalVar(0xC8C28808)) - setGlobalVar(0xC8C28808, calcHash("stLineagex")); + if (!getGlobalVar(V_COLUMN_TEXT_NAME)) + setGlobalVar(V_COLUMN_TEXT_NAME, calcHash("stLineagex")); - _textResource.load(getGlobalVar(0xC8C28808)); + _textResource.load(getGlobalVar(V_COLUMN_TEXT_NAME)); - textStart = _textResource.getString(getGlobalVar(0x48A68852), textEnd); + textStart = _textResource.getString(getGlobalVar(V_CLICKED_COLUMN_INDEX), textEnd); while (textStart < textEnd) { _strings.push_back(textStart); textStart += strlen(textStart) + 1; } - _maxRowIndex = 8 + 10 * (3 - (getGlobalVar(0xC8C28808) == calcHash("stLineagex") ? 1 : 0)); + _maxRowIndex = 8 + 10 * (3 - (getGlobalVar(V_COLUMN_TEXT_NAME) == calcHash("stLineagex") ? 1 : 0)); _background = new Background(_vm, 0); _background->createSurface(0, 640, 528); @@ -2257,11 +2257,11 @@ Scene2208::Scene2208(NeverhoodEngine *vm, Module *parentModule, int which) _backgroundSurface->drawSpriteResourceEx(spriteResource, false, false, 0, 0); _topBackgroundSurface = new BaseSurface(_vm, 0, 640, 192); - spriteResource.load2(!getGlobalVar(0x4CE79018) ? kScene2208FileHashes1[getGlobalVar(0x48A68852) % 6] : getGlobalVar(0x4CE79018)); + spriteResource.load2(!getGlobalVar(V_COLUMN_BACK_NAME) ? kScene2208FileHashes1[getGlobalVar(V_CLICKED_COLUMN_INDEX) % 6] : getGlobalVar(V_COLUMN_BACK_NAME)); _topBackgroundSurface->drawSpriteResourceEx(spriteResource, false, false, 0, 0); _bottomBackgroundSurface = new BaseSurface(_vm, 0, 640, 192); - spriteResource.load2(kScene2208FileHashes2[getGlobalVar(0x48A68852) % 6]); + spriteResource.load2(kScene2208FileHashes2[getGlobalVar(V_CLICKED_COLUMN_INDEX) % 6]); _bottomBackgroundSurface->drawSpriteResourceEx(spriteResource, false, false, 0, 0); SetUpdateHandler(&Scene2208::update); @@ -2269,7 +2269,7 @@ Scene2208::Scene2208(NeverhoodEngine *vm, Module *parentModule, int which) _visibleRowsCount = 10; - _newRowIndex = (int16)getGlobalVar(0x49C40058); + _newRowIndex = (int16)getGlobalVar(V_CLICKED_COLUMN_ROW); if (_newRowIndex + _visibleRowsCount > _maxRowIndex) _newRowIndex = _maxRowIndex - _visibleRowsCount; if (_newRowIndex < 6) @@ -2416,7 +2416,7 @@ Scene2242::Scene2242(NeverhoodEngine *vm, Module *parentModule, int which) SetMessageHandler(&Scene2242::handleMessage); SetUpdateHandler(&Scene2242::update); - if (getGlobalVar(0x4D080E54)) { + if (getGlobalVar(V_LIGHTS_ON)) { setBackground(0x11840E24); setPalette(0x11840E24); insertMouse433(0x40E20110); @@ -2441,9 +2441,9 @@ Scene2242::Scene2242(NeverhoodEngine *vm, Module *parentModule, int which) insertKlayman(530, 430); setMessageList(0x004B3D60); } else if (which == 2) { - insertKlayman(kScene2242XPositions[!getGlobalVar(0x48A68852) ? 0 : 1], 430); + insertKlayman(kScene2242XPositions[!getGlobalVar(V_CLICKED_COLUMN_INDEX) ? 0 : 1], 430); setMessageList(0x004B3D48); - if (getGlobalVar(0xC0418A02)) + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) _klayman->setDoDeltaX(1); } else { insertKlayman(0, 430); @@ -2455,11 +2455,11 @@ Scene2242::Scene2242(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2242::~Scene2242() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } void Scene2242::update() { - if (!getGlobalVar(0x4D080E54)) { + if (!getGlobalVar(V_LIGHTS_ON)) { if (_isKlaymanInLight && _klayman->getX() < 440) { _palette->addBasePalette(0x68033B1C, 0, 65, 0); _palette->startFadeToPalette(12); @@ -2494,17 +2494,17 @@ uint32 Scene2242::handleMessage(int messageNum, const MessageParam ¶m, Entit void Scene2242::readClickedColumn() { int index; if (_mouseClickPos.x < 108) { - setGlobalVar(0xC8C28808, 0x04290188); - setGlobalVar(0x48A68852, 42); - setGlobalVar(0x4CE79018, calcHash("bgRecPanelStart1")); + setGlobalVar(V_COLUMN_TEXT_NAME, 0x04290188); + setGlobalVar(V_CLICKED_COLUMN_INDEX, 42); + setGlobalVar(V_COLUMN_BACK_NAME, calcHash("bgRecPanelStart1")); index = 0; } else { - setGlobalVar(0xC8C28808, 0x04290188); - setGlobalVar(0x48A68852, 43); - setGlobalVar(0x4CE79018, calcHash("bgRecPanelStart2")); + setGlobalVar(V_COLUMN_TEXT_NAME, 0x04290188); + setGlobalVar(V_CLICKED_COLUMN_INDEX, 43); + setGlobalVar(V_COLUMN_BACK_NAME, calcHash("bgRecPanelStart2")); index = 1; } - setGlobalVar(0x49C40058, (_mouseClickPos.y - 100) / 7); + setGlobalVar(V_CLICKED_COLUMN_ROW, (_mouseClickPos.y - 100) / 7); if (ABS(_klayman->getX() - kScene2242XPositions[index]) < 133) { setMessageList2(kScene2242MessageListIds1[index]); } else { @@ -2536,7 +2536,7 @@ HallOfRecordsScene::HallOfRecordsScene(NeverhoodEngine *vm, Module *parentModule SetMessageHandler(&HallOfRecordsScene::handleMessage); SetUpdateHandler(&Scene::update); - if (!getGlobalVar(0x4D080E54) && _sceneInfo140->bgFilename2) { + if (!getGlobalVar(V_LIGHTS_ON) && _sceneInfo140->bgFilename2) { setRectList(0x004B2BF8); setBackground(_sceneInfo140->bgFilename2); setPalette(_sceneInfo140->bgFilename2); @@ -2555,9 +2555,9 @@ HallOfRecordsScene::HallOfRecordsScene(NeverhoodEngine *vm, Module *parentModule insertKlayman(640, 430); setMessageList(0x004B2910); } else if (which == 2) { - insertKlayman(kHallOfRecordsKlaymanXPos[getGlobalVar(0x48A68852) - _sceneInfo140->xPosIndex], 430); + insertKlayman(kHallOfRecordsKlaymanXPos[getGlobalVar(V_CLICKED_COLUMN_INDEX) - _sceneInfo140->xPosIndex], 430); setMessageList(0x004B2B70); - if (getGlobalVar(0xC0418A02)) + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) _klayman->setDoDeltaX(1); } else { insertKlayman(0, 430); @@ -2570,7 +2570,7 @@ HallOfRecordsScene::HallOfRecordsScene(NeverhoodEngine *vm, Module *parentModule } HallOfRecordsScene::~HallOfRecordsScene() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } uint32 HallOfRecordsScene::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -2590,13 +2590,13 @@ void HallOfRecordsScene::readClickedColumn() { if (index >= _sceneInfo140->count) { setMessageList2(0x004B2920); } else { - setGlobalVar(0x48A68852, _sceneInfo140->xPosIndex + index); - setGlobalVar(0x49C40058, (_mouseClickPos.y - 100) / 7); - setGlobalVar(0xC8C28808, _sceneInfo140->txFilename); + setGlobalVar(V_CLICKED_COLUMN_INDEX, _sceneInfo140->xPosIndex + index); + setGlobalVar(V_CLICKED_COLUMN_ROW, (_mouseClickPos.y - 100) / 7); + setGlobalVar(V_COLUMN_TEXT_NAME, _sceneInfo140->txFilename); if (index == 0 && _sceneInfo140->bgFilename3) { - setGlobalVar(0x4CE79018, _sceneInfo140->bgFilename3); + setGlobalVar(V_COLUMN_BACK_NAME, _sceneInfo140->bgFilename3); } else { - setGlobalVar(0x4CE79018, 0); + setGlobalVar(V_COLUMN_BACK_NAME, 0); } if (ABS(_klayman->getX() - kHallOfRecordsKlaymanXPos[index]) < 133) { setMessageList2(kHallOfRecordsSceneMessageListIds1[index]); @@ -2622,13 +2622,13 @@ Scene2247::Scene2247(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true) { //DEBUG - setGlobalVar(0x4D080E54, 1); + setGlobalVar(V_LIGHTS_ON, 1); _surfaceFlag = true; SetMessageHandler(&Scene2247::handleMessage); SetUpdateHandler(&Scene::update); - if (getGlobalVar(0x4D080E54)) { + if (getGlobalVar(V_LIGHTS_ON)) { setRectList(0x004B5588); setBackground(0x40339414); setPalette(0x40339414); @@ -2647,8 +2647,8 @@ Scene2247::Scene2247(NeverhoodEngine *vm, Module *parentModule, int which) insertKlayman(640, 430); setMessageList(0x004B5438); } else if (which == 2) { - insertKlayman(kScene2247XPositions[getGlobalVar(0xC8C28808) == 0x0008E486 ? 0 : 1], 430); - if (getGlobalVar(0xC0418A02)) + insertKlayman(kScene2247XPositions[getGlobalVar(V_COLUMN_TEXT_NAME) == 0x0008E486 ? 0 : 1], 430); + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) _klayman->setDoDeltaX(1); setMessageList(0x004B5530); } else { @@ -2661,7 +2661,7 @@ Scene2247::Scene2247(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2247::~Scene2247() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } uint32 Scene2247::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -2680,16 +2680,16 @@ uint32 Scene2247::handleMessage(int messageNum, const MessageParam ¶m, Entit void Scene2247::readClickedColumn() { int index; if (_mouseClickPos.x < 553) { - setGlobalVar(0xC8C28808, 0x0008E486); - setGlobalVar(0x4CE79018, calcHash("bgFatherHeader")); + setGlobalVar(V_COLUMN_TEXT_NAME, 0x0008E486); + setGlobalVar(V_COLUMN_BACK_NAME, calcHash("bgFatherHeader")); index = 0; } else { - setGlobalVar(0xC8C28808, 0x03086004); - setGlobalVar(0x4CE79018, calcHash("bgQuaterHeader")); + setGlobalVar(V_COLUMN_TEXT_NAME, 0x03086004); + setGlobalVar(V_COLUMN_BACK_NAME, calcHash("bgQuaterHeader")); index = 1; } - setGlobalVar(0x48A68852, 0); - setGlobalVar(0x49C40058, (_mouseClickPos.y - 100) / 7); + setGlobalVar(V_CLICKED_COLUMN_INDEX, 0); + setGlobalVar(V_CLICKED_COLUMN_ROW, (_mouseClickPos.y - 100) / 7); if (ABS(_klayman->getX() - kScene2247XPositions[index]) < 133) { setMessageList2(kScene2247MessageListIds1[index]); } else { diff --git a/engines/neverhood/module2300.cpp b/engines/neverhood/module2300.cpp index 9e2acff9973..c2cf0df133c 100644 --- a/engines/neverhood/module2300.cpp +++ b/engines/neverhood/module2300.cpp @@ -37,10 +37,10 @@ Module2300::Module2300(NeverhoodEngine *vm, Module *parentModule, int which) _vm->_soundMan->setSoundListParams(kModule2300SoundList, true, 50, 600, 10, 150); //DEBUG>>> - setGlobalVar(0x10938830, 0); + setGlobalVar(V_WALL_BROKEN, 0); //DEBUG<<< - _flag = getGlobalVar(0x10938830) == 0; + _flag = getGlobalVar(V_WALL_BROKEN) == 0; if (_flag) { _vm->_soundMan->setSoundVolume(0x90F0D1C3, 0); @@ -90,7 +90,7 @@ void Module2300::createScene(int sceneNum, int which) { createNavigationScene(0x004B6878, which); break; case 3: - if (getGlobalVar(0x10938830)) { + if (getGlobalVar(V_WALL_BROKEN)) { createNavigationScene(0x004B68F0, which); } else { _vm->_soundMan->setSoundVolume(0x90F0D1C3, _soundVolume); diff --git a/engines/neverhood/module2400.cpp b/engines/neverhood/module2400.cpp index a29795bc215..4e8d26d3a7e 100644 --- a/engines/neverhood/module2400.cpp +++ b/engines/neverhood/module2400.cpp @@ -389,8 +389,8 @@ Scene2401::Scene2401(NeverhoodEngine *vm, Module *parentModule, int which) _vm->gameModule()->initScene2401Vars(); - setGlobalVar(0x4E0BE910, 1); //DEBUG! Enables water - setGlobalVar(0x45080C38, 1); //DEBUG! Gives the test tube + setGlobalVar(V_WATER_RUNNING, 1); //DEBUG! Enables water + setGlobalVar(V_HAS_TEST_TUBE, 1); //DEBUG! Gives the test tube _surfaceFlag = true; SetMessageHandler(&Scene2401::handleMessage); @@ -454,8 +454,8 @@ void Scene2401::update() { waterInside = true; } if (puzzleSolved) { - setGlobalVar(0x0045D021, 1); - setGlobalVar(0x86615030, 1); + setGlobalVar(V_NOTES_DOOR_UNLOCKED, 1); + setGlobalVar(V_NOTES_PUZZLE_SOLVED, 1); sendMessage(_asDoor, 0x4808, 0); } else if (waterInside) { playPipeSound(0xD0431020); @@ -495,20 +495,20 @@ uint32 Scene2401::handleMessage(int messageNum, const MessageParam ¶m, Entit else if (param.asInteger() == 0x02144CB1) sendEntityMessage(_klayman, 0x1014, _ssFloorButton); else if (param.asInteger() == 0x11C40840) { - if (getGlobalVar(0x0045D021) && sendMessage(_asDoor, 0x2004, 0)) { + if (getGlobalVar(V_NOTES_DOOR_UNLOCKED) && sendMessage(_asDoor, 0x2004, 0)) { setMessageList(0x004B3090); } else { setMessageList(0x004B30B0); } } else if (param.asInteger() == 0x412722C0) { - if (_countdown2 > 0 && getGlobalVar(0x45080C38)) { + if (_countdown2 > 0 && getGlobalVar(V_HAS_TEST_TUBE)) { _countdown2 = 144; setMessageList(0x004B3020); } else { setMessageList(0x004B3050); } } else if (param.asInteger() == 0x21142050) { - if (_flag && _countdown1 == 0 && getGlobalVar(0x86615030) == 0) { + if (_flag && _countdown1 == 0 && getGlobalVar(V_NOTES_PUZZLE_SOLVED) == 0) { setMessageList(0x004B2FA8); } else { setMessageList(0x004B2FC8); @@ -542,7 +542,7 @@ uint32 Scene2401::handleMessage(int messageNum, const MessageParam ¶m, Entit if (sender == _ssButton) { _pipeStatus = 0; _countdown1 = 8; - } else if (sender == _ssFloorButton && getGlobalVar(0x4E0BE910)) { + } else if (sender == _ssFloorButton && getGlobalVar(V_WATER_RUNNING)) { _countdown2 = 144; sendMessage(_asFlowingWater, 0x2002, 0); playSound(0, 0xE1130324); @@ -643,7 +643,7 @@ AsScene2402TV::AsScene2402TV(NeverhoodEngine *vm, Klayman *klayman) _y = 210; setDoDeltaX(1); - if (!getGlobalVar(0x92603A79)) { + if (!getGlobalVar(V_TV_JOKE_TOLD)) { loadSound(0, 0x58208810); _countdown1 = 48; startAnimation(0x4919397A, 0, -1); @@ -697,7 +697,7 @@ void AsScene2402TV::upFocusKlayman() { } void AsScene2402TV::stJokeFinished() { - setGlobalVar(0x92603A79, 1); + setGlobalVar(V_TV_JOKE_TOLD, 1); startAnimation(0x050A0103, 0, -1); _newStickFrameIndex = 0; SetUpdateHandler(&AsScene2402TV::upFocusKlayman); @@ -743,7 +743,7 @@ Scene2402::Scene2402(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004AF7D8); } else if (which == 2) { insertKlayman(409, 404); - _klayman->setDoDeltaX(getGlobalVar(0xC0418A02) ? 1 : 0); + _klayman->setDoDeltaX(getGlobalVar(V_KLAYMAN_IS_DELTA_X) ? 1 : 0); setMessageList(0x004AF888); } else { insertKlayman(0, 404); @@ -760,7 +760,7 @@ Scene2402::Scene2402(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2402::~Scene2402() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } void Scene2402::update() { @@ -921,8 +921,8 @@ Scene2406::Scene2406(NeverhoodEngine *vm, Module *parentModule, int which) Sprite *tempSprite1, *tempSprite2; - if (getGlobalVar(0xC0780812) && getGlobalVar(0x13382860) == 0) - setGlobalVar(0x13382860, 2); + if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0) + setGlobalVar(V_KEY3_LOCATION, 2); _surfaceFlag = true; SetMessageHandler(&Scene2406::handleMessage); @@ -930,7 +930,7 @@ Scene2406::Scene2406(NeverhoodEngine *vm, Module *parentModule, int which) setRectList(0x004B78C8); insertMouse433(0xB03001A8); - if (getGlobalVar(0x13382860) == 2) { + if (getGlobalVar(V_KEY3_LOCATION) == 2) { _asKey = insertSprite(this, 2, 1100, 560, 409); _vm->_collisionMan->addSprite(_asKey); } @@ -944,7 +944,7 @@ Scene2406::Scene2406(NeverhoodEngine *vm, Module *parentModule, int which) _clipRects[0].x2 = tempSprite2->getDrawRect().x2(); _clipRects[0].y2 = 480; - if (getGlobalVar(0x18890C91)) { + if (getGlobalVar(V_SPIKES_RETRACTED)) { setBackground(0x1A0B0304); setPalette(0x1A0B0304); tempSprite1 = insertStaticSprite(0x32923922, 1100); @@ -998,7 +998,7 @@ uint32 Scene2406::handleMessage(int messageNum, const MessageParam ¶m, Entit switch (messageNum) { case 0x100D: if (param.asInteger() == 0x41062804) { - if (getGlobalVar(0x18890C91)) { + if (getGlobalVar(V_SPIKES_RETRACTED)) { setMessageList(0x004B7758); } else { setMessageList(0x004B7738); diff --git a/engines/neverhood/module2500.cpp b/engines/neverhood/module2500.cpp index b4d39d9e1db..d6840a3f652 100644 --- a/engines/neverhood/module2500.cpp +++ b/engines/neverhood/module2500.cpp @@ -92,9 +92,9 @@ void Module2500::createScene(int sceneNum, int which) { createScene2704(which, 0x004B01B8, 220); break; case 2: - setGlobalVar(0x98109F12, 1);// TODO DEBUG! Join the tracks. + setGlobalVar(V_WORLDS_JOINED, 1);// TODO DEBUG! Join the tracks. _vm->gameState().which = which; - if (getGlobalVar(0x98109F12)) + if (getGlobalVar(V_WORLDS_JOINED)) createScene2704(which, 0x004B01E0, 150); else createScene2704(which, 0x004B0208, 150); @@ -107,7 +107,7 @@ void Module2500::createScene(int sceneNum, int which) { createScene2704(which, 0x004B0230, 150, kScene2505StaticSprites, &kScene2505ClipRect); break; case 5: - setGlobalVar(0x21E60190, 1); + setGlobalVar(V_CAR_DELTA_X, 1); _vm->gameState().which = which; createScene2704(which, 0x004B0268, 150, kScene2506StaticSprites, &kScene2506ClipRect); break; @@ -117,7 +117,7 @@ void Module2500::createScene(int sceneNum, int which) { break; case 7: _vm->gameState().which = which; - if (getGlobalVar(0xD0A14D10)) + if (getGlobalVar(V_ENTRANCE_OPEN)) createScene2704(which, 0x004B02C8, 150, kScene2508StaticSprites1, &kScene2508ClipRect1); else createScene2704(which, 0x004B02C8, 150, kScene2508StaticSprites2, &kScene2508ClipRect2); @@ -126,7 +126,7 @@ void Module2500::createScene(int sceneNum, int which) { _childObject = new Scene1608(_vm, this, which); break; case 9: - if (getGlobalVar(0xD0A14D10)) + if (getGlobalVar(V_ENTRANCE_OPEN)) createStaticScene(0xC62A0645, 0xA0641C6A); else createStaticScene(0x7A343546, 0x435427AB); @@ -224,7 +224,7 @@ Scene2501::Scene2501(NeverhoodEngine *vm, Module *parentModule, int which) _sceneInfos[1] = _vm->_staticData->getSceneInfo2700(0x004B264C); _sceneInfos[2] = _vm->_staticData->getSceneInfo2700(0x004B2670); - setGlobalVar(0x21E60190, 1); + setGlobalVar(V_CAR_DELTA_X, 1); SetUpdateHandler(&Scene2501::update); _surfaceFlag = true; setBackground(0x1B8E8115); diff --git a/engines/neverhood/module2600.cpp b/engines/neverhood/module2600.cpp index 435c38c0792..6eebd403f88 100644 --- a/engines/neverhood/module2600.cpp +++ b/engines/neverhood/module2600.cpp @@ -68,7 +68,7 @@ void Module2600::createScene(int sceneNum, int which) { createNavigationScene(0x004B86C8, which); break; case 3: - if (getGlobalVar(0x0A310817)) { + if (getGlobalVar(V_CREATURE_ANGRY)) { createNavigationScene(0x004B8758, which); } else { createNavigationScene(0x004B86F8, which); @@ -88,31 +88,31 @@ void Module2600::createScene(int sceneNum, int which) { _childObject = new Scene2609(_vm, this, which); break; case 1002: - if (getGlobalVar(0x40040831) == 1) { + if (getGlobalVar(V_FRUIT_COUNTING_INDEX) == 1) { createSmackerScene(0x018C0404, true, true, false); - } else if (getGlobalVar(0x40040831) == 2) { + } else if (getGlobalVar(V_FRUIT_COUNTING_INDEX) == 2) { createSmackerScene(0x018C0407, true, true, false); } else { createSmackerScene(0x818C0405, true, true, false); } - if (getGlobalVar(0x40040831) >= 2) { - setGlobalVar(0x40040831, 0); + if (getGlobalVar(V_FRUIT_COUNTING_INDEX) >= 2) { + setGlobalVar(V_FRUIT_COUNTING_INDEX, 0); } else { - incGlobalVar(0x40040831, +1); + incGlobalVar(V_FRUIT_COUNTING_INDEX, +1); } break; case 1003: createSmackerScene(0x001C0007, true, true, false); break; case 1006: - if (getGlobalVar(0x4E0BE910)) { + if (getGlobalVar(V_WATER_RUNNING)) { createSmackerScene(0x049A1181, true, true, false); } else { createSmackerScene(0x04981181, true, true, false); } break; case 1008: - if (getGlobalVar(0x4E0BE910)) { + if (getGlobalVar(V_WATER_RUNNING)) { createSmackerScene(0x42B80941, true, true, false); } else { createSmackerScene(0x42980941, true, true, false); @@ -153,7 +153,7 @@ void Module2600::updateScene() { break; case 3: if (_moduleResult == 0) { - if (getGlobalVar(0x0A310817)) { + if (getGlobalVar(V_CREATURE_ANGRY)) { createScene(4, 0); } else { createScene(1003, -1); @@ -161,10 +161,10 @@ void Module2600::updateScene() { } else if (_moduleResult == 2) { createScene(1, 1); } else if (_moduleResult == 3) { - if (getGlobalVar(0x0A310817)) { + if (getGlobalVar(V_CREATURE_ANGRY)) { createScene(4, 0); } else { - setGlobalVar(0x0A310817, 1); + setGlobalVar(V_CREATURE_ANGRY, 1); createScene(7, -1); } } @@ -210,7 +210,7 @@ SsScene2609Button::SsScene2609Button(NeverhoodEngine *vm, Scene *parentScene) _spriteResource.load2(0x825A6923); createSurface(400, _spriteResource.getDimensions().width, _spriteResource.getDimensions().height); - if (!getGlobalVar(0x4E0BE910)) + if (!getGlobalVar(V_WATER_RUNNING)) setVisible(false); _drawRect.set(0, 0, _spriteResource.getDimensions().width, _spriteResource.getDimensions().height); @@ -233,11 +233,11 @@ SsScene2609Button::SsScene2609Button(NeverhoodEngine *vm, Scene *parentScene) void SsScene2609Button::update() { StaticSprite::update(); if (_countdown != 0 && (--_countdown == 0)) { - if (getGlobalVar(0x4E0BE910)) { - setGlobalVar(0x4E0BE910, 0); + if (getGlobalVar(V_WATER_RUNNING)) { + setGlobalVar(V_WATER_RUNNING, 0); sendMessage(_parentScene, 0x2001, 0); } else { - setGlobalVar(0x4E0BE910, 1); + setGlobalVar(V_WATER_RUNNING, 1); sendMessage(_parentScene, 0x2002, 0); } } @@ -249,7 +249,7 @@ uint32 SsScene2609Button::handleMessage(int messageNum, const MessageParam ¶ case 0x1011: if (_countdown == 0) { sendMessage(_parentScene, 0x2000, 0); - if (getGlobalVar(0x4E0BE910)) { + if (getGlobalVar(V_WATER_RUNNING)) { setVisible(false); playSound(3); playSound(1); @@ -278,7 +278,7 @@ AsScene2609Water::AsScene2609Water(NeverhoodEngine *vm) _vm->_soundMan->addSound(0x08526C36, 0xDC2769B0); SetUpdateHandler(&AnimatedSprite::update); SetMessageHandler(&AsScene2609Water::handleMessage); - if (getGlobalVar(0x4E0BE910)) + if (getGlobalVar(V_WATER_RUNNING)) sendMessage(this, 0x2002, 0); } diff --git a/engines/neverhood/module2700.cpp b/engines/neverhood/module2700.cpp index 983e2651251..9603f7027d8 100644 --- a/engines/neverhood/module2700.cpp +++ b/engines/neverhood/module2700.cpp @@ -459,7 +459,7 @@ void Module2700::updateScene() { if (!_flag1) { _vm->_soundMan->stopMusic(0x04020210, 0, 1); // TODO _vm->gameModule()->initScene2801Vars(); - _musicFileHash = getGlobalVar(0x89A82A15); + _musicFileHash = getGlobalVar(V_MUSIC_NAME); // TODO? GameState_sub_469C50(&field_52, 0); // TODO MusicMan_create(); // Why? _vm->_soundMan->addMusic(0x42212411, _musicFileHash); @@ -594,7 +594,7 @@ Scene2701::Scene2701(NeverhoodEngine *vm, Module *parentModule, int which) NRect clipRect; SceneInfo2700 *sceneInfo = _vm->_staticData->getSceneInfo2700(0x004B2240); - setGlobalVar(0x21E60190, 1); + setGlobalVar(V_CAR_DELTA_X, 1); _surfaceFlag = true; diff --git a/engines/neverhood/module2800.cpp b/engines/neverhood/module2800.cpp index 1ec23e01536..e664eb3a832 100644 --- a/engines/neverhood/module2800.cpp +++ b/engines/neverhood/module2800.cpp @@ -76,8 +76,8 @@ void Module2800::createScene(int sceneNum, int which) { break; case 2: _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2); - //setGlobalVar(0x1860C990,1);//DEBUG - if (getGlobalVar(0x1860C990)) + //setGlobalVar(V_KLAYMAN_SMALL,1);//DEBUG + if (getGlobalVar(V_KLAYMAN_SMALL)) _childObject = new Scene2803Small(_vm, this, which); else _childObject = new Scene2803(_vm, this, which); @@ -171,7 +171,7 @@ void Module2800::createScene(int sceneNum, int which) { break; case 25: _vm->_soundMan->startMusic(0xD2FA4D14, 0, 2); - if (getGlobalVar(0x190A1D18)) + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) createStaticScene(0x01600204, 0x0020001E); else createStaticScene(0x08611204, 0x1120008E); @@ -378,7 +378,7 @@ Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which) SetMessageHandler(&Scene2801::handleMessage); SetUpdateHandler(&Scene::update); - if (getGlobalVar(0x4DE80AC0) == 0) { + if (getGlobalVar(V_RING5_PULLED) == 0) { insertStaticSprite(0x0001264C, 100); } @@ -389,7 +389,7 @@ Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which) insertKlayman(443, 398); setMessageList(0x004B6BC0); } else if (which == 2) { - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(312, 432); _klayman->setDoDeltaX(1); } else { @@ -450,7 +450,7 @@ Scene2801::Scene2801(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2801::~Scene2801() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); } uint32 Scene2801::handleMessage(int messageNum, const MessageParam ¶m, Entity *sender) { @@ -640,7 +640,7 @@ Scene2803::Scene2803(NeverhoodEngine *vm, Module *parentModule, int which) 0x28680AD4 }; - setGlobalVar(0x1C1B8A9A, 1); + setGlobalVar(V_BEEN_SHRINKING_ROOM, 1); _vm->gameModule()->initScene2808Vars1(); SetMessageHandler(&Scene2803::handleMessage); @@ -815,13 +815,13 @@ void Scene2803::klaymanFloor() { } void Scene2803::toggleBackground() { - setGlobalVar(0x190A1D18, getGlobalVar(0x190A1D18) ? 0 : 1); + setGlobalVar(V_SHRINK_LIGHTS_ON, getGlobalVar(V_SHRINK_LIGHTS_ON) ? 0 : 1); changeBackground(); } void Scene2803::changeBackground() { // TODO? g_screen->resetDirtyRects(); - if (getGlobalVar(0x190A1D18)) { + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) { _asLightCord->setFileHashes(0x8FAD5932, 0x276E1A3D); _background->load(0x412A423E); _palette->addPalette(0x412A423E, 0, 256, 0); @@ -911,7 +911,7 @@ void Scene2803::setPaletteArea1() { void Scene2803::updatePaletteArea() { uint32 fadePaletteHash; - if (getGlobalVar(0x190A1D18)) + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) fadePaletteHash = (_paletteArea == 1) ? 0xB103B604 : 0x412A423E; else fadePaletteHash = (_paletteArea == 1) ? 0x0263D144 : 0x29800A01; @@ -938,7 +938,7 @@ Scene2803Small::Scene2803Small(NeverhoodEngine *vm, Module *parentModule, int wh insertSprite(this, 0xAFAD591A, 0x276E321D, 578, 200); - if (getGlobalVar(0x190A1D18)) { + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) { setBackground(0x412A423E); setPalette(0x412A423E); _palette->addBasePalette(0x412A423E, 0, 256, 0); @@ -1148,7 +1148,7 @@ void Scene2803Small::setPaletteArea3() { } void Scene2803Small::updatePaletteArea(bool instantly) { - if (getGlobalVar(0x190A1D18)) { + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) { switch (_paletteArea) { case 1: _palette->addBasePalette(0x0A938204, 0, 64, 0); @@ -1182,7 +1182,7 @@ void Scene2803Small::updatePaletteArea(bool instantly) { SsScene2804RedButton::SsScene2804RedButton(NeverhoodEngine *vm, Scene2804 *parentScene) : StaticSprite(vm, 900), _countdown(0), _parentScene(parentScene) { - if (getGlobalVar(0x190A1D18)) + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) _spriteResource.load2(0x51A10202); else _spriteResource.load2(0x11814A21); @@ -1387,7 +1387,7 @@ AsScene2804Crystal::AsScene2804Crystal(NeverhoodEngine *vm, AsScene2804CrystalWa }; _colorNum = (int16)getSubVar(0xE11A1929, crystalIndex); - _isLightOn = getGlobalVar(0x190A1D18) != 0; + _isLightOn = getGlobalVar(V_SHRINK_LIGHTS_ON) != 0; if (_isLightOn) { _x = kAsScene2804CrystalPoints[crystalIndex].x; _y = kAsScene2804CrystalPoints[crystalIndex].y; @@ -1464,7 +1464,7 @@ SsScene2804CrystalButton::SsScene2804CrystalButton(NeverhoodEngine *vm, Scene280 0x5008292B }; - if (getGlobalVar(0x190A1D18)) + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) _spriteResource.load2(kSsScene2804CrystalButtonFileHashes1[crystalIndex]); else _spriteResource.load2(kSsScene2804CrystalButtonFileHashes2[crystalIndex]); @@ -1626,9 +1626,9 @@ Scene2804::Scene2804(NeverhoodEngine *vm, Module *parentModule, int which) SetMessageHandler(&Scene2804::handleMessage); SetUpdateHandler(&Scene2804::update); - //setGlobalVar(0x190A1D18, 1); // DEBUG Set lights on + //setGlobalVar(V_SHRINK_LIGHTS_ON, 1); // DEBUG Set lights on - if (getGlobalVar(0x190A1D18)) { + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) { setBackground(0xA1D03005); setPalette(0xA1D03005); addEntity(_palette); @@ -1652,7 +1652,7 @@ Scene2804::Scene2804(NeverhoodEngine *vm, Module *parentModule, int which) for (uint crystalIndex = 0; crystalIndex < 5; crystalIndex++) { AsScene2804CrystalWaves *asCrystalWaves = NULL; - if (crystalIndex < 4 && getGlobalVar(0x190A1D18) == 0) + if (crystalIndex < 4 && getGlobalVar(V_SHRINK_LIGHTS_ON) == 0) asCrystalWaves = insertSprite(crystalIndex); _asCrystals[crystalIndex] = insertSprite(asCrystalWaves, crystalIndex); _ssCrystalButtons[crystalIndex] = insertSprite(this, _asCrystals[crystalIndex], crystalIndex); @@ -1676,7 +1676,7 @@ uint32 Scene2804::handleMessage(int messageNum, const MessageParam ¶m, Entit case 0x2000: _isWorking = true; sendMessage(_asCoil, 0x2002, 0); - if (getGlobalVar(0x190A1D18)) { + if (getGlobalVar(V_SHRINK_LIGHTS_ON)) { sendMessage(_asTarget, 0x2004, 0); _countdown2 = 48; } @@ -1716,7 +1716,7 @@ void Scene2804::update() { if (_isSolved) { _palette->fillBaseWhite(0, 256); _palette->startFadeToPalette(18); - setGlobalVar(0x1860C990, 1); + setGlobalVar(V_KLAYMAN_SMALL, 1); _countdown1 = 48; } } else if (_beamStatus == 6) { @@ -1736,7 +1736,7 @@ void Scene2804::update() { void Scene2804::initCrystalColors() { // TODO Maybe move this into the GameModule so all puzzle init code is together - if (getGlobalVar(0xDE2EC914) == 0) { + if (getGlobalVar(V_CRYSTAL_COLORS_INIT) == 0) { TextResource textResource(_vm); const char *textStart, *textEnd; textResource.load(0x46691611); @@ -1770,7 +1770,7 @@ void Scene2804::initCrystalColors() { setSubVar(0xD4B2089C, index, correctColorNum); setSubVar(0xE11A1929, index, misalignedColorNum); } - setGlobalVar(0xDE2EC914, 1); + setGlobalVar(V_CRYSTAL_COLORS_INIT, 1); } } @@ -1927,7 +1927,7 @@ Scene2806::Scene2806(NeverhoodEngine *vm, Module *parentModule, int which) } else if (which == 3) { insertKlayman(378, 423, true, _clipRects, 4); setMessageList(0x004AF0A0, false); - setGlobalVar(0x1860C990, 0); + setGlobalVar(V_KLAYMAN_SMALL, 0); } else { insertKlayman(670, 423, false, _clipRects, 4); setMessageList(0x004AF090); @@ -2562,7 +2562,7 @@ Scene2809::Scene2809(NeverhoodEngine *vm, Module *parentModule, int which) } else if (which == 3) { insertKlayman(262, 423, true, _clipRects, 4); setMessageList(0x004B5BA8, false); - setGlobalVar(0x1860C990, 0); + setGlobalVar(V_KLAYMAN_SMALL, 0); } else { insertKlayman(-30, 423, false, _clipRects, 4); setMessageList(0x004B5B88); @@ -2670,7 +2670,7 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) _clipRects[1].x2 = _sprite6->getDrawRect().x2(); _clipRects[1].y2 = 480; - if (getGlobalVar(0x1860C990)) { + if (getGlobalVar(V_KLAYMAN_SMALL)) { _asTape = insertSprite(this, 0, 900, 245, 429, 0x9148A011); _vm->_collisionMan->addSprite(_asTape); } else { @@ -2680,9 +2680,9 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) _sprite1 = insertStaticSprite(0x430001C4, 1200); - if (getGlobalVar(0x0018CA22)) { - setGlobalVar(0xCB45DE03, 1); - if (getGlobalVar(0x1860C990)) { + if (getGlobalVar(V_LADDER_DOWN)) { + setGlobalVar(V_BEEN_STATUE_ROOM, 1); + if (getGlobalVar(V_KLAYMAN_SMALL)) { _sprite4 = insertStaticSprite(0x82653808, 100); } else { _sprite4 = insertStaticSprite(0x82653808, 1100); @@ -2691,7 +2691,7 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) } if (which < 0) { - if (getGlobalVar(0x1860C990)) { + if (getGlobalVar(V_KLAYMAN_SMALL)) { insertKlayman(240, 448); _klayman->setClipRect(_sprite5->getDrawRect().x, 0, 640, 480); setMessageList(0x004AE438); @@ -2701,7 +2701,7 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) } else { insertKlayman(300, 424, _clipRects, 2); setMessageList(0x004AE438); - if (getGlobalVar(0x0018CA22)) + if (getGlobalVar(V_LADDER_DOWN)) loadDataResource(0x84130112); else loadDataResource(0x84500132); @@ -2733,9 +2733,9 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) _vm->_soundMan->setSoundVolume(0xC874EE6C, 50); _isRopingDown = false; } else if ((which >= 11 && which <= 14) || (which >= 19 && which <= 22) || which == 3) { - if (getGlobalVar(0x1860C990)) { - insertKlayman((int16)getGlobalVar(0x00D30138), 448); - if (getGlobalVar(0xC0418A02)) + if (getGlobalVar(V_KLAYMAN_SMALL)) { + insertKlayman((int16)getGlobalVar(V_KLAYMAN_SAVED_X), 448); + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) _klayman->setDoDeltaX(1); _klayman->setClipRect(_sprite5->getDrawRect().x, 0, 640, 480); setMessageList(0x004AE6D8); @@ -2744,9 +2744,9 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) _vm->_collisionMan->removeSprite(_asTape); } else { insertKlaymanLadder(); - if (getGlobalVar(0x00188211)) { + if (getGlobalVar(V_LADDER_DOWN_ACTION)) { setMessageList(0x004AE6E8); - setGlobalVar(0x00188211, 0); + setGlobalVar(V_LADDER_DOWN_ACTION, 0); _isRopingDown = false; } else { setMessageList(0x004AE6D8); @@ -2758,7 +2758,7 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) setMessageList(0x004AE6E0); _isRopingDown = false; } else if (which == 4) { - if (getGlobalVar(0x1860C990)) { + if (getGlobalVar(V_KLAYMAN_SMALL)) { insertKlayman(473, 448); _klayman->setClipRect(_sprite5->getDrawRect().x, 0, 640, 480); setMessageList(0x004AE428); @@ -2768,7 +2768,7 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) } else { insertKlayman(450, 424, _clipRects, 2); setMessageList(0x004AE418); - if (getGlobalVar(0x0018CA22)) + if (getGlobalVar(V_LADDER_DOWN)) loadDataResource(0x84130112); else loadDataResource(0x84500132); @@ -2789,23 +2789,23 @@ Scene2810::Scene2810(NeverhoodEngine *vm, Module *parentModule, int which) } Scene2810::~Scene2810() { - setGlobalVar(0xC0418A02, _klayman->isDoDeltaX() ? 1 : 0); - setGlobalVar(0x00D30138, _klayman->getX()); + setGlobalVar(V_KLAYMAN_IS_DELTA_X, _klayman->isDoDeltaX() ? 1 : 0); + setGlobalVar(V_KLAYMAN_SAVED_X, _klayman->getX()); _vm->_soundMan->deleteSoundGroup(0x84400112); } void Scene2810::insertKlaymanLadder() { Sprite *tempSprite; - if (getGlobalVar(0x00188211)) { + if (getGlobalVar(V_LADDER_DOWN_ACTION)) { insertKlayman(430, 424, _clipRects, 2); _klayman->setDoDeltaX(1); } else { - insertKlayman((int16)getGlobalVar(0x00D30138), 424, _clipRects, 2); - if (getGlobalVar(0xC0418A02)) + insertKlayman((int16)getGlobalVar(V_KLAYMAN_SAVED_X), 424, _clipRects, 2); + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) _klayman->setDoDeltaX(1); } - if (getGlobalVar(0x0018CA22)) + if (getGlobalVar(V_LADDER_DOWN)) loadDataResource(0x84130112); else loadDataResource(0x84500132); @@ -2848,20 +2848,18 @@ uint32 Scene2810::handleMessage(int messageNum, const MessageParam ¶m, Entit setMessageList(0x004AE688); break; case 0x2000: - debug("0x2000"); setRectList(0x004AE800); _isRopingDown = true; break; case 0x2001: - debug("0x2001"); - if (getGlobalVar(0x0018CA22)) + if (getGlobalVar(V_LADDER_DOWN)) loadDataResource(0x84130112); else loadDataResource(0x84500132); _isRopingDown = false; break; case 0x4826: - if (sender == _asTape && getGlobalVar(0x1860C990) == 0 && !_isRopingDown) { + if (sender == _asTape && getGlobalVar(V_KLAYMAN_SMALL) == 0 && !_isRopingDown) { sendEntityMessage(_klayman, 0x1014, _asTape); setMessageList(0x004AE750); } @@ -2968,8 +2966,8 @@ uint32 AsScene2812TrapDoor::handleMessage(int messageNum, const MessageParam &pa Scene2812::Scene2812(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true), _paletteArea(0) { - if (getGlobalVar(0xC0780812) && getGlobalVar(0x13382860) == 0) - setGlobalVar(0x13382860, 3); + if (getGlobalVar(V_HAS_FINAL_KEY) && getGlobalVar(V_KEY3_LOCATION) == 0) + setGlobalVar(V_KEY3_LOCATION, 3); _surfaceFlag = true; SetMessageHandler(&Scene2812::handleMessage); @@ -2985,7 +2983,7 @@ Scene2812::Scene2812(NeverhoodEngine *vm, Module *parentModule, int which) _sprite1 = insertStaticSprite(0x0C06C860, 1100); insertMouse433(0x0060203E); - if (getGlobalVar(0x13382860) == 3) { + if (getGlobalVar(V_KEY3_LOCATION) == 3) { _asKey = insertSprite(this, 2, 1100, 474, 437); _vm->_collisionMan->addSprite(_asKey); } @@ -3015,7 +3013,7 @@ Scene2812::Scene2812(NeverhoodEngine *vm, Module *parentModule, int which) _klayman->setClipRect(_sprite1->getDrawRect().x, 0, _sprite1->getDrawRect().x2(), _sprite3->getDrawRect().y2()); } else if (which == 2) { _isRopingDown = false; - if (getGlobalVar(0xC0418A02)) { + if (getGlobalVar(V_KLAYMAN_IS_DELTA_X)) { insertKlayman(554, 432); _klayman->setDoDeltaX(1); } else { @@ -3153,10 +3151,10 @@ void Scene2822::update() { playSound(0, 0x1384CB60); _countdownStatus = 2; _countdown = 12; - } else if (_countdownStatus == 2 && getGlobalVar(0x00188211)) { + } else if (_countdownStatus == 2 && getGlobalVar(V_LADDER_DOWN_ACTION)) { leaveScene(0); } - } else if (_countdownStatus == 2 && getGlobalVar(0x00188211)) { + } else if (_countdownStatus == 2 && getGlobalVar(V_LADDER_DOWN_ACTION)) { if (_scrollIndex < 9) { _background->getSurface()->getDrawRect().y = kScene2822BackgroundYPositions[_scrollIndex]; _scrollIndex++; @@ -3180,9 +3178,9 @@ uint32 Scene2822::handleMessage(int messageNum, const MessageParam ¶m, Entit _countdownStatus = 0; _countdown = 12; playSound(1, 0x44061000); - if (getGlobalVar(0x0018CA22) == 0) { - setGlobalVar(0x0018CA22, 1); - setGlobalVar(0x00188211, 1); + if (getGlobalVar(V_LADDER_DOWN) == 0) { + setGlobalVar(V_LADDER_DOWN, 1); + setGlobalVar(V_LADDER_DOWN_ACTION, 1); SetMessageHandler(NULL); playSound(2); _mouseCursor->setVisible(false); diff --git a/engines/neverhood/module3000.cpp b/engines/neverhood/module3000.cpp index 88caff944a6..7312da7a1c1 100644 --- a/engines/neverhood/module3000.cpp +++ b/engines/neverhood/module3000.cpp @@ -47,7 +47,7 @@ Module3000::Module3000(NeverhoodEngine *vm, Module *parentModule, int which) _vm->_soundMan->playTwoSounds(0x81293110, 0x40030A51, 0xC862CA15, 0); _vm->_soundMan->playTwoSounds(0x81293110, 0x41861371, 0x43A2507F, 0); - _flag = getGlobalVar(0x10938830) != 0; + _flag = getGlobalVar(V_WALL_BROKEN) != 0; if (_flag) { _vm->_soundMan->setSoundVolume(0x90F0D1C3, 0); @@ -79,9 +79,9 @@ void Module3000::createScene(int sceneNum, int which) { _vm->gameState().sceneNum = sceneNum; switch (_vm->gameState().sceneNum) { case 1: - if (!getGlobalVar(0x01BA1A52)) { + if (!getGlobalVar(V_BOLT_DOOR_OPEN)) { createNavigationScene(0x004B7C80, which); - } else if (getGlobalVar(0x10938830)) { + } else if (getGlobalVar(V_WALL_BROKEN)) { createNavigationScene(0x004B7CE0, which); } else { createNavigationScene(0x004B7CB0, which); @@ -93,22 +93,22 @@ void Module3000::createScene(int sceneNum, int which) { _soundVolume = 90; _vm->_soundMan->setSoundVolume(0x90F0D1C3, 90); } - if (getGlobalVar(0x10938830)) { + if (getGlobalVar(V_WALL_BROKEN)) { createNavigationScene(0x004B7D58, which); } else { createNavigationScene(0x004B7D10, which); } break; case 3: - if (getGlobalVar(0x09221A62)) + if (getGlobalVar(V_STAIRS_DOWN)) createNavigationScene(0x004B7E60, which); - else if (getGlobalVar(0x10938830)) + else if (getGlobalVar(V_WALL_BROKEN)) createNavigationScene(0x004B7DA0, which); else createNavigationScene(0x004B7E00, which); break; case 4: - if (getGlobalVar(0x09221A62)) + if (getGlobalVar(V_STAIRS_DOWN)) createNavigationScene(0x004B7F20, which); else createNavigationScene(0x004B7EC0, which); @@ -149,23 +149,23 @@ void Module3000::createScene(int sceneNum, int which) { break; // NOTE: Newly introduced sceneNums case 1001: - if (!getGlobalVar(0x01BA1A52)) - if (getGlobalVar(0x10938830)) + if (!getGlobalVar(V_BOLT_DOOR_OPEN)) + if (getGlobalVar(V_WALL_BROKEN)) createSmackerScene(0x00940021, true, true, false); else createSmackerScene(0x01140021, true, true, false); else - if (getGlobalVar(0x10938830)) + if (getGlobalVar(V_WALL_BROKEN)) createSmackerScene(0x001011B1, true, true, false); else createSmackerScene(0x001021B1, true, true, false); - setGlobalVar(0x01BA1A52, getGlobalVar(0x01BA1A52) ? 0 : 1); + setGlobalVar(V_BOLT_DOOR_OPEN, getGlobalVar(V_BOLT_DOOR_OPEN) ? 0 : 1); break; case 1006: createSmackerScene(0x080810C5, true, true, false); break; case 1008: - createSmackerScene(getGlobalVar(0xF0402B0A), true, true, false); + createSmackerScene(getGlobalVar(V_CANNON_SMACKER_NAME), true, true, false); break; } SetUpdateHandler(&Module3000::updateScene); @@ -176,7 +176,7 @@ void Module3000::updateScene() { if (!updateChild()) { switch (_vm->gameState().sceneNum) { case 1: - if (!getGlobalVar(0x01BA1A52)) { + if (!getGlobalVar(V_BOLT_DOOR_OPEN)) { if (_moduleResult == 0) createScene(9, -1); else if (_moduleResult == 1) @@ -200,7 +200,7 @@ void Module3000::updateScene() { if (_moduleResult == 0) { createScene(3, 0); } else if (_moduleResult == 1) { - setGlobalVar(0x01BA1A52, 0); + setGlobalVar(V_BOLT_DOOR_OPEN, 0); createScene(1, 1); } break; @@ -209,7 +209,7 @@ void Module3000::updateScene() { createScene(4, 0); else if (_moduleResult == 3) createScene(10, -1); - else if (getGlobalVar(0x09221A62)) + else if (getGlobalVar(V_STAIRS_DOWN)) createScene(5, 0); else createScene(2, 1); @@ -238,11 +238,11 @@ void Module3000::updateScene() { createScene(8, -1); break; case 8: - _flag = getGlobalVar(0x10938830); // CHECKME + _flag = getGlobalVar(V_WALL_BROKEN); // CHECKME if (_moduleResult != 1) { _vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 0, 0, 0, 0); createScene(4, 1); - } else if (getGlobalVar(0xF0402B0A)) { + } else if (getGlobalVar(V_CANNON_SMACKER_NAME)) { createScene(1008, -1); } else { _vm->_soundMan->setSoundListParams(kModule3000SoundList, true, 0, 0, 0, 0); @@ -265,7 +265,7 @@ void Module3000::updateScene() { createScene(1, 0); break; case 1001: - if (getGlobalVar(0x01BA1A52)) + if (getGlobalVar(V_BOLT_DOOR_OPEN)) createScene(1, 0); else createScene(12, -1); @@ -526,7 +526,7 @@ SsScene3009SymbolEdges::SsScene3009SymbolEdges(NeverhoodEngine *vm, int index) _drawRect.width = _spriteResource.getDimensions().width; _drawRect.height = _spriteResource.getDimensions().height; _needRefresh = true; - if (getGlobalVar(0x0C0288F4)) { + if (getGlobalVar(V_ROBOT_HIT)) { hide(); } else { startBlinking(); @@ -649,7 +649,7 @@ AsScene3009VerticalIndicator::AsScene3009VerticalIndicator(NeverhoodEngine *vm, : AnimatedSprite(vm, 1000), _parentScene(parentScene), _enabled(false) { _x = 300; - _y = getGlobalVar(0x000809C2) ? 52 : 266; + _y = getGlobalVar(V_CANNON_RAISED) ? 52 : 266; createSurface1(0xC2463913, 1200); _needRefresh = true; updatePosition(); @@ -681,7 +681,7 @@ uint32 AsScene3009VerticalIndicator::handleMessage(int messageNum, const Message AsScene3009HorizontalIndicator::AsScene3009HorizontalIndicator(NeverhoodEngine *vm, Scene3009 *parentScene, uint32 cannonTargetStatus) : AnimatedSprite(vm, 1000), _parentScene(parentScene), _enabled(false) { - _x = getGlobalVar(0x9040018A) ? 533 : 92; + _x = getGlobalVar(V_CANNON_TURNED) ? 533 : 92; _y = 150; createSurface1(0xC0C12954, 1200); _needRefresh = true; @@ -799,12 +799,12 @@ Scene3009::Scene3009(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true), _keepVideo(false), _moveCannonLeftFirst(false), _isTurning(false), _lockSymbolsPart1Countdown(1), _lockSymbolsPart2Countdown(1) { - _cannonTargetStatus = getGlobalVar(0x20580A86); + _cannonTargetStatus = getGlobalVar(V_CANNON_TARGET_STATUS); debug("_cannonTargetStatus = %d", _cannonTargetStatus); _vm->gameModule()->initScene3009Vars(); - setGlobalVar(0xF0402B0A, 0); + setGlobalVar(V_CANNON_SMACKER_NAME, 0); _surfaceFlag = true; _vm->_screen->clear(); @@ -858,7 +858,7 @@ Scene3009::Scene3009(NeverhoodEngine *vm, Module *parentModule, int which) for (int i = 0; i < 6; i++) setSubVar(0x00000914, i, _correctSymbols[i]); sendMessage(this, 0x2003, 0); - //setGlobalVar(0x610210B7, 1); + //setGlobalVar(V_ROBOT_TARGET, 1); } @@ -914,7 +914,7 @@ void Scene3009::update() { if (_lockSymbolsPart1Countdown != 0 && (--_lockSymbolsPart1Countdown == 0) && isSymbolsPart1Solved()) { for (int i = 0; i < 3; i++) _asSymbols[i]->hide(); - if (!getGlobalVar(0x0C0288F4) || getGlobalVar(0x000809C2) || getGlobalVar(0x9040018A)) { + if (!getGlobalVar(V_ROBOT_HIT) || getGlobalVar(V_CANNON_RAISED) || getGlobalVar(V_CANNON_TURNED)) { _ssSymbolEdges[0]->show(); _ssTargetLines[0]->show(); _asVerticalIndicator->show(); @@ -924,7 +924,7 @@ void Scene3009::update() { if (_lockSymbolsPart2Countdown != 0 && (--_lockSymbolsPart2Countdown == 0) && isSymbolsPart2Solved()) { for (int i = 3; i < 6; i++) _asSymbols[i]->hide(); - if (!getGlobalVar(0x0C0288F4) || getGlobalVar(0x000809C2) || getGlobalVar(0x9040018A)) { + if (!getGlobalVar(V_ROBOT_HIT) || getGlobalVar(V_CANNON_RAISED) || getGlobalVar(V_CANNON_TURNED)) { _ssSymbolEdges[1]->show(); _ssTargetLines[1]->show(); _asHorizontalIndicator->show(); @@ -938,8 +938,8 @@ uint32 Scene3009::handleMessage(int messageNum, const MessageParam ¶m, Entit switch (messageNum) { case 0x0001: // TODO: Debug stuff - if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !getGlobalVar(0x000809C2)) { - setGlobalVar(0x20580A86, 0); + if ((param.asPoint().x <= 20 || param.asPoint().x >= 620) && !getGlobalVar(V_CANNON_RAISED)) { + setGlobalVar(V_CANNON_TARGET_STATUS, 0); leaveScene(0); } break; @@ -947,19 +947,19 @@ uint32 Scene3009::handleMessage(int messageNum, const MessageParam ¶m, Entit // TODO: Debug stuff break; case 0x2000: - if (!getGlobalVar(0x000809C2)) { - if (!getGlobalVar(0x10938830)) { + if (!getGlobalVar(V_CANNON_RAISED)) { + if (!getGlobalVar(V_WALL_BROKEN)) { _cannonTargetStatus = kCTSBreakWall; - setGlobalVar(0x10938830, 1); + setGlobalVar(V_WALL_BROKEN, 1); } else { _cannonTargetStatus = kCTSWall; } - } else if (!getGlobalVar(0x9040018A)) { + } else if (!getGlobalVar(V_CANNON_TURNED)) { _cannonTargetStatus = kCTSEmptyness; - } else if (!getGlobalVar(0x610210B7)) { + } else if (!getGlobalVar(V_ROBOT_TARGET)) { _cannonTargetStatus = kCTSFireRobotNoTarget; - } else if (!getGlobalVar(0x0C0288F4)) { - setGlobalVar(0x0C0288F4, 1); + } else if (!getGlobalVar(V_ROBOT_HIT)) { + setGlobalVar(V_ROBOT_HIT, 1); _cannonTargetStatus = kCTSFireRobotIsTarget; } else { _cannonTargetStatus = kCTSFireNoRobot; @@ -971,13 +971,13 @@ uint32 Scene3009::handleMessage(int messageNum, const MessageParam ¶m, Entit break; case 0x2002: // Raise/lower the cannon - if (!getGlobalVar(0x9040018A) && !_isTurning) { - if (getGlobalVar(0x000809C2)) { + if (!getGlobalVar(V_CANNON_TURNED) && !_isTurning) { + if (getGlobalVar(V_CANNON_RAISED)) { _cannonTargetStatus = kCTSLowerCannon; - setGlobalVar(0x000809C2, 0); + setGlobalVar(V_CANNON_RAISED, 0); } else { _cannonTargetStatus = kCTSRaiseCannon; - setGlobalVar(0x000809C2, 1); + setGlobalVar(V_CANNON_RAISED, 1); } playActionVideo(); } @@ -987,25 +987,25 @@ uint32 Scene3009::handleMessage(int messageNum, const MessageParam ¶m, Entit break; case 0x2004: // Turn the cannon if it's raised - if (getGlobalVar(0x000809C2)) { - if (!getGlobalVar(0x9040018A)) { + if (getGlobalVar(V_CANNON_RAISED)) { + if (!getGlobalVar(V_CANNON_TURNED)) { // Cannon is at the left position - if (!getGlobalVar(0x610210B7)) { + if (!getGlobalVar(V_ROBOT_TARGET)) { _cannonTargetStatus = kCTSRightRobotNoTarget; - } else if (!getGlobalVar(0x0C0288F4)) { + } else if (!getGlobalVar(V_ROBOT_HIT)) { _cannonTargetStatus = kCTSRightRobotIsTarget; } else { _cannonTargetStatus = kCTSRightNoRobot; } - setGlobalVar(0x9040018A, 1); + setGlobalVar(V_CANNON_TURNED, 1); _isTurning = true; playActionVideo(); } else { // Cannon is at the right position - if (!getGlobalVar(0x610210B7)) { + if (!getGlobalVar(V_ROBOT_TARGET)) { _cannonTargetStatus = kCTSLeftRobotNoTarget; _smackerPlayer->open(0x108A000F, false); - } else if (!getGlobalVar(0x0C0288F4)) { + } else if (!getGlobalVar(V_ROBOT_HIT)) { _cannonTargetStatus = kCTSLeftRobotIsTarget; _smackerPlayer->open(0x500B002F, false); } else { @@ -1016,7 +1016,7 @@ uint32 Scene3009::handleMessage(int messageNum, const MessageParam ¶m, Entit _moveCannonLeftFirst = true; _isTurning = true; _keepVideo = false; - setGlobalVar(0x9040018A, 0); + setGlobalVar(V_CANNON_TURNED, 0); } } break; @@ -1025,8 +1025,8 @@ uint32 Scene3009::handleMessage(int messageNum, const MessageParam ¶m, Entit } void Scene3009::playActionVideo() { - setGlobalVar(0x20580A86, _cannonTargetStatus); - setGlobalVar(0xF0402B0A, kScene3009CannonActionVideos[_cannonTargetStatus]); + setGlobalVar(V_CANNON_TARGET_STATUS, _cannonTargetStatus); + setGlobalVar(V_CANNON_SMACKER_NAME, kScene3009CannonActionVideos[_cannonTargetStatus]); leaveScene(1); } @@ -1378,8 +1378,8 @@ uint32 Scene3010::handleMessage(int messageNum, const MessageParam ¶m, Entit _boltUnlocked[param.asInteger()] = true; _boltUnlocking[param.asInteger()] = false; if (_boltUnlocked[0] && _boltUnlocked[1] && _boltUnlocked[2]) { - if (!getGlobalVar(0x00040153)) { - setGlobalVar(0x00040153, 1); + if (!getGlobalVar(V_BOLT_DOOR_UNLOCKED)) { + setGlobalVar(V_BOLT_DOOR_UNLOCKED, 1); playSound(0); _countdown = 60; } else { @@ -1539,7 +1539,7 @@ Scene3011::Scene3011(NeverhoodEngine *vm, Module *parentModule, int which) : Scene(vm, parentModule, true), _updateStatus(0), _buttonClicked(false), _currentSymbolIndex(0) { // TODO _vm->gameModule()->initScene3011Vars(); - _noisySymbolIndex = getGlobalVar(0x2414C2F2); + _noisySymbolIndex = getGlobalVar(V_NOISY_SYMBOL_INDEX); _surfaceFlag = true; SetMessageHandler(&Scene3011::handleMessage); diff --git a/engines/neverhood/navigationscene.cpp b/engines/neverhood/navigationscene.cpp index 5594cce8dab..5dc80c9322a 100644 --- a/engines/neverhood/navigationscene.cpp +++ b/engines/neverhood/navigationscene.cpp @@ -39,11 +39,11 @@ NavigationScene::NavigationScene(NeverhoodEngine *vm, Module *parentModule, uint //DEBUG<<< if (_navigationIndex < 0) { - _navigationIndex = (int)getGlobalVar(0x4200189E); + _navigationIndex = (int)getGlobalVar(V_NAVIGATION_INDEX); if (_navigationIndex >= (int)_navigationList->size()) _navigationIndex = 0; } - setGlobalVar(0x4200189E, _navigationIndex); + setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex); SetUpdateHandler(&NavigationScene::update); SetMessageHandler(&NavigationScene::handleMessage); @@ -173,7 +173,7 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) { if (_navigationIndex < 0) _navigationIndex = _navigationList->size() - 1; } while (!(*_navigationList)[_navigationIndex].interactive); - setGlobalVar(0x4200189E, _navigationIndex); + setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex); } else { _vm->_screen->setSmackerDecoder(NULL); sendMessage(_parentModule, 0x1009, _navigationIndex); @@ -190,7 +190,7 @@ void NavigationScene::handleNavigation(const NPoint &mousePos) { if (_navigationIndex >= (int)_navigationList->size()) _navigationIndex = 0; } while (!(*_navigationList)[_navigationIndex].interactive); - setGlobalVar(0x4200189E, _navigationIndex); + setGlobalVar(V_NAVIGATION_INDEX, _navigationIndex); } else { _vm->_screen->setSmackerDecoder(NULL); sendMessage(_parentModule, 0x1009, _navigationIndex); diff --git a/engines/neverhood/resource.cpp b/engines/neverhood/resource.cpp index 9bf6549ffe8..e009ff286eb 100644 --- a/engines/neverhood/resource.cpp +++ b/engines/neverhood/resource.cpp @@ -397,6 +397,17 @@ void TextResource::load(uint32 fileHash) { if (_vm->_res->getResourceType(_resourceHandle) == 6) { _textData = _vm->_res->loadResource(_resourceHandle, true); _count = READ_LE_UINT32(_textData); + + debug("TEXT RESOURCE %08X, count = %d:", fileHash, _count); + for (uint i = 0; i < _count-1; i++) { + const char *textEnd, *text = getString(i, textEnd); + while (text < textEnd) { + debug("[%04d] [%s]", i, text); + text += strlen(text) + 1; + } + debug("------------------"); + } + } else { _vm->_res->unuseResource(_resourceHandle); _resourceHandle = -1; diff --git a/engines/neverhood/smackerscene.cpp b/engines/neverhood/smackerscene.cpp index 375f7f3aa88..e96fe8ad3d8 100644 --- a/engines/neverhood/smackerscene.cpp +++ b/engines/neverhood/smackerscene.cpp @@ -32,7 +32,7 @@ SmackerScene::SmackerScene(NeverhoodEngine *vm, Module *parentModule, bool doubl // NOTE: Merged from SmackerScene::init, maybe split again if needed (incl. parameter flags) - if (getGlobalVar(0x06C02850)) { + if (getGlobalVar(V_SMACKER_CAN_ABORT)) { _flag1 = true; _canAbort = true; }