diff options
author | Bendegúz Nagy | 2016-08-26 22:43:17 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | a9cda9df7c4f03aadf080c6c166b7a1a02987a1b (patch) | |
tree | 72ec8b66ad3c890b1bfd97530cdd2bd1a0190c98 /engines/dm | |
parent | 71e4b5b2bca49f0de8b07f4f85de9167dd9b5f99 (diff) | |
download | scummvm-rg350-a9cda9df7c4f03aadf080c6c166b7a1a02987a1b.tar.gz scummvm-rg350-a9cda9df7c4f03aadf080c6c166b7a1a02987a1b.tar.bz2 scummvm-rg350-a9cda9df7c4f03aadf080c6c166b7a1a02987a1b.zip |
DM: More renaming
Diffstat (limited to 'engines/dm')
-rw-r--r-- | engines/dm/champion.cpp | 56 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 44 | ||||
-rw-r--r-- | engines/dm/dm.h | 58 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 572 | ||||
-rw-r--r-- | engines/dm/dungeonman.h | 422 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 68 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 228 | ||||
-rw-r--r-- | engines/dm/group.cpp | 10 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 32 | ||||
-rw-r--r-- | engines/dm/loadsave.cpp | 6 | ||||
-rw-r--r-- | engines/dm/menus.cpp | 2 | ||||
-rw-r--r-- | engines/dm/movesens.cpp | 54 | ||||
-rw-r--r-- | engines/dm/objectman.cpp | 4 | ||||
-rw-r--r-- | engines/dm/timeline.cpp | 2 |
14 files changed, 779 insertions, 779 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 9302216766..b8dac7ff3e 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -142,13 +142,13 @@ void ChampionMan::applyModifiersToStatistics(Champion* champ, ChampionSlot slotI int16 statIndex;
int16 modifier = 0;
ThingType thingType = thing.getType();
- if (((thingType == kWeaponThingType) || (thingType == kArmourThingType))
+ if (((thingType == k5_WeaponThingType) || (thingType == k6_ArmourThingType))
&& (slotIndex >= k0_ChampionSlotReadyHand)
&& (slotIndex <= k12_ChampionSlotQuiverLine_1_1)) {
Weapon *weapon = (Weapon*)_vm->_dungeonMan->getThingData(thing);
Armour *armour = (Armour*)_vm->_dungeonMan->getThingData(thing);
- if (((thingType == kWeaponThingType) && weapon->getCursed())
- || ((thingType == kArmourThingType) && armour->getCursed())) {
+ if (((thingType == k5_WeaponThingType) && weapon->getCursed())
+ || ((thingType == k6_ArmourThingType) && armour->getCursed())) {
statIndex = k0_ChampionStatLuck;
modifier = -3;
goto T0299044_ApplyModifier;
@@ -437,7 +437,7 @@ ChampionIndex ChampionMan::getIndexInCell(ViewCell cell) { }
void ChampionMan::resetDataToStartGame() {
- if (!_vm->_dungeonMan->_messages._newGame) {
+ if (!_vm->_dungeonMan->_messages._g298_newGame) {
warning("MISSING CODE: stuff for resetting for loaded games");
assert(false);
}
@@ -468,26 +468,26 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { champ->_actionIndex = k255_ChampionActionNone;
champ->_enableActionEventIndex = -1;
champ->_hideDamageReceivedIndex = -1;
- champ->_dir = dunMan._currMap._partyDir;
+ champ->_dir = dunMan._currMap._g308_partyDir;
ViewCell AL_0_viewCell = k0_ViewCellFronLeft;
- while (getIndexInCell((ViewCell)((AL_0_viewCell + dunMan._currMap._partyDir) & 3)) != kM1_ChampionNone)
+ while (getIndexInCell((ViewCell)((AL_0_viewCell + dunMan._currMap._g308_partyDir) & 3)) != kM1_ChampionNone)
AL_0_viewCell = (ViewCell)(AL_0_viewCell + 1);
- champ->_cell = (ViewCell)((AL_0_viewCell + dunMan._currMap._partyDir) & 3);
+ champ->_cell = (ViewCell)((AL_0_viewCell + dunMan._currMap._g308_partyDir) & 3);
champ->clearAttributes(k0x0400_ChampionAttributeIcon);
- champ->_directionMaximumDamageReceived = dunMan._currMap._partyDir;
+ champ->_directionMaximumDamageReceived = dunMan._currMap._g308_partyDir;
champ->_food = 1500 + _vm->_rnd->getRandomNumber(256);
champ->_water = 1500 + _vm->_rnd->getRandomNumber(256);
int16 AL_0_slotIndex_Red;
for (AL_0_slotIndex_Red = k0_ChampionSlotReadyHand; AL_0_slotIndex_Red < k30_ChampionSlotChest_1; ++AL_0_slotIndex_Red) {
champ->setSlot((ChampionSlot)AL_0_slotIndex_Red, Thing::_none);
}
- Thing thing = dunMan.getSquareFirstThing(dunMan._currMap._partyPosX, dunMan._currMap._partyPosY);
- while (thing.getType() != kTextstringType) {
+ Thing thing = dunMan.getSquareFirstThing(dunMan._currMap._g306_partyPosX, dunMan._currMap._g307_partyPosY);
+ while (thing.getType() != k2_TextstringType) {
thing = dunMan.getNextThing(thing);
}
char decodedChampionText[77];
char* character_Green = decodedChampionText;
- dunMan.decodeText(character_Green, thing, (TextType)(kTextTypeScroll | kDecodeEvenIfInvisible));
+ dunMan.decodeText(character_Green, thing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible));
int16 AL_0_characterIndex = 0;
uint16 AL_2_character;
while ((AL_2_character = *character_Green++) != '\n') {
@@ -557,21 +557,21 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { _vm->_menuMan->drawActionIcon((ChampionIndex)(_g305_partyChampionCount - 1));
}
- int16 mapX = _vm->_dungeonMan->_currMap._partyPosX;
- int16 mapY = _vm->_dungeonMan->_currMap._partyPosY;
+ int16 mapX = _vm->_dungeonMan->_currMap._g306_partyPosX;
+ int16 mapY = _vm->_dungeonMan->_currMap._g307_partyPosY;
- uint16 championObjectsCell = returnOppositeDir((direction)(dunMan._currMap._partyDir));
- mapX += _vm->_dirIntoStepCountEast[dunMan._currMap._partyDir];
- mapY += _vm->_dirIntoStepCountNorth[dunMan._currMap._partyDir];
+ uint16 championObjectsCell = returnOppositeDir((direction)(dunMan._currMap._g308_partyDir));
+ mapX += _vm->_dirIntoStepCountEast[dunMan._currMap._g308_partyDir];
+ mapY += _vm->_dirIntoStepCountNorth[dunMan._currMap._g308_partyDir];
thing = dunMan.getSquareFirstThing(mapX, mapY);
AL_0_slotIndex_Red = k13_ChampionSlotBackpackLine_1_1;
uint16 slotIndex_Green;
while (thing != Thing::_endOfList) {
ThingType AL_2_thingType = thing.getType();
- if ((AL_2_thingType > kSensorThingType) && (thing.getCell() == championObjectsCell)) {
- int16 objectAllowedSlots = gObjectInfo[dunMan.getObjectInfoIndex(thing)].getAllowedSlots();
+ if ((AL_2_thingType > k3_SensorThingType) && (thing.getCell() == championObjectsCell)) {
+ int16 objectAllowedSlots = g237_ObjectInfo[dunMan.getObjectInfoIndex(thing)].getAllowedSlots();
switch (AL_2_thingType) {
- case kArmourThingType:
+ case k6_ArmourThingType:
for (slotIndex_Green = k2_ChampionSlotHead; slotIndex_Green <= k5_ChampionSlotFeet; slotIndex_Green++) {
if (objectAllowedSlots & gSlotMasks[slotIndex_Green])
goto T0280048;
@@ -582,15 +582,15 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { goto T0280046;
}
break;
- case kWeaponThingType:
+ case k5_WeaponThingType:
if (champ->getSlot(k1_ChampionSlotActionHand) == Thing::_none) {
slotIndex_Green = k1_ChampionSlotActionHand;
} else {
goto T0280046;
}
break;
- case kScrollThingType:
- case kPotionThingType:
+ case k7_ScrollThingType:
+ case k8_PotionThingType:
if (champ->getSlot(k11_ChampionSlotPouch_1) == Thing::_none) {
slotIndex_Green = k11_ChampionSlotPouch_1;
} else if (champ->getSlot(k6_ChampionSlotPouch_2) == Thing::_none) {
@@ -599,8 +599,8 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { goto T0280046;
}
break;
- case kContainerThingType:
- case kJunkThingType:
+ case k9_ContainerThingType:
+ case k10_JunkThingType:
T0280046:
if ((objectAllowedSlots & gSlotMasks[k10_ChampionSlotNeck]) && (champ->getSlot(k10_ChampionSlotNeck) == Thing::_none)) {
slotIndex_Green = k10_ChampionSlotNeck;
@@ -850,19 +850,19 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { }
{ // block so goto won't skip AL_0_championIconIndex initialization
- int16 AL_0_championIconIndex = championIconIndex(champ->_cell, _vm->_dungeonMan->_currMap._partyDir);
+ int16 AL_0_championIconIndex = championIconIndex(champ->_cell, _vm->_dungeonMan->_currMap._g308_partyDir);
if ((champAttributes & k28_ChampionIcons) && (eventMan._useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(AL_0_championIconIndex))) {
dispMan.clearScreenBox(g46_ChampionColor[champIndex], g54_BoxChampionIcons[AL_0_championIconIndex]);
- dispMan.blitToScreen(dispMan.getBitmap(k28_ChampionIcons), 80, championIconIndex(champ->_dir, _vm->_dungeonMan->_currMap._partyDir) * 19, 0,
+ dispMan.blitToScreen(dispMan.getBitmap(k28_ChampionIcons), 80, championIconIndex(champ->_dir, _vm->_dungeonMan->_currMap._g308_partyDir) * 19, 0,
g54_BoxChampionIcons[AL_0_championIconIndex], k12_ColorDarkestGray);
}
}
if ((champAttributes & k0x0800_ChampionAttributePanel) && isInventoryChamp) {
- if (_vm->_pressingMouth) {
+ if (_vm->_g333_pressingMouth) {
invMan.drawPanelFoodWaterPoisoned();
- } else if (_vm->_pressingEye) {
+ } else if (_vm->_g331_pressingEye) {
if (_g415_leaderEmptyHanded) {
warning("MISSING CODE: F0351_INVENTORY_DrawChampionSkillsAndStatistics");
}
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index adc842b0ab..83fb506b6a 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -106,14 +106,14 @@ DMEngine::DMEngine(OSystem *syst) : Engine(syst), _console(nullptr) { _movsens = nullptr; _groupMan = nullptr; _timeline = nullptr; - _stopWaitingForPlayerInput = false; - _gameTimeTicking = false; - _restartGameAllowed = false; - _pressingEye = false; - _pressingMouth = false; - _stopPressingEye = false; - _stopPressingMouth = false; - _highlightBoxInversionRequested = false; + _g321_stopWaitingForPlayerInput = false; + _g301_gameTimeTicking = false; + _g524_restartGameAllowed = false; + _g331_pressingEye = false; + _g333_pressingMouth = false; + _g332_stopPressingEye = false; + _g334_stopPressingMouth = false; + _g340_highlightBoxInversionRequested = false; debug("DMEngine::DMEngine"); } @@ -164,11 +164,11 @@ void DMEngine::initializeGame() { void DMEngine::startGame() { - _pressingEye = false; - _stopPressingEye = false; - _pressingMouth = false; - _stopPressingMouth = false; - _highlightBoxInversionRequested = false; + _g331_pressingEye = false; + _g332_stopPressingEye = false; + _g333_pressingMouth = false; + _g334_stopPressingMouth = false; + _g340_highlightBoxInversionRequested = false; _eventMan->_highlightBoxEnabled = false; _championMan->_g300_partyIsSleeping = false; _championMan->_g506_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone); @@ -179,9 +179,9 @@ void DMEngine::startGame() { _eventMan->_secondaryMouseInput = gSecondaryMouseInput_Movement; warning("MISSING CODE: set primary/secondary keyboard input"); - processNewPartyMap(_dungeonMan->_currMap._currPartyMapIndex); + processNewPartyMap(_dungeonMan->_currMap._g309_currPartyMapIndex); - if (!_dungeonMan->_messages._newGame) { + if (!_dungeonMan->_messages._g298_newGame) { warning("TODO: loading game"); } else { _displayMan->_g578_useByteBoxCoordinates = false; @@ -191,7 +191,7 @@ void DMEngine::startGame() { warning("TODO: build copper"); _menuMan->drawMovementArrows(); _championMan->resetDataToStartGame(); - _gameTimeTicking = true; + _g301_gameTimeTicking = true; } void DMEngine::processNewPartyMap(uint16 mapIndex) { @@ -233,28 +233,28 @@ Common::Error DMEngine::run() { void DMEngine::gameloop() { warning("DUMMY CODE SETTING PARTY POS AND DIRECTION"); - _dungeonMan->_currMap._partyPosX = 10; - _dungeonMan->_currMap._partyPosY = 4; - _dungeonMan->_currMap._partyDir = kDirNorth; + _dungeonMan->_currMap._g306_partyPosX = 10; + _dungeonMan->_currMap._g307_partyPosY = 4; + _dungeonMan->_currMap._g308_partyDir = kDirNorth; warning("DUMMY CODE: setting InventoryMan::_inventoryChampionOrdinal to zero"); _inventoryMan->_inventoryChampionOrdinal = 0; warning("DUMMY CODE: clearing screen to black"); // in loop below while (true) { - _stopWaitingForPlayerInput = false; + _g321_stopWaitingForPlayerInput = false; _menuMan->refreshActionAreaAndSetChampDirMaxDamageReceived(); //do { _eventMan->processInput(); _eventMan->processCommandQueue(); - //} while (!_stopWaitingForPlayerInput || !_gameTimeTicking); + //} while (!_g321_stopWaitingForPlayerInput || !_g301_gameTimeTicking); if (!_inventoryMan->_inventoryChampionOrdinal && !_championMan->_g300_partyIsSleeping) { Box box(0, 224, 0, 126); _displayMan->clearScreenBox(k0_ColorBlack, box, g296_DungeonViewport); // dummy code - _displayMan->drawDungeon(_dungeonMan->_currMap._partyDir, _dungeonMan->_currMap._partyPosX, _dungeonMan->_currMap._partyPosY); + _displayMan->drawDungeon(_dungeonMan->_currMap._g308_partyDir, _dungeonMan->_currMap._g306_partyPosX, _dungeonMan->_currMap._g307_partyPosY); } // DUMMY CODE: next line _menuMan->drawMovementArrows(); diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 814b89da4e..4505c746c0 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -71,29 +71,29 @@ void clearFlag(uint16 &val, uint16 mask); enum ThingType { - kPartyThingType = -1, // @ CM1_THING_TYPE_PARTY, special value - kDoorThingType = 0, - kTeleporterThingType = 1, - kTextstringType = 2, - kSensorThingType = 3, - kGroupThingType = 4, - kWeaponThingType = 5, - kArmourThingType = 6, - kScrollThingType = 7, - kPotionThingType = 8, - kContainerThingType = 9, - kJunkThingType = 10, - kProjectileThingType = 14, - kExplosionThingType = 15, - kThingTypeTotal = 16 // +1 than the last (explosionThingType) + kM1_PartyThingType = -1, // @ CM1_THING_TYPE_PARTY, special value + k0_DoorThingType = 0, + k1_TeleporterThingType = 1, + k2_TextstringType = 2, + k3_SensorThingType = 3, + k4_GroupThingType = 4, + k5_WeaponThingType = 5, + k6_ArmourThingType = 6, + k7_ScrollThingType = 7, + k8_PotionThingType = 8, + k9_ContainerThingType = 9, + k10_JunkThingType = 10, + k14_ProjectileThingType = 14, + k15_ExplosionThingType = 15, + k16_ThingTypeTotal = 16 // +1 than the last (explosionThingType) }; // @ C[00..15]_THING_TYPE_... enum Cell { - kCellAny = -1, // @ CM1_CELL_ANY - kCellNorthWest = 0, // @ C00_CELL_NORTHWEST - kCellNorthEast = 1, // @ C01_CELL_NORTHEAST - kCellSouthEast = 2, // @ C02_CELL_SOUTHEAST - kCellSouthWest = 3 // @ C03_CELL_SOUTHWEST + kM1_CellAny = -1, // @ CM1_CELL_ANY + k0_CellNorthWest = 0, // @ C00_CELL_NORTHWEST + k1_CellNorthEast = 1, // @ C01_CELL_NORTHEAST + k2_CellSouthEast = 2, // @ C02_CELL_SOUTHEAST + k3_CellSouthWest = 3 // @ C03_CELL_SOUTHWEST }; class Thing { @@ -168,15 +168,15 @@ public: GroupMan *_groupMan; Timeline *_timeline; - bool _stopWaitingForPlayerInput; // G0321_B_StopWaitingForPlayerInput - bool _gameTimeTicking; // @ G0301_B_GameTimeTicking - bool _restartGameAllowed; // @ G0524_B_RestartGameAllowed - uint32 _gameId; // @ G0525_l_GameID, probably useless here - bool _pressingEye; // @ G0331_B_PressingEye - bool _stopPressingEye; // @ G0332_B_StopPressingEye - bool _pressingMouth; // @ G0333_B_PressingMouth - bool _stopPressingMouth; // @ G0334_B_StopPressingMouth - bool _highlightBoxInversionRequested; // @ G0340_B_HighlightBoxInversionRequested + bool _g321_stopWaitingForPlayerInput; // G0321_B_StopWaitingForPlayerInput + bool _g301_gameTimeTicking; // @ G0301_B_GameTimeTicking + bool _g524_restartGameAllowed; // @ G0524_B_RestartGameAllowed + uint32 _g525_gameId; // @ G0525_l_GameID, probably useless here + bool _g331_pressingEye; // @ G0331_B_PressingEye + bool _g332_stopPressingEye; // @ G0332_B_StopPressingEye + bool _g333_pressingMouth; // @ G0333_B_PressingMouth + bool _g334_stopPressingMouth; // @ G0334_B_StopPressingMouth + bool _g340_highlightBoxInversionRequested; // @ G0340_B_HighlightBoxInversionRequested // TODO: refactor direction into a class int8 _dirIntoStepCountEast[4]; diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 1d74bec094..4ce3c186f9 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -35,7 +35,7 @@ namespace DM { -ObjectInfo gObjectInfo[180] = { // @ G0237_as_Graphic559_ObjectInfo +ObjectInfo g237_ObjectInfo[180] = { // @ G0237_as_Graphic559_ObjectInfo /* { Type, ObjectAspectIndex, ActionSetIndex, AllowedSlots } */ ObjectInfo(30, 1, 0, 0x0500), /* COMPASS Pouch/Chest */ ObjectInfo(144, 0, 0, 0x0200), /* COMPASS Hands */ @@ -218,7 +218,7 @@ ObjectInfo gObjectInfo[180] = { // @ G0237_as_Graphic559_ObjectInfo ObjectInfo(197, 74, 0, 0x0000), /* SOLID KEY */ ObjectInfo(198, 41, 0, 0x0400)}; /* SQUARE KEY Chest */ -ArmourInfo gArmourInfo[58] = { // G0239_as_Graphic559_ArmourInfo +ArmourInfo g239_ArmourInfo[58] = { // G0239_as_Graphic559_ArmourInfo /* { Weight, Defense, Attributes, Unreferenced } */ ArmourInfo(3, 5, 0x01), /* CAPE */ ArmourInfo(4, 10, 0x01), /* CLOAK OF NIGHT */ @@ -279,7 +279,7 @@ ArmourInfo gArmourInfo[58] = { // G0239_as_Graphic559_ArmourInfo ArmourInfo(3, 16, 0x02), /* BOOTS OF SPEED */ ArmourInfo(2, 3, 0x03)}; /* HALTER */ -WeaponInfo gWeaponInfo[46] = { // @ G0238_as_Graphic559_WeaponInfo +WeaponInfo g238_WeaponInfo[46] = { // @ G0238_as_Graphic559_WeaponInfo /* { Weight, Class, Strength, KineticEnergy, Attributes } */ WeaponInfo(1, 130, 2, 0, 0x2000), /* EYE OF TIME */ WeaponInfo(1, 131, 2, 0, 0x2000), /* STORMRING */ @@ -328,7 +328,7 @@ WeaponInfo gWeaponInfo[46] = { // @ G0238_as_Graphic559_WeaponInfo WeaponInfo(30, 26, 1, 220, 0x207D), /* SPEEDBOW */ WeaponInfo(36, 255, 100, 50, 0x20FF)}; /* THE FIRESTAFF */ -CreatureInfo gCreatureInfo[k27_CreatureTypeCount] = { // @ G0243_as_Graphic559_CreatureInfo +CreatureInfo g243_CreatureInfo[k27_CreatureTypeCount] = { // @ G0243_as_Graphic559_CreatureInfo /* { CreatureAspectIndex, AttackSoundOrdinal, Attributes, GraphicInfo, MovementTicks, AttackTicks, Defense, BaseHealth, Attack, PoisonAttack, Dexterity, Ranges, Properties, Resistances, AnimationTicks, WoundProbabilities, AttackType } */ @@ -368,73 +368,73 @@ void DungeonMan::mapCoordsAfterRelMovement(direction dir, int16 stepsForward, in posY += _vm->_dirIntoStepCountNorth[dir] * stepsRight; } -DungeonMan::DungeonMan(DMEngine *dmEngine) : _vm(dmEngine), _rawDunFileData(NULL), _maps(NULL), _rawMapData(NULL) { - _dunData._columCount = 0; +DungeonMan::DungeonMan(DMEngine *dmEngine) : _vm(dmEngine), _rawDunFileData(NULL), _g277_maps(NULL), _g276_rawMapData(NULL) { + _dunData._g282_columCount = 0; - _dunData._mapsFirstColumnIndex = nullptr; - _dunData._columnsCumulativeSquareThingCount = nullptr; - _dunData._squareFirstThings = nullptr; - _dunData._textData = nullptr; - _dunData._mapData = nullptr; + _dunData._g281_mapsFirstColumnIndex = nullptr; + _dunData._g280_columnsCumulativeSquareThingCount = nullptr; + _dunData._g283_squareFirstThings = nullptr; + _dunData._g260_textData = nullptr; + _dunData._g279_mapData = nullptr; for (int i = 0; i < 16; i++) - _dunData._thingsData[i] = nullptr; + _dunData._g284_thingsData[i] = nullptr; - _currMap._partyDir = kDirNorth; - _currMap._partyPosX = 0; - _currMap._partyPosY = 0; - _currMap._currPartyMapIndex = 0; - _currMap._index = 0; - _currMap._width = 0; - _currMap._height = 0; + _currMap._g308_partyDir = kDirNorth; + _currMap._g306_partyPosX = 0; + _currMap._g307_partyPosY = 0; + _currMap._g309_currPartyMapIndex = 0; + _currMap._g272_index = 0; + _currMap._g273_width = 0; + _currMap._g274_height = 0; - _currMap._data = nullptr; - _currMap._map = nullptr; - _currMap._colCumulativeSquareFirstThingCount = nullptr; + _currMap._g271_data = nullptr; + _currMap._g269_map = nullptr; + _currMap._g270_colCumulativeSquareFirstThingCount = nullptr; - _messages._newGame = true; - _messages._restartGameRequest = false; + _messages._g298_newGame = true; + _messages._g523_restartGameRequest = false; _rawDunFileDataSize = 0; _rawDunFileData = nullptr; - _fileHeader._dungeonId = 0; - _fileHeader._ornamentRandomSeed = 0; - _fileHeader._rawMapDataSize = 0; - _fileHeader._mapCount = 0; - _fileHeader._textDataWordCount = 0; - _fileHeader._partyStartDir = kDirNorth; - _fileHeader._partyStartPosX = 0; - _fileHeader._partyStartPosY = 0; - _fileHeader._squareFirstThingCount = 0; + _g278_fileHeader._dungeonId = 0; + _g278_fileHeader._ornamentRandomSeed = 0; + _g278_fileHeader._rawMapDataSize = 0; + _g278_fileHeader._mapCount = 0; + _g278_fileHeader._textDataWordCount = 0; + _g278_fileHeader._partyStartDir = kDirNorth; + _g278_fileHeader._partyStartPosX = 0; + _g278_fileHeader._partyStartPosY = 0; + _g278_fileHeader._squareFirstThingCount = 0; for (int i = 0; i < 16; i++) - _fileHeader._thingCounts[i] = 0; + _g278_fileHeader._thingCounts[i] = 0; - _maps = nullptr; - _rawMapData = nullptr; + _g277_maps = nullptr; + _g276_rawMapData = nullptr; - _currMapInscriptionWallOrnIndex = 0; - _isFacingAlcove = false; - _isFacingViAltar = false; - _isFacingFountain = false; + _g265_currMapInscriptionWallOrnIndex = 0; + _g286_isFacingAlcove = false; + _g287_isFacingViAltar = false; + _g288_isFacingFountain = false; for (int j = 0; j < 6; j++) - _dungeonViewClickableBoxes[j].setToZero(); + _g291_dungeonViewClickableBoxes[j].setToZero(); } DungeonMan::~DungeonMan() { delete[] _rawDunFileData; - delete[] _maps; - delete[] _dunData._mapsFirstColumnIndex; - delete[] _dunData._columnsCumulativeSquareThingCount; - delete[] _dunData._squareFirstThings; - delete[] _dunData._textData; - delete[] _dunData._mapData; + delete[] _g277_maps; + delete[] _dunData._g281_mapsFirstColumnIndex; + delete[] _dunData._g280_columnsCumulativeSquareThingCount; + delete[] _dunData._g283_squareFirstThings; + delete[] _dunData._g260_textData; + delete[] _dunData._g279_mapData; for (uint16 i = 0; i < 16; ++i) { - if (_dunData._thingsData[i]) - delete[] _dunData._thingsData[i][0]; - delete[] _dunData._thingsData[i]; + if (_dunData._g284_thingsData[i]) + delete[] _dunData._g284_thingsData[i][0]; + delete[] _dunData._g284_thingsData[i]; } } @@ -551,177 +551,177 @@ const Thing Thing::_explRebirthStep2(0xFFE5); // @ C0xFFE5_THING_EXPLOSION_REBIR const Thing Thing::_party(0xFFFF); // @ C0xFFFF_THING_PARTY void DungeonMan::loadDungeonFile() { - if (_messages._newGame) + if (_messages._g298_newGame) decompressDungeonFile(); Common::MemoryReadStream dunDataStream(_rawDunFileData, _rawDunFileDataSize, DisposeAfterUse::NO); - // initialize _fileHeader - _fileHeader._dungeonId = _fileHeader._ornamentRandomSeed = dunDataStream.readUint16BE(); - _fileHeader._rawMapDataSize = dunDataStream.readUint16BE(); - _fileHeader._mapCount = dunDataStream.readByte(); + // initialize _g278_fileHeader + _g278_fileHeader._dungeonId = _g278_fileHeader._ornamentRandomSeed = dunDataStream.readUint16BE(); + _g278_fileHeader._rawMapDataSize = dunDataStream.readUint16BE(); + _g278_fileHeader._mapCount = dunDataStream.readByte(); dunDataStream.readByte(); // discard 1 byte - _fileHeader._textDataWordCount = dunDataStream.readUint16BE(); + _g278_fileHeader._textDataWordCount = dunDataStream.readUint16BE(); uint16 partyPosition = dunDataStream.readUint16BE(); - _fileHeader._partyStartDir = (direction)((partyPosition >> 10) & 3); - _fileHeader._partyStartPosY = (partyPosition >> 5) & 0x1F; - _fileHeader._partyStartPosX = (partyPosition >> 0) & 0x1F; - _fileHeader._squareFirstThingCount = dunDataStream.readUint16BE(); - for (uint16 i = 0; i < kThingTypeTotal; ++i) - _fileHeader._thingCounts[i] = dunDataStream.readUint16BE(); + _g278_fileHeader._partyStartDir = (direction)((partyPosition >> 10) & 3); + _g278_fileHeader._partyStartPosY = (partyPosition >> 5) & 0x1F; + _g278_fileHeader._partyStartPosX = (partyPosition >> 0) & 0x1F; + _g278_fileHeader._squareFirstThingCount = dunDataStream.readUint16BE(); + for (uint16 i = 0; i < k16_ThingTypeTotal; ++i) + _g278_fileHeader._thingCounts[i] = dunDataStream.readUint16BE(); // init party position and mapindex - if (_messages._newGame) { - _currMap._partyDir = _fileHeader._partyStartDir; - _currMap._partyPosX = _fileHeader._partyStartPosX; - _currMap._partyPosY = _fileHeader._partyStartPosY; - _currMap._currPartyMapIndex = 0; + if (_messages._g298_newGame) { + _currMap._g308_partyDir = _g278_fileHeader._partyStartDir; + _currMap._g306_partyPosX = _g278_fileHeader._partyStartPosX; + _currMap._g307_partyPosY = _g278_fileHeader._partyStartPosY; + _currMap._g309_currPartyMapIndex = 0; } // load map data - delete[] _maps; - _maps = new Map[_fileHeader._mapCount]; - for (uint16 i = 0; i < _fileHeader._mapCount; ++i) { - _maps[i]._rawDunDataOffset = dunDataStream.readUint16BE(); + delete[] _g277_maps; + _g277_maps = new Map[_g278_fileHeader._mapCount]; + for (uint16 i = 0; i < _g278_fileHeader._mapCount; ++i) { + _g277_maps[i]._rawDunDataOffset = dunDataStream.readUint16BE(); dunDataStream.readUint32BE(); // discard 4 bytes - _maps[i]._offsetMapX = dunDataStream.readByte(); - _maps[i]._offsetMapY = dunDataStream.readByte(); + _g277_maps[i]._offsetMapX = dunDataStream.readByte(); + _g277_maps[i]._offsetMapY = dunDataStream.readByte(); uint16 tmp = dunDataStream.readUint16BE(); - _maps[i]._height = tmp >> 11; - _maps[i]._width = (tmp >> 6) & 0x1F; - _maps[i]._level = tmp & 0x1F; // Only used in DMII + _g277_maps[i]._height = tmp >> 11; + _g277_maps[i]._width = (tmp >> 6) & 0x1F; + _g277_maps[i]._level = tmp & 0x1F; // Only used in DMII tmp = dunDataStream.readUint16BE(); - _maps[i]._randFloorOrnCount = tmp >> 12; - _maps[i]._floorOrnCount = (tmp >> 8) & 0xF; - _maps[i]._randWallOrnCount = (tmp >> 4) & 0xF; - _maps[i]._wallOrnCount = tmp & 0xF; + _g277_maps[i]._randFloorOrnCount = tmp >> 12; + _g277_maps[i]._floorOrnCount = (tmp >> 8) & 0xF; + _g277_maps[i]._randWallOrnCount = (tmp >> 4) & 0xF; + _g277_maps[i]._wallOrnCount = tmp & 0xF; tmp = dunDataStream.readUint16BE(); - _maps[i]._difficulty = tmp >> 12; - _maps[i]._creatureTypeCount = (tmp >> 4) & 0xF; - _maps[i]._doorOrnCount = tmp & 0xF; + _g277_maps[i]._difficulty = tmp >> 12; + _g277_maps[i]._creatureTypeCount = (tmp >> 4) & 0xF; + _g277_maps[i]._doorOrnCount = tmp & 0xF; tmp = dunDataStream.readUint16BE(); - _maps[i]._doorSet1 = (tmp >> 12) & 0xF; - _maps[i]._doorSet0 = (tmp >> 8) & 0xF; - _maps[i]._wallSet = (WallSet)((tmp >> 4) & 0xF); - _maps[i]._floorSet = (FloorSet)(tmp & 0xF); + _g277_maps[i]._doorSet1 = (tmp >> 12) & 0xF; + _g277_maps[i]._doorSet0 = (tmp >> 8) & 0xF; + _g277_maps[i]._wallSet = (WallSet)((tmp >> 4) & 0xF); + _g277_maps[i]._floorSet = (FloorSet)(tmp & 0xF); } // TODO: ??? is this - begin - delete[] _dunData._mapsFirstColumnIndex; - _dunData._mapsFirstColumnIndex = new uint16[_fileHeader._mapCount]; + delete[] _dunData._g281_mapsFirstColumnIndex; + _dunData._g281_mapsFirstColumnIndex = new uint16[_g278_fileHeader._mapCount]; uint16 columCount = 0; - for (uint16 i = 0; i < _fileHeader._mapCount; ++i) { - _dunData._mapsFirstColumnIndex[i] = columCount; - columCount += _maps[i]._width + 1; + for (uint16 i = 0; i < _g278_fileHeader._mapCount; ++i) { + _dunData._g281_mapsFirstColumnIndex[i] = columCount; + columCount += _g277_maps[i]._width + 1; } - _dunData._columCount = columCount; + _dunData._g282_columCount = columCount; // TODO: ??? is this - end - uint32 actualSquareFirstThingCount = _fileHeader._squareFirstThingCount; - if (_messages._newGame) // TODO: what purpose does this serve? - _fileHeader._squareFirstThingCount += 300; + uint32 actualSquareFirstThingCount = _g278_fileHeader._squareFirstThingCount; + if (_messages._g298_newGame) // TODO: what purpose does this serve? + _g278_fileHeader._squareFirstThingCount += 300; // TODO: ??? is this - begin - delete[] _dunData._columnsCumulativeSquareThingCount; - _dunData._columnsCumulativeSquareThingCount = new uint16[columCount]; + delete[] _dunData._g280_columnsCumulativeSquareThingCount; + _dunData._g280_columnsCumulativeSquareThingCount = new uint16[columCount]; for (uint16 i = 0; i < columCount; ++i) - _dunData._columnsCumulativeSquareThingCount[i] = dunDataStream.readUint16BE(); + _dunData._g280_columnsCumulativeSquareThingCount[i] = dunDataStream.readUint16BE(); // TODO: ??? is this - end // TODO: ??? is this - begin - delete[] _dunData._squareFirstThings; - _dunData._squareFirstThings = new Thing[_fileHeader._squareFirstThingCount]; + delete[] _dunData._g283_squareFirstThings; + _dunData._g283_squareFirstThings = new Thing[_g278_fileHeader._squareFirstThingCount]; for (uint16 i = 0; i < actualSquareFirstThingCount; ++i) - _dunData._squareFirstThings[i].set(dunDataStream.readUint16BE()); - if (_messages._newGame) + _dunData._g283_squareFirstThings[i].set(dunDataStream.readUint16BE()); + if (_messages._g298_newGame) for (uint16 i = 0; i < 300; ++i) - _dunData._squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none; + _dunData._g283_squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none; // TODO: ??? is this - end // load text data - delete[] _dunData._textData; - _dunData._textData = new uint16[_fileHeader._textDataWordCount]; - for (uint16 i = 0; i < _fileHeader._textDataWordCount; ++i) - _dunData._textData[i] = dunDataStream.readUint16BE(); + delete[] _dunData._g260_textData; + _dunData._g260_textData = new uint16[_g278_fileHeader._textDataWordCount]; + for (uint16 i = 0; i < _g278_fileHeader._textDataWordCount; ++i) + _dunData._g260_textData[i] = dunDataStream.readUint16BE(); // TODO: ??? what this - if (_messages._newGame) + if (_messages._g298_newGame) _vm->_timeline->_eventMaxCount = 100; // load things - for (uint16 thingType = kDoorThingType; thingType < kThingTypeTotal; ++thingType) { - uint16 thingCount = _fileHeader._thingCounts[thingType]; - if (_messages._newGame) { - _fileHeader._thingCounts[thingType] = MIN((thingType == kExplosionThingType) ? 768 : 1024, thingCount + gAdditionalThingCounts[thingType]); + for (uint16 thingType = k0_DoorThingType; thingType < k16_ThingTypeTotal; ++thingType) { + uint16 thingCount = _g278_fileHeader._thingCounts[thingType]; + if (_messages._g298_newGame) { + _g278_fileHeader._thingCounts[thingType] = MIN((thingType == k15_ExplosionThingType) ? 768 : 1024, thingCount + gAdditionalThingCounts[thingType]); } uint16 thingStoreWordCount = gThingDataWordCount[thingType]; if (thingStoreWordCount == 0) continue; - if (_dunData._thingsData[thingType]) { - delete[] _dunData._thingsData[thingType][0]; - delete[] _dunData._thingsData[thingType]; + if (_dunData._g284_thingsData[thingType]) { + delete[] _dunData._g284_thingsData[thingType][0]; + delete[] _dunData._g284_thingsData[thingType]; } - _dunData._thingsData[thingType] = new uint16*[_fileHeader._thingCounts[thingType]]; - _dunData._thingsData[thingType][0] = new uint16[_fileHeader._thingCounts[thingType] * thingStoreWordCount]; - for (uint16 i = 0; i < _fileHeader._thingCounts[thingType]; ++i) - _dunData._thingsData[thingType][i] = _dunData._thingsData[thingType][0] + i * thingStoreWordCount; + _dunData._g284_thingsData[thingType] = new uint16*[_g278_fileHeader._thingCounts[thingType]]; + _dunData._g284_thingsData[thingType][0] = new uint16[_g278_fileHeader._thingCounts[thingType] * thingStoreWordCount]; + for (uint16 i = 0; i < _g278_fileHeader._thingCounts[thingType]; ++i) + _dunData._g284_thingsData[thingType][i] = _dunData._g284_thingsData[thingType][0] + i * thingStoreWordCount; - if (thingType == kGroupThingType) { + if (thingType == k4_GroupThingType) { for (uint16 i = 0; i < thingCount; ++i) for (uint16 j = 0; j < thingStoreWordCount; ++j) { if (j == 2 || j == 3) - _dunData._thingsData[thingType][i][j] = dunDataStream.readByte(); + _dunData._g284_thingsData[thingType][i][j] = dunDataStream.readByte(); else - _dunData._thingsData[thingType][i][j] = dunDataStream.readUint16BE(); + _dunData._g284_thingsData[thingType][i][j] = dunDataStream.readUint16BE(); } - } else if (thingType == kProjectileThingType) { + } else if (thingType == k14_ProjectileThingType) { for (uint16 i = 0; i < thingCount; ++i) { - _dunData._thingsData[thingType][i][0] = dunDataStream.readUint16BE(); - _dunData._thingsData[thingType][i][1] = dunDataStream.readUint16BE(); - _dunData._thingsData[thingType][i][2] = dunDataStream.readByte(); - _dunData._thingsData[thingType][i][3] = dunDataStream.readByte(); - _dunData._thingsData[thingType][i][4] = dunDataStream.readUint16BE(); + _dunData._g284_thingsData[thingType][i][0] = dunDataStream.readUint16BE(); + _dunData._g284_thingsData[thingType][i][1] = dunDataStream.readUint16BE(); + _dunData._g284_thingsData[thingType][i][2] = dunDataStream.readByte(); + _dunData._g284_thingsData[thingType][i][3] = dunDataStream.readByte(); + _dunData._g284_thingsData[thingType][i][4] = dunDataStream.readUint16BE(); } } else { for (uint16 i = 0; i < thingCount; ++i) { for (uint16 j = 0; j < thingStoreWordCount; ++j) - _dunData._thingsData[thingType][i][j] = dunDataStream.readUint16BE(); + _dunData._g284_thingsData[thingType][i][j] = dunDataStream.readUint16BE(); } } - if (_messages._newGame) { - if ((thingType == kGroupThingType) || thingType >= kProjectileThingType) - _vm->_timeline->_eventMaxCount += _fileHeader._thingCounts[thingType]; + if (_messages._g298_newGame) { + if ((thingType == k4_GroupThingType) || thingType >= k14_ProjectileThingType) + _vm->_timeline->_eventMaxCount += _g278_fileHeader._thingCounts[thingType]; for (uint16 i = 0; i < gAdditionalThingCounts[thingType]; ++i) { - _dunData._thingsData[thingType][thingCount + i][0] = Thing::_none.toUint16(); + _dunData._g284_thingsData[thingType][thingCount + i][0] = Thing::_none.toUint16(); } } } // load map data - if (!_messages._restartGameRequest) - _rawMapData = _rawDunFileData + dunDataStream.pos(); + if (!_messages._g523_restartGameRequest) + _g276_rawMapData = _rawDunFileData + dunDataStream.pos(); - if (!_messages._restartGameRequest) { - uint8 mapCount = _fileHeader._mapCount; - delete[] _dunData._mapData; - _dunData._mapData = new byte**[_dunData._columCount + mapCount]; - byte **colFirstSquares = (byte**)_dunData._mapData + mapCount; + if (!_messages._g523_restartGameRequest) { + uint8 mapCount = _g278_fileHeader._mapCount; + delete[] _dunData._g279_mapData; + _dunData._g279_mapData = new byte**[_dunData._g282_columCount + mapCount]; + byte **colFirstSquares = (byte**)_dunData._g279_mapData + mapCount; for (uint8 i = 0; i < mapCount; ++i) { - _dunData._mapData[i] = colFirstSquares; - byte *square = _rawMapData + _maps[i]._rawDunDataOffset; + _dunData._g279_mapData[i] = colFirstSquares; + byte *square = _g276_rawMapData + _g277_maps[i]._rawDunDataOffset; *colFirstSquares++ = square; - for (uint16 w = 1; w <= _maps[i]._width; ++w) { - square += _maps[i]._height + 1; + for (uint16 w = 1; w <= _g277_maps[i]._width; ++w) { + square += _g277_maps[i]._height + 1; *colFirstSquares++ = square; } } @@ -729,63 +729,63 @@ void DungeonMan::loadDungeonFile() { } void DungeonMan::setCurrentMap(uint16 mapIndex) { - _currMap._index = mapIndex; - _currMap._data = _dunData._mapData[mapIndex]; - _currMap._map = _maps + mapIndex; - _currMap._width = _maps[mapIndex]._width + 1; - _currMap._height = _maps[mapIndex]._height + 1; - _currMap._colCumulativeSquareFirstThingCount - = &_dunData._columnsCumulativeSquareThingCount[_dunData._mapsFirstColumnIndex[mapIndex]]; + _currMap._g272_index = mapIndex; + _currMap._g271_data = _dunData._g279_mapData[mapIndex]; + _currMap._g269_map = _g277_maps + mapIndex; + _currMap._g273_width = _g277_maps[mapIndex]._width + 1; + _currMap._g274_height = _g277_maps[mapIndex]._height + 1; + _currMap._g270_colCumulativeSquareFirstThingCount + = &_dunData._g280_columnsCumulativeSquareThingCount[_dunData._g281_mapsFirstColumnIndex[mapIndex]]; } void DungeonMan::setCurrentMapAndPartyMap(uint16 mapIndex) { setCurrentMap(mapIndex); - byte *metaMapData = _currMap._data[_currMap._width - 1] + _currMap._height; + byte *metaMapData = _currMap._g271_data[_currMap._g273_width - 1] + _currMap._g274_height; _vm->_displayMan->_g264_currMapAllowedCreatureTypes = metaMapData; - metaMapData += _currMap._map->_creatureTypeCount; - memcpy(_vm->_displayMan->_g261_currMapWallOrnIndices, metaMapData, _currMap._map->_wallOrnCount); + metaMapData += _currMap._g269_map->_creatureTypeCount; + memcpy(_vm->_displayMan->_g261_currMapWallOrnIndices, metaMapData, _currMap._g269_map->_wallOrnCount); - metaMapData += _currMap._map->_wallOrnCount; - memcpy(_vm->_displayMan->_g262_currMapFloorOrnIndices, metaMapData, _currMap._map->_floorOrnCount); + metaMapData += _currMap._g269_map->_wallOrnCount; + memcpy(_vm->_displayMan->_g262_currMapFloorOrnIndices, metaMapData, _currMap._g269_map->_floorOrnCount); - metaMapData += _currMap._map->_wallOrnCount; - memcpy(_vm->_displayMan->_g263_currMapDoorOrnIndices, metaMapData, _currMap._map->_doorOrnCount); + metaMapData += _currMap._g269_map->_wallOrnCount; + memcpy(_vm->_displayMan->_g263_currMapDoorOrnIndices, metaMapData, _currMap._g269_map->_doorOrnCount); - _currMapInscriptionWallOrnIndex = _currMap._map->_wallOrnCount; - _vm->_displayMan->_g261_currMapWallOrnIndices[_currMapInscriptionWallOrnIndex] = k0_WallOrnInscription; + _g265_currMapInscriptionWallOrnIndex = _currMap._g269_map->_wallOrnCount; + _vm->_displayMan->_g261_currMapWallOrnIndices[_g265_currMapInscriptionWallOrnIndex] = k0_WallOrnInscription; } Square DungeonMan::getSquare(int16 mapX, int16 mapY) { - bool isInXBounds = (mapX >= 0) && (mapX < _currMap._width); - bool isInYBounds = (mapY >= 0) && (mapY < _currMap._height); + bool isInXBounds = (mapX >= 0) && (mapX < _currMap._g273_width); + bool isInYBounds = (mapY >= 0) && (mapY < _currMap._g274_height); if (isInXBounds && isInYBounds) - return _currMap._data[mapX][mapY]; + return Square(_currMap._g271_data[mapX][mapY]); Square tmpSquare; if (isInYBounds) { - tmpSquare.set(_currMap._data[0][mapY]); - if (mapX == -1 && (tmpSquare.getType() == kCorridorElemType || tmpSquare.getType() == kPitElemType)) - return Square(kWallElemType).set(kWallEastRandOrnAllowed); + tmpSquare.set(_currMap._g271_data[0][mapY]); + if (mapX == -1 && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType)) + return Square(k0_WallElemType).set(k0x0004_WallEastRandOrnAllowed); - tmpSquare.set(_currMap._data[_currMap._width - 1][mapY]); - if (mapX == _currMap._width && (tmpSquare.getType() == kCorridorElemType || tmpSquare.getType() == kPitElemType)) - return Square(kWallElemType).set(kWallWestRandOrnAllowed); + tmpSquare.set(_currMap._g271_data[_currMap._g273_width - 1][mapY]); + if (mapX == _currMap._g273_width && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType)) + return Square(k0_WallElemType).set(k0x0001_WallWestRandOrnAllowed); } else if (isInXBounds) { - tmpSquare.set(_currMap._data[mapX][0]); - if (mapY == -1 && (tmpSquare.getType() == kCorridorElemType || tmpSquare.getType() == kPitElemType)) - return Square(kWallElemType).set(kWallSouthRandOrnAllowed); + tmpSquare.set(_currMap._g271_data[mapX][0]); + if (mapY == -1 && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType)) + return Square(k0_WallElemType).set(k0x0002_WallSouthRandOrnAllowed); - tmpSquare.set(_currMap._data[mapX][_currMap._height - 1]); - if (mapY == _currMap._height && (tmpSquare.getType() == kCorridorElemType || tmpSquare.getType() == kPitElemType)) - return (kWallElemType << 5) | kWallNorthRandOrnAllowed; + tmpSquare.set(_currMap._g271_data[mapX][_currMap._g274_height - 1]); + if (mapY == _currMap._g274_height && (tmpSquare.getType() == k1_CorridorElemType || tmpSquare.getType() == k2_PitElemType)) + return Square((k0_WallElemType << 5) | k0x0008_WallNorthRandOrnAllowed); } - return Square(kWallElemType); + return Square(k0_WallElemType); } Square DungeonMan::getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) { @@ -794,14 +794,14 @@ Square DungeonMan::getRelSquare(direction dir, int16 stepsForward, int16 stepsRi } int16 DungeonMan::getSquareFirstThingIndex(int16 mapX, int16 mapY) { - if (mapX < 0 || mapX >= _currMap._width || mapY < 0 || mapY >= _currMap._height || !Square(_currMap._data[mapX][mapY]).get(kThingListPresent)) + if (mapX < 0 || mapX >= _currMap._g273_width || mapY < 0 || mapY >= _currMap._g274_height || !Square(_currMap._g271_data[mapX][mapY]).get(k0x0010_ThingListPresent)) return -1; int16 y = 0; - uint16 index = _currMap._colCumulativeSquareFirstThingCount[mapX]; - byte* square = _currMap._data[mapX]; + uint16 index = _currMap._g270_colCumulativeSquareFirstThingCount[mapX]; + byte* square = _currMap._g271_data[mapX]; while (y++ != mapY) - if (Square(*square++).get(kThingListPresent)) + if (Square(*square++).get(k0x0010_ThingListPresent)) index++; return index; @@ -811,7 +811,7 @@ Thing DungeonMan::getSquareFirstThing(int16 mapX, int16 mapY) { int16 index = getSquareFirstThingIndex(mapX, mapY); if (index == -1) return Thing::_endOfList; - return _dunData._squareFirstThings[index]; + return _dunData._g283_squareFirstThings[index]; } @@ -825,7 +825,7 @@ void DungeonMan::setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, Thing thing = getSquareFirstThing(mapX, mapY); Square square = getSquare(mapX, mapY); - aspectArray[kElemAspect] = square.getType(); + aspectArray[k0_ElemAspect] = square.getType(); bool leftOrnAllowed = false; bool rightOrnAllowed = false; @@ -833,27 +833,27 @@ void DungeonMan::setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, bool squareIsFakeWall = false; bool footPrintsAllowed = false; switch (square.getType()) { - case kWallElemType: + case k0_WallElemType: switch (dir) { case kDirNorth: - leftOrnAllowed = square.get(kWallEastRandOrnAllowed); - frontOrnAllowed = square.get(kWallSouthRandOrnAllowed); - rightOrnAllowed = square.get(kWallWestRandOrnAllowed); + leftOrnAllowed = square.get(k0x0004_WallEastRandOrnAllowed); + frontOrnAllowed = square.get(k0x0002_WallSouthRandOrnAllowed); + rightOrnAllowed = square.get(k0x0001_WallWestRandOrnAllowed); break; case kDirEast: - leftOrnAllowed = square.get(kWallSouthRandOrnAllowed); - frontOrnAllowed = square.get(kWallWestRandOrnAllowed); - rightOrnAllowed = square.get(kWallNorthRandOrnAllowed); + leftOrnAllowed = square.get(k0x0002_WallSouthRandOrnAllowed); + frontOrnAllowed = square.get(k0x0001_WallWestRandOrnAllowed); + rightOrnAllowed = square.get(k0x0008_WallNorthRandOrnAllowed); break; case kDirSouth: - leftOrnAllowed = square.get(kWallWestRandOrnAllowed); - frontOrnAllowed = square.get(kWallNorthRandOrnAllowed); - rightOrnAllowed = square.get(kWallEastRandOrnAllowed); + leftOrnAllowed = square.get(k0x0001_WallWestRandOrnAllowed); + frontOrnAllowed = square.get(k0x0008_WallNorthRandOrnAllowed); + rightOrnAllowed = square.get(k0x0004_WallEastRandOrnAllowed); break; case kDirWest: - leftOrnAllowed = square.get(kWallNorthRandOrnAllowed); - frontOrnAllowed = square.get(kWallEastRandOrnAllowed); - rightOrnAllowed = square.get(kWallSouthRandOrnAllowed); + leftOrnAllowed = square.get(k0x0008_WallNorthRandOrnAllowed); + frontOrnAllowed = square.get(k0x0004_WallEastRandOrnAllowed); + rightOrnAllowed = square.get(k0x0002_WallSouthRandOrnAllowed); break; default: break; @@ -862,104 +862,104 @@ void DungeonMan::setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, T0172010_ClosedFakeWall: setSquareAspectOrnOrdinals(aspectArray, leftOrnAllowed, frontOrnAllowed, rightOrnAllowed, dir, mapX, mapY, squareIsFakeWall); - while ((thing != Thing::_endOfList) && (thing.getType() <= kSensorThingType)) { + while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) { int16 sideIndex = (thing.getCell() - dir) & 3; if (sideIndex) { - if (thing.getType() == kTextstringType) { + if (thing.getType() == k2_TextstringType) { if (TextString(getThingData(thing)).isVisible()) { - aspectArray[sideIndex + 1] = _currMapInscriptionWallOrnIndex + 1; + aspectArray[sideIndex + 1] = _g265_currMapInscriptionWallOrnIndex + 1; _vm->_displayMan->_g290_inscriptionThing = thing; // BUG0_76 } } else { Sensor sensor(getThingData(thing)); aspectArray[sideIndex + 1] = sensor.getOrnOrdinal(); - if (sensor.getType() == kSensorWallChampionPortrait) { + if (sensor.getType() == k127_SensorWallChampionPortrait) { _vm->_displayMan->_g289_championPortraitOrdinal = _vm->indexToOrdinal(sensor.getData()); } } } thing = getNextThing(thing); } - if (squareIsFakeWall && (_currMap._partyPosX != mapX) && (_currMap._partyPosY != mapY)) { - aspectArray[kFirstGroupOrObjectAspect] = Thing::_endOfList.toUint16(); + if (squareIsFakeWall && (_currMap._g306_partyPosX != mapX) && (_currMap._g307_partyPosY != mapY)) { + aspectArray[k1_FirstGroupOrObjectAspect] = Thing::_endOfList.toUint16(); return; } break; - case kPitElemType: - if (square.get(kPitOpen)) { - aspectArray[kPitInvisibleAspect] = square.get(kPitInvisible); + case k2_PitElemType: + if (square.get(k0x0008_PitOpen)) { + aspectArray[k2_PitInvisibleAspect] = square.get(k0x0004_PitInvisible); footPrintsAllowed = square.toByte() & 1; } else { - aspectArray[kElemAspect] = kCorridorElemType; + aspectArray[k0_ElemAspect] = k1_CorridorElemType; footPrintsAllowed = true; } goto T0172030_Pit; - case kFakeWallElemType: - if (!square.get(kFakeWallOpen)) { - aspectArray[kElemAspect] = kWallElemType; - leftOrnAllowed = rightOrnAllowed = frontOrnAllowed = square.get(kFakeWallRandOrnOrFootPAllowed); + case k6_FakeWallElemType: + if (!square.get(k0x0004_FakeWallOpen)) { + aspectArray[k0_ElemAspect] = k0_WallElemType; + leftOrnAllowed = rightOrnAllowed = frontOrnAllowed = square.get(k0x0008_FakeWallRandOrnOrFootPAllowed); squareIsFakeWall = true; goto T0172010_ClosedFakeWall; } - aspectArray[kWallElemType] = kCorridorElemType; - footPrintsAllowed = square.get(kFakeWallRandOrnOrFootPAllowed); - square = footPrintsAllowed ? 8 : 0; + aspectArray[k0_WallElemType] = k1_CorridorElemType; + footPrintsAllowed = square.get(k0x0008_FakeWallRandOrnOrFootPAllowed); + square = Square(footPrintsAllowed ? 8 : 0); // intentional fallthrough - case kCorridorElemType: - aspectArray[kFloorOrnOrdAspect] = getRandomOrnOrdinal(square.get(kCorridorRandOrnAllowed), _currMap._map->_randFloorOrnCount, mapX, mapY, 30); + case k1_CorridorElemType: + aspectArray[k4_FloorOrnOrdAspect] = getRandomOrnOrdinal(square.get(k0x0008_CorridorRandOrnAllowed), _currMap._g269_map->_randFloorOrnCount, mapX, mapY, 30); T0172029_Teleporter: footPrintsAllowed = true; T0172030_Pit: - while ((thing != Thing::_endOfList) && (thing.getType() <= kSensorThingType)) { - if (thing.getType() == kSensorThingType) - aspectArray[kFloorOrnOrdAspect] = Sensor(getThingData(thing)).getOrnOrdinal(); + while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) { + if (thing.getType() == k3_SensorThingType) + aspectArray[k4_FloorOrnOrdAspect] = Sensor(getThingData(thing)).getOrnOrdinal(); thing = getNextThing(thing); } goto T0172049_Footprints; - case kTeleporterElemType: - aspectArray[kTeleporterVisibleAspect] = square.get(kTeleporterOpen) && square.get(kTeleporterVisible); + case k5_TeleporterElemType: + aspectArray[k2_TeleporterVisibleAspect] = square.get(k0x0008_TeleporterOpen) && square.get(k0x0004_TeleporterVisible); goto T0172029_Teleporter; - case kStairsElemType: - aspectArray[kElemAspect] = ((square.get(kStairsNorthSouthOrient) >> 3) == (isOrientedWestEast(dir) ? 1 : 0)) ? kStairsSideElemType : kStairsFrontElemType; - aspectArray[kStairsUpAspect] = square.get(kStairsUp); + case k3_StairsElemType: + aspectArray[k0_ElemAspect] = ((square.get(k0x0008_StairsNorthSouthOrient) >> 3) == (isOrientedWestEast(dir) ? 1 : 0)) ? k18_StairsSideElemType : k19_StairsFrontElemType; + aspectArray[k2_StairsUpAspect] = square.get(k0x0004_StairsUp); footPrintsAllowed = false; goto T0172046_Stairs; - case kDoorElemType: - if ((square.get(kDoorNorthSouthOrient) >> 3) == (isOrientedWestEast(dir) ? 1 : 0)) { - aspectArray[kElemAspect] = kDoorSideElemType; + case k4_DoorElemType: + if ((square.get(k0x0008_DoorNorthSouthOrient) >> 3) == (isOrientedWestEast(dir) ? 1 : 0)) { + aspectArray[k0_ElemAspect] = k16_DoorSideElemType; } else { - aspectArray[kElemAspect] = kDoorFrontElemType; - aspectArray[kDoorStateAspect] = square.getDoorState(); - aspectArray[kDoorThingIndexAspect] = getSquareFirstThing(mapX, mapY).getIndex(); + aspectArray[k0_ElemAspect] = k17_DoorFrontElemType; + aspectArray[k2_DoorStateAspect] = square.getDoorState(); + aspectArray[k3_DoorThingIndexAspect] = getSquareFirstThing(mapX, mapY).getIndex(); } footPrintsAllowed = true; T0172046_Stairs: - while ((thing != Thing::_endOfList) && (thing.getType() <= kSensorThingType)) + while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) thing = getNextThing(thing); T0172049_Footprints: unsigned char scentOrdinal; // see next line comment if (footPrintsAllowed) // TODO: I skipped some party query code, must come back later and complete - aspectArray[kFloorOrnOrdAspect] &= kFootprintsAspect; + aspectArray[k4_FloorOrnOrdAspect] &= k0x8000_FootprintsAspect; break; default: break; } - aspectArray[kFirstGroupOrObjectAspect] = thing.toUint16(); + aspectArray[k1_FirstGroupOrObjectAspect] = thing.toUint16(); } void DungeonMan::setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir, int16 mapX, int16 mapY, bool isFakeWall) { - int16 ornCount = _currMap._map->_randWallOrnCount; + int16 ornCount = _currMap._g269_map->_randWallOrnCount; turnDirRight(dir); - aspectArray[kRightWallOrnOrdAspect] = getRandomOrnOrdinal(leftAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); + aspectArray[k2_RightWallOrnOrdAspect] = getRandomOrnOrdinal(leftAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); turnDirRight(dir); - aspectArray[kFrontWallOrnOrdAspect] = getRandomOrnOrdinal(frontAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); + aspectArray[k3_FrontWallOrnOrdAspect] = getRandomOrnOrdinal(frontAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); turnDirRight(dir); - aspectArray[kLeftWallOrnOrdAspect] = getRandomOrnOrdinal(rightAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); + aspectArray[k4_LeftWallOrnOrdAspect] = getRandomOrnOrdinal(rightAllowed, ornCount, mapX, ++mapY * (dir + 1), 30); - if (isFakeWall || mapX < 0 || mapX >= _currMap._width || mapY < 0 || mapY >= _currMap._height) { - for (uint16 i = kRightWallOrnOrdAspect; i <= kLeftWallOrnOrdAspect; ++i) { + if (isFakeWall || mapX < 0 || mapX >= _currMap._g273_width || mapY < 0 || mapY >= _currMap._g274_height) { + for (uint16 i = k2_RightWallOrnOrdAspect; i <= k4_LeftWallOrnOrdAspect; ++i) { if (isWallOrnAnAlcove(_vm->ordinalToIndex(aspectArray[i]))) aspectArray[i] = 0; } @@ -968,8 +968,8 @@ void DungeonMan::setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowe int16 DungeonMan::getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) { int16 index = (((((2000 + (mapX << 5) + mapY) * 31417) >> 1) - + (3000 + (_currMap._index << 6) + _currMap._width + _currMap._height) * 11 - + _fileHeader._ornamentRandomSeed) >> 2) % modulo; + + (3000 + (_currMap._g272_index << 6) + _currMap._g273_width + _currMap._g274_height) * 11 + + _g278_fileHeader._ornamentRandomSeed) >> 2) % modulo; if (allowed && index < count) return _vm->indexToOrdinal(index); return 0; @@ -985,7 +985,7 @@ bool DungeonMan::isWallOrnAnAlcove(int16 wallOrnIndex) { } uint16 *DungeonMan::getThingData(Thing thing) { - return _dunData._thingsData[thing.getType()][thing.getIndex()]; + return _dunData._g284_thingsData[thing.getType()][thing.getIndex()]; } uint16* DungeonMan::getSquareFirstThingData(int16 mapX, int16 mapY) { @@ -1099,20 +1099,20 @@ char gInscriptionEscReplacementStrings[32][8] = { // @ G0257_aac_Graphic559_Insc void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { char sepChar; - TextString textString(_dunData._thingsData[kTextstringType][thing.getIndex()]); - if ((textString.isVisible()) || (type & kDecodeEvenIfInvisible)) { - type = (TextType)(type & ~kDecodeEvenIfInvisible); - if (type == kTextTypeMessage) { + TextString textString(_dunData._g284_thingsData[k2_TextstringType][thing.getIndex()]); + if ((textString.isVisible()) || (type & k0x8000_DecodeEvenIfInvisible)) { + type = (TextType)(type & ~k0x8000_DecodeEvenIfInvisible); + if (type == k1_TextTypeMessage) { *destString++ = '\n'; sepChar = ' '; - } else if (type == kTextTypeInscription) { + } else if (type == k0_TextTypeInscription) { sepChar = (char)0x80; } else { sepChar = '\n'; } uint16 codeCounter = 0; int16 escChar = 0; - uint16 *codeWord = _dunData._textData + textString.getWordOffset(); + uint16 *codeWord = _dunData._g260_textData + textString.getWordOffset(); uint16 code = 0, codes = 0; char *escReplString = nullptr; for (;;) { /*infinite loop*/ @@ -1130,7 +1130,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { if (escChar) { *destString = '\0'; if (escChar == 30) { - if (type != kTextTypeInscription) { + if (type != k0_TextTypeInscription) { escReplString = gMessageAndScrollEscReplacementStrings[code]; } else { escReplString = gInscriptionEscReplacementStrings[code]; @@ -1142,7 +1142,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { destString += strlen(escReplString); escChar = 0; } else if (code < 28) { - if (type != kTextTypeInscription) { + if (type != k0_TextTypeInscription) { if (code == 26) { code = ' '; } else if (code == 27) { @@ -1161,7 +1161,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { } } } - *destString = ((type == kTextTypeInscription) ? 0x81 : '\0'); + *destString = ((type == k0_TextTypeInscription) ? 0x81 : '\0'); } @@ -1194,18 +1194,18 @@ uint16 DungeonMan::getObjectWeight(Thing thing) { if (thing == Thing::_none) return 0; switch (thing.getType()) { - case kWeaponThingType: - return gWeaponInfo[Weapon(getThingData(thing)).getType()]._weight; - case kArmourThingType: - return gArmourInfo[Armour(getThingData(thing)).getType()]._weight; - case kJunkThingType: { - Junk junk = getThingData(thing); + case k5_WeaponThingType: + return g238_WeaponInfo[Weapon(getThingData(thing)).getType()]._weight; + case k6_ArmourThingType: + return g239_ArmourInfo[Armour(getThingData(thing)).getType()]._weight; + case k10_JunkThingType: { + Junk junk(getThingData(thing)); uint16 weight = junkInfo[junk.getType()]; - if (junk.getType() == kJunkTypeWaterskin) + if (junk.getType() == k1_JunkTypeWaterskin) weight += junk.getChargeCount() * 2; return weight; } - case kContainerThingType: { + case k9_ContainerThingType: { uint16 weight = 50; Container container(getThingData(thing)); Thing slotThing = container.getSlot(); @@ -1215,13 +1215,13 @@ uint16 DungeonMan::getObjectWeight(Thing thing) { } return weight; } - case kPotionThingType: - if (Junk(getThingData(thing)).getType() == kPotionTypeEmptyFlask) { + case k8_PotionThingType: + if (Junk(getThingData(thing)).getType() == k20_PotionTypeEmptyFlask) { return 1; } else { return 3; } - case kScrollThingType: + case k7_ScrollThingType: return 1; default: break; @@ -1235,18 +1235,18 @@ uint16 DungeonMan::getObjectWeight(Thing thing) { int16 DungeonMan::getObjectInfoIndex(Thing thing) { uint16 *rawType = getThingData(thing); switch (thing.getType()) { - case kScrollThingType: - return kObjectInfoIndexFirstScroll; - case kContainerThingType: - return kObjectInfoIndexFirstContainer + Container(rawType).getType(); - case kJunkThingType: - return kObjectInfoIndexFirstJunk + Junk(rawType).getType(); - case kWeaponThingType: - return kObjectInfoIndexFirstWeapon + Weapon(rawType).getType(); - case kArmourThingType: - return kObjectInfoIndexFirstArmour + Armour(rawType).getType(); - case kPotionThingType: - return kObjectInfoIndexFirstPotion + Potion(rawType).getType(); + case k7_ScrollThingType: + return k0_ObjectInfoIndexFirstScroll; + case k9_ContainerThingType: + return k1_ObjectInfoIndexFirstContainer + Container(rawType).getType(); + case k10_JunkThingType: + return k127_ObjectInfoIndexFirstJunk + Junk(rawType).getType(); + case k5_WeaponThingType: + return k23_ObjectInfoIndexFirstWeapon + Weapon(rawType).getType(); + case k6_ArmourThingType: + return k69_ObjectInfoIndexFirstArmour + Armour(rawType).getType(); + case k8_PotionThingType: + return k2_ObjectInfoIndexFirstPotion + Potion(rawType).getType(); default: return -1; } @@ -1260,27 +1260,27 @@ void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 map *rawObjPtr = Thing::_endOfList.toUint16(); if (mapX >= 0) { - Square *squarePtr = (Square*)&_currMap._data[mapX][mapY]; - if (squarePtr->get(kThingListPresent)) { + Square *squarePtr = (Square*)&_currMap._g271_data[mapX][mapY]; + if (squarePtr->get(k0x0010_ThingListPresent)) { thingInList = getSquareFirstThing(mapX, mapY); } else { - squarePtr->set(kThingListPresent); - uint16 *cumulativeCount = &_currMap._colCumulativeSquareFirstThingCount[mapX + 1]; - uint16 column = _dunData._columCount - (_dunData._mapsFirstColumnIndex[_currMap._index] + mapX) - 1; + squarePtr->set(k0x0010_ThingListPresent); + uint16 *cumulativeCount = &_currMap._g270_colCumulativeSquareFirstThingCount[mapX + 1]; + uint16 column = _dunData._g282_columCount - (_dunData._g281_mapsFirstColumnIndex[_currMap._g272_index] + mapX) - 1; while (column--) { (*cumulativeCount++)++; } uint16 mapYStep = 0; squarePtr -= mapY; - uint16 squareFirstThingIndex = _currMap._colCumulativeSquareFirstThingCount[mapX]; + uint16 squareFirstThingIndex = _currMap._g270_colCumulativeSquareFirstThingCount[mapX]; while (mapYStep++ != mapY) { - if (squarePtr->get(kThingListPresent)) { + if (squarePtr->get(k0x0010_ThingListPresent)) { squareFirstThingIndex++; } squarePtr++; } - Thing* thingPtr = &_dunData._squareFirstThings[squareFirstThingIndex]; - memmove(thingPtr + 1, thingPtr, sizeof(Thing) * (_fileHeader._squareFirstThingCount - squareFirstThingIndex - 1)); + Thing* thingPtr = &_dunData._g283_squareFirstThings[squareFirstThingIndex]; + memmove(thingPtr + 1, thingPtr, sizeof(Thing) * (_g278_fileHeader._squareFirstThingCount - squareFirstThingIndex - 1)); *thingPtr = thingToLink; return; } @@ -1297,7 +1297,7 @@ void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 map WeaponInfo* DungeonMan::getWeaponInfo(Thing thing) { Weapon* weapon = (Weapon*)getThingData(thing); - return &gWeaponInfo[weapon->getType()]; + return &g238_WeaponInfo[weapon->getType()]; } int16 DungeonMan::getProjectileAspect(Thing thing) { @@ -1305,7 +1305,7 @@ int16 DungeonMan::getProjectileAspect(Thing thing) { int16 projAspOrd; WeaponInfo *weaponInfo; - if ((thingType = thing.getType()) == kExplosionThingType) { + if ((thingType = thing.getType()) == k15_ExplosionThingType) { if (thing == Thing::_explFireBall) return -_vm->indexToOrdinal(k10_ProjectileAspectExplosionFireBall); if (thing == Thing::_explSlime) @@ -1316,13 +1316,13 @@ int16 DungeonMan::getProjectileAspect(Thing thing) { return -_vm->indexToOrdinal(k13_ProjectileAspectExplosionPoisonBoltCloud); return -_vm->indexToOrdinal(k11_ProjectileAspectExplosionDefault); - } else if (thingType == kWeaponThingType) { + } else if (thingType == k5_WeaponThingType) { weaponInfo = getWeaponInfo(thing); if (projAspOrd = weaponInfo->getProjectileAspectOrdinal()) return -projAspOrd; } - return gObjectInfo[getObjectInfoIndex(thing)]._objectAspectIndex; + return g237_ObjectInfo[getObjectInfoIndex(thing)]._objectAspectIndex; } } diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h index b3f81d8746..d6ebdc09e9 100644 --- a/engines/dm/dungeonman.h +++ b/engines/dm/dungeonman.h @@ -35,44 +35,44 @@ namespace DM { /* Object info */ -#define kObjectInfoIndexFirstScroll 0 // @ C000_OBJECT_INFO_INDEX_FIRST_SCROLL -#define kObjectInfoIndexFirstContainer 1 // @ C001_OBJECT_INFO_INDEX_FIRST_CONTAINER -#define kObjectInfoIndexFirstPotion 2 // @ C002_OBJECT_INFO_INDEX_FIRST_POTION -#define kObjectInfoIndexFirstWeapon 23 // @ C023_OBJECT_INFO_INDEX_FIRST_WEAPON -#define kObjectInfoIndexFirstArmour 69 // @ C069_OBJECT_INFO_INDEX_FIRST_ARMOUR -#define kObjectInfoIndexFirstJunk 127 // @ C127_OBJECT_INFO_INDEX_FIRST_JUNK +#define k0_ObjectInfoIndexFirstScroll 0 // @ C000_OBJECT_INFO_INDEX_FIRST_SCROLL +#define k1_ObjectInfoIndexFirstContainer 1 // @ C001_OBJECT_INFO_INDEX_FIRST_CONTAINER +#define k2_ObjectInfoIndexFirstPotion 2 // @ C002_OBJECT_INFO_INDEX_FIRST_POTION +#define k23_ObjectInfoIndexFirstWeapon 23 // @ C023_OBJECT_INFO_INDEX_FIRST_WEAPON +#define k69_ObjectInfoIndexFirstArmour 69 // @ C069_OBJECT_INFO_INDEX_FIRST_ARMOUR +#define k127_ObjectInfoIndexFirstJunk 127 // @ C127_OBJECT_INFO_INDEX_FIRST_JUNK -#define kMapXNotOnASquare -1 // @ CM1_MAPX_NOT_ON_A_SQUARE +#define kM1_MapXNotOnASquare -1 // @ CM1_MAPX_NOT_ON_A_SQUARE enum ElementType { - kElementTypeChampion = -2, // @ CM2_ELEMENT_CHAMPION /* Values -2 and -1 are only used as projectile impact types */ - kElementTypeCreature = -1, // @ CM1_ELEMENT_CREATURE - kElementTypeWall = 0, // @ C00_ELEMENT_WALL /* Values 0-6 are used as square types and projectile impact types. Values 0-2 and 5-6 are also used for square aspect */ - kElementTypeCorridor = 1, // @ C01_ELEMENT_CORRIDOR - kElementTypePit = 2, // @ C02_ELEMENT_PIT - kElementTypeStairs = 3, // @ C03_ELEMENT_STAIRS - kElementTypeDoor = 4, // @ C04_ELEMENT_DOOR - kElementTypeTeleporter = 5, // @ C05_ELEMENT_TELEPORTER - kElementTypeFakeWall = 6, // @ C06_ELEMENT_FAKEWALL - kElementTypeDoorSide = 16, // @ C16_ELEMENT_DOOR_SIDE /* Values 16-19 are only used for square aspect */ - kElementTypeDoorFront = 17, // @ C17_ELEMENT_DOOR_FRONT - kElementTypeStairsSide = 18, // @ C18_ELEMENT_STAIRS_SIDE - kElementTypeStaisFront = 19 // @ C19_ELEMENT_STAIRS_FRONT + kM2_ElementTypeChampion = -2, // @ CM2_ELEMENT_CHAMPION /* Values -2 and -1 are only used as projectile impact types */ + kM1_ElementTypeCreature = -1, // @ CM1_ELEMENT_CREATURE + k0_ElementTypeWall = 0, // @ C00_ELEMENT_WALL /* Values 0-6 are used as square types and projectile impact types. Values 0-2 and 5-6 are also used for square aspect */ + k1_ElementTypeCorridor = 1, // @ C01_ELEMENT_CORRIDOR + k2_ElementTypePit = 2, // @ C02_ELEMENT_PIT + k3_ElementTypeStairs = 3, // @ C03_ELEMENT_STAIRS + k4_ElementTypeDoor = 4, // @ C04_ELEMENT_DOOR + k5_ElementTypeTeleporter = 5, // @ C05_ELEMENT_TELEPORTER + k6_ElementTypeFakeWall = 6, // @ C06_ELEMENT_FAKEWALL + k16_ElementTypeDoorSide = 16, // @ C16_ELEMENT_DOOR_SIDE /* Values 16-19 are only used for square aspect */ + k17_ElementTypeDoorFront = 17, // @ C17_ELEMENT_DOOR_FRONT + k18_ElementTypeStairsSide = 18, // @ C18_ELEMENT_STAIRS_SIDE + k19_ElementTypeStaisFront = 19 // @ C19_ELEMENT_STAIRS_FRONT }; enum ObjectAllowedSlot { - kObjectAllowedSlotMouth = 0x0001, // @ MASK0x0001_MOUTH - kObjectAllowedSlotHead = 0x0002, // @ MASK0x0002_HEAD - kObjectAllowedSlotNeck = 0x0004, // @ MASK0x0004_NECK - kObjectAllowedSlotTorso = 0x0008, // @ MASK0x0008_TORSO - kObjectAllowedSlotLegs = 0x0010, // @ MASK0x0010_LEGS - kObjectAllowedSlotFeet = 0x0020, // @ MASK0x0020_FEET - kObjectAllowedSlotQuiverLine_1 = 0x0040, // @ MASK0x0040_QUIVER_LINE1 - kObjectAllowedSlotQuiverLine_2 = 0x0080, // @ MASK0x0080_QUIVER_LINE2 - kObjectAllowedSlotPouchPassAndThroughDoors = 0x0100, // @ MASK0x0100_POUCH_PASS_AND_THROUGH_DOORS - kObjectAllowedSlotHands = 0x0200, // @ MASK0x0200_HANDS - kObjectAllowedSlotContainer = 0x0400 // @ MASK0x0400_CONTAINER + k0x0001_ObjectAllowedSlotMouth = 0x0001, // @ MASK0x0001_MOUTH + k0x0002_ObjectAllowedSlotHead = 0x0002, // @ MASK0x0002_HEAD + k0x0004_ObjectAllowedSlotNeck = 0x0004, // @ MASK0x0004_NECK + k0x0008_ObjectAllowedSlotTorso = 0x0008, // @ MASK0x0008_TORSO + k0x0010_ObjectAllowedSlotLegs = 0x0010, // @ MASK0x0010_LEGS + k0x0020_ObjectAllowedSlotFeet = 0x0020, // @ MASK0x0020_FEET + k0x0040_ObjectAllowedSlotQuiverLine_1 = 0x0040, // @ MASK0x0040_QUIVER_LINE1 + k0x0080_ObjectAllowedSlotQuiverLine_2 = 0x0080, // @ MASK0x0080_QUIVER_LINE2 + k0x0100_ObjectAllowedSlotPouchPassAndThroughDoors = 0x0100, // @ MASK0x0100_POUCH_PASS_AND_THROUGH_DOORS + k0x0200_ObjectAllowedSlotHands = 0x0200, // @ MASK0x0200_HANDS + k0x0400_ObjectAllowedSlotContainer = 0x0400 // @ MASK0x0400_CONTAINER }; class ObjectInfo { @@ -96,11 +96,11 @@ public: } }; // @ OBJECT_INFO -extern ObjectInfo gObjectInfo[180]; +extern ObjectInfo g237_ObjectInfo[180]; // @ G0237_as_Graphic559_ObjectInfo enum ArmourAttribute { - kArmourAttributeIsAShield = 0x0080, // @ MASK0x0080_IS_A_SHIELD - kArmourAttributeSharpDefense = 0x0007 // @ MASK0x0007_SHARP_DEFENSE + k0x0080_ArmourAttributeIsAShield = 0x0080, // @ MASK0x0080_IS_A_SHIELD + k0x0007_ArmourAttributeSharpDefense = 0x0007 // @ MASK0x0007_SHARP_DEFENSE }; class ArmourInfo { @@ -117,22 +117,22 @@ public: void setAttribute(ArmourAttribute attribute) { _attributes |= attribute; } }; // @ ARMOUR_INFO -extern ArmourInfo gArmourInfo[58]; +extern ArmourInfo g239_ArmourInfo[58]; // G0239_as_Graphic559_ArmourInfo /* Class 0: SWING weapons */ -#define kWeaponClassSwingWeapon 0 // @ C000_CLASS_SWING_WEAPON +#define k0_WeaponClassSwingWeapon 0 // @ C000_CLASS_SWING_WEAPON /* Class 1 to 15: THROW weapons */ -#define kWeaponClassDaggerAndAxes 2 // @ C002_CLASS_DAGGER_AND_AXES -#define kWeaponClassBowAmmunition 10 // @ C010_CLASS_BOW_AMMUNITION -#define kWeaponClassSlingAmmunition 11 // @ C011_CLASS_SLING_AMMUNITION -#define kWeaponClassPoisinDart 12 // @ C012_CLASS_POISON_DART +#define k2_WeaponClassDaggerAndAxes 2 // @ C002_CLASS_DAGGER_AND_AXES +#define k10_WeaponClassBowAmmunition 10 // @ C010_CLASS_BOW_AMMUNITION +#define k11_WeaponClassSlingAmmunition 11 // @ C011_CLASS_SLING_AMMUNITION +#define k12_WeaponClassPoisinDart 12 // @ C012_CLASS_POISON_DART /* Class 16 to 111: SHOOT weapons */ -#define kWeaponClassFirstBow 16 // @ C016_CLASS_FIRST_BOW -#define kWeaponClassLastBow 31 // @ C031_CLASS_LAST_BOW -#define kWeaponClassFirstSling 32 // @ C032_CLASS_FIRST_SLING -#define kWeaponClassLastSling 47 // @ C047_CLASS_LAST_SLING +#define k16_WeaponClassFirstBow 16 // @ C016_CLASS_FIRST_BOW +#define k31_WeaponClassLastBow 31 // @ C031_CLASS_LAST_BOW +#define k32_WeaponClassFirstSling 32 // @ C032_CLASS_FIRST_SLING +#define k47_WeaponClassLastSling 47 // @ C047_CLASS_LAST_SLING /* Class 112 to 255: Magic and special weapons */ -#define kWeaponClassFirstMagicWeapon 112 // @ C112_CLASS_FIRST_MAGIC_WEAPON +#define k112_WeaponClassFirstMagicWeapon 112 // @ C112_CLASS_FIRST_MAGIC_WEAPON class WeaponInfo { @@ -151,32 +151,32 @@ public: uint16 getProjectileAspectOrdinal() { return (_attributes >> 8) & 0x1F; } // @ M66_PROJECTILE_ASPECT_ORDINAL }; // @ WEAPON_INFO -extern WeaponInfo gWeaponInfo[46]; +extern WeaponInfo g238_WeaponInfo[46]; // @ G0238_as_Graphic559_WeaponInfo; enum TextType { /* Used for text on walls */ - kTextTypeInscription = 0, // @ C0_TEXT_TYPE_INSCRIPTION + k0_TextTypeInscription = 0, // @ C0_TEXT_TYPE_INSCRIPTION /* Used for messages displayed when the party walks on a square */ - kTextTypeMessage = 1, // @ C1_TEXT_TYPE_MESSAGE + k1_TextTypeMessage = 1, // @ C1_TEXT_TYPE_MESSAGE /* Used for text on scrolls and champion information */ - kTextTypeScroll = 2 // @ C2_TEXT_TYPE_SCROLL + k2_TextTypeScroll = 2 // @ C2_TEXT_TYPE_SCROLL }; enum SquareAspectIndice { - kElemAspect = 0, // @ C0_ELEMENT - kFirstGroupOrObjectAspect = 1, // @ C1_FIRST_GROUP_OR_OBJECT - kRightWallOrnOrdAspect = 2, // @ C2_RIGHT_WALL_ORNAMENT_ORDINAL - kFrontWallOrnOrdAspect = 3, // @ C3_FRONT_WALL_ORNAMENT_ORDINAL - kLeftWallOrnOrdAspect = 4, // @ C4_LEFT_WALL_ORNAMENT_ORDINAL - kPitInvisibleAspect = 2, // @ C2_PIT_INVISIBLE - kTeleporterVisibleAspect = 2, // @ C2_TELEPORTER_VISIBLE - kStairsUpAspect = 2, // @ C2_STAIRS_UP - kDoorStateAspect = 2, // @ C2_DOOR_STATE - kDoorThingIndexAspect = 3, // @ C3_DOOR_THING_INDEX - kFloorOrnOrdAspect = 4, // @ C4_FLOOR_ORNAMENT_ORDINAL - kFootprintsAspect = 0x8000 // @ MASK0x8000_FOOTPRINTS + k0_ElemAspect = 0, // @ C0_ELEMENT + k1_FirstGroupOrObjectAspect = 1, // @ C1_FIRST_GROUP_OR_OBJECT + k2_RightWallOrnOrdAspect = 2, // @ C2_RIGHT_WALL_ORNAMENT_ORDINAL + k3_FrontWallOrnOrdAspect = 3, // @ C3_FRONT_WALL_ORNAMENT_ORDINAL + k4_LeftWallOrnOrdAspect = 4, // @ C4_LEFT_WALL_ORNAMENT_ORDINAL + k2_PitInvisibleAspect = 2, // @ C2_PIT_INVISIBLE + k2_TeleporterVisibleAspect = 2, // @ C2_TELEPORTER_VISIBLE + k2_StairsUpAspect = 2, // @ C2_STAIRS_UP + k2_DoorStateAspect = 2, // @ C2_DOOR_STATE + k3_DoorThingIndexAspect = 3, // @ C3_DOOR_THING_INDEX + k4_FloorOrnOrdAspect = 4, // @ C4_FLOOR_ORNAMENT_ORDINAL + k0x8000_FootprintsAspect = 0x8000 // @ MASK0x8000_FOOTPRINTS }; -; + @@ -202,7 +202,7 @@ struct CreatureInfo { }; // @ CREATURE_INFO -extern CreatureInfo gCreatureInfo[k27_CreatureTypeCount]; +extern CreatureInfo g243_CreatureInfo[k27_CreatureTypeCount]; // @ G0243_as_Graphic559_CreatureInfo class Door { Thing _nextThing; @@ -219,8 +219,8 @@ public: }; // @ DOOR enum TeleporterScope { - kTelepScopeCreatures = 1, // @ MASK0x0001_SCOPE_CREATURES - kTelepScopeObjOrParty = 2 // @ MASK0x0002_SCOPE_OBJECTS_OR_PARTY + k0x0001_TelepScopeCreatures = 1, // @ MASK0x0001_SCOPE_CREATURES + k0x0002_TelepScopeObjOrParty = 2 // @ MASK0x0002_SCOPE_OBJECTS_OR_PARTY }; @@ -254,44 +254,44 @@ public: }; // @ TEXTSTRING enum SensorActionType { - kSensorEffNone = -1, // @ CM1_EFFECT_NONE - kSensorEffSet = 0, // @ C00_EFFECT_SET - kSensorEffClear = 1, // @ C01_EFFECT_CLEAR - kSensorEffToggle = 2, // @ C02_EFFECT_TOGGLE - kSensorEffHold = 3, // @ C03_EFFECT_HOLD - kSensorEffAddExp = 10 // @ C10_EFFECT_ADD_EXPERIENCE + kM1_SensorEffNone = -1, // @ CM1_EFFECT_NONE + k0_SensorEffSet = 0, // @ C00_EFFECT_SET + k1_SensorEffClear = 1, // @ C01_EFFECT_CLEAR + k2_SensorEffToggle = 2, // @ C02_EFFECT_TOGGLE + k3_SensorEffHold = 3, // @ C03_EFFECT_HOLD + k10_SensorEffAddExp = 10 // @ C10_EFFECT_ADD_EXPERIENCE }; enum SensorType { - kSensorDisabled = 0, // @ C000_SENSOR_DISABLED /* Never triggered, may be used for a floor or wall ornament */ - kSensorFloorTheronPartyCreatureObj = 1, // @ C001_SENSOR_FLOOR_THERON_PARTY_CREATURE_OBJECT /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorFloorTheronPartyCreature = 2, // @ C002_SENSOR_FLOOR_THERON_PARTY_CREATURE /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorFloorParty = 3, // @ C003_SENSOR_FLOOR_PARTY /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorFloorObj = 4, // @ C004_SENSOR_FLOOR_OBJECT /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorFloorPartyOnStairs = 5, // @ C005_SENSOR_FLOOR_PARTY_ON_STAIRS /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorFloorGroupGenerator = 6, // @ C006_SENSOR_FLOOR_GROUP_GENERATOR /* Triggered by event F0245_TIMELINE_ProcessEvent5_Square_Corridor */ - kSensorFloorCreature = 7, // @ C007_SENSOR_FLOOR_CREATURE /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorFloorPartyPossession = 8, // @ C008_SENSOR_FLOOR_PARTY_POSSESSION /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorFloorVersionChecker = 9, // @ C009_SENSOR_FLOOR_VERSION_CHECKER /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ - kSensorWallOrnClick = 1, // @ C001_SENSOR_WALL_ORNAMENT_CLICK /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallOrnClickWithAnyObj = 2, // @ C002_SENSOR_WALL_ORNAMENT_CLICK_WITH_ANY_OBJECT /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallOrnClickWithSpecObj = 3, // @ C003_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallOrnClickWithSpecObjRemoved = 4, // @ C004_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT_REMOVED /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallAndOrGate = 5, // @ C005_SENSOR_WALL_AND_OR_GATE /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallCountdown = 6, // @ C006_SENSOR_WALL_COUNTDOWN /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallSingleProjLauncherNewObj = 7, // @ C007_SENSOR_WALL_SINGLE_PROJECTILE_LAUNCHER_NEW_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallSingleProjLauncherExplosion = 8, // @ C008_SENSOR_WALL_SINGLE_PROJECTILE_LAUNCHER_EXPLOSION /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallDoubleProjLauncherNewObj = 9, // @ C009_SENSOR_WALL_DOUBLE_PROJECTILE_LAUNCHER_NEW_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallDoubleProjLauncherExplosion = 10, // @ C010_SENSOR_WALL_DOUBLE_PROJECTILE_LAUNCHER_EXPLOSION /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallOrnClickWithSpecObjRemovedRotateSensors = 11, // @ C011_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT_REMOVED_ROTATE_SENSORS /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallObjGeneratorRotateSensors = 12, // @ C012_SENSOR_WALL_OBJECT_GENERATOR_ROTATE_SENSORS /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallSingleObjStorageRotateSensors = 13, // @ C013_SENSOR_WALL_SINGLE_OBJECT_STORAGE_ROTATE_SENSORS /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallSingleProjLauncherSquareObj = 14, // @ C014_SENSOR_WALL_SINGLE_PROJECTILE_LAUNCHER_SQUARE_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallDoubleProjLauncherSquareObj = 15, // @ C015_SENSOR_WALL_DOUBLE_PROJECTILE_LAUNCHER_SQUARE_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallObjExchanger = 16, // @ C016_SENSOR_WALL_OBJECT_EXCHANGER /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallOrnClickWithSpecObjRemovedSensor = 17, // @ C017_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT_REMOVED_REMOVE_SENSOR /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ - kSensorWallEndGame = 18, // @ C018_SENSOR_WALL_END_GAME /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ - kSensorWallChampionPortrait = 127 // @ C127_SENSOR_WALL_CHAMPION_PORTRAIT /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k0_SensorDisabled = 0, // @ C000_SENSOR_DISABLED /* Never triggered, may be used for a floor or wall ornament */ + k1_SensorFloorTheronPartyCreatureObj = 1, // @ C001_SENSOR_FLOOR_THERON_PARTY_CREATURE_OBJECT /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k2_SensorFloorTheronPartyCreature = 2, // @ C002_SENSOR_FLOOR_THERON_PARTY_CREATURE /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k3_SensorFloorParty = 3, // @ C003_SENSOR_FLOOR_PARTY /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k4_SensorFloorObj = 4, // @ C004_SENSOR_FLOOR_OBJECT /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k5_SensorFloorPartyOnStairs = 5, // @ C005_SENSOR_FLOOR_PARTY_ON_STAIRS /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k6_SensorFloorGroupGenerator = 6, // @ C006_SENSOR_FLOOR_GROUP_GENERATOR /* Triggered by event F0245_TIMELINE_ProcessEvent5_Square_Corridor */ + k7_SensorFloorCreature = 7, // @ C007_SENSOR_FLOOR_CREATURE /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k8_SensorFloorPartyPossession = 8, // @ C008_SENSOR_FLOOR_PARTY_POSSESSION /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k9_SensorFloorVersionChecker = 9, // @ C009_SENSOR_FLOOR_VERSION_CHECKER /* Triggered by party/thing F0276_SENSOR_ProcessThingAdditionOrRemoval */ + k1_SensorWallOrnClick = 1, // @ C001_SENSOR_WALL_ORNAMENT_CLICK /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k2_SensorWallOrnClickWithAnyObj = 2, // @ C002_SENSOR_WALL_ORNAMENT_CLICK_WITH_ANY_OBJECT /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k3_SensorWallOrnClickWithSpecObj = 3, // @ C003_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k4_SensorWallOrnClickWithSpecObjRemoved = 4, // @ C004_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT_REMOVED /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k5_SensorWallAndOrGate = 5, // @ C005_SENSOR_WALL_AND_OR_GATE /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k6_SensorWallCountdown = 6, // @ C006_SENSOR_WALL_COUNTDOWN /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k7_SensorWallSingleProjLauncherNewObj = 7, // @ C007_SENSOR_WALL_SINGLE_PROJECTILE_LAUNCHER_NEW_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k8_SensorWallSingleProjLauncherExplosion = 8, // @ C008_SENSOR_WALL_SINGLE_PROJECTILE_LAUNCHER_EXPLOSION /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k9_SensorWallDoubleProjLauncherNewObj = 9, // @ C009_SENSOR_WALL_DOUBLE_PROJECTILE_LAUNCHER_NEW_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k10_SensorWallDoubleProjLauncherExplosion = 10, // @ C010_SENSOR_WALL_DOUBLE_PROJECTILE_LAUNCHER_EXPLOSION /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors = 11, // @ C011_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT_REMOVED_ROTATE_SENSORS /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k12_SensorWallObjGeneratorRotateSensors = 12, // @ C012_SENSOR_WALL_OBJECT_GENERATOR_ROTATE_SENSORS /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k13_SensorWallSingleObjStorageRotateSensors = 13, // @ C013_SENSOR_WALL_SINGLE_OBJECT_STORAGE_ROTATE_SENSORS /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k14_SensorWallSingleProjLauncherSquareObj = 14, // @ C014_SENSOR_WALL_SINGLE_PROJECTILE_LAUNCHER_SQUARE_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k15_SensorWallDoubleProjLauncherSquareObj = 15, // @ C015_SENSOR_WALL_DOUBLE_PROJECTILE_LAUNCHER_SQUARE_OBJECT /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k16_SensorWallObjExchanger = 16, // @ C016_SENSOR_WALL_OBJECT_EXCHANGER /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k17_SensorWallOrnClickWithSpecObjRemovedSensor = 17, // @ C017_SENSOR_WALL_ORNAMENT_CLICK_WITH_SPECIFIC_OBJECT_REMOVED_REMOVE_SENSOR /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ + k18_SensorWallEndGame = 18, // @ C018_SENSOR_WALL_END_GAME /* Triggered by event F0248_TIMELINE_ProcessEvent6_Square_Wall */ + k127_SensorWallChampionPortrait = 127 // @ C127_SENSOR_WALL_CHAMPION_PORTRAIT /* Triggered by player click F0275_SENSOR_IsTriggeredByClickOnWall */ }; class Sensor { @@ -331,17 +331,17 @@ public: enum WeaponType { - kWeaponTypeTorch = 2, // @ C02_WEAPON_TORCH - kWeaponTypeDagger = 8, // @ C08_WEAPON_DAGGER - kWeaponTypeFalchion = 9, // @ C09_WEAPON_FALCHION - kWeaponTypeSword = 10, // @ C10_WEAPON_SWORD - kWeaponTypeClub = 23, // @ C23_WEAPON_CLUB - kWeaponTypeStoneClub = 24, // @ C24_WEAPON_STONE_CLUB - kWeaponTypeArrow = 27, // @ C27_WEAPON_ARROW - kWeaponTypeSlayer = 28, // @ C28_WEAPON_SLAYER - kWeaponTypeRock = 30, // @ C30_WEAPON_ROCK - kWeaponTypePoisonDart = 31, // @ C31_WEAPON_POISON_DART - kWeaponTypeThrowingStar = 32 // @ C32_WEAPON_THROWING_STAR + k2_WeaponTypeTorch = 2, // @ C02_WEAPON_TORCH + k8_WeaponTypeDagger = 8, // @ C08_WEAPON_DAGGER + k9_WeaponTypeFalchion = 9, // @ C09_WEAPON_FALCHION + k10_WeaponTypeSword = 10, // @ C10_WEAPON_SWORD + k23_WeaponTypeClub = 23, // @ C23_WEAPON_CLUB + k24_WeaponTypeStoneClub = 24, // @ C24_WEAPON_STONE_CLUB + k27_WeaponTypeArrow = 27, // @ C27_WEAPON_ARROW + k28_WeaponTypeSlayer = 28, // @ C28_WEAPON_SLAYER + k30_WeaponTypeRock = 30, // @ C30_WEAPON_ROCK + k31_WeaponTypePoisonDart = 31, // @ C31_WEAPON_POISON_DART + k32_WeaponTypeThrowingStar = 32 // @ C32_WEAPON_THROWING_STAR }; class Weapon { Thing _nextThing; @@ -365,11 +365,11 @@ public: }; // @ WEAPON enum ArmourType { - kArmourTypeWoodenShield = 30, // @ C30_ARMOUR_WOODEN_SHIELD - kArmourTypeArmet = 38, // @ C38_ARMOUR_ARMET - kArmourTypeTorsoPlate = 39, // @ C39_ARMOUR_TORSO_PLATE - kArmourTypeLegPlate = 40, // @ C40_ARMOUR_LEG_PLATE - kArmourTypeFootPlate = 41 // @ C41_ARMOUR_FOOT_PLATE + k30_ArmourTypeWoodenShield = 30, // @ C30_ARMOUR_WOODEN_SHIELD + k38_ArmourTypeArmet = 38, // @ C38_ARMOUR_ARMET + k39_ArmourTypeTorsoPlate = 39, // @ C39_ARMOUR_TORSO_PLATE + k40_ArmourTypeLegPlate = 40, // @ C40_ARMOUR_LEG_PLATE + k41_ArmourTypeFootPlate = 41 // @ C41_ARMOUR_FOOT_PLATE }; class Armour { Thing _nextThing; @@ -404,19 +404,19 @@ public: }; // @ SCROLL enum PotionType { - kPotionTypeVen = 3, // @ C03_POTION_VEN_POTION, - kPotionTypeRos = 6, // @ C06_POTION_ROS_POTION, - kPotionTypeKu = 7, // @ C07_POTION_KU_POTION, - kPotionTypeDane = 8, // @ C08_POTION_DANE_POTION, - kPotionTypeNeta = 9, // @ C09_POTION_NETA_POTION, - kPotionTypeAntivenin = 10, // @ C10_POTION_ANTIVENIN, - kPotionTypeMon = 11, // @ C11_POTION_MON_POTION, - kPotionTypeYa = 12, // @ C12_POTION_YA_POTION, - kPotionTypeEe = 13, // @ C13_POTION_EE_POTION, - kPotionTypeVi = 14, // @ C14_POTION_VI_POTION, - kPotionTypeWaterFlask = 15, // @ C15_POTION_WATER_FLASK, - kPotionTypeFulBomb = 19, // @ C19_POTION_FUL_BOMB, - kPotionTypeEmptyFlask = 20 // @ C20_POTION_EMPTY_FLASK, + k3_PotionTypeVen = 3, // @ C03_POTION_VEN_POTION, + k6_PotionTypeRos = 6, // @ C06_POTION_ROS_POTION, + k7_PotionTypeKu = 7, // @ C07_POTION_KU_POTION, + k8_PotionTypeDane = 8, // @ C08_POTION_DANE_POTION, + k9_PotionTypeNeta = 9, // @ C09_POTION_NETA_POTION, + k10_PotionTypeAntivenin = 10, // @ C10_POTION_ANTIVENIN, + k11_PotionTypeMon = 11, // @ C11_POTION_MON_POTION, + k12_PotionTypeYa = 12, // @ C12_POTION_YA_POTION, + k13_PotionTypeEe = 13, // @ C13_POTION_EE_POTION, + k14_PotionTypeVi = 14, // @ C14_POTION_VI_POTION, + k15_PotionTypeWaterFlask = 15, // @ C15_POTION_WATER_FLASK, + k19_PotionTypeFulBomb = 19, // @ C19_POTION_FUL_BOMB, + k20_PotionTypeEmptyFlask = 20 // @ C20_POTION_EMPTY_FLASK, }; class Potion { Thing _nextThing; @@ -443,16 +443,16 @@ public: }; // @ CONTAINER enum JunkType { - kJunkTypeWaterskin = 1, // @ C01_JUNK_WATERSKIN, - kJunkTypeBones = 5, // @ C05_JUNK_BONES, - kJunkTypeBoulder = 25, // @ C25_JUNK_BOULDER, - kJunkTypeScreamerSlice = 33, // @ C33_JUNK_SCREAMER_SLICE, - kJunkTypeWormRound = 34, // @ C34_JUNK_WORM_ROUND, - kJunkTypeDrumstickShank = 35, // @ C35_JUNK_DRUMSTICK_SHANK, - kJunkTypeDragonSteak = 36, // @ C36_JUNK_DRAGON_STEAK, - kJunkTypeMagicalBoxBlue = 42, // @ C42_JUNK_MAGICAL_BOX_BLUE, - kJunkTypeMagicalBoxGreen = 43, // @ C43_JUNK_MAGICAL_BOX_GREEN, - kJunkTypeZokathra = 51 // @ C51_JUNK_ZOKATHRA, + k1_JunkTypeWaterskin = 1, // @ C01_JUNK_WATERSKIN, + k5_JunkTypeBones = 5, // @ C05_JUNK_BONES, + k25_JunkTypeBoulder = 25, // @ C25_JUNK_BOULDER, + k33_JunkTypeScreamerSlice = 33, // @ C33_JUNK_SCREAMER_SLICE, + k34_JunkTypeWormRound = 34, // @ C34_JUNK_WORM_ROUND, + k35_JunkTypeDrumstickShank = 35, // @ C35_JUNK_DRUMSTICK_SHANK, + k36_JunkTypeDragonSteak = 36, // @ C36_JUNK_DRAGON_STEAK, + k42_JunkTypeMagicalBoxBlue = 42, // @ C42_JUNK_MAGICAL_BOX_BLUE, + k43_JunkTypeMagicalBoxGreen = 43, // @ C43_JUNK_MAGICAL_BOX_GREEN, + k51_JunkTypeZokathra = 51 // @ C51_JUNK_ZOKATHRA, }; class Junk { @@ -481,17 +481,17 @@ public: Thing getNextThing() { return _nextThing; } }; // @ PROJECTILE -#define kExplosionType_Fireball 0 // @ C000_EXPLOSION_FIREBALL -#define kExplosionType_Slime 1 // @ C001_EXPLOSION_SLIME -#define kExplosionType_LightningBolt 2 // @ C002_EXPLOSION_LIGHTNING_BOLT -#define kExplosionType_HarmNonMaterial 3 // @ C003_EXPLOSION_HARM_NON_MATERIAL -#define kExplosionType_OpenDoor 4 // @ C004_EXPLOSION_OPEN_DOOR -#define kExplosionType_PoisonBolt 6 // @ C006_EXPLOSION_POISON_BOLT -#define kExplosionType_PoisonCloud 7 // @ C007_EXPLOSION_POISON_CLOUD -#define kExplosionType_Smoke 40 // @ C040_EXPLOSION_SMOKE -#define kExplosionType_Fluxcage 50 // @ C050_EXPLOSION_FLUXCAGE -#define kExplosionType_RebirthStep1 100 // @ C100_EXPLOSION_REBIRTH_STEP1 -#define kExplosionType_RebirthStep2 101 // @ C101_EXPLOSION_REBIRTH_STEP2 +#define k0_ExplosionType_Fireball 0 // @ C000_EXPLOSION_FIREBALL +#define k1_ExplosionType_Slime 1 // @ C001_EXPLOSION_SLIME +#define k2_ExplosionType_LightningBolt 2 // @ C002_EXPLOSION_LIGHTNING_BOLT +#define k3_ExplosionType_HarmNonMaterial 3 // @ C003_EXPLOSION_HARM_NON_MATERIAL +#define k4_ExplosionType_OpenDoor 4 // @ C004_EXPLOSION_OPEN_DOOR +#define k6_ExplosionType_PoisonBolt 6 // @ C006_EXPLOSION_POISON_BOLT +#define k7_ExplosionType_PoisonCloud 7 // @ C007_EXPLOSION_POISON_CLOUD +#define k40_ExplosionType_Smoke 40 // @ C040_EXPLOSION_SMOKE +#define k50_ExplosionType_Fluxcage 50 // @ C050_EXPLOSION_FLUXCAGE +#define k100_ExplosionType_RebirthStep1 100 // @ C100_EXPLOSION_REBIRTH_STEP1 +#define k101_ExplosionType_RebirthStep2 101 // @ C101_EXPLOSION_REBIRTH_STEP2 class Explosion { Thing _nextThing; @@ -507,40 +507,40 @@ public: enum SquareMask { - kWallWestRandOrnAllowed = 0x1, - kWallSouthRandOrnAllowed = 0x2, - kWallEastRandOrnAllowed = 0x4, - kWallNorthRandOrnAllowed = 0x8, - kCorridorRandOrnAllowed = 0x8, - kPitImaginary = 0x1, - kPitInvisible = 0x4, - kPitOpen = 0x8, - kStairsUp = 0x4, - kStairsNorthSouthOrient = 0x8, - kDoorNorthSouthOrient = 0x8, - kTeleporterVisible = 0x4, - kTeleporterOpen = 0x8, - kFakeWallImaginary = 0x1, - kFakeWallOpen = 0x4, - kFakeWallRandOrnOrFootPAllowed = 0x8, - kThingListPresent = 0x10, - kDecodeEvenIfInvisible = 0x8000 + k0x0001_WallWestRandOrnAllowed = 0x1, // @ MASK0x0001_WALL_WEST_RANDOM_ORNAMENT_ALLOWED + k0x0002_WallSouthRandOrnAllowed = 0x2, // @ MASK0x0002_WALL_SOUTH_RANDOM_ORNAMENT_ALLOWED + k0x0004_WallEastRandOrnAllowed = 0x4, // @ MASK0x0004_WALL_EAST_RANDOM_ORNAMENT_ALLOWED + k0x0008_WallNorthRandOrnAllowed = 0x8, // @ MASK0x0008_WALL_NORTH_RANDOM_ORNAMENT_ALLOWED + k0x0008_CorridorRandOrnAllowed = 0x8, // @ MASK0x0008_CORRIDOR_RANDOM_ORNAMENT_ALLOWED + k0x0001_PitImaginary = 0x1, // @ MASK0x0001_PIT_IMAGINARY + k0x0004_PitInvisible = 0x4, // @ MASK0x0004_PIT_INVISIBLE + k0x0008_PitOpen = 0x8, // @ MASK0x0008_PIT_OPEN + k0x0004_StairsUp = 0x4, // @ MASK0x0004_STAIRS_UP + k0x0008_StairsNorthSouthOrient = 0x8, // @ MASK0x0008_STAIRS_NORTH_SOUTH_ORIENTATION + k0x0008_DoorNorthSouthOrient = 0x8, // @ MASK0x0008_DOOR_NORTH_SOUTH_ORIENTATION + k0x0004_TeleporterVisible = 0x4, // @ MASK0x0004_TELEPORTER_VISIBLE + k0x0008_TeleporterOpen = 0x8, // @ MASK0x0008_TELEPORTER_OPEN + k0x0001_FakeWallImaginary = 0x1, // @ MASK0x0001_FAKEWALL_IMAGINARY + k0x0004_FakeWallOpen = 0x4, // @ MASK0x0004_FAKEWALL_OPEN + k0x0008_FakeWallRandOrnOrFootPAllowed = 0x8, // @ MASK0x0008_FAKEWALL_RANDOM_ORNAMENT_OR_FOOTPRINTS_ALLOWED + k0x0010_ThingListPresent = 0x10, // @ MASK0x0010_THING_LIST_PRESENT + k0x8000_DecodeEvenIfInvisible = 0x8000 // @ MASK0x8000_DECODE_EVEN_IF_INVISIBLE }; enum SquareType { - kChampionElemType = -2, - kCreatureElemType = -1, - kWallElemType = 0, - kCorridorElemType = 1, - kPitElemType = 2, - kStairsElemType = 3, - kDoorElemType = 4, - kTeleporterElemType = 5, - kFakeWallElemType = 6, - kDoorSideElemType = 16, - kDoorFrontElemType = 17, - kStairsSideElemType = 18, - kStairsFrontElemType = 19 + kM2_ChampionElemType = -2, // @ CM2_ELEMENT_CHAMPION + kM1_CreatureElemType = -1, // @ CM1_ELEMENT_CREATURE + k0_WallElemType = 0, // @ C00_ELEMENT_WALL + k1_CorridorElemType = 1, // @ C01_ELEMENT_CORRIDOR + k2_PitElemType = 2, // @ C02_ELEMENT_PIT + k3_StairsElemType = 3, // @ C03_ELEMENT_STAIRS + k4_DoorElemType = 4, // @ C04_ELEMENT_DOOR + k5_TeleporterElemType = 5, // @ C05_ELEMENT_TELEPORTER + k6_FakeWallElemType = 6, // @ C06_ELEMENT_FAKEWALL + k16_DoorSideElemType = 16, // @ C16_ELEMENT_DOOR_SIDE + k17_DoorFrontElemType = 17, // @ C17_ELEMENT_DOOR_FRONT + k18_StairsSideElemType = 18, // @ C18_ELEMENT_STAIRS_SIDE + k19_StairsFrontElemType = 19 // @ C19_ELEMENT_STAIRS_FRONT }; // @ C[-2..19]_ELEMENT_... class Square { @@ -594,36 +594,36 @@ struct Map { struct DungeonData { // I have no idea the heck is this - uint16 *_mapsFirstColumnIndex; // @ G0281_pui_DungeonMapsFirstColumnIndex - uint16 _columCount; // @ G0282_ui_DungeonColumnCount + uint16 *_g281_mapsFirstColumnIndex; // @ G0281_pui_DungeonMapsFirstColumnIndex + uint16 _g282_columCount; // @ G0282_ui_DungeonColumnCount // I have no idea the heck is this - uint16 *_columnsCumulativeSquareThingCount; // @ G0280_pui_DungeonColumnsCumulativeSquareThingCount - Thing *_squareFirstThings; // @ G0283_pT_SquareFirstThings - uint16 *_textData; // @ G0260_pui_DungeonTextData + uint16 *_g280_columnsCumulativeSquareThingCount; // @ G0280_pui_DungeonColumnsCumulativeSquareThingCount + Thing *_g283_squareFirstThings; // @ G0283_pT_SquareFirstThings + uint16 *_g260_textData; // @ G0260_pui_DungeonTextData - uint16 **_thingsData[16]; // @ G0284_apuc_ThingData + uint16 **_g284_thingsData[16]; // @ G0284_apuc_ThingData - byte ***_mapData; // @ G0279_pppuc_DungeonMapData + byte ***_g279_mapData; // @ G0279_pppuc_DungeonMapData }; // @ AGGREGATE struct CurrMapData { - direction _partyDir; // @ G0308_i_PartyDirection - int16 _partyPosX; // @ G0306_i_PartyMapX - int16 _partyPosY; // @ G0307_i_PartyMapY - uint8 _currPartyMapIndex; // @ G0309_i_PartyMapIndex - - uint8 _index; // @ G0272_i_CurrentMapIndex - byte **_data; // @ G0271_ppuc_CurrentMapData - Map *_map; // @ G0269_ps_CurrentMap - uint16 _width; // @ G0273_i_CurrentMapWidth - uint16 _height; // @ G0274_i_CurrentMapHeight - uint16 *_colCumulativeSquareFirstThingCount; // @G0270_pui_CurrentMapColumnsCumulativeSquareFirstThingCount + direction _g308_partyDir; // @ G0308_i_PartyDirection + int16 _g306_partyPosX; // @ G0306_i_PartyMapX + int16 _g307_partyPosY; // @ G0307_i_PartyMapY + uint8 _g309_currPartyMapIndex; // @ G0309_i_PartyMapIndex + + uint8 _g272_index; // @ G0272_i_CurrentMapIndex + byte **_g271_data; // @ G0271_ppuc_CurrentMapData + Map *_g269_map; // @ G0269_ps_CurrentMap + uint16 _g273_width; // @ G0273_i_CurrentMapWidth + uint16 _g274_height; // @ G0274_i_CurrentMapHeight + uint16 *_g270_colCumulativeSquareFirstThingCount; // @G0270_pui_CurrentMapColumnsCumulativeSquareFirstThingCount }; // @ AGGREGATE struct Messages { - bool _newGame; // @ G0298_B_NewGame - bool _restartGameRequest; // @ G0523_B_RestartGameRequested + bool _g298_newGame; // @ G0298_B_NewGame + bool _g523_restartGameRequest; // @ G0523_B_RestartGameRequested }; // @ AGGREGATE class DungeonMan { @@ -674,22 +674,22 @@ public: uint32 _rawDunFileDataSize; // @ probably NONE byte *_rawDunFileData; // @ ??? - DungeonFileHeader _fileHeader; // @ G0278_ps_DungeonHeader + DungeonFileHeader _g278_fileHeader; // @ G0278_ps_DungeonHeader DungeonData _dunData; // @ NONE CurrMapData _currMap; // @ NONE - Map *_maps; // @ G0277_ps_DungeonMaps + Map *_g277_maps; // @ G0277_ps_DungeonMaps // does not have to be freed - byte *_rawMapData; // @ G0276_puc_DungeonRawMapData + byte *_g276_rawMapData; // @ G0276_puc_DungeonRawMapData Messages _messages; // @ NONE; - int16 _currMapInscriptionWallOrnIndex; // @ G0265_i_CurrentMapInscriptionWallOrnamentIndex - Box _dungeonViewClickableBoxes[6]; // G0291_aauc_DungeonViewClickableBoxes - bool _isFacingAlcove; // @ G0286_B_FacingAlcove - bool _isFacingViAltar; // @ G0287_B_FacingViAltar - bool _isFacingFountain; // @ G0288_B_FacingFountain - ElementType _squareAheadElement; // @ G0285_i_SquareAheadElement - Thing _pileTopObject[5]; // @ G0292_aT_PileTopObject + int16 _g265_currMapInscriptionWallOrnIndex; // @ G0265_i_CurrentMapInscriptionWallOrnamentIndex + Box _g291_dungeonViewClickableBoxes[6]; // G0291_aauc_DungeonViewClickableBoxes + bool _g286_isFacingAlcove; // @ G0286_B_FacingAlcove + bool _g287_isFacingViAltar; // @ G0287_B_FacingViAltar + bool _g288_isFacingFountain; // @ G0288_B_FacingFountain + ElementType _g285_squareAheadElement; // @ G0285_i_SquareAheadElement + Thing _g292_pileTopObject[5]; // @ G0292_aT_PileTopObject }; } diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 82fd07caac..4a60768fda 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -317,22 +317,22 @@ void EventManager::processInput() { switch (event.kbd.keycode) { case Common::KEYCODE_w: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, 1, 0, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, 1, 0, currMap._g306_partyPosX, currMap._g307_partyPosY); break; case Common::KEYCODE_a: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, 0, -1, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, 0, -1, currMap._g306_partyPosX, currMap._g307_partyPosY); break; case Common::KEYCODE_s: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, -1, 0, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, -1, 0, currMap._g306_partyPosX, currMap._g307_partyPosY); break; case Common::KEYCODE_d: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, 0, 1, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, 0, 1, currMap._g306_partyPosX, currMap._g307_partyPosY); break; case Common::KEYCODE_q: - turnDirLeft(currMap._partyDir); + turnDirLeft(currMap._g308_partyDir); break; case Common::KEYCODE_e: - turnDirRight(currMap._partyDir); + turnDirRight(currMap._g308_partyDir); break; case Common::KEYCODE_UP: if (_dummyMapIndex < 13) @@ -431,7 +431,7 @@ void EventManager::processCommandQueue() { } void EventManager::commandTurnParty(CommandType cmdType) { - _vm->_stopWaitingForPlayerInput = true; + _vm->_g321_stopWaitingForPlayerInput = true; // MISSING CODE: highlight turn left/right buttons @@ -440,14 +440,14 @@ void EventManager::commandTurnParty(CommandType cmdType) { // MISSING CODE: process sensors // DUMMY CODE: should call F0284_CHAMPION_SetPartyDirection instead - direction &partyDir = _vm->_dungeonMan->_currMap._partyDir; + direction &partyDir = _vm->_dungeonMan->_currMap._g308_partyDir; (cmdType == kCommandTurnLeft) ? turnDirLeft(partyDir) : turnDirRight(partyDir); // MISSING CODE: process sensors } void EventManager::commandMoveParty(CommandType cmdType) { - _vm->_stopWaitingForPlayerInput = true; + _vm->_g321_stopWaitingForPlayerInput = true; // MISSING CODE: Lots of code @@ -457,16 +457,16 @@ void EventManager::commandMoveParty(CommandType cmdType) { switch (cmdType) { case kCommandMoveForward: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, 1, 0, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, 1, 0, currMap._g306_partyPosX, currMap._g307_partyPosY); break; case kCommandMoveLeft: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, 0, -1, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, 0, -1, currMap._g306_partyPosX, currMap._g307_partyPosY); break; case kCommandMoveBackward: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, -1, 0, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, -1, 0, currMap._g306_partyPosX, currMap._g307_partyPosY); break; case kCommandMoveRight: - dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._partyDir, 0, 1, currMap._partyPosX, currMap._partyPosY); + dungeonMan.mapCoordsAfterRelMovement(dungeonMan._currMap._g308_partyDir, 0, 1, currMap._g306_partyPosX, currMap._g307_partyPosY); break; default: break; @@ -496,7 +496,7 @@ void EventManager::commandSetLeader(ChampionIndex champIndex) { } cm._g411_leaderIndex = champIndex; Champion *champion = &cm._champions[cm._g411_leaderIndex]; - champion->_dir = _vm->_dungeonMan->_currMap._partyDir; + champion->_dir = _vm->_dungeonMan->_currMap._g308_partyDir; cm._champions[champIndex]._load += _vm->_dungeonMan->getObjectWeight(cm._414_leaderHandObject); if (_vm->indexToOrdinal(champIndex) != cm._g299_candidateChampionOrdinal) { champion->setAttributeFlag(k0x0400_ChampionAttributeIcon, true); @@ -508,10 +508,10 @@ void EventManager::commandSetLeader(ChampionIndex champIndex) { void EventManager::commandProcessType80ClickInDungeonViewTouchFrontWall() { DungeonMan &dunMan = *_vm->_dungeonMan; CurrMapData &currMap = dunMan._currMap; - int16 mapX = currMap._partyPosX + _vm->_dirIntoStepCountEast[currMap._partyDir]; - int16 mapY = currMap._partyPosY + _vm->_dirIntoStepCountNorth[currMap._partyDir]; - if ((mapX >= 0) && (mapX < currMap._width) && (mapY >= 0) && (mapY < currMap._height)) { - _vm->_stopWaitingForPlayerInput = _vm->_movsens->sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(currMap._partyDir)); + int16 mapX = currMap._g306_partyPosX + _vm->_dirIntoStepCountEast[currMap._g308_partyDir]; + int16 mapY = currMap._g307_partyPosY + _vm->_dirIntoStepCountNorth[currMap._g308_partyDir]; + if ((mapX >= 0) && (mapX < currMap._g273_width) && (mapY >= 0) && (mapY < currMap._g274_height)) { + _vm->_g321_stopWaitingForPlayerInput = _vm->_movsens->sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(currMap._g308_partyDir)); } } @@ -520,17 +520,17 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY ChampionMan &champMan = *_vm->_championMan; CurrMapData &currMap = _vm->_dungeonMan->_currMap; - if (dunMan._squareAheadElement == kElementTypeDoorFront) { + if (dunMan._g285_squareAheadElement == k17_ElementTypeDoorFront) { if (champMan._g411_leaderIndex == kM1_ChampionNone) return; if (champMan._g415_leaderEmptyHanded) { - int16 mapX = currMap._partyPosX + _vm->_dirIntoStepCountEast[currMap._partyDir]; - int16 mapY = currMap._partyPosY + _vm->_dirIntoStepCountNorth[currMap._partyDir]; + int16 mapX = currMap._g306_partyPosX + _vm->_dirIntoStepCountEast[currMap._g308_partyDir]; + int16 mapY = currMap._g307_partyPosY + _vm->_dirIntoStepCountNorth[currMap._g308_partyDir]; if (Door(dunMan.getSquareFirstThingData(mapX, mapY)).hasButton() && - dunMan._dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(Common::Point(posX, posY - 33))) { - _vm->_stopWaitingForPlayerInput = true; + dunMan._g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(Common::Point(posX, posY - 33))) { + _vm->_g321_stopWaitingForPlayerInput = true; warning("MISSING CODE: F0064_SOUND_RequestPlay_CPSD"); warning("MISSING CODE: F0268_SENSOR_AddEvent"); return; @@ -542,9 +542,9 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY if (champMan._g415_leaderEmptyHanded) { for (int16 viewCell = k0_ViewCellFronLeft; viewCell <= k5_ViewCellDoorButtonOrWallOrn; viewCell++) { - if (dunMan._dungeonViewClickableBoxes[viewCell].isPointInside(Common::Point(posX, posY - 33))) { + if (dunMan._g291_dungeonViewClickableBoxes[viewCell].isPointInside(Common::Point(posX, posY - 33))) { if (viewCell == k5_ViewCellDoorButtonOrWallOrn) { - if (!dunMan._isFacingAlcove) { + if (!dunMan._g286_isFacingAlcove) { commandProcessType80ClickInDungeonViewTouchFrontWall(); } } else { @@ -556,7 +556,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY } else { Thing thing = champMan._414_leaderHandObject; uint16 *rawThingPointer = dunMan.getThingData(thing); - if (dunMan._squareAheadElement == kElementTypeWall) { + if (dunMan._g285_squareAheadElement == k0_ElementTypeWall) { for (int16 viewCell = k0_ViewCellFronLeft; viewCell <= k1_ViewCellFrontRight; ++viewCell) { if (gBoxObjectPiles[viewCell].isPointInside(Common::Point(posX, posY))) { warning("F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject"); @@ -564,17 +564,17 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY } } - if (dunMan._dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(Common::Point(posX, posY - 33))) { - if (dunMan._isFacingAlcove) { + if (dunMan._g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(Common::Point(posX, posY - 33))) { + if (dunMan._g286_isFacingAlcove) { warning("MISSING CODE: F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject"); } else { - if (dunMan._isFacingFountain) { + if (dunMan._g288_isFacingFountain) { uint16 iconIndex = _vm->_objectMan->getIconIndex(thing); int16 weight = dunMan.getObjectWeight(thing); if ((iconIndex >= k8_IconIndiceJunkWater) && (iconIndex <= k9_IconIndiceJunkWaterSkin)) { ((Junk*)rawThingPointer)->setChargeCount(3); } else if (iconIndex == k195_IconIndicePotionEmptyFlask) { - ((Potion*)rawThingPointer)->setType(kPotionTypeWaterFlask); + ((Potion*)rawThingPointer)->setType(k15_PotionTypeWaterFlask); } else { goto T0377019; } @@ -620,15 +620,15 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane box._x2 = box._x1 + 66 + 1; dispMan._g578_useByteBoxCoordinates = false; dispMan.clearScreenBox(k0_ColorBlack, box); - dispMan.clearScreenBox(k0_ColorBlack, g54_BoxChampionIcons[champMan.championIconIndex(champ->_cell, currMap._partyDir) * 2]); + dispMan.clearScreenBox(k0_ColorBlack, g54_BoxChampionIcons[champMan.championIconIndex(champ->_cell, currMap._g308_partyDir) * 2]); warning("F0457_START_DrawEnabledMenus_CPSF"); warning("F0078_MOUSE_ShowPointer"); return; } champMan._g299_candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); - int16 mapX = currMap._partyPosX + _vm->_dirIntoStepCountEast[currMap._partyDir]; - int16 mapY = currMap._partyPosY + _vm->_dirIntoStepCountNorth[currMap._partyDir]; + int16 mapX = currMap._g306_partyPosX + _vm->_dirIntoStepCountEast[currMap._g308_partyDir]; + int16 mapY = currMap._g307_partyPosY + _vm->_dirIntoStepCountNorth[currMap._g308_partyDir]; for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++) { Thing thing = champ->getSlot((ChampionSlot)slotIndex); @@ -638,7 +638,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane } Thing thing = dunMan.getSquareFirstThing(mapX, mapY); for (;;) { // infinite - if (thing.getType() == kSensorThingType) { + if (thing.getType() == k3_SensorThingType) { ((Sensor*)dunMan.getThingData(thing))->setTypeDisabled(); break; } diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 35b30a3907..c93bf1db6d 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -823,7 +823,7 @@ void DisplayMan::loadGraphics() { for (int16 creatureIndex = 0; creatureIndex < k27_CreatureTypeCount; creatureIndex++) { creatureAsp = &g219_CreatureAspects[creatureIndex]; - int16 creatureGraphicInfo = gCreatureInfo[creatureIndex]._graphicInfo; + int16 creatureGraphicInfo = g243_CreatureInfo[creatureIndex]._graphicInfo; creatureAsp->_firstDerivedBitmapIndex = derivedBitmapIndex; int16 creatureFrontBitmapD3PixelCount; @@ -1079,46 +1079,46 @@ void DisplayMan::drawSquareD3L(direction dir, int16 posX, int16 posY) { int16 order; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[kElemAspect]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + switch (squareAspect[k0_ElemAspect]) { + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g675_stairsNativeBitmapIndex_Up_Front_D3L, g110_FrameStairsUpFront_D3L); else drawFloorPitOrStairsBitmap(_g682_stairsNativeBitmapIndex_Down_Front_D3L, g121_FrameStairsDownFront_D3L); goto T0116015_redEagle; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmap(_wallSetBitMaps[kG698_Wall_D3LCR], g163_FrameWalls[k1_ViewSquare_D3L]); - isDrawnWallOrnAnAlcove(squareAspect[kRightWallOrnOrdAspect], k0_ViewWall_D3L_RIGHT); - if (isDrawnWallOrnAnAlcove(squareAspect[kFrontWallOrnOrdAspect], k2_ViewWall_D3L_FRONT)) { + isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k0_ViewWall_D3L_RIGHT); + if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k2_ViewWall_D3L_FRONT)) { order = k0x0000_CellOrder_Alcove; goto T0116017_orangeElk; } return; - case kElementTypeDoorSide: - case kElementTypeStairsSide: + case k16_ElementTypeDoorSide: + case k18_ElementTypeStairsSide: order = k0x0321_CellOrder_BackLeft_BackRight_FrontRight; goto T0116016_blueToad; - case kElementTypeDoorFront: + case k17_ElementTypeDoorFront: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); - cthulhu(Thing(squareAspect[kFirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); + cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); drawWallSetBitmap(_wallSetBitMaps[kG705_DoorFrameLeft_D3L], g164_Frame_DoorFrameLeft_D3L); warning("MISSING CODE: F0111_DUNGEONVIEW_DrawDoor"); order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight; goto T0116017_orangeElk; - case kElementTypePit: - if (!squareAspect[kPitInvisibleAspect]) { + case k2_ElementTypePit: + if (!squareAspect[k2_PitInvisibleAspect]) { drawFloorPitOrStairsBitmap(k49_FloorPit_D3L_GraphicIndice, g140_FrameFloorPit_D3L); } - case kElementTypeTeleporter: - case kElementTypeCorridor: + case k5_ElementTypeTeleporter: + case k1_ElementTypeCorridor: T0116015_redEagle: order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; T0116016_blueToad: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); T0116017_orangeElk: - cthulhu(Thing(squareAspect[kFirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order); + cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order); } - if ((squareAspect[kElemAspect] == kElementTypeTeleporter) && squareAspect[kTeleporterVisibleAspect]) { + if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) { drawField(&g188_FieldAspects[k1_ViewSquare_D3L], g163_FrameWalls[k1_ViewSquare_D3L]._box); } } @@ -1130,51 +1130,51 @@ void DisplayMan::drawSquareD3R(direction dir, int16 posX, int16 posY) { _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[kElemAspect]) { - case kElementTypeStaisFront: - if (squareAspect[kStairsUpAspect]) { + switch (squareAspect[k0_ElemAspect]) { + case k19_ElementTypeStaisFront: + if (squareAspect[k2_StairsUpAspect]) { drawFloorPitOrStairsBitmapFlippedHorizontally(_g675_stairsNativeBitmapIndex_Up_Front_D3L, g112_FrameStairsUpFront_D3R); } else { drawFloorPitOrStairsBitmapFlippedHorizontally(_g682_stairsNativeBitmapIndex_Down_Front_D3L, g123_FrameStairsDownFront_D3R); } goto T0117016; - case kElementTypeWall: + case k0_ElementTypeWall: drawWallSetBitmap(_wallSetBitMaps[kG698_Wall_D3LCR], g163_FrameWalls[k2_ViewSquare_D3R]); - isDrawnWallOrnAnAlcove(squareAspect[kLeftWallOrnOrdAspect], k1_ViewWall_D3R_LEFT); - if (isDrawnWallOrnAnAlcove(squareAspect[kFrontWallOrnOrdAspect], k4_ViewWall_D3R_FRONT)) { + isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k1_ViewWall_D3R_LEFT); + if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k4_ViewWall_D3R_FRONT)) { order = k0x0000_CellOrder_Alcove; goto T0117018; } return; - case kElementTypeDoorSide: - case kElementTypeStairsSide: + case k16_ElementTypeDoorSide: + case k18_ElementTypeStairsSide: order = k0x0412_CellOrder_BackRight_BackLeft_FrontLeft; goto T0117017; - case kElementTypeDoorFront: + case k17_ElementTypeDoorFront: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); - cthulhu(Thing(squareAspect[kFirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); + cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); memcpy(_g74_tmpBitmap, _wallSetBitMaps[kG705_DoorFrameLeft_D3L], 32 * 44); warning("MISSING CODE: F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally"); - if (((Door*)_vm->_dungeonMan->_dunData._thingsData[kDoorThingType])[squareAspect[kDoorThingIndexAspect]].hasButton()) { + if (((Door*)_vm->_dungeonMan->_dunData._g284_thingsData[k0_DoorThingType])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) { warning("MISSING CODE: F0110_DUNGEONVIEW_DrawDoorButton"); } warning("MISSING CODE: F0111_DUNGEONVIEW_DrawDoor"); order = k0x0439_CellOrder_DoorPass2_FrontRight_FrontLeft; goto T0117018; - case kElementTypePit: - if (!squareAspect[kPitInvisibleAspect]) { + case k2_ElementTypePit: + if (!squareAspect[k2_PitInvisibleAspect]) { drawFloorPitOrStairsBitmapFlippedHorizontally(k49_FloorPit_D3L_GraphicIndice, g142_FrameFloorPit_D3R); } - case kElementTypeTeleporter: - case kElementTypeCorridor: + case k5_ElementTypeTeleporter: + case k1_ElementTypeCorridor: T0117016: order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft; T0117017: warning("MISSING CODE: F0108_DUNGEONVIEW_DrawFloorOrnament"); T0117018: - cthulhu(Thing(squareAspect[kFirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, order); + cthulhu(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, order); } - if ((squareAspect[kElemAspect] == kElementTypeTeleporter) && squareAspect[kTeleporterVisibleAspect]) { + if ((squareAspect[k0_ElemAspect] == k5_ElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) { drawField(&g188_FieldAspects[k2_ViewSquare_D3R], g163_FrameWalls[k2_ViewSquare_D3R]._box); } } @@ -1183,15 +1183,15 @@ void DisplayMan::drawSquareD3C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g676_stairsNativeBitmapIndex_Up_Front_D3C, g111_FrameStairsUpFront_D3C); else drawFloorPitOrStairsBitmap(_g683_stairsNativeBitmapIndex_Down_Front_D3C, g122_FrameStairsDownFront_D3C); break; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmapWithoutTransparency(_wallSetBitMaps[kG698_Wall_D3LCR], g163_FrameWalls[k0_ViewSquare_D3C]); - if (isDrawnWallOrnAnAlcove(squareAspect[kFrontWallOrnOrdAspect], k3_ViewWall_D3C_FRONT)) { + if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k3_ViewWall_D3C_FRONT)) { //... missing code } break; @@ -1203,20 +1203,20 @@ void DisplayMan::drawSquareD2L(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g677_stairsNativeBitmapIndex_Up_Front_D2L, g113_FrameStairsUpFront_D2L); else drawFloorPitOrStairsBitmap(_g684_stairsNativeBitmapIndex_Down_Front_D2L, g124_FrameStairsDownFront_D2L); break; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmap(_wallSetBitMaps[kG699_Wall_D2LCR], g163_FrameWalls[k4_ViewSquare_D2L]); - isDrawnWallOrnAnAlcove(squareAspect[kRightWallOrnOrdAspect], k5_ViewWall_D2L_RIGHT); - if (isDrawnWallOrnAnAlcove(squareAspect[kFrontWallOrnOrdAspect], k7_ViewWall_D2L_FRONT)) { + isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k5_ViewWall_D2L_RIGHT); + if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k7_ViewWall_D2L_FRONT)) { // ... missing code } break; - case kStairsSideElemType: + case k18_StairsSideElemType: drawFloorPitOrStairsBitmap(_g689_stairsNativeBitmapIndex_Side_D2L, g132_FrameStairsSide_D2L); break; default: @@ -1227,20 +1227,20 @@ void DisplayMan::drawSquareD2R(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmapFlippedHorizontally(_g677_stairsNativeBitmapIndex_Up_Front_D2L, g115_FrameStairsUpFront_D2R); else drawFloorPitOrStairsBitmapFlippedHorizontally(_g684_stairsNativeBitmapIndex_Down_Front_D2L, g126_FrameStairsDownFront_D2R); break; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmap(_wallSetBitMaps[kG699_Wall_D2LCR], g163_FrameWalls[k5_ViewSquare_D2R]); - isDrawnWallOrnAnAlcove(squareAspect[kLeftWallOrnOrdAspect], k6_ViewWall_D2R_LEFT); - if (isDrawnWallOrnAnAlcove(squareAspect[kFrontWallOrnOrdAspect], k9_ViewWall_D2R_FRONT)) { + isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k6_ViewWall_D2R_LEFT); + if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k9_ViewWall_D2R_FRONT)) { // ... missing code } break; - case kStairsSideElemType: + case k18_StairsSideElemType: drawFloorPitOrStairsBitmapFlippedHorizontally(_g689_stairsNativeBitmapIndex_Side_D2L, g133_FrameStairsSide_D2R); break; default: @@ -1251,15 +1251,15 @@ void DisplayMan::drawSquareD2C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g678_stairsNativeBitmapIndex_Up_Front_D2C, g114_FrameStairsUpFront_D2C); else drawFloorPitOrStairsBitmap(_g685_stairsNativeBitmapIndex_Down_Front_D2C, g125_FrameStairsDownFront_D2C); break; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmapWithoutTransparency(_wallSetBitMaps[kG699_Wall_D2LCR], g163_FrameWalls[k3_ViewSquare_D2C]); - if (isDrawnWallOrnAnAlcove(squareAspect[kFrontWallOrnOrdAspect], k8_ViewWall_D2C_FRONT)) { + if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k8_ViewWall_D2C_FRONT)) { // ... missing code } break; @@ -1271,18 +1271,18 @@ void DisplayMan::drawSquareD1L(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g679_stairsNativeBitmapIndex_Up_Front_D1L, g116_FrameStairsUpFront_D1L); else drawFloorPitOrStairsBitmap(_g686_stairsNativeBitmapIndex_Down_Front_D1L, g127_FrameStairsDownFront_D1L); break; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmap(_wallSetBitMaps[kG700_Wall_D1LCR], g163_FrameWalls[k7_ViewSquare_D1L]); - isDrawnWallOrnAnAlcove(squareAspect[kRightWallOrnOrdAspect], k10_ViewWall_D1L_RIGHT); + isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k10_ViewWall_D1L_RIGHT); break; - case kStairsSideElemType: - if (squareAspect[kStairsUpAspect]) + case k18_StairsSideElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g690_stairsNativeBitmapIndex_Up_Side_D1L, g134_FrameStairsUpSide_D1L); else drawFloorPitOrStairsBitmap(_g691_stairsNativeBitmapIndex_Down_Side_D1L, g136_FrameStairsDownSide_D1L); @@ -1295,18 +1295,18 @@ void DisplayMan::drawSquareD1R(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmapFlippedHorizontally(_g679_stairsNativeBitmapIndex_Up_Front_D1L, g118_FrameStairsUpFront_D1R); else drawFloorPitOrStairsBitmapFlippedHorizontally(_g686_stairsNativeBitmapIndex_Down_Front_D1L, g129_FrameStairsDownFront_D1R); break; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmap(_wallSetBitMaps[kG700_Wall_D1LCR], g163_FrameWalls[k8_ViewSquare_D1R]); - isDrawnWallOrnAnAlcove(squareAspect[kLeftWallOrnOrdAspect], k11_ViewWall_D1R_LEFT); + isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k11_ViewWall_D1R_LEFT); break; - case kStairsSideElemType: - if (squareAspect[kStairsUpAspect]) + case k18_StairsSideElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmapFlippedHorizontally(_g690_stairsNativeBitmapIndex_Up_Side_D1L, g135_FrameStairsUpSide_D1R); else drawFloorPitOrStairsBitmapFlippedHorizontally(_g691_stairsNativeBitmapIndex_Down_Side_D1L, g137_FrameStairsDownSide_D1R); @@ -1319,18 +1319,18 @@ void DisplayMan::drawSquareD1C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g680_stairsNativeBitmapIndex_Up_Front_D1C, g117_FrameStairsUpFront_D1C); else drawFloorPitOrStairsBitmap(_g687_stairsNativeBitmapIndex_Down_Front_D1C, g128_FrameStairsDownFront_D1C); break; - case kWallElemType: - _vm->_dungeonMan->_isFacingAlcove = false; - _vm->_dungeonMan->_isFacingViAltar = false; - _vm->_dungeonMan->_isFacingFountain = false; + case k0_WallElemType: + _vm->_dungeonMan->_g286_isFacingAlcove = false; + _vm->_dungeonMan->_g287_isFacingViAltar = false; + _vm->_dungeonMan->_g288_isFacingFountain = false; drawWallSetBitmapWithoutTransparency(_wallSetBitMaps[kG700_Wall_D1LCR], g163_FrameWalls[k6_ViewSquare_D1C]); - if (isDrawnWallOrnAnAlcove(squareAspect[kFrontWallOrnOrdAspect], k12_ViewWall_D1C_FRONT)) { + if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k12_ViewWall_D1C_FRONT)) { // .... code not yet implemneted } break; @@ -1343,11 +1343,11 @@ void DisplayMan::drawSquareD0L(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsSideElemType: - if (squareAspect[kStairsUpAspect]) + case k18_StairsSideElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmap(_g692_stairsNativeBitmapIndex_Side_D0L, g138_FrameStairsSide_D0L); break; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmap(_wallSetBitMaps[kG701_Wall_D0L], g163_FrameWalls[k10_ViewSquare_D0L]); break; default: @@ -1359,11 +1359,11 @@ void DisplayMan::drawSquareD0R(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsSideElemType: - if (squareAspect[kStairsUpAspect]) + case k18_StairsSideElemType: + if (squareAspect[k2_StairsUpAspect]) drawFloorPitOrStairsBitmapFlippedHorizontally(_g692_stairsNativeBitmapIndex_Side_D0L, g139_FrameStairsSide_D0R); return; - case kWallElemType: + case k0_WallElemType: drawWallSetBitmap(_wallSetBitMaps[kG702_Wall_D0R], g163_FrameWalls[k11_ViewSquare_D0R]); break; default: @@ -1375,8 +1375,8 @@ void DisplayMan::drawSquareD0C(direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); switch (squareAspect[0]) { - case kStairsFrontElemType: - if (squareAspect[kStairsUpAspect]) { + case k19_StairsFrontElemType: + if (squareAspect[k2_StairsUpAspect]) { drawFloorPitOrStairsBitmap(_g681_stairsNativeBitmapIndex_Up_Front_D0C_Left, g119_FrameStairsUpFront_D0L); drawFloorPitOrStairsBitmapFlippedHorizontally(_g681_stairsNativeBitmapIndex_Up_Front_D0C_Left, g120_FrameStairsUpFront_D0R); } else { @@ -1399,10 +1399,10 @@ void DisplayMan::drawDungeon(direction dir, int16 posX, int16 posY) { clearBitmap(tmpBitmap, 305, 111, k10_ColorFlesh); for (int16 i = 0; i < 6; ++i) - _vm->_dungeonMan->_dungeonViewClickableBoxes[i].setToZero(); + _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[i].setToZero(); for (uint16 i = 0; i < 6; ++i) { - _vm->_dungeonMan->_dungeonViewClickableBoxes[i]._x1 = 255 + 1; + _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[i]._x1 = 255 + 1; } if (flippedFloorCeiling) { @@ -1422,9 +1422,9 @@ void DisplayMan::drawDungeon(direction dir, int16 posX, int16 posY) { drawWallSetBitmap(_g84_floorBitmap, gK13_FloorFrame); } - if (_vm->_dungeonMan->getRelSquareType(dir, 3, -2, posX, posY) == kWallElemType) + if (_vm->_dungeonMan->getRelSquareType(dir, 3, -2, posX, posY) == k0_WallElemType) drawWallSetBitmap(_wallSetBitMaps[kG697_Wall_D3L2], g711_FrameWall_D3L2); - if (_vm->_dungeonMan->getRelSquareType(dir, 3, 2, posX, posY) == kWallElemType) + if (_vm->_dungeonMan->getRelSquareType(dir, 3, 2, posX, posY) == k0_WallElemType) drawWallSetBitmap(_wallSetBitMaps[kG696_Wall_D3R2], g712_FrameWall_D3R2); int16 tmpPosX = posX, tmpPosY = posY; @@ -1519,13 +1519,13 @@ void DisplayMan::loadWallSet(WallSet set) { void DisplayMan::loadCurrentMapGraphics() { - loadFloorSet(_vm->_dungeonMan->_currMap._map->_floorSet); - loadWallSet(_vm->_dungeonMan->_currMap._map->_wallSet); + loadFloorSet(_vm->_dungeonMan->_currMap._g269_map->_floorSet); + loadWallSet(_vm->_dungeonMan->_currMap._g269_map->_wallSet); // the original loads some flipped walls here, I moved it to loadWallSet { - int16 val = _vm->_dungeonMan->_currMap._map->_wallSet * k18_StairsGraphicCount + k90_FirstStairs; + int16 val = _vm->_dungeonMan->_currMap._g269_map->_wallSet * k18_StairsGraphicCount + k90_FirstStairs; _g675_stairsNativeBitmapIndex_Up_Front_D3L = val++; _g676_stairsNativeBitmapIndex_Up_Front_D3C = val++; _g677_stairsNativeBitmapIndex_Up_Front_D2L = val++; @@ -1556,7 +1556,7 @@ void DisplayMan::loadCurrentMapGraphics() { uint16 alcoveCount = 0; uint16 fountainCount = 0; - Map &currMap = *_vm->_dungeonMan->_currMap._map; + Map &currMap = *_vm->_dungeonMan->_currMap._g269_map; _g266_currMapViAltarIndex = -1; @@ -1682,9 +1682,9 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex uint16 *coordinateSetA = g205_WallOrnCoordSets[_g101_currMapWallOrnInfo[wallOrnIndex][k1_CoordinateSet]][viewWallIndex]; isAlcove = _vm->_dungeonMan->isWallOrnAnAlcove(wallOrnIndex); - isInscription = (wallOrnIndex == _vm->_dungeonMan->_currMapInscriptionWallOrnIndex); + isInscription = (wallOrnIndex == _vm->_dungeonMan->_g265_currMapInscriptionWallOrnIndex); if (isInscription) { - _vm->_dungeonMan->decodeText((char*)inscriptionString, _g290_inscriptionThing, kTextTypeInscription); + _vm->_dungeonMan->decodeText((char*)inscriptionString, _g290_inscriptionThing, k0_TextTypeInscription); } if (viewWallIndex >= k10_ViewWall_D1L_RIGHT) { @@ -1715,17 +1715,17 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex } nativeBitmapIndex++; - _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x1 = coordinateSetA[0]; - _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x2 = coordinateSetA[1]; - _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y1 = coordinateSetA[2]; - _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y2 = coordinateSetA[3]; + _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x1 = coordinateSetA[0]; + _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x2 = coordinateSetA[1]; + _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y1 = coordinateSetA[2]; + _vm->_dungeonMan->_g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y2 = coordinateSetA[3]; - _vm->_dungeonMan->_isFacingAlcove = isAlcove; - _vm->_dungeonMan->_isFacingViAltar = (wallOrnIndex == _g266_currMapViAltarIndex); - _vm->_dungeonMan->_isFacingFountain = false; + _vm->_dungeonMan->_g286_isFacingAlcove = isAlcove; + _vm->_dungeonMan->_g287_isFacingViAltar = (wallOrnIndex == _g266_currMapViAltarIndex); + _vm->_dungeonMan->_g288_isFacingFountain = false; for (int16 fountainOrnIndex = 0; fountainOrnIndex < k1_FountainOrnCount; ++fountainOrnIndex) { if (_g268_currMapFountainOrnIndices[fountainOrnIndex] == wallOrnIndex) { - _vm->_dungeonMan->_isFacingFountain = true; + _vm->_dungeonMan->_g288_isFacingFountain = true; break; } } @@ -2179,22 +2179,22 @@ creatures are drawn in the right order and so that Fluxcages are not drawn twice objectShiftIndex += (cellYellowBear & 0x0001) << 3; drawProjectileAsObject = false; do { - if ((AL_4_thingType = thingParam.getType()) == kGroupThingType) { + if ((AL_4_thingType = thingParam.getType()) == k4_GroupThingType) { groupThing = thingParam; continue; } - if (AL_4_thingType == kProjectileThingType) { + if (AL_4_thingType == k14_ProjectileThingType) { sqaureHasProjectile = true; continue; } - if (AL_4_thingType == kExplosionThingType) { + if (AL_4_thingType == k15_ExplosionThingType) { squareHasExplosion = true; continue; } /* Square where objects are visible and object is located on cell being processed */ if ((viewSquareIndex >= k0_ViewSquare_D3C) && (viewSquareIndex <= k9_ViewSquare_D0C) && (thingParam.getCell() == cellYellowBear)) { - objectAspect = &(g209_ObjectAspects[gObjectInfo[dunMan.getObjectInfoIndex(thingParam)]._objectAspectIndex]); + objectAspect = &(g209_ObjectAspects[g237_ObjectInfo[dunMan.getObjectInfoIndex(thingParam)]._objectAspectIndex]); AL_4_nativeBitmapIndex = k360_FirstObjectGraphicIndice + objectAspect->_firstNativeBitmapRelativeIndex; if (useAlcoveObjectImage = (drawAlcoveObjects && getFlag(objectAspect->_graphicInfo, k0x0010_ObjectAlcoveMask) && !viewLane)) { AL_4_nativeBitmapIndex++; @@ -2287,7 +2287,7 @@ T0115015_DrawProjectileAsObject: if (drawingGrabbableObject) { bitmapGreenAnt = AL_6_bitmapRedBanana; - Box *AL_6_boxPtrRed = &dunMan._dungeonViewClickableBoxes[AL_2_viewCell]; + Box *AL_6_boxPtrRed = &dunMan._g291_dungeonViewClickableBoxes[AL_2_viewCell]; if (AL_6_boxPtrRed->_x1 == 255) { /* If the grabbable object is the first */ *AL_6_boxPtrRed = boxByteGreen; @@ -2305,7 +2305,7 @@ T0115015_DrawProjectileAsObject: AL_6_boxPtrRed->_y2 = MIN(AL_6_boxPtrRed->_y2, boxByteGreen._y2); } AL_6_bitmapRedBanana = bitmapGreenAnt; - dunMan._pileTopObject[AL_2_viewCell] = thingParam; /* The object is at the top of the pile */ + dunMan._g292_pileTopObject[AL_2_viewCell] = thingParam; /* The object is at the top of the pile */ } blitToScreen(AL_6_bitmapRedBanana, byteWidth, AL_4_xPos, 0, boxByteGreen, k10_ColorFlesh, g296_DungeonViewport); @@ -2328,7 +2328,7 @@ T0115015_DrawProjectileAsObject: if (group == nullptr) { /* If all creature data and info has not already been gathered */ group = (Group*)dunMan.getThingData(groupThing); activeGroup = &_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]; - creatureInfo = &gCreatureInfo[group->_type]; + creatureInfo = &g243_CreatureInfo[group->_type]; creatureAspectStruct = &g219_CreatureAspects[creatureInfo->_creatureAspectIndex]; creatureSize = getFlag(creatureInfo->_attributes, kMaskCreatureInfo_size); creatureGraphicInfoGreen = creatureInfo->_graphicInfo; @@ -2581,7 +2581,7 @@ continue; thingParam = firstThingToDraw; /* Restart processing list of objects from the beginning. The next loop draws only projectile objects among the list */ do { - if ((thingParam.getType() == kProjectileThingType) && (thingParam.getCell() == cellYellowBear)) { + if ((thingParam.getType() == k14_ProjectileThingType) && (thingParam.getCell() == cellYellowBear)) { projectile = (Projectile*)dunMan.getThingData(thingParam); if ((AL_4_projectileAspect = dunMan.getProjectileAspect(projectile->_object)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */ objectAspect = (ObjectAspect*)&g210_ProjectileAspect[_vm->ordinalToIndex(-AL_4_projectileAspect)]; @@ -2720,26 +2720,26 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; uint16 explosionScaleIndex = AL_1_viewSquareExplosionIndex / 3; thingParam = firstThingToDraw; /* Restart processing list of things from the beginning. The next loop draws only explosion things among the list */ do { - if (thingParam.getType() == kExplosionThingType) { + if (thingParam.getType() == k15_ExplosionThingType) { AL_2_cellPurpleMan = thingParam.getCell(); explosion = (Explosion*)dunMan.getThingData(thingParam); - if ((rebirthExplosion = ((unsigned int)(AL_4_explosionType = explosion->getType()) >= kExplosionType_RebirthStep1)) + if ((rebirthExplosion = ((unsigned int)(AL_4_explosionType = explosion->getType()) >= k100_ExplosionType_RebirthStep1)) && ((AL_1_viewSquareExplosionIndex < k3_ViewSquare_D3C_Explosion) || (AL_1_viewSquareExplosionIndex > k9_ViewSquare_D1C_Explosion) || (AL_2_cellPurpleMan != cellYellowBear))) /* If explosion is rebirth and is not visible */ continue; smoke = false; - if ((AL_4_explosionType == kExplosionType_Fireball) || (AL_4_explosionType == kExplosionType_LightningBolt) || (AL_4_explosionType == kExplosionType_RebirthStep2)) { + if ((AL_4_explosionType == k0_ExplosionType_Fireball) || (AL_4_explosionType == k2_ExplosionType_LightningBolt) || (AL_4_explosionType == k101_ExplosionType_RebirthStep2)) { AL_4_explosionAspectIndex = k0_ExplosionAspectFire; } else { - if ((AL_4_explosionType == kExplosionType_PoisonBolt) || (AL_4_explosionType == kExplosionType_PoisonCloud)) { + if ((AL_4_explosionType == k6_ExplosionType_PoisonBolt) || (AL_4_explosionType == k7_ExplosionType_PoisonCloud)) { AL_4_explosionAspectIndex = k2_ExplosionAspectPoison; } else { - if (AL_4_explosionType == kExplosionType_Smoke) { + if (AL_4_explosionType == k40_ExplosionType_Smoke) { smoke = true; AL_4_explosionAspectIndex = k3_ExplosionAspectSmoke; } else { - if (AL_4_explosionType == kExplosionType_RebirthStep1) { + if (AL_4_explosionType == k100_ExplosionType_RebirthStep1) { objectAspect = (ObjectAspect*)&g210_ProjectileAspect[_vm->ordinalToIndex(-dunMan.getProjectileAspect(Thing::_explLightningBolt))]; AL_6_bitmapRedBanana = getBitmap(((ProjectileAspect*)objectAspect)->_firstNativeBitmapRelativeIndex + (k316_FirstProjectileGraphicIndice + 1)); explosionCoordinates = g228_RebirthStep1ExplosionCoordinates[AL_1_viewSquareExplosionIndex - 3]; @@ -2753,7 +2753,7 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:; } goto T0115200_DrawExplosion; } - if (AL_4_explosionType == kExplosionType_Fluxcage) { + if (AL_4_explosionType == k50_ExplosionType_Fluxcage) { if (AL_1_viewSquareExplosionIndex >= k4_ViewSquare_D3L_Explosion) { fluxcageExplosion = explosion; } diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index b224dff229..76aab71ff7 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -43,7 +43,7 @@ GroupMan::~GroupMan() { } void GroupMan::initActiveGroups() { - if (_vm->_dungeonMan->_messages._newGame) + if (_vm->_dungeonMan->_messages._g298_newGame) _maxActiveGroupCount = 60; if (_activeGroups) delete[] _activeGroups; @@ -55,7 +55,7 @@ void GroupMan::initActiveGroups() { uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) { byte cells; cells = group->_cells; - if (mapIndex == _vm->_dungeonMan->_currMap._currPartyMapIndex) + if (mapIndex == _vm->_dungeonMan->_currMap._g309_currPartyMapIndex) cells = _activeGroups[cells]._cells; return cells; } @@ -63,20 +63,20 @@ uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) { byte gGroupDirections[4] = {0x00, 0x55, 0xAA, 0xFF}; // @ G0258_auc_Graphic559_GroupDirections uint16 GroupMan::getGroupDirections(Group* group, int16 mapIndex) { - if (mapIndex == _vm->_dungeonMan->_currMap._currPartyMapIndex) + if (mapIndex == _vm->_dungeonMan->_currMap._g309_currPartyMapIndex) return _activeGroups[group->getActiveGroupIndex()]._directions; return gGroupDirections[group->getDir()]; } int16 GroupMan::getCreatureOrdinalInCell(Group* group, uint16 cell) { - uint16 currMapIndex = _vm->_dungeonMan->_currMap._index; + uint16 currMapIndex = _vm->_dungeonMan->_currMap._g272_index; byte groupCells = getGroupCells(group, currMapIndex); if (groupCells == kCreatureTypeSingleCenteredCreature) return _vm->indexToOrdinal(0); byte creatureIndex = group->getCount(); - if (getFlag(gCreatureInfo[group->_type]._attributes, kMaskCreatureInfo_size) == kMaskCreatureSizeHalf) { + if (getFlag(g243_CreatureInfo[group->_type]._attributes, kMaskCreatureInfo_size) == kMaskCreatureSizeHalf) { if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1)) cell = returnPrevVal(cell); diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 0779a7ee0f..742f392865 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -57,9 +57,9 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) { if ((championIndex != k4_ChampionCloseInventory) && !cm._champions[championIndex]._currHealth) return; - if (_vm->_pressingEye || _vm->_pressingMouth) + if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth) return; - _vm->_stopWaitingForPlayerInput = true; + _vm->_g321_stopWaitingForPlayerInput = true; int16 invChampOrdinal = _inventoryChampionOrdinal; // copy, as the original will be edited if (_vm->indexToOrdinal(championIndex) == invChampOrdinal) { championIndex = k4_ChampionCloseInventory; @@ -192,10 +192,10 @@ void InventoryMan::drawPanel() { _panelContent = kPanelContentFoodWaterPoisoned; switch (thing.getType()) { - case kContainerThingType: + case k9_ContainerThingType: _panelContent = kPanelContentChest; break; - case kScrollThingType: + case k7_ScrollThingType: _panelContent = kPanelContentScroll; break; default: @@ -229,7 +229,7 @@ void InventoryMan::closeChest() { *dunMan.getThingData(thing) = Thing::_endOfList.toUint16(); container->getSlot() = prevThing = thing; } else { - dunMan.linkThingToList(thing, prevThing, kMapXNotOnASquare, 0); + dunMan.linkThingToList(thing, prevThing, kM1_MapXNotOnASquare, 0); prevThing = thing; } } @@ -252,7 +252,7 @@ void InventoryMan::drawPanelScroll(Scroll* scroll) { DisplayMan &dispMan = *_vm->_displayMan; char stringFirstLine[300]; - _vm->_dungeonMan->decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(kTextTypeScroll | kDecodeEvenIfInvisible)); + _vm->_dungeonMan->decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); char *charRed = stringFirstLine; while (*charRed && (*charRed != '\n')) { charRed++; @@ -429,7 +429,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { ChampionMan &champMan = *_vm->_championMan; TextMan &textMan = *_vm->_textMan; - if (_vm->_pressingEye || _vm->_pressingMouth) { + if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth) { warning("BUG0_48 The contents of a chest are reorganized when an object with a statistic modifier is placed or removed on a champion"); closeChest(); } @@ -437,9 +437,9 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { uint16 *rawThingPtr = dunMan.getThingData(thingToDraw); drawPanelObjectDescriptionString("\f"); // form feed ThingType thingType = thingToDraw.getType(); - if (thingType == kScrollThingType) { + if (thingType == k7_ScrollThingType) { drawPanelScroll((Scroll*)rawThingPtr); - } else if (thingType == kContainerThingType) { + } else if (thingType == k9_ContainerThingType) { openAndDrawChest(thingToDraw, (Container*)rawThingPtr, pressingEye); } else { IconIndice iconIndex = objMan.getIconIndex(thingToDraw); @@ -454,7 +454,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { strcat(str, objMan._objectNames[iconIndex]); // TODO: localization descString = str; - } else if ((thingType == kPotionThingType) + } else if ((thingType == k8_PotionThingType) && (iconIndex != k163_IconIndicePotionWaterFlask) && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) { str[0] = '_' + ((Potion*)rawThingPtr)->getPower() / 40; @@ -476,7 +476,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { uint16 potentialAttribMask; uint16 actualAttribMask; switch (thingType) { - case kWeaponThingType: { + case k5_WeaponThingType: { potentialAttribMask = kDescriptionMaskCursed | kDescriptionMaskPoisoned | kDescriptionMaskBroken; Weapon *weapon = (Weapon*)rawThingPtr; actualAttribMask = (weapon->getCursed() << 3) | (weapon->getPoisoned() << 1) | (weapon->getBroken() << 2); @@ -487,19 +487,19 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { } break; } - case kArmourThingType: { + case k6_ArmourThingType: { potentialAttribMask = kDescriptionMaskCursed | kDescriptionMaskBroken; Armour *armour = (Armour*)rawThingPtr; actualAttribMask = (armour->getCursed() << 3) | (armour->getBroken() << 2); break; } - case kPotionThingType: { + case k8_PotionThingType: { actualAttribMask = kDescriptionMaskConsumable; Potion *potion = (Potion*)rawThingPtr; - actualAttribMask = gObjectInfo[kObjectInfoIndexFirstPotion + potion->getType()].getAllowedSlots(); + actualAttribMask = g237_ObjectInfo[k2_ObjectInfoIndexFirstPotion + potion->getType()].getAllowedSlots(); break; } - case kJunkThingType: { + case k10_JunkThingType: { Junk *junk = (Junk*)rawThingPtr; if ((iconIndex >= k8_IconIndiceJunkWater) && (iconIndex <= k9_IconIndiceJunkWaterSkin)) { potentialAttribMask = 0; @@ -526,7 +526,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { drawPanelObjectDescriptionString(str); } else { potentialAttribMask = kDescriptionMaskConsumable; - actualAttribMask = gObjectInfo[kObjectInfoIndexFirstJunk + junk->getType()].getAllowedSlots(); + actualAttribMask = g237_ObjectInfo[k127_ObjectInfoIndexFirstJunk + junk->getType()].getAllowedSlots(); } break; } diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index 42f8bad5e0..bd99345c41 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -39,14 +39,14 @@ LoadsaveMan::LoadsaveMan(DMEngine *vm) : _vm(vm) {} LoadgameResponse LoadsaveMan::loadgame() { - bool newGame = _vm->_dungeonMan->_messages._newGame; + bool newGame = _vm->_dungeonMan->_messages._g298_newGame; ChampionMan &cm = *_vm->_championMan; if (newGame) { - _vm->_restartGameAllowed = false; + _vm->_g524_restartGameAllowed = false; cm._g305_partyChampionCount = 0; cm._414_leaderHandObject = Thing::_none; - _vm->_gameId = _vm->_rnd->getRandomNumber(65536) * _vm->_rnd->getRandomNumber(65536); + _vm->_g525_gameId = _vm->_rnd->getRandomNumber(65536) * _vm->_rnd->getRandomNumber(65536); } else { assert(false); // MISSING CODE: load game diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 19912adc0a..20d0f53646 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -98,7 +98,7 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) { IconIndice iconIndex;
if (thing == Thing::_none) {
iconIndex = k201_IconIndiceActionEmptyHand;
- } else if (gObjectInfo[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) {
+ } else if (g237_ObjectInfo[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) {
iconIndex = _vm->_objectMan->getIconIndex(thing);
} else {
dm.clearBitmap(bitmapIcon, 16, 16, k4_ColorCyan);
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index 0aca699aaf..5d37884557 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -47,7 +47,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 Thing leaderHandObject = champMan._414_leaderHandObject; int16 sensorCountToProcessPerCell[4]; uint16 cell; - for (cell = kCellNorthWest; cell < kCellSouthWest; ++cell) { + for (cell = k0_CellNorthWest; cell < k3_CellSouthWest; ++cell) { sensorCountToProcessPerCell[cell] = 0; } Thing squareFirstThing; @@ -55,9 +55,9 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 ThingType thingType; while (thingBeingProcessed != Thing::_endOfList) { thingType = thingBeingProcessed.getType(); - if (thingType == kSensorThingType) { + if (thingType == k3_SensorThingType) { sensorCountToProcessPerCell[thingBeingProcessed.getCell()]++; - } else if (thingType >= kGroupThingType) { + } else if (thingType >= k4_GroupThingType) { break; } thingBeingProcessed = dunMan.getNextThing(thingBeingProcessed); @@ -66,14 +66,14 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 while (thingBeingProcessed != Thing::_endOfList) { thingType = thingBeingProcessed.getType(); - if (thingType == kSensorThingType) { + if (thingType == k3_SensorThingType) { cell = thingBeingProcessed.getCell(); sensorCountToProcessPerCell[cell]--; Sensor *sensor = (Sensor*)dunMan.getThingData(thingBeingProcessed); // IF YOU CHECK ME, I'LL CALL THE COPS! SensorType sensorType = sensor->getType(); - if (sensorType == kSensorDisabled) + if (sensorType == k0_SensorDisabled) goto T0275058_ProceedToNextThing; - if ((champMan._g411_leaderIndex == kM1_ChampionNone) && (sensorType != kSensorWallChampionPortrait)) + if ((champMan._g411_leaderIndex == kM1_ChampionNone) && (sensorType != k127_SensorWallChampionPortrait)) goto T0275058_ProceedToNextThing; if (cell != cellParam) goto T0275058_ProceedToNextThing; @@ -81,34 +81,34 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 int16 sensorEffect = sensor->getEffectA(); bool doNotTriggerSensor; switch (sensorType) { - case kSensorWallOrnClick: + case k1_SensorWallOrnClick: doNotTriggerSensor = false; - if (sensor->getEffectA() == kSensorEffHold) { + if (sensor->getEffectA() == k3_SensorEffHold) { goto T0275058_ProceedToNextThing; } break; - case kSensorWallOrnClickWithAnyObj: + case k2_SensorWallOrnClickWithAnyObj: doNotTriggerSensor = (champMan._g415_leaderEmptyHanded != sensor->getRevertEffectA()); break; - case kSensorWallOrnClickWithSpecObjRemovedSensor: - case kSensorWallOrnClickWithSpecObjRemovedRotateSensors: + case k17_SensorWallOrnClickWithSpecObjRemovedSensor: + case k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors: if (sensorCountToProcessPerCell[cell]) goto T0275058_ProceedToNextThing; - case kSensorWallOrnClickWithSpecObj: - case kSensorWallOrnClickWithSpecObjRemoved: + case k3_SensorWallOrnClickWithSpecObj: + case k4_SensorWallOrnClickWithSpecObjRemoved: doNotTriggerSensor = ((sensorData == objMan.getObjectType(leaderHandObject)) == sensor->getRevertEffectA()); - if (!doNotTriggerSensor && (sensorType == kSensorWallOrnClickWithSpecObjRemovedSensor)) { + if (!doNotTriggerSensor && (sensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor)) { if (lastProcessedThing == thingBeingProcessed) break; ((Sensor*)dunMan.getThingData(lastProcessedThing))->setNextThing(sensor->getNextThing()); sensor->setNextThing(Thing::_none); thingBeingProcessed = lastProcessedThing; } - if (!doNotTriggerSensor && (sensorType == kSensorWallOrnClickWithSpecObjRemovedRotateSensors)) { + if (!doNotTriggerSensor && (sensorType == k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors)) { warning("MISSING CODE: F0270_SENSOR_TriggerLocalEffect"); } break; - case kSensorWallObjGeneratorRotateSensors: + case k12_SensorWallObjGeneratorRotateSensors: if (sensorCountToProcessPerCell[cell]) goto T0275058_ProceedToNextThing; doNotTriggerSensor = !champMan._g415_leaderEmptyHanded; @@ -116,7 +116,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 warning("MISSING CODE: F0270_SENSOR_TriggerLocalEffect"); } break; - case kSensorWallSingleObjStorageRotateSensors: + case k13_SensorWallSingleObjStorageRotateSensors: if (champMan._g415_leaderEmptyHanded) { warning("MISSING CODE: F0273_SENSOR_GetObjectOfTypeInCell"); warning("MISSING CODE: F0164_DUNGEON_UnlinkThingFromList"); @@ -128,13 +128,13 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 leaderHandObject = Thing::_none; } warning("MISSING CODE: F0270_SENSOR_TriggerLocalEffect"); - if ((sensorEffect == kSensorEffHold) && !champMan._g415_leaderEmptyHanded) { + if ((sensorEffect == k3_SensorEffHold) && !champMan._g415_leaderEmptyHanded) { doNotTriggerSensor = true; } else { doNotTriggerSensor = false; } break; - case kSensorWallObjExchanger: { + case k16_SensorWallObjExchanger: { if (sensorCountToProcessPerCell[cell]) goto T0275058_ProceedToNextThing; Thing thingOnSquare = dunMan.getSquareFirstThing(mapX, mapY); @@ -147,15 +147,15 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 doNotTriggerSensor = false; break; } - case kSensorWallChampionPortrait: + case k127_SensorWallChampionPortrait: champMan.addCandidateChampionToParty(sensorData); goto T0275058_ProceedToNextThing; default: goto T0275058_ProceedToNextThing; } - if (sensorEffect == kSensorEffHold) { - sensorEffect = doNotTriggerSensor ? kSensorEffClear : kSensorEffSet; + if (sensorEffect == k3_SensorEffHold) { + sensorEffect = doNotTriggerSensor ? k1_SensorEffClear : k0_SensorEffSet; doNotTriggerSensor = false; } @@ -165,16 +165,16 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 warning("MISSING CODE: F0064_SOUND_RequestPlay_CPSD"); } if (!champMan._g415_leaderEmptyHanded && - ((sensorType == kSensorWallOrnClickWithSpecObjRemoved) || - (sensorType == kSensorWallOrnClickWithSpecObjRemovedRotateSensors) || - (sensorType == kSensorWallOrnClickWithSpecObjRemovedSensor))) { + ((sensorType == k4_SensorWallOrnClickWithSpecObjRemoved) || + (sensorType == k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors) || + (sensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor))) { *((Thing*)dunMan.getThingData(leaderHandObject)) = Thing::_none; warning("MISSING CODE: F0298_CHAMPION_GetObjectRemovedFromLeaderHand"); leaderHandObject = Thing::_none; } else { warning("MISSING CODE: (leaderHandObject = F0167_DUNGEON_GetObjectForProjectileLauncherOrObjectGenerator(sensorData)"); - if (champMan._g415_leaderEmptyHanded && (sensorType == kSensorWallObjGeneratorRotateSensors) && (leaderHandObject != Thing::_none)) { + if (champMan._g415_leaderEmptyHanded && (sensorType == k12_SensorWallObjGeneratorRotateSensors) && (leaderHandObject != Thing::_none)) { warning("MISSING CODE: F0297_CHAMPION_PutObjectInLeaderHand"); } } @@ -182,7 +182,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 } goto T0275058_ProceedToNextThing; } - if (thingType >= kGroupThingType) + if (thingType >= k4_GroupThingType) break; T0275058_ProceedToNextThing: lastProcessedThing = thingBeingProcessed; diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp index ae67904beb..810847caad 100644 --- a/engines/dm/objectman.cpp +++ b/engines/dm/objectman.cpp @@ -127,7 +127,7 @@ IconIndice ObjectMan::getObjectType(Thing thing) { int16 objectInfoIndex = _vm->_dungeonMan->getObjectInfoIndex(thing); if (objectInfoIndex != -1) { - objectInfoIndex = gObjectInfo[objectInfoIndex]._type; + objectInfoIndex = g237_ObjectInfo[objectInfoIndex]._type; } return (IconIndice)objectInfoIndex; } @@ -145,7 +145,7 @@ IconIndice ObjectMan::getIconIndex(Thing thing) { uint16 *rawType = _vm->_dungeonMan->getThingData(thing); switch (iconIndex) { case k0_IconIndiceJunkCompassNorth: - iconIndex = (IconIndice)(iconIndex + _vm->_dungeonMan->_currMap._partyDir); + iconIndex = (IconIndice)(iconIndex + _vm->_dungeonMan->_currMap._g308_partyDir); break; case k4_IconIndiceWeaponTorchUnlit: { Weapon weapon(rawType); diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 150c3c2ed6..101fccad42 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -44,7 +44,7 @@ Timeline::~Timeline() { void Timeline::initTimeline() { _events = new TimelineEvent[_eventMaxCount]; _timeline = new uint16[_eventMaxCount]; - if (_vm->_dungeonMan->_messages._newGame) { + if (_vm->_dungeonMan->_messages._g298_newGame) { for (int16 i = 0; i < _eventMaxCount; ++i) _events->_type = kTMEventTypeNone; _eventCount = 0; |