diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dm/champion.cpp | 24 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 2 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 62 | ||||
-rw-r--r-- | engines/dm/dungeonman.h | 426 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 268 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 2 | ||||
-rw-r--r-- | engines/dm/menus.cpp | 12 | ||||
-rw-r--r-- | engines/dm/movesens.cpp | 2 | ||||
-rw-r--r-- | engines/dm/projexpl.cpp | 2 | ||||
-rw-r--r-- | engines/dm/timeline.cpp | 2 |
10 files changed, 402 insertions, 400 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 90caaeba9a..83c2ad56ca 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -225,7 +225,7 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side) if (curThing.getType() == kDMThingTypeWeapon) { experience += 4; WeaponInfo *curWeapon = _vm->_dungeonMan->getWeaponInfo(curThing); - if (curWeapon->_class <= k12_WeaponClassPoisinDart) { + if (curWeapon->_class <= kDMWeaponClassPoisinDart) { weaponKineticEnergy = curWeapon->_kineticEnergy; experience += weaponKineticEnergy >> 2; } @@ -642,13 +642,13 @@ uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) { strength += weaponInfo->_strength; uint16 skillLevel = 0; uint16 weaponClass = weaponInfo->_class; - if ((weaponClass == k0_WeaponClassSwingWeapon) || (weaponClass == k2_WeaponClassDaggerAndAxes)) { + if ((weaponClass == kDMWeaponClassSwingWeapon) || (weaponClass == kDMWeaponClassDaggerAndAxes)) { skillLevel = getSkillLevel(champIndex, kDMSkillSwing); } - if ((weaponClass != k0_WeaponClassSwingWeapon) && (weaponClass < k16_WeaponClassFirstBow)) { + if ((weaponClass != kDMWeaponClassSwingWeapon) && (weaponClass < kDMWeaponClassFirstBow)) { skillLevel += getSkillLevel(champIndex, kDMSkillThrow); } - if ((weaponClass >= k16_WeaponClassFirstBow) && (weaponClass < k112_WeaponClassFirstMagicWeapon)) { + if ((weaponClass >= kDMWeaponClassFirstBow) && (weaponClass < kDMWeaponClassFirstMagicWeapon)) { skillLevel += getSkillLevel(champIndex, kDMSkillShoot); } strength += skillLevel << 1; @@ -853,7 +853,7 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) { if (curThing.getType() == kDMThingTypeArmour) { ArmourInfo *armorInfo = (ArmourInfo *)_vm->_dungeonMan->getThingData(curThing); armorInfo = &_vm->_dungeonMan->_armourInfos[((Armour *)armorInfo)->getType()]; - if (getFlag(armorInfo->_attributes, k0x0080_ArmourAttributeIsAShield)) + if (getFlag(armorInfo->_attributes, kDMArmourAttributeShield)) armorShieldDefense += ((getStrength(champIndex, slotIndex) + _vm->_dungeonMan->getArmourDefense(armorInfo, useSharpDefense)) * woundDefenseFactor[woundIndex]) >> ((slotIndex == woundIndex) ? 4 : 5); } } @@ -1251,14 +1251,14 @@ bool ChampionMan::isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint16 wea return false; WeaponInfo *weaponInfo = _vm->_dungeonMan->getWeaponInfo(curThing); - int16 weaponClass = kM1_WeaponClassNone; + int16 weaponClass = kDMWeaponClassNone; - if ((weaponInfo->_class >= k16_WeaponClassFirstBow) && (weaponInfo->_class <= k31_WeaponClassLastBow)) - weaponClass = k10_WeaponClassBowAmmunition; - else if ((weaponInfo->_class >= k32_WeaponClassFirstSling) && (weaponInfo->_class <= k47_WeaponClassLastSling)) - weaponClass = k11_WeaponClassSlingAmmunition; + if ((weaponInfo->_class >= kDMWeaponClassFirstBow) && (weaponInfo->_class <= kDMWeaponClassLastBow)) + weaponClass = kDMWeaponClassBowAmmunition; + else if ((weaponInfo->_class >= kDMWeaponClassFirstSling) && (weaponInfo->_class <= kDMWeaponClassLastSling)) + weaponClass = kDMWeaponClassSlingAmmunition; - if (weaponClass == kM1_WeaponClassNone) + if (weaponClass == kDMWeaponClassNone) return false; curThing = curChampion->_slots[ammunitionSlotIndex]; @@ -1898,7 +1898,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { char L0807_ac_DecodedChampionText[77]; char *decodedStringPtr = L0807_ac_DecodedChampionText; - _vm->_dungeonMan->decodeText(decodedStringPtr, curThing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); + _vm->_dungeonMan->decodeText(decodedStringPtr, curThing, (TextType)(kDMTextTypeScroll | k0x8000_DecodeEvenIfInvisible)); uint16 charIdx = 0; char tmpChar; diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 63c4e8b26c..10d20aef68 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -989,7 +989,7 @@ void DMEngine::fuseSequence() { while (textStringThingCount--) { for (int16 idx = 0; idx < maxCount; idx++) { char decodedString[200]; - _dungeonMan->decodeText(decodedString, textStringThings[idx], (TextType)(k1_TextTypeMessage | k0x8000_DecodeEvenIfInvisible)); + _dungeonMan->decodeText(decodedString, textStringThings[idx], (TextType)(kDMTextTypeMessage | k0x8000_DecodeEvenIfInvisible)); if (decodedString[1] == textFirstChar) { _textMan->clearAllRows(); decodedString[1] = '\n'; /* New line */ diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 8b6a844edc..050e031e3d 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -862,8 +862,8 @@ void DungeonMan::setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, bool frontRandomWallOrnamentAllowed = false; bool squareIsFakeWall; - aspectArray[k0_ElementAspect] = Square(AL0307_uc_Square).getType(); - switch (aspectArray[k0_ElementAspect]) { + aspectArray[kDMSquareAspectElement] = Square(AL0307_uc_Square).getType(); + switch (aspectArray[kDMSquareAspectElement]) { case kDMElementTypeWall: switch (dir) { case kDMDirNorth: @@ -913,66 +913,66 @@ T0172010_ClosedFakeWall: curThing = getNextThing(curThing); } if (squareIsFakeWall && (_partyMapX != mapX) && (_partyMapY != mapY)) { - aspectArray[k1_FirstGroupOrObjectAspect] = Thing::_endOfList.toUint16(); + aspectArray[kDMSquareAspectFirstGroupOrObject] = Thing::_endOfList.toUint16(); return; } break; case kDMElementTypeFakeWall: if (!getFlag(AL0307_uc_Square, k0x0004_FakeWallOpen)) { - aspectArray[k0_ElementAspect] = kDMElementTypeWall; + aspectArray[kDMSquareAspectElement] = kDMElementTypeWall; leftRandomWallOrnamentAllowed = rightRandomWallOrnamentAllowed = frontRandomWallOrnamentAllowed = getFlag(AL0307_uc_Square, k0x0008_FakeWallRandOrnOrFootPAllowed); squareIsFakeWall = true; goto T0172010_ClosedFakeWall; } - aspectArray[k0_ElementAspect] = k1_CorridorElemType; + aspectArray[kDMSquareAspectElement] = k1_CorridorElemType; AL0307_uc_FootprintsAllowed = getFlag(AL0307_uc_Square, k0x0008_FakeWallRandOrnOrFootPAllowed) ? 8 : 0; // No break on purpose case k1_CorridorElemType: case kDMElementTypePit: case kDMElementTypeTeleporter: - if (aspectArray[k0_ElementAspect] == k1_CorridorElemType) { - aspectArray[k4_FloorOrnOrdAspect] = getRandomOrnOrdinal(getFlag(AL0307_uc_Square, k0x0008_CorridorRandOrnAllowed), _currMap->_randFloorOrnCount, mapX, mapY, 30); + if (aspectArray[kDMSquareAspectElement] == k1_CorridorElemType) { + aspectArray[kDMSquareAspectFloorOrn] = getRandomOrnOrdinal(getFlag(AL0307_uc_Square, k0x0008_CorridorRandOrnAllowed), _currMap->_randFloorOrnCount, mapX, mapY, 30); AL0307_uc_FootprintsAllowed = true; - } else if (aspectArray[k0_ElementAspect] == kDMElementTypePit) { + } else if (aspectArray[kDMSquareAspectElement] == kDMElementTypePit) { if (getFlag(AL0307_uc_Square, k0x0008_PitOpen)) { - aspectArray[k2_PitInvisibleAspect] = getFlag(AL0307_uc_Square, k0x0004_PitInvisible); + aspectArray[kDMSquareAspectPitInvisible] = getFlag(AL0307_uc_Square, k0x0004_PitInvisible); AL0307_uc_FootprintsAllowed &= 0x0001; } else { - aspectArray[k0_ElementAspect] = k1_CorridorElemType; + aspectArray[kDMSquareAspectElement] = k1_CorridorElemType; AL0307_uc_FootprintsAllowed = true; } } else { // k5_ElementTypeTeleporter - aspectArray[k2_TeleporterVisibleAspect] = getFlag(AL0307_uc_Square, k0x0008_TeleporterOpen) && getFlag(AL0307_uc_Square, k0x0004_TeleporterVisible); + aspectArray[kDMSquareAspectTeleporterVisible] = getFlag(AL0307_uc_Square, k0x0008_TeleporterOpen) && getFlag(AL0307_uc_Square, k0x0004_TeleporterVisible); AL0307_uc_FootprintsAllowed = true; } while ((curThing != Thing::_endOfList) && (curThing.getType() <= kDMThingTypeSensor)) { if (curThing.getType() == kDMThingTypeSensor) { Sensor *curSensor = (Sensor *)getThingData(curThing); - aspectArray[k4_FloorOrnOrdAspect] = curSensor->getAttrOrnOrdinal(); + aspectArray[kDMSquareAspectFloorOrn] = curSensor->getAttrOrnOrdinal(); } curThing = getNextThing(curThing); } AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY); if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) - setFlag(aspectArray[k4_FloorOrnOrdAspect], k0x8000_FootprintsAspect); + setFlag(aspectArray[kDMSquareAspectFloorOrn], kDMMaskFootprints); break; case kDMElementTypeStairs: - aspectArray[k0_ElementAspect] = (bool((getFlag(AL0307_uc_Square, k0x0008_StairsNorthSouthOrient) >> 3)) == _vm->isOrientedWestEast(dir)) ? kDMElementTypeStairsSide : kDMElementTypeStairsFront; - aspectArray[k2_StairsUpAspect] = getFlag(AL0307_uc_Square, k0x0004_StairsUp); + aspectArray[kDMSquareAspectElement] = (bool((getFlag(AL0307_uc_Square, k0x0008_StairsNorthSouthOrient) >> 3)) == _vm->isOrientedWestEast(dir)) ? kDMElementTypeStairsSide : kDMElementTypeStairsFront; + aspectArray[kDMSquareAspectStairsUp] = getFlag(AL0307_uc_Square, k0x0004_StairsUp); AL0307_uc_FootprintsAllowed = false; while ((curThing != Thing::_endOfList) && (curThing.getType() <= kDMThingTypeSensor)) curThing = getNextThing(curThing); break; case k4_DoorElemType: if (bool((getFlag(AL0307_uc_Square, (byte) k0x0008_DoorNorthSouthOrient) >> 3)) == _vm->isOrientedWestEast(dir)) { - aspectArray[k0_ElementAspect] = k16_DoorSideElemType; + aspectArray[kDMSquareAspectElement] = k16_DoorSideElemType; } else { - aspectArray[k0_ElementAspect] = k17_DoorFrontElemType; - aspectArray[k2_DoorStateAspect] = Square(AL0307_uc_Square).getDoorState(); - aspectArray[k3_DoorThingIndexAspect] = getSquareFirstThing(mapX, mapY).getIndex(); + aspectArray[kDMSquareAspectElement] = k17_DoorFrontElemType; + aspectArray[kDMSquareAspectDoorState] = Square(AL0307_uc_Square).getDoorState(); + aspectArray[kDMSquareAspectDoorThingIndex] = getSquareFirstThing(mapX, mapY).getIndex(); } AL0307_uc_FootprintsAllowed = true; @@ -981,21 +981,21 @@ T0172010_ClosedFakeWall: AL0307_uc_ScentOrdinal = _vm->_championMan->getScentOrdinal(mapX, mapY); if (AL0307_uc_FootprintsAllowed && (AL0307_uc_ScentOrdinal) && (--AL0307_uc_ScentOrdinal >= _vm->_championMan->_party._firstScentIndex) && (AL0307_uc_ScentOrdinal < _vm->_championMan->_party._lastScentIndex)) - setFlag(aspectArray[k4_FloorOrnOrdAspect], k0x8000_FootprintsAspect); + setFlag(aspectArray[kDMSquareAspectFloorOrn], kDMMaskFootprints); break; } - aspectArray[k1_FirstGroupOrObjectAspect] = curThing.toUint16(); + aspectArray[kDMSquareAspectFirstGroupOrObject] = curThing.toUint16(); } void DungeonMan::setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, int16 dir, int16 mapX, int16 mapY, bool isFakeWall) { int16 randomWallOrnamentCount = _currMap->_randWallOrnCount; - aspectArray[k2_RightWallOrnOrdAspect] = getRandomOrnOrdinal(leftAllowed, randomWallOrnamentCount, mapX, ++mapY * (_vm->normalizeModulo4(++dir) + 1), 30); - aspectArray[k3_FrontWallOrnOrdAspect] = getRandomOrnOrdinal(frontAllowed, randomWallOrnamentCount, mapX, mapY * (_vm->normalizeModulo4(++dir) + 1), 30); - aspectArray[k4_LeftWallOrnOrdAspect] = getRandomOrnOrdinal(rightAllowed, randomWallOrnamentCount, mapX, mapY-- * (_vm->normalizeModulo4(++dir) + 1), 30); + aspectArray[kDMSquareAspectRightWallOrnOrd] = getRandomOrnOrdinal(leftAllowed, randomWallOrnamentCount, mapX, ++mapY * (_vm->normalizeModulo4(++dir) + 1), 30); + aspectArray[kDMSquareFrontWallOrnOrd] = getRandomOrnOrdinal(frontAllowed, randomWallOrnamentCount, mapX, mapY * (_vm->normalizeModulo4(++dir) + 1), 30); + aspectArray[kDMSquareAspectLeftWallOrnOrd] = getRandomOrnOrdinal(rightAllowed, randomWallOrnamentCount, mapX, mapY-- * (_vm->normalizeModulo4(++dir) + 1), 30); if (isFakeWall || (mapX < 0) || (mapX >= _currMapWidth) || (mapY < 0) || (mapY >= _currMapHeight)) { /* If square is a fake wall or is out of map bounds */ - for (int16 sideIndex = k2_RightWallOrnOrdAspect; sideIndex <= k4_LeftWallOrnOrdAspect; sideIndex++) { /* Loop to remove any random ornament that is an alcove */ + for (int16 sideIndex = kDMSquareAspectRightWallOrnOrd; sideIndex <= kDMSquareAspectLeftWallOrnOrd; sideIndex++) { /* Loop to remove any random ornament that is an alcove */ if (isWallOrnAnAlcove(_vm->ordinalToIndex(aspectArray[sideIndex]))) aspectArray[sideIndex] = 0; } @@ -1121,10 +1121,10 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { if ((textString.isVisible()) || (type & k0x8000_DecodeEvenIfInvisible)) { type = (TextType)(type & ~k0x8000_DecodeEvenIfInvisible); char sepChar; - if (type == k1_TextTypeMessage) { + if (type == kDMTextTypeMessage) { *destString++ = '\n'; sepChar = ' '; - } else if (type == k0_TextTypeInscription) { + } else if (type == kDMTextTypeInscription) { sepChar = (char)0x80; } else { sepChar = '\n'; @@ -1149,7 +1149,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { if (escChar) { *destString = '\0'; if (escChar == 30) { - if (type != k0_TextTypeInscription) + if (type != kDMTextTypeInscription) escReplString = messageAndScrollEscReplacementStrings[code]; else escReplString = inscriptionEscReplacementStrings[code]; @@ -1160,7 +1160,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { destString += strlen(escReplString); escChar = 0; } else if (code < 28) { - if (type != k0_TextTypeInscription) { + if (type != kDMTextTypeInscription) { if (code == 26) code = ' '; else if (code == 27) @@ -1177,7 +1177,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) { break; } } - *destString = ((type == k0_TextTypeInscription) ? 0x81 : '\0'); + *destString = ((type == kDMTextTypeInscription) ? 0x81 : '\0'); } Thing DungeonMan::getUnusedThing(uint16 thingType) { @@ -1409,7 +1409,7 @@ Thing DungeonMan::getSquareFirstObject(int16 mapX, int16 mapY) { uint16 DungeonMan::getArmourDefense(ArmourInfo *armourInfo, bool useSharpDefense) { uint16 defense = armourInfo->_defense; if (useSharpDefense) - defense = _vm->getScaledProduct(defense, 3, getFlag(armourInfo->_attributes, k0x0007_ArmourAttributeSharpDefense) + 4); + defense = _vm->getScaledProduct(defense, 3, getFlag(armourInfo->_attributes, kDMArmourAttributeSharpDefense) + 4); return defense; } diff --git a/engines/dm/dungeonman.h b/engines/dm/dungeonman.h index 704ffa134d..a09abb27d7 100644 --- a/engines/dm/dungeonman.h +++ b/engines/dm/dungeonman.h @@ -65,16 +65,222 @@ enum ObjectAllowedSlot { kDMMaskMouth = 0x0001, // @ MASK0x0001_MOUTH kDMMaskHead = 0x0002, // @ MASK0x0002_HEAD kDMMaskNeck = 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 + kDMMaskTorso = 0x0008, // @ MASK0x0008_TORSO + kDMMaskLegs = 0x0010, // @ MASK0x0010_LEGS + kDMMaskFeet = 0x0020, // @ MASK0x0020_FEET + kDMMaskQuiverLine1 = 0x0040, // @ MASK0x0040_QUIVER_LINE1 + kDMMaskQuiverLine2 = 0x0080, // @ MASK0x0080_QUIVER_LINE2 + kDMMaskPouchPassAndThroughDoors = 0x0100, // @ MASK0x0100_POUCH_PASS_AND_THROUGH_DOORS + kDMMaskHands = 0x0200, // @ MASK0x0200_HANDS + kDMMaskContainer = 0x0400, // @ MASK0x0400_CONTAINER + kDMMaskFootprints = 0x8000 // @ MASK0x8000_FOOTPRINTS }; +enum ArmourAttribute { + kDMArmourAttributeShield = 0x0080, // @ MASK0x0080_IS_A_SHIELD + kDMArmourAttributeSharpDefense = 0x0007 // @ MASK0x0007_SHARP_DEFENSE +}; + +enum WeaponClass { + kDMWeaponClassNone = -1, +/* Class 0: SWING weapons */ + kDMWeaponClassSwingWeapon = 0, // @ C000_CLASS_SWING_WEAPON +/* Class 1 to 15: THROW weapons */ + kDMWeaponClassDaggerAndAxes = 2, // @ C002_CLASS_DAGGER_AND_AXES + kDMWeaponClassBowAmmunition = 10, // @ C010_CLASS_BOW_AMMUNITION + kDMWeaponClassSlingAmmunition = 11, // @ C011_CLASS_SLING_AMMUNITION + kDMWeaponClassPoisinDart = 12, // @ C012_CLASS_POISON_DART +/* Class 16 to 111: SHOOT weapons */ + kDMWeaponClassFirstBow = 16, // @ C016_CLASS_FIRST_BOW + kDMWeaponClassLastBow = 31, // @ C031_CLASS_LAST_BOW + kDMWeaponClassFirstSling = 32, // @ C032_CLASS_FIRST_SLING + kDMWeaponClassLastSling = 47, // @ C047_CLASS_LAST_SLING +/* Class 112 to 255: Magic and special weapons */ + kDMWeaponClassFirstMagicWeapon = 112 // @ C112_CLASS_FIRST_MAGIC_WEAPON +}; + +enum TextType { + /* Used for text on walls */ + kDMTextTypeInscription = 0, // @ C0_TEXT_TYPE_INSCRIPTION + /* Used for messages displayed when the party walks on a square */ + kDMTextTypeMessage = 1, // @ C1_TEXT_TYPE_MESSAGE + /* Used for text on scrolls and champion information */ + kDMTextTypeScroll = 2 // @ C2_TEXT_TYPE_SCROLL +}; + +enum SquareAspect { + kDMSquareAspectElement = 0, // @ C0_ELEMENT + kDMSquareAspectFirstGroupOrObject = 1, // @ C1_FIRST_GROUP_OR_OBJECT + kDMSquareAspectRightWallOrnOrd = 2, // @ C2_RIGHT_WALL_ORNAMENT_ORDINAL + kDMSquareFrontWallOrnOrd = 3, // @ C3_FRONT_WALL_ORNAMENT_ORDINAL + kDMSquareAspectLeftWallOrnOrd = 4, // @ C4_LEFT_WALL_ORNAMENT_ORDINAL + kDMSquareAspectPitInvisible = 2, // @ C2_PIT_INVISIBLE + kDMSquareAspectTeleporterVisible = 2, // @ C2_TELEPORTER_VISIBLE + kDMSquareAspectStairsUp = 2, // @ C2_STAIRS_UP + kDMSquareAspectDoorState = 2, // @ C2_DOOR_STATE + kDMSquareAspectDoorThingIndex = 3, // @ C3_DOOR_THING_INDEX + kDMSquareAspectFloorOrn = 4, // @ C4_FLOOR_ORNAMENT_ORDINAL +}; + +#define k15_immuneToFire 15 // @ C15_IMMUNE_TO_FIRE +#define k15_immuneToPoison 15 // @ C15_IMMUNE_TO_POISON + +enum TeleporterScope { + k0x0001_TelepScopeCreatures = 1, // @ MASK0x0001_SCOPE_CREATURES + k0x0002_TelepScopeObjOrParty = 2 // @ MASK0x0002_SCOPE_OBJECTS_OR_PARTY +}; + +enum SensorActionType { + 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 { + 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 */ +}; + +#define k0x8000_randomDrop 0x8000 // @ MASK0x8000_RANDOM_DROP + +enum WeaponType { + 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 +}; + +enum ArmourType { + 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 +}; + +enum PotionType { + 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, +}; + +enum JunkType { + 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, +}; + +#define kM1_soundModeDoNotPlaySound -1 // @ CM1_MODE_DO_NOT_PLAY_SOUND +#define k0_soundModePlayImmediately 0 // @ C00_MODE_PLAY_IMMEDIATELY +#define k1_soundModePlayIfPrioritized 1 // @ C01_MODE_PLAY_IF_PRIORITIZED +#define k2_soundModePlayOneTickLater 2 // @ C02_MODE_PLAY_ONE_TICK_LATER + +#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 + +enum SquareMask { + 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 { + 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_... + +#define k0x8000_championBones 0x8000 // @ MASK0x8000_CHAMPION_BONES +#define k0x7FFF_thingType 0x7FFF // @ MASK0x7FFF_THING_TYPE + class ObjectInfoIndex { public: int16 _type; @@ -95,11 +301,6 @@ public: } }; // @ OBJECT_INFO -enum ArmourAttribute { - k0x0080_ArmourAttributeIsAShield = 0x0080, // @ MASK0x0080_IS_A_SHIELD - k0x0007_ArmourAttributeSharpDefense = 0x0007 // @ MASK0x0007_SHARP_DEFENSE -}; - class ArmourInfo { public: uint16 _weight; @@ -114,24 +315,7 @@ public: void setAttribute(ArmourAttribute attribute) { _attributes |= attribute; } }; // @ ARMOUR_INFO -#define kM1_WeaponClassNone -1 -/* Class 0: SWING weapons */ -#define k0_WeaponClassSwingWeapon 0 // @ C000_CLASS_SWING_WEAPON -/* Class 1 to 15: THROW weapons */ -#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 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 k112_WeaponClassFirstMagicWeapon 112 // @ C112_CLASS_FIRST_MAGIC_WEAPON - class WeaponInfo { - public: uint16 _weight; uint16 _class; @@ -148,33 +332,6 @@ public: uint16 getProjectileAspectOrdinal() { return (_attributes >> 8) & 0x1F; } // @ M66_PROJECTILE_ASPECT_ORDINAL }; // @ WEAPON_INFO -enum TextType { - /* Used for text on walls */ - k0_TextTypeInscription = 0, // @ C0_TEXT_TYPE_INSCRIPTION - /* Used for messages displayed when the party walks on a square */ - k1_TextTypeMessage = 1, // @ C1_TEXT_TYPE_MESSAGE - /* Used for text on scrolls and champion information */ - k2_TextTypeScroll = 2 // @ C2_TEXT_TYPE_SCROLL -}; - -enum SquareAspectIndice { - k0_ElementAspect = 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 -}; - -#define k15_immuneToFire 15 // @ C15_IMMUNE_TO_FIRE -#define k15_immuneToPoison 15 // @ C15_IMMUNE_TO_POISON - class CreatureInfo { public: byte _creatureAspectIndex; @@ -220,11 +377,6 @@ public: byte getType() { return _attributes & 1; } }; // @ DOOR -enum TeleporterScope { - k0x0001_TelepScopeCreatures = 1, // @ MASK0x0001_SCOPE_CREATURES - k0x0002_TelepScopeObjOrParty = 2 // @ MASK0x0002_SCOPE_OBJECTS_OR_PARTY -}; - class Teleporter { Thing _nextThing; uint16 _attributes; @@ -253,47 +405,6 @@ public: void setVisible(bool visible) { _textDataRef = (_textDataRef & ~1) | (visible ? 1 : 0); } }; // @ TEXTSTRING -enum SensorActionType { - 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 { - 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 { Thing _nextThing; uint16 _datAndType; @@ -332,22 +443,6 @@ public: }; // @ SENSOR - -#define k0x8000_randomDrop 0x8000 // @ MASK0x8000_RANDOM_DROP - -enum WeaponType { - 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; uint16 _desc; @@ -375,13 +470,6 @@ public: void setDoNotDiscard(uint16 val) { _desc = (_desc & ~(1 << 7)) | ((val & 1) << 7); } }; // @ WEAPON -enum ArmourType { - 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; uint16 _attributes; @@ -417,21 +505,6 @@ public: uint16 getTextStringThingIndex() { return _attributes & 0x3FF; } }; // @ SCROLL -enum PotionType { - 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 { public: Thing _nextThing; @@ -458,19 +531,6 @@ public: Thing &getNextThing() { return _nextThing; } }; // @ CONTAINER -enum JunkType { - 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 { Thing _nextThing; uint16 _attributes; @@ -488,11 +548,6 @@ public: void setNextThing(Thing thing) { _nextThing = thing; } }; // @ JUNK -#define kM1_soundModeDoNotPlaySound -1 // @ CM1_MODE_DO_NOT_PLAY_SOUND -#define k0_soundModePlayImmediately 0 // @ C00_MODE_PLAY_IMMEDIATELY -#define k1_soundModePlayIfPrioritized 1 // @ C01_MODE_PLAY_IF_PRIORITIZED -#define k2_soundModePlayOneTickLater 2 // @ C02_MODE_PLAY_ONE_TICK_LATER - class Projectile { public: Thing _nextThing; @@ -505,18 +560,6 @@ public: }; // @ PROJECTILE -#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; uint16 _attributes; @@ -533,47 +576,6 @@ public: void setCentered(uint16 val) { _attributes = (_attributes & ~(1 << 7)) | ((val & 1) << 7); } }; // @ EXPLOSION - -enum SquareMask { - 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 { - 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_... - -#define k0x8000_championBones 0x8000 // @ MASK0x8000_CHAMPION_BONES -#define k0x7FFF_thingType 0x7FFF // @ MASK0x7FFF_THING_TYPE - class Square { byte _data; public: diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index be0a95a3e9..8aa3aa5245 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -1031,9 +1031,9 @@ void DisplayMan::drawFloorOrnament(uint16 floorOrnOrdinal, uint16 viewFloorIndex if (!floorOrnOrdinal) return; - bool drawFootprints = (getFlag(floorOrnOrdinal, k0x8000_FootprintsAspect) ? true : false); + bool drawFootprints = (getFlag(floorOrnOrdinal, kDMMaskFootprints) ? true : false); byte *bitmap; - if (!drawFootprints || clearFlag(floorOrnOrdinal, k0x8000_FootprintsAspect)) { + if (!drawFootprints || clearFlag(floorOrnOrdinal, kDMMaskFootprints)) { floorOrnOrdinal--; uint16 floorOrnIndex = floorOrnOrdinal; int16 nativeBitmapIndex = _currMapFloorOrnInfo[floorOrnIndex][k0_NativeBitmapIndex] @@ -1224,20 +1224,20 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) { int16 order; bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case k19_StairsFrontElemType: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD3L, frameStairsUpFrontD3L); else drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD3L, frameStairsDownFrontD3L); order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k0_viewFloor_D3L); break; case k0_WallElemType: drawWallSetBitmap(_bitmapWallSetD3LCR, _frameWalls163[k1_ViewSquare_D3L]); - isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k0_ViewWall_D3L_RIGHT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k2_ViewWall_D3L_FRONT)) + isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectRightWallOrnOrd], k0_ViewWall_D3L_RIGHT); + if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], k2_ViewWall_D3L_FRONT)) order = k0x0000_CellOrder_Alcove; else return; @@ -1246,25 +1246,25 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) { case kDMElementTypeStairsSide: order = k0x0321_CellOrder_BackLeft_BackRight_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k0_viewFloor_D3L); break; case kDMElementTypeDoorFront: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k0_viewFloor_D3L); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD3L, doorFrameLeftD3L); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD3LCR, bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3L); order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight; break; case kDMElementTypePit: - if (!squareAspect[k2_PitInvisibleAspect]) + if (!squareAspect[kDMSquareAspectPitInvisible]) drawFloorPitOrStairsBitmap(k49_FloorPit_D3L_GraphicIndice, frameFloorPitD3L); // no break on purpose case kDMElementTypeTeleporter: case kDMElementTypeCorridor: order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k0_viewFloor_D3L); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k0_viewFloor_D3L); break; default: skip = true; @@ -1272,9 +1272,9 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k1_ViewSquare_D3L, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k1_ViewSquare_D3L, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k1_ViewSquare_D3L], _frameWalls163[k1_ViewSquare_D3L]._box); } @@ -1302,21 +1302,21 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexUpFrontD3L, frameStairsUpFrontD3R); else drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownFrontD3L, frameStairsDownFrontD3R); order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k2_viewFloor_D3R); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k2_viewFloor_D3R); break; case kDMElementTypeWall: drawWallSetBitmap(_bitmapWallSetD3LCR, _frameWalls163[k2_ViewSquare_D3R]); - isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k1_ViewWall_D3R_LEFT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k4_ViewWall_D3R_FRONT)) + isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectLeftWallOrnOrd], k1_ViewWall_D3R_LEFT); + if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], k4_ViewWall_D3R_FRONT)) order = k0x0000_CellOrder_Alcove; else return; @@ -1325,29 +1325,29 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) { case kDMElementTypeStairsSide: order = k0x0412_CellOrder_BackRight_BackLeft_FrontLeft; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k2_viewFloor_D3R); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k2_viewFloor_D3R); break; case kDMElementTypeDoorFront: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k2_viewFloor_D3R); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k2_viewFloor_D3R); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); memmove(_tmpBitmap, _bitmapWallSetDoorFrameLeftD3L, 32 * 44); drawDoorFrameBitmapFlippedHorizontally(_tmpBitmap, &doorFrameRightD3R); - if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[kDMSquareAspectDoorThingIndex]].hasButton()) drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k0_viewDoorButton_D3R); - drawDoor(squareAspect[k3_DoorThingIndexAspect], - squareAspect[k2_DoorStateAspect], _doorNativeBitmapIndexFrontD3LCR, + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], + squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD3LCR, bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3R); break;; case kDMElementTypePit: - if (!squareAspect[k2_PitInvisibleAspect]) + if (!squareAspect[kDMSquareAspectPitInvisible]) drawFloorPitOrStairsBitmapFlippedHorizontally(k49_FloorPit_D3L_GraphicIndice, frameFloorPitD3R); // No break on purpose case kDMElementTypeTeleporter: case kDMElementTypeCorridor: order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k2_viewFloor_D3R); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k2_viewFloor_D3R); break; default: skip = true; @@ -1355,9 +1355,9 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k2_ViewSquare_D3R, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k2_ViewSquare_D3R, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k2_ViewSquare_D3R], _frameWalls163[k2_ViewSquare_D3R]._box); } @@ -1386,45 +1386,45 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD3C, frameStairsUpFrontD3C); else drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD3C, frameStairsDownFrontD3C); order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k1_viewFloor_D3C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k1_viewFloor_D3C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ break; case kDMElementTypeWall: drawWallSetBitmapWithoutTransparency(_bitmapWallSetD3LCR, _frameWalls163[k0_ViewSquare_D3C]); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k3_ViewWall_D3C_FRONT)) + if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], k3_ViewWall_D3C_FRONT)) order = k0x0000_CellOrder_Alcove; else return; break; case k17_DoorFrontElemType: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k1_viewFloor_D3C); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k0_ViewSquare_D3C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k1_viewFloor_D3C); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k0_ViewSquare_D3C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD3C, doorFrameLeftD3C); memmove(_tmpBitmap, _bitmapWallSetDoorFrameLeftD3C, 32 * 44); drawDoorFrameBitmapFlippedHorizontally(_tmpBitmap, &doorFrameRightD3C); - if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[kDMSquareAspectDoorThingIndex]].hasButton()) drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k1_ViewDoorOrnament_D2LCR); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD3LCR, bitmapByteCount(48, 41), k0_ViewDoorOrnament_D3LCR, &doorFrameD3C); order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight; break; case kDMElementTypePit: - if (!squareAspect[k2_PitInvisibleAspect]) + if (!squareAspect[kDMSquareAspectPitInvisible]) drawFloorPitOrStairsBitmap(k50_FloorPit_D3C_GraphicIndice, frameFloorPitD3C); // No break on purpose case kDMElementTypeTeleporter: case k1_CorridorElemType: order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k1_viewFloor_D3C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k1_viewFloor_D3C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ break; default: skip = true; @@ -1432,9 +1432,9 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k0_ViewSquare_D3C, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k0_ViewSquare_D3C, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k0_ViewSquare_D3C], _frameWalls163[k0_ViewSquare_D3C]._box); } @@ -1464,20 +1464,20 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD2L, frameStairsUpFrontD2L); else drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD2L, frameStairsDownFrontD2L); order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k3_viewFloor_D2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k3_viewFloor_D2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ break; case kDMElementTypeWall: drawWallSetBitmap(_bitmapWallSetD2LCR, _frameWalls163[k4_ViewSquare_D2L]); - isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k5_ViewWall_D2L_RIGHT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k7_ViewWall_D2L_FRONT)) + isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectRightWallOrnOrd], k5_ViewWall_D2L_RIGHT); + if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], k7_ViewWall_D2L_FRONT)) order = k0x0000_CellOrder_Alcove; else return; @@ -1487,24 +1487,24 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) { // No break on purpose case k16_DoorSideElemType: order = k0x0342_CellOrder_BackRight_FrontLeft_FrontRight; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k3_viewFloor_D2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k3_viewFloor_D2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ break; case k17_DoorFrontElemType: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k3_viewFloor_D2L); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k4_ViewSquare_D2L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k3_viewFloor_D2L); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k4_ViewSquare_D2L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); drawWallSetBitmap(_bitmapWallSetDoorFrameTopD2LCR, doorFrameTopD2L); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], _doorNativeBitmapIndexFrontD2LCR, + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD2LCR, bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2L); order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight; break; case kDMElementTypePit: - drawFloorPitOrStairsBitmap(squareAspect[k2_PitInvisibleAspect] ? k57_FloorPir_Invisible_D2L_GraphicIndice : k51_FloorPit_D2L_GraphicIndice, + drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k57_FloorPir_Invisible_D2L_GraphicIndice : k51_FloorPit_D2L_GraphicIndice, frameFloorPitD2L); // No break on purpose case kDMElementTypeTeleporter: case k1_CorridorElemType: order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k3_viewFloor_D2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k3_viewFloor_D2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ break; default: @@ -1514,10 +1514,10 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) { if (!skip) { drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &FrameCeilingPitD2L, posX, posY, false); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k4_ViewSquare_D2L, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k4_ViewSquare_D2L, order); } - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k4_ViewSquare_D2L], _frameWalls163[k4_ViewSquare_D2L]._box); } @@ -1547,22 +1547,22 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexUpFrontD2L, frameStairsUpFrontD2R); else drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownFrontD2L, frameStairsDownFrontD2R); order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k5_viewFloor_D2R); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k5_viewFloor_D2R); drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &frameCeilingPitD2R, posX, posY, true); break; case kDMElementTypeWall: drawWallSetBitmap(_bitmapWallSetD2LCR, _frameWalls163[k5_ViewSquare_D2R]); - isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k6_ViewWall_D2R_LEFT); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k9_ViewWall_D2R_FRONT)) + isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectLeftWallOrnOrd], k6_ViewWall_D2R_LEFT); + if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], k9_ViewWall_D2R_FRONT)) order = k0x0000_CellOrder_Alcove; else return; @@ -1573,26 +1573,26 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) { case k16_DoorSideElemType: order = k0x0431_CellOrder_BackLeft_FrontRight_FrontLeft; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k5_viewFloor_D2R); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k5_viewFloor_D2R); drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &frameCeilingPitD2R, posX, posY, true); break; case k17_DoorFrontElemType: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k5_ViewSquare_D2R); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k5_ViewSquare_D2R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k5_ViewSquare_D2R); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k5_ViewSquare_D2R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft); drawWallSetBitmap(_bitmapWallSetDoorFrameTopD2LCR, doorFrameTopD2R); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD2LCR, bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2R); order = k0x0439_CellOrder_DoorPass2_FrontRight_FrontLeft; break; case kDMElementTypePit: drawFloorPitOrStairsBitmapFlippedHorizontally( - squareAspect[k2_PitInvisibleAspect] ? k57_FloorPir_Invisible_D2L_GraphicIndice : k51_FloorPit_D2L_GraphicIndice, frameFloorPitD2R); + squareAspect[kDMSquareAspectPitInvisible] ? k57_FloorPir_Invisible_D2L_GraphicIndice : k51_FloorPit_D2L_GraphicIndice, frameFloorPitD2R); // No break on purpose case kDMElementTypeTeleporter: case k1_CorridorElemType: order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k5_viewFloor_D2R); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k5_viewFloor_D2R); drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &frameCeilingPitD2R, posX, posY, true); break; default: @@ -1601,9 +1601,9 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k5_ViewSquare_D2R, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k5_ViewSquare_D2R, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k5_ViewSquare_D2R], _frameWalls163[k5_ViewSquare_D2R]._box); } @@ -1634,47 +1634,47 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD2C, frameStairsUpFrontD2C); else drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD2C, frameStairsDownFrontD2C); order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k4_viewFloor_D2C); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k4_viewFloor_D2C); drawCeilingPit(k64_ceilingPitD2C_GraphicIndice, &frameCeilingPitD2C, posX, posY, false); break; case kDMElementTypeWall: drawWallSetBitmapWithoutTransparency(_bitmapWallSetD2LCR, _frameWalls163[k3_ViewSquare_D2C]); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k8_ViewWall_D2C_FRONT)) + if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], k8_ViewWall_D2C_FRONT)) order = k0x0000_CellOrder_Alcove; else return; break; case k17_DoorFrontElemType: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k4_viewFloor_D2C); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k3_ViewSquare_D2C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k4_viewFloor_D2C); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k3_ViewSquare_D2C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); drawWallSetBitmap(_bitmapWallSetDoorFrameTopD2LCR, doorFrameTopD2C); drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD2C, doorFrameLeftD2C); memcpy(_tmpBitmap, _bitmapWallSetDoorFrameLeftD2C, 48 * 65); drawDoorFrameBitmapFlippedHorizontally(_tmpBitmap, &doorFrameRightD2C); - if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[kDMSquareAspectDoorThingIndex]].hasButton()) drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k2_viewDoorButton_D2C); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD2LCR, bitmapByteCount(64, 61), k1_ViewDoorOrnament_D2LCR, &doorFrameD2C); order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight; break; case kDMElementTypePit: - drawFloorPitOrStairsBitmap(squareAspect[k2_PitInvisibleAspect] ? k58_FloorPit_invisible_D2C_GraphicIndice : k52_FloorPit_D2C_GraphicIndice, frameFloorPitD2C); + drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k58_FloorPit_invisible_D2C_GraphicIndice : k52_FloorPit_D2C_GraphicIndice, frameFloorPitD2C); // No break on purpose case kDMElementTypeTeleporter: case k1_CorridorElemType: order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k4_viewFloor_D2C); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k4_viewFloor_D2C); drawCeilingPit(k64_ceilingPitD2C_GraphicIndice, &frameCeilingPitD2C, posX, posY, false); break; default: @@ -1683,9 +1683,9 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k3_ViewSquare_D2C, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k3_ViewSquare_D2C, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k3_ViewSquare_D2C], _frameWalls163[k3_ViewSquare_D2C]._box); } @@ -1716,24 +1716,24 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD1L, frameStairsUpFrontD1L); else drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD1L, frameStairsDownFrontD1L); order = k0x0032_CellOrder_BackRight_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k6_viewFloor_D1L); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k6_viewFloor_D1L); drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1L, posX, posY, false); break; case kDMElementTypeWall: drawWallSetBitmap(_bitmapWallSetD1LCR, _frameWalls163[k7_ViewSquare_D1L]); - isDrawnWallOrnAnAlcove(squareAspect[k2_RightWallOrnOrdAspect], k10_ViewWall_D1L_RIGHT); + isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectRightWallOrnOrd], k10_ViewWall_D1L_RIGHT); return; case kDMElementTypeStairsSide: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpSideD1L, frameStairsUpSideD1L); else drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownSideD1L, frameStairsDownSideD1L); @@ -1741,25 +1741,25 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) { case k16_DoorSideElemType: order = k0x0032_CellOrder_BackRight_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k6_viewFloor_D1L); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k6_viewFloor_D1L); drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1L, posX, posY, false); break; case k17_DoorFrontElemType: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k6_viewFloor_D1L); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k7_ViewSquare_D1L, k0x0028_CellOrder_DoorPass1_BackRight); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k6_viewFloor_D1L); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k7_ViewSquare_D1L, k0x0028_CellOrder_DoorPass1_BackRight); drawWallSetBitmap(_bitmapWallSetDoorFrameTopD1LCR, doorFrameTopD1L); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD1LCR, bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, &doorFrameD1L); order = k0x0039_CellOrder_DoorPass2_FrontRight; break; case kDMElementTypePit: - drawFloorPitOrStairsBitmap(squareAspect[k2_PitInvisibleAspect] ? k59_floorPit_invisible_D1L_GraphicIndice : k53_FloorPit_D1L_GraphicIndice, frameFloorPitD1L); + drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k59_floorPit_invisible_D1L_GraphicIndice : k53_FloorPit_D1L_GraphicIndice, frameFloorPitD1L); // No break on purpose case kDMElementTypeTeleporter: case k1_CorridorElemType: order = k0x0032_CellOrder_BackRight_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k6_viewFloor_D1L); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k6_viewFloor_D1L); drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1L, posX, posY, false); break; default: @@ -1768,9 +1768,9 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k7_ViewSquare_D1L, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k7_ViewSquare_D1L, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k7_ViewSquare_D1L], _frameWalls163[k7_ViewSquare_D1L]._box); } @@ -1801,23 +1801,23 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexUpFrontD1L, frameStairsUpFrontD1R); else drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownFrontD1L, frameStairsDownFrontD1R); order = k0x0041_CellOrder_BackLeft_FrontLeft; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k8_viewFloor_D1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k8_viewFloor_D1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1R, posX, posY, true); break; case kDMElementTypeWall: drawWallSetBitmap(_bitmapWallSetD1LCR, _frameWalls163[k8_ViewSquare_D1R]); - isDrawnWallOrnAnAlcove(squareAspect[k4_LeftWallOrnOrdAspect], k11_ViewWall_D1R_LEFT); + isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectLeftWallOrnOrd], k11_ViewWall_D1R_LEFT); return; case kDMElementTypeStairsSide: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexUpSideD1L, frameStairsUpSideD1R); else drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownSideD1L, frameStairsDownSideD1R); @@ -1825,25 +1825,25 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) { // No break on purpose case k16_DoorSideElemType: order = k0x0041_CellOrder_BackLeft_FrontLeft; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k8_viewFloor_D1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k8_viewFloor_D1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1R, posX, posY, true); break; case k17_DoorFrontElemType: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k8_viewFloor_D1R); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k8_ViewSquare_D1R, k0x0018_CellOrder_DoorPass1_BackLeft); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k8_viewFloor_D1R); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k8_ViewSquare_D1R, k0x0018_CellOrder_DoorPass1_BackLeft); drawWallSetBitmap(_bitmapWallSetDoorFrameTopD1LCR, doorFrameTopD1R); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD1LCR, bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, &doorFrameD1R); order = k0x0049_CellOrder_DoorPass2_FrontLeft; break; case kDMElementTypePit: - drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[k2_PitInvisibleAspect] ? k59_floorPit_invisible_D1L_GraphicIndice + drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[kDMSquareAspectPitInvisible] ? k59_floorPit_invisible_D1L_GraphicIndice : k53_FloorPit_D1L_GraphicIndice, frameFloorPitD1R); // No break on purpose case kDMElementTypeTeleporter: case k1_CorridorElemType: order = k0x0041_CellOrder_BackLeft_FrontLeft; - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k8_viewFloor_D1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k8_viewFloor_D1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1R, posX, posY, true); break; default: @@ -1852,9 +1852,9 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k8_ViewSquare_D1R, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k8_ViewSquare_D1R, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k8_ViewSquare_D1R], _frameWalls163[k8_ViewSquare_D1R]._box); } @@ -1871,16 +1871,16 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) { bool skip = false; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (_vm->_dungeonMan->_squareAheadElement = (ElementType)squareAspect[k0_ElementAspect]) { + switch (_vm->_dungeonMan->_squareAheadElement = (ElementType)squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD1C, frameStairsUpFrontD1C); else drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD1C, frameStairsDownFrontD1C); order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k7_viewFloor_D1C); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k7_viewFloor_D1C); drawCeilingPit(k66_ceilingPitD1C_GraphicIndice, &frameCeilingPitD1C, posX, posY, false); break; case kDMElementTypeWall: @@ -1897,8 +1897,8 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) { boxThievesEyeVisibleArea, 0, 0, 48, 48, k10_ColorFlesh, 95, 95); } drawWallSetBitmapWithoutTransparency(_bitmapWallSetD1LCR, _frameWalls163[k6_ViewSquare_D1C]); - if (isDrawnWallOrnAnAlcove(squareAspect[k3_FrontWallOrnOrdAspect], k12_ViewWall_D1C_FRONT)) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k6_ViewSquare_D1C, k0x0000_CellOrder_Alcove); + if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], k12_ViewWall_D1C_FRONT)) + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k6_ViewSquare_D1C, k0x0000_CellOrder_Alcove); if (_vm->_championMan->_party._event73Count_ThievesEye) { blitToBitmap(getDerivedBitmap(k1_DerivedBitmapThievesEyeVisibleArea), @@ -1909,26 +1909,26 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) { } return; case k17_DoorFrontElemType: - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k7_viewFloor_D1C); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k6_ViewSquare_D1C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k7_viewFloor_D1C); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k6_ViewSquare_D1C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight); drawWallSetBitmap(_bitmapWallSetDoorFrameTopD1LCR, doorFrameTopD1C); drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD1C, _doorFrameLeftD1C); drawWallSetBitmap(_bitmapWallSetDoorFrameRightD1C, _doorFrameRightD1C); - if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[k3_DoorThingIndexAspect]].hasButton()) + if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[kDMSquareAspectDoorThingIndex]].hasButton()) drawDoorButton(_vm->indexToOrdinal(k0_DoorButton), k3_viewDoorButton_D1C); - drawDoor(squareAspect[k3_DoorThingIndexAspect], squareAspect[k2_DoorStateAspect], + drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD1LCR, bitmapByteCount(96, 88), k2_ViewDoorOrnament_D1LCR, _doorFrameD1C); order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight; break; case kDMElementTypePit: - drawFloorPitOrStairsBitmap(squareAspect[k2_PitInvisibleAspect] ? k60_floorPitInvisibleD1C_GraphicIndice : k54_FloorPit_D1C_GraphicIndice, frameFloorPitD1C); + drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k60_floorPitInvisibleD1C_GraphicIndice : k54_FloorPit_D1C_GraphicIndice, frameFloorPitD1C); // No break on purpose case kDMElementTypeTeleporter: case k1_CorridorElemType: order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight; /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */ - drawFloorOrnament(squareAspect[k4_FloorOrnOrdAspect], k7_viewFloor_D1C); + drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], k7_viewFloor_D1C); drawCeilingPit(k66_ceilingPitD1C_GraphicIndice, &frameCeilingPitD1C, posX, posY, false); break; default: @@ -1937,9 +1937,9 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) { } if (!skip) - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k6_ViewSquare_D1C, order); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k6_ViewSquare_D1C, order); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k6_ViewSquare_D1C], _frameWalls163[k6_ViewSquare_D1C]._box); } @@ -1950,19 +1950,19 @@ void DisplayMan::drawSquareD0L(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case k0_WallElemType: drawWallSetBitmap(bitmapWallSetWallD0L, _frameWalls163[k10_ViewSquare_D0L]); break; case k1_CorridorElemType: case k5_TeleporterElemType: case k16_DoorSideElemType: - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k10_ViewSquare_D0L, k0x0002_CellOrder_BackRight); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k10_ViewSquare_D0L, k0x0002_CellOrder_BackRight); break; case k2_PitElemType: - drawFloorPitOrStairsBitmap(squareAspect[k2_PitInvisibleAspect] ? k61_floorPitInvisibleD0L_GraphicIndice : k55_FloorPit_D0L_GraphicIndice, frameFloorPitD0L); + drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k61_floorPitInvisibleD0L_GraphicIndice : k55_FloorPit_D0L_GraphicIndice, frameFloorPitD0L); case k18_StairsSideElemType: - if (squareAspect[k2_StairsUpAspect]) + if (squareAspect[kDMSquareAspectStairsUp]) drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexSideD0L, frameStairsSideD0L); break; default: @@ -1970,7 +1970,7 @@ void DisplayMan::drawSquareD0L(Direction dir, int16 posX, int16 posY) { } drawCeilingPit(k67_ceilingPitD0L_grahicIndice, &frameCeilingPitD0L, posX, posY, false); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k10_ViewSquare_D0L], _frameWalls163[k10_ViewSquare_D0L]._box); } @@ -1982,24 +1982,24 @@ void DisplayMan::drawSquareD0R(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case kDMElementTypeStairsSide: drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexSideD0L, frameStairsSideD0R); return; case kDMElementTypePit: - drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[k2_PitInvisibleAspect] ? k61_floorPitInvisibleD0L_GraphicIndice + drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[kDMSquareAspectPitInvisible] ? k61_floorPitInvisibleD0L_GraphicIndice : k55_FloorPit_D0L_GraphicIndice, frameFloorPitD0R); case k1_CorridorElemType: case k16_DoorSideElemType: case kDMElementTypeTeleporter: drawCeilingPit(k67_ceilingPitD0L_grahicIndice, &frameCeilingPitD0R, posX, posY, true); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k11_ViewSquare_D0R, k0x0001_CellOrder_BackLeft); + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k11_ViewSquare_D0R, k0x0001_CellOrder_BackLeft); break; case kDMElementTypeWall: drawWallSetBitmap(_bitmapWallSetWallD0R, _frameWalls163[k11_ViewSquare_D0R]); return; } - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k11_ViewSquare_D0R], _frameWalls163[k11_ViewSquare_D0R]._box); } @@ -2016,7 +2016,7 @@ void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) { uint16 squareAspect[5]; _vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY); - switch (squareAspect[k0_ElementAspect]) { + switch (squareAspect[kDMSquareAspectElement]) { case k16_DoorSideElemType: if (_vm->_championMan->_party._event73Count_ThievesEye) { memmove(_tmpBitmap, _bitmapWallSetDoorFrameFront, 32 * 123); @@ -2028,7 +2028,7 @@ void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) { drawWallSetBitmap(_bitmapWallSetDoorFrameFront, doorFrameD0C); break; case kDMElementTypeStairsFront: - if (squareAspect[k2_StairsUpAspect]) { + if (squareAspect[kDMSquareAspectStairsUp]) { drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD0CLeft, frameStairsUpFrontD0L); drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexUpFrontD0CLeft, frameStairsUpFrontD0R); } else { @@ -2037,12 +2037,12 @@ void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) { } break; case kDMElementTypePit: - drawFloorPitOrStairsBitmap(squareAspect[k2_PitInvisibleAspect] ? k62_flootPitInvisibleD0C_graphicIndice : k56_FloorPit_D0C_GraphicIndice, frameFloorPitD0C); + drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k62_flootPitInvisibleD0C_graphicIndice : k56_FloorPit_D0C_GraphicIndice, frameFloorPitD0C); break; } drawCeilingPit(k68_ceilingPitD0C_graphicIndice, &frameCeilingPitD0C, posX, posY, false); - drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[k1_FirstGroupOrObjectAspect]), dir, posX, posY, k9_ViewSquare_D0C, k0x0021_CellOrder_BackLeft_BackRight); - if ((squareAspect[k0_ElementAspect] == kDMElementTypeTeleporter) && squareAspect[k2_TeleporterVisibleAspect]) + drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k9_ViewSquare_D0C, k0x0021_CellOrder_BackLeft_BackRight); + if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible]) drawField(&_fieldAspects188[k9_ViewSquare_D0C], _frameWalls163[k9_ViewSquare_D0C]._box); } @@ -2627,7 +2627,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex unsigned char inscriptionString[70]; bool isInscription = (wallOrnamentIndex == _vm->_dungeonMan->_currMapInscriptionWallOrnIndex); if (isInscription) - _vm->_dungeonMan->decodeText((char *)inscriptionString, _inscriptionThing, k0_TextTypeInscription); + _vm->_dungeonMan->decodeText((char *)inscriptionString, _inscriptionThing, kDMTextTypeInscription); int16 blitPosX; byte *ornBlitBitmap; diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 1424fd8ebd..1efc905d42 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -308,7 +308,7 @@ void InventoryMan::drawPanelScroll(Scroll *scroll) { DisplayMan &dispMan = *_vm->_displayMan; char stringFirstLine[300]; - _vm->_dungeonMan->decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible)); + _vm->_dungeonMan->decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(kDMTextTypeScroll | k0x8000_DecodeEvenIfInvisible)); char *charRed = stringFirstLine; while (*charRed && (*charRed != '\n')) charRed++; diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 57617c57d7..5e1dd58a4d 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -1141,22 +1141,22 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) { int16 actionHandWeaponClass = weaponInfoActionHand->_class; int16 readyHandWeaponClass = weaponInfoReadyHand->_class; int16 stepEnergy = actionHandWeaponClass; - if ((actionHandWeaponClass >= k16_WeaponClassFirstBow) && (actionHandWeaponClass <= k31_WeaponClassLastBow)) { - if (readyHandWeaponClass != k10_WeaponClassBowAmmunition) { + if ((actionHandWeaponClass >= kDMWeaponClassFirstBow) && (actionHandWeaponClass <= kDMWeaponClassLastBow)) { + if (readyHandWeaponClass != kDMWeaponClassBowAmmunition) { _actionDamage = kM2_damageNoAmmunition; actionExperienceGain = 0; actionPerformed = false; break; } - stepEnergy -= k16_WeaponClassFirstBow; - } else if ((actionHandWeaponClass >= k32_WeaponClassFirstSling) && (actionHandWeaponClass <= k47_WeaponClassLastSling)) { - if (readyHandWeaponClass != k11_WeaponClassSlingAmmunition) { + stepEnergy -= kDMWeaponClassFirstBow; + } else if ((actionHandWeaponClass >= kDMWeaponClassFirstSling) && (actionHandWeaponClass <= kDMWeaponClassLastSling)) { + if (readyHandWeaponClass != kDMWeaponClassSlingAmmunition) { _actionDamage = kM2_damageNoAmmunition; actionExperienceGain = 0; actionPerformed = false; break; } - stepEnergy -= k32_WeaponClassFirstSling; + stepEnergy -= kDMWeaponClassFirstSling; } setChampionDirectionToPartyDirection(curChampion); diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp index 3339eb67a2..e464c9f89c 100644 --- a/engines/dm/movesens.cpp +++ b/engines/dm/movesens.cpp @@ -728,7 +728,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing if (curThingType == kDMThingTypeGroup) squareContainsGroup = true; else if ((curThingType == kDMstringTypeText) && (thingType == kDMThingTypeParty) && addThing && !partySquare) { - _vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, curThing, k1_TextTypeMessage); + _vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, curThing, kDMTextTypeMessage); _vm->_textMan->printMessage(k15_ColorWhite, _vm->_stringBuildBuffer); } else if ((curThingType > kDMThingTypeGroup) && (curThingType < kDMThingTypeProjectile)) { squareContainsObject = true; diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp index 211c671076..b7b932f9b5 100644 --- a/engines/dm/projexpl.cpp +++ b/engines/dm/projexpl.cpp @@ -136,7 +136,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in int16 iconIndex = _vm->_objectMan->getIconIndex(projectileAssociatedThing); if ((projectileThingData->_attack > _vm->getRandomNumber(128)) - && getFlag(associatedAllowedSlots, k0x0100_ObjectAllowedSlotPouchPassAndThroughDoors) + && getFlag(associatedAllowedSlots, kDMMaskPouchPassAndThroughDoors) && ( (projectileAssociatedThingType != kDMThingTypeJunk) || (iconIndex < kDMIconIndiceJunkIronKey) || (iconIndex > kDMIconIndiceJunkMasterKey) diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index c9e26ce046..8bfa6ef0b6 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -715,7 +715,7 @@ void Timeline::processEventSquareCorridor(TimelineEvent *event) { textString->setVisible((event->_Cu.A._effect == k0_SensorEffSet)); if (!textCurrentlyVisible && textString->isVisible() && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (mapX == _vm->_dungeonMan->_partyMapX) && (mapY == _vm->_dungeonMan->_partyMapY)) { - _vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, curThing, k1_TextTypeMessage); + _vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, curThing, kDMTextTypeMessage); _vm->_textMan->printMessage(k15_ColorWhite, _vm->_stringBuildBuffer); } } else if (curThingType == kDMThingTypeSensor) { |