diff options
-rw-r--r-- | engines/dm/champion.cpp | 36 | ||||
-rw-r--r-- | engines/dm/dm.cpp | 10 | ||||
-rw-r--r-- | engines/dm/dungeonman.cpp | 4 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 8 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 24 | ||||
-rw-r--r-- | engines/dm/group.cpp | 24 | ||||
-rw-r--r-- | engines/dm/group.h | 94 | ||||
-rw-r--r-- | engines/dm/inventory.cpp | 124 | ||||
-rw-r--r-- | engines/dm/inventory.h | 26 | ||||
-rw-r--r-- | engines/dm/loadsave.cpp | 2 | ||||
-rw-r--r-- | engines/dm/loadsave.h | 4 | ||||
-rw-r--r-- | engines/dm/menus.cpp | 110 | ||||
-rw-r--r-- | engines/dm/menus.h | 14 | ||||
-rw-r--r-- | engines/dm/objectman.cpp | 142 | ||||
-rw-r--r-- | engines/dm/objectman.h | 14 | ||||
-rw-r--r-- | engines/dm/text.cpp | 16 | ||||
-rw-r--r-- | engines/dm/timeline.cpp | 20 | ||||
-rw-r--r-- | engines/dm/timeline.h | 112 |
18 files changed, 392 insertions, 392 deletions
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp index 0e062bbee6..17ee18124b 100644 --- a/engines/dm/champion.cpp +++ b/engines/dm/champion.cpp @@ -282,7 +282,7 @@ bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) || (currIconIndex == k195_IconIndicePotionEmptyFlask)) {
IconIndice newIconIndex = objMan.getIconIndex(thing);
if (newIconIndex != currIconIndex) {
- if ((slotBoxIndex < kSlotBoxInventoryFirstSlot) && !_g420_mousePointerHiddenToDrawChangedObjIconOnScreen) {
+ if ((slotBoxIndex < k8_SlotBoxInventoryFirstSlot) && !_g420_mousePointerHiddenToDrawChangedObjIconOnScreen) {
_g420_mousePointerHiddenToDrawChangedObjIconOnScreen = true;
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
}
@@ -299,7 +299,7 @@ void ChampionMan::drawChangedObjectIcons() { ObjectMan &objMan = *_vm->_objectMan;
MenuMan &menuMan = *_vm->_menuMan;
- uint16 invChampOrdinal = invMan._inventoryChampionOrdinal;
+ uint16 invChampOrdinal = invMan._g432_inventoryChampionOrdinal;
if (_g299_candidateChampionOrdinal && !invChampOrdinal)
return;
@@ -313,7 +313,7 @@ void ChampionMan::drawChangedObjectIcons() { if (iconIndex != leaderHandObjIconIndex) {
_g420_mousePointerHiddenToDrawChangedObjIconOnScreen = true;
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
- objMan.extractIconFromBitmap(iconIndex, objMan._objectIconForMousePointer);
+ objMan.extractIconFromBitmap(iconIndex, objMan._g412_objectIconForMousePointer);
warning("MISSING CODE: F0068_MOUSE_SetPointerToObject");
_g413_leaderHandObjectIconIndex = iconIndex;
objMan.drawLeaderObjectName(_414_leaderHandObject);
@@ -338,17 +338,17 @@ void ChampionMan::drawChangedObjectIcons() { uint16 drawViewport = 0;
for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++, thing++) {
- uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + kSlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
+ uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
drawViewport |= objIconChanged;
if (objIconChanged && (slotIndex == k1_ChampionSlotActionHand)) {
menuMan.drawActionIcon((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
}
}
- if (invMan._panelContent = kPanelContentChest) {
- thing = invMan._chestSlots;
+ if (invMan._g424_panelContent = k4_PanelContentChest) {
+ thing = invMan._g425_chestSlots;
for (int16 slotIndex = 0; slotIndex < 8; ++slotIndex, thing++) {
- drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + kSlotBoxChestFirstSlot, *thing) ? 1 : 0);
+ drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0);
}
}
@@ -374,7 +374,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio Champion *champ = &_champions[champIndex];
if (slotIndex >= k30_ChampionSlotChest_1) {
- invMan._chestSlots[slotIndex - k30_ChampionSlotChest_1] = thing;
+ invMan._g425_chestSlots[slotIndex - k30_ChampionSlotChest_1] = thing;
} else {
champ->setSlot(slotIndex, thing);
}
@@ -382,7 +382,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio champ->_load += dunMan.getObjectWeight(thing);
champ->setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
IconIndice iconIndex = objMan.getIconIndex(thing);
- bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._inventoryChampionOrdinal);
+ bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing);
uint16 *rawObjPtr = dunMan.getThingData(thing);
@@ -551,7 +551,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) { _g299_candidateChampionOrdinal = prevChampCount + 1;
if (++_g305_partyChampionCount == 1) {
_vm->_eventMan->commandSetLeader(k0_ChampionFirst);
- _vm->_menuMan->_refreshActionArea = true;
+ _vm->_menuMan->_g508_refreshActionArea = true;
} else {
_vm->_menuMan->clearActingChampion();
_vm->_menuMan->drawActionIcon((ChampionIndex)(_g305_partyChampionCount - 1));
@@ -666,7 +666,7 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) { warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
Box box;
- box._x1 = champIndex * kChampionStatusBoxSpacing + 46;
+ box._x1 = champIndex * k69_ChampionStatusBoxSpacing + 46;
box._x2 = box._x1 + 3 + 1;
box._y1 = 2;
box._y2 = 26 + 1;
@@ -723,7 +723,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { EventManager &eventMan = *_vm->_eventMan;
Box box;
- int16 champStatusBoxX = champIndex * kChampionStatusBoxSpacing;
+ int16 champStatusBoxX = champIndex * k69_ChampionStatusBoxSpacing;
Champion *champ = &_champions[champIndex];
uint16 champAttributes = champ->getAttributes();
if (!((champAttributes) & (k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon |
@@ -731,7 +731,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) { k0x8000_ChampionAttributeActionHand))) {
return;
}
- bool isInventoryChamp = (_vm->indexToOrdinal(champIndex) == invMan._inventoryChampionOrdinal);
+ bool isInventoryChamp = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
dispMan._g578_useByteBoxCoordinates = false;
if (champAttributes & k0x1000_ChampionAttributeStatusBox) {
box._y1 = 0;
@@ -905,7 +905,7 @@ void ChampionMan::drawHealthStaminaManaValues(Champion* champ) { void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) {
int16 nativeBitmapIndex = -1;
Champion *champ = &_champions[champIndex];
- bool isInventoryChamp = (_vm->_inventoryMan->_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex));
+ bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex));
uint16 slotBoxIndex;
if (!isInventoryChamp) { /* If drawing a slot for a champion other than the champion whose inventory is open */
@@ -914,17 +914,17 @@ void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) { }
slotBoxIndex = (champIndex << 1) + slotIndex;
} else {
- slotBoxIndex = kSlotBoxInventoryFirstSlot + slotIndex;
+ slotBoxIndex = k8_SlotBoxInventoryFirstSlot + slotIndex;
}
Thing thing;
if (slotIndex >= k30_ChampionSlotChest_1) {
- thing = _vm->_inventoryMan->_chestSlots[slotIndex - k30_ChampionSlotChest_1];
+ thing = _vm->_inventoryMan->_g425_chestSlots[slotIndex - k30_ChampionSlotChest_1];
} else {
thing = champ->getSlot(slotIndex);
}
- SlotBox *slotBox = &_vm->_objectMan->_slotBoxes[slotBoxIndex];
+ SlotBox *slotBox = &_vm->_objectMan->_g30_slotBoxes[slotBoxIndex];
Box box;
box._x1 = slotBox->_x - 1;
box._y1 = slotBox->_y - 1;
@@ -999,7 +999,7 @@ void ChampionMan::renameChampion(Champion* champ) { box._x2 = box._x1 + 167;
dispMan.clearScreenBox(k12_ColorDarkestGray, box, g296_DungeonViewport);
- dispMan.blitToScreen(dispMan.getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0, gBoxPanel, k4_ColorCyan, g296_DungeonViewport);
+ dispMan.blitToScreen(dispMan.getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0, g32_BoxPanel, k4_ColorCyan, g296_DungeonViewport);
textMan.printToViewport(177, 58, k13_ColorLightestGray, "_______");
textMan.printToViewport(105, 76, k13_ColorLightestGray, "___________________");
Common::Point clickPos;
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 6f0c4658e4..5c854d5209 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -148,7 +148,7 @@ void DMEngine::initializeGame() { _eventMan->initMouse(); - while (_loadsaveMan->loadgame() != kLoadgameSuccess) { + while (_loadsaveMan->loadgame() != k1_LoadgameSuccess) { warning("TODO: F0441_STARTEND_ProcessEntrance"); } @@ -172,7 +172,7 @@ void DMEngine::startGame() { _eventMan->_g341_highlightBoxEnabled = false; _championMan->_g300_partyIsSleeping = false; _championMan->_g506_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone); - _menuMan->_actionAreaContainsIcons = true; + _menuMan->_g509_actionAreaContainsIcons = true; _eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone); _eventMan->_g441_primaryMouseInput = g447_PrimaryMouseInput_Interface; @@ -238,8 +238,8 @@ void DMEngine::gameloop() { _dungeonMan->_currMap._g308_partyDir = kDirNorth; - warning("DUMMY CODE: setting InventoryMan::_inventoryChampionOrdinal to zero"); - _inventoryMan->_inventoryChampionOrdinal = 0; + warning("DUMMY CODE: setting InventoryMan::_g432_inventoryChampionOrdinal to zero"); + _inventoryMan->_g432_inventoryChampionOrdinal = 0; warning("DUMMY CODE: clearing screen to black"); // in loop below while (true) { _g321_stopWaitingForPlayerInput = false; @@ -251,7 +251,7 @@ void DMEngine::gameloop() { _eventMan->processCommandQueue(); //} while (!_g321_stopWaitingForPlayerInput || !_g301_gameTimeTicking); - if (!_inventoryMan->_inventoryChampionOrdinal && !_championMan->_g300_partyIsSleeping) { + if (!_inventoryMan->_g432_inventoryChampionOrdinal && !_championMan->_g300_partyIsSleeping) { Box box(0, 224, 0, 126); _displayMan->clearScreenBox(k0_ColorBlack, box, g296_DungeonViewport); // dummy code _displayMan->drawDungeon(_dungeonMan->_currMap._g308_partyDir, _dungeonMan->_currMap._g306_partyPosX, _dungeonMan->_currMap._g307_partyPosY); diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp index 7b12bf4752..df61b45149 100644 --- a/engines/dm/dungeonman.cpp +++ b/engines/dm/dungeonman.cpp @@ -652,7 +652,7 @@ void DungeonMan::loadDungeonFile() { // TODO: ??? what this if (_messages._g298_newGame) - _vm->_timeline->_eventMaxCount = 100; + _vm->_timeline->_g369_eventMaxCount = 100; // load things for (uint16 thingType = k0_DoorThingType; thingType < k16_ThingTypeTotal; ++thingType) { @@ -699,7 +699,7 @@ void DungeonMan::loadDungeonFile() { if (_messages._g298_newGame) { if ((thingType == k4_GroupThingType) || thingType >= k14_ProjectileThingType) - _vm->_timeline->_eventMaxCount += _g278_fileHeader._thingCounts[thingType]; + _vm->_timeline->_g369_eventMaxCount += _g278_fileHeader._thingCounts[thingType]; for (uint16 i = 0; i < g236_AdditionalThingCounts[thingType]; ++i) { _dunData._g284_thingsData[thingType][thingCount + i][0] = Thing::_none.toUint16(); } diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 69886e54c6..6d59727e2b 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -616,7 +616,7 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane Box box; box._y1 = 0; box._y2 = 28 + 1; - box._x1 = championIndex * kChampionStatusBoxSpacing; + box._x1 = championIndex * k69_ChampionStatusBoxSpacing; box._x2 = box._x1 + 66 + 1; dispMan._g578_useByteBoxCoordinates = false; dispMan.clearScreenBox(k0_ColorBlack, box); @@ -679,15 +679,15 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) { InventoryMan &invMan = *_vm->_inventoryMan; CommandType commandType; - switch (invMan._panelContent) { - case kPanelContentChest: + switch (invMan._g424_panelContent) { + case k4_PanelContentChest: if (champMan._g411_leaderIndex == kM1_ChampionNone) // if no leader return; commandType = getCommandTypeFromMouseInput(g456_MouseInput_PanelChest, Common::Point(x, y), k1_LeftMouseButton); if (commandType != k0_CommandNone) warning("MISSING CODE: F0302_CHAMPION_ProcessCommands28To65_ClickOnSlotBox"); break; - case kPanelContentResurrectReincarnate: + case k5_PanelContentResurrectReincarnate: if (!champMan._g415_leaderEmptyHanded) break; commandType = getCommandTypeFromMouseInput(g457_MouseInput_PanelResurrectReincarnateCancel, Common::Point(x, y), k1_LeftMouseButton); diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index c93bf1db6d..62bf070579 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -2327,17 +2327,17 @@ T0115015_DrawProjectileAsObject: goto T0115129_DrawProjectiles; /* Skip code to draw creatures */ if (group == nullptr) { /* If all creature data and info has not already been gathered */ group = (Group*)dunMan.getThingData(groupThing); - activeGroup = &_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]; + activeGroup = &_vm->_groupMan->_g375_activeGroups[group->getActiveGroupIndex()]; creatureInfo = &g243_CreatureInfo[group->_type]; creatureAspectStruct = &g219_CreatureAspects[creatureInfo->_creatureAspectIndex]; - creatureSize = getFlag(creatureInfo->_attributes, kMaskCreatureInfo_size); + creatureSize = getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size); creatureGraphicInfoGreen = creatureInfo->_graphicInfo; } objectAspect = (ObjectAspect*)creatureAspectStruct; if (AL_0_creatureIndexRed = _vm->_groupMan->getCreatureOrdinalInCell(group, cellYellowBear)) { /* If there is a creature on the cell being processed */ AL_0_creatureIndexRed--; /* Convert ordinal to index */ creatureIndexGreen = AL_0_creatureIndexRed; - } else if (creatureSize == kMaskCreatureSizeHalf) { + } else if (creatureSize == k1_MaskCreatureSizeHalf) { AL_0_creatureIndexRed = 0; creatureIndexGreen = -1; } else { @@ -2346,18 +2346,18 @@ T0115015_DrawProjectileAsObject: creatureDirectionDelta = (directionParam - _vm->_groupMan->getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed)) % 3; twoHalfSquareCreaturesFrontView = false; - if ((AL_4_groupCells = activeGroup->_cells) == kCreatureTypeSingleCenteredCreature) { /* If there is a single centered creature in the group */ + if ((AL_4_groupCells = activeGroup->_cells) == k255_CreatureTypeSingleCenteredCreature) { /* If there is a single centered creature in the group */ if (remainingViewCellOrdinalsToProcess || (doorFrontViewDrawingPass == 1)) /* Do not draw a single centered creature now, wait until second pass (for a front view door) or until all cells have been drawn so the creature is drawn over all the objects on the floor */ goto T0115129_DrawProjectiles; drawCreaturesCompleted = true; - if ((creatureSize == kMaskCreatureSizeHalf) && (creatureDirectionDelta & 0x0001)) { /* Side view of half square creature */ + if ((creatureSize == k1_MaskCreatureSizeHalf) && (creatureDirectionDelta & 0x0001)) { /* Side view of half square creature */ AL_2_viewCell = k3_HalfSizedViewCell_CenterColumn; } else { AL_2_viewCell = k4_HalfSizedViewCell_FrontRow; } - } else if ((creatureSize == kMaskCreatureSizeHalf) && (drawingLastBackRowCell || !remainingViewCellOrdinalsToProcess || (creatureIndexGreen < 0))) { + } else if ((creatureSize == k1_MaskCreatureSizeHalf) && (drawingLastBackRowCell || !remainingViewCellOrdinalsToProcess || (creatureIndexGreen < 0))) { if (drawingLastBackRowCell && (doorFrontViewDrawingPass != 2)) { if ((creatureIndexGreen >= 0) && (creatureDirectionDelta & 0x0001)) { AL_2_viewCell = k2_HalfSizedViewCell_BackRow; /* Side view of a half square creature on the back row. Drawn during pass 1 for a door square */ @@ -2388,7 +2388,7 @@ T0115015_DrawProjectileAsObject: goto T0115129_DrawProjectiles; } - } else if (creatureSize != kMaskCreatureSizeQuarter) + } else if (creatureSize != k0_MaskCreatureSizeQuarter) goto T0115129_DrawProjectiles; @@ -2411,7 +2411,7 @@ T0115077_DrawSecondHalfSquareCreature: sourceHeight = heightRedEagle = ((CreatureAspect*)objectAspect)->_heightSide; } else { useCreatureBackBitmap = getFlag(AL_0_creatureGraphicInfoRed, k0x0010_CreatureInfoGraphicMaskBack) && (creatureDirectionDelta == 0); - if (useCreatureAttackBitmap = !useCreatureBackBitmap && getFlag(creatureAspectInt, kMaskActiveGroupIsAttacking) + if (useCreatureAttackBitmap = !useCreatureBackBitmap && getFlag(creatureAspectInt, k0x0080_MaskActiveGroupIsAttacking) && getFlag(AL_0_creatureGraphicInfoRed, k0x0020_CreatureInfoGraphicMaskAttack)) { useFlippedHorizontallyCreatureFrontImage = false; @@ -2441,7 +2441,7 @@ T0115077_DrawSecondHalfSquareCreature: } } else { if (useFlippedHorizontallyCreatureFrontImage = getFlag(AL_0_creatureGraphicInfoRed, k0x0004_CreatureInfoGraphicMaskFlipNonAttack) - && getFlag(creatureAspectInt, kMaskActiveGroupFlipBitmap)) { + && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) { derivedBitmapIndex += 2; if (getFlag(AL_0_creatureGraphicInfoRed, k0x0008_CreatureInfoGraphicMaskSide)) { derivedBitmapIndex += 2; @@ -2470,7 +2470,7 @@ T0115077_DrawSecondHalfSquareCreature: } else { if (useCreatureBackBitmap || !useFlippedHorizontallyCreatureFrontImage) { AL_6_bitmapRedBanana = getBitmap(AL_4_nativeBitmapIndex); - if (useCreatureAttackBitmap && getFlag(creatureAspectInt, kMaskActiveGroupFlipBitmap)) { + if (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) { memcpy(_g74_tmpBitmap, AL_6_bitmapRedBanana, byteWidth * heightRedEagle * sizeof(byte)); flipBitmapHorizontal(_g74_tmpBitmap, byteWidth, heightRedEagle); AL_6_bitmapRedBanana = _g74_tmpBitmap; @@ -2518,7 +2518,7 @@ T0115077_DrawSecondHalfSquareCreature: warning("IGNORED CODE: F0493_CACHE_AddDerivedBitmap"); } if ((useCreatureSideBitmap && (creatureDirectionDelta == 1)) || /* If creature is viewed from the right, the side view must be flipped */ - (useCreatureAttackBitmap && getFlag(creatureAspectInt, kMaskActiveGroupFlipBitmap)) || + (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) || (useCreatureSpecialD2FrontBitmap && getFlag(AL_0_creatureGraphicInfoRed, k0x0100_CreatureInfoGraphicMaskSpecialD2FrontIsFlipped)) || (useFlippedHorizontallyCreatureFrontImage && getFlag(AL_0_creatureGraphicInfoRed, k0x0004_CreatureInfoGraphicMaskFlipNonAttack))) { /* If the graphic should be flipped */ if (!useFlippedHorizontallyCreatureFrontImage || !derivedBitmapInCache) { @@ -2608,7 +2608,7 @@ continue; projectileBitmapIndexData = 0; flipVertical = flipHorizontal = false; } else { - if (isOrientedWestEast((direction)(projectileDirection = _vm->_timeline->_events[projectile->_timerIndex]._C._projectile.getDir())) + if (isOrientedWestEast((direction)(projectileDirection = _vm->_timeline->_g370_events[projectile->_timerIndex]._C._projectile.getDir())) != isOrientedWestEast(directionParam)) { if (projectileAspectType == k2_ProjectileAspectHasRotation) { projectileBitmapIndexData = 1; diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 76aab71ff7..2891da3ec5 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -35,28 +35,28 @@ namespace DM { GroupMan::GroupMan(DMEngine* vm) : _vm(vm) { - _activeGroups = nullptr; + _g375_activeGroups = nullptr; } GroupMan::~GroupMan() { - delete[] _activeGroups; + delete[] _g375_activeGroups; } void GroupMan::initActiveGroups() { if (_vm->_dungeonMan->_messages._g298_newGame) - _maxActiveGroupCount = 60; - if (_activeGroups) - delete[] _activeGroups; - _activeGroups = new ActiveGroup[_maxActiveGroupCount]; - for (uint16 i = 0; i < _maxActiveGroupCount; ++i) - _activeGroups[i]._groupThingIndex = -1; + _g376_maxActiveGroupCount = 60; + if (_g375_activeGroups) + delete[] _g375_activeGroups; + _g375_activeGroups = new ActiveGroup[_g376_maxActiveGroupCount]; + for (uint16 i = 0; i < _g376_maxActiveGroupCount; ++i) + _g375_activeGroups[i]._groupThingIndex = -1; } uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) { byte cells; cells = group->_cells; if (mapIndex == _vm->_dungeonMan->_currMap._g309_currPartyMapIndex) - cells = _activeGroups[cells]._cells; + cells = _g375_activeGroups[cells]._cells; return cells; } @@ -64,7 +64,7 @@ byte gGroupDirections[4] = {0x00, 0x55, 0xAA, 0xFF}; // @ G0258_auc_Graphic559_G uint16 GroupMan::getGroupDirections(Group* group, int16 mapIndex) { if (mapIndex == _vm->_dungeonMan->_currMap._g309_currPartyMapIndex) - return _activeGroups[group->getActiveGroupIndex()]._directions; + return _g375_activeGroups[group->getActiveGroupIndex()]._directions; return gGroupDirections[group->getDir()]; } @@ -72,11 +72,11 @@ uint16 GroupMan::getGroupDirections(Group* group, int16 mapIndex) { int16 GroupMan::getCreatureOrdinalInCell(Group* group, uint16 cell) { uint16 currMapIndex = _vm->_dungeonMan->_currMap._g272_index; byte groupCells = getGroupCells(group, currMapIndex); - if (groupCells == kCreatureTypeSingleCenteredCreature) + if (groupCells == k255_CreatureTypeSingleCenteredCreature) return _vm->indexToOrdinal(0); byte creatureIndex = group->getCount(); - if (getFlag(g243_CreatureInfo[group->_type]._attributes, kMaskCreatureInfo_size) == kMaskCreatureSizeHalf) { + if (getFlag(g243_CreatureInfo[group->_type]._attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) { if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1)) cell = returnPrevVal(cell); diff --git a/engines/dm/group.h b/engines/dm/group.h index b5198ed2a9..af7a4eb622 100644 --- a/engines/dm/group.h +++ b/engines/dm/group.h @@ -35,56 +35,56 @@ namespace DM { // this doesn't seem to be used anywhere at all /* Creature types */ enum CreatureType { - kCreatureTypeGiantScorpionScorpion = 0, // @ C00_CREATURE_GIANT_SCORPION_SCORPION - kCreatureTypeSwampSlimeSlime = 1, // @ C01_CREATURE_SWAMP_SLIME_SLIME_DEVIL - kCreatureTypeGiggler = 2, // @ C02_CREATURE_GIGGLER - kCreatureTypeWizardEyeFlyingEye = 3, // @ C03_CREATURE_WIZARD_EYE_FLYING_EYE - kCreatureTypePainRatHellHound = 4, // @ C04_CREATURE_PAIN_RAT_HELLHOUND - kCreatureTypeRuster = 5, // @ C05_CREATURE_RUSTER - kCreatureTypeScreamer = 6, // @ C06_CREATURE_SCREAMER - kCreatureTypeRockpile = 7, // @ C07_CREATURE_ROCK_ROCKPILE - kCreatureTypeGhostRive = 8, // @ C08_CREATURE_GHOST_RIVE - kCreatureTypeStoneGolem = 9, // @ C09_CREATURE_STONE_GOLEM - kCreatureTypeMummy = 10, // @ C10_CREATURE_MUMMY - kCreatureTypeBlackFlame = 11, // @ C11_CREATURE_BLACK_FLAME - kCreatureTypeSkeleton = 12, // @ C12_CREATURE_SKELETON - kCreatureTypeCouatl = 13, // @ C13_CREATURE_COUATL - kCreatureTypeVexirk = 14, // @ C14_CREATURE_VEXIRK - kCreatureTypeMagnetaWormWorm = 15, // @ C15_CREATURE_MAGENTA_WORM_WORM - kCreatureTypeTrolinAntman = 16, // @ C16_CREATURE_TROLIN_ANTMAN - kCreatureTypeGiantWaspMuncher = 17, // @ C17_CREATURE_GIANT_WASP_MUNCHER - kCreatureTypeAnimatedArmourDethKnight = 18, // @ C18_CREATURE_ANIMATED_ARMOUR_DETH_KNIGHT - kCreatureTypeMaterializerZytaz = 19, // @ C19_CREATURE_MATERIALIZER_ZYTAZ - kCreatureTypeWaterElemental = 20, // @ C20_CREATURE_WATER_ELEMENTAL - kCreatureTypeOitu = 21, // @ C21_CREATURE_OITU - kCreatureTypeDemon = 22, // @ C22_CREATURE_DEMON - kCreatureTypeLordChaos = 23, // @ C23_CREATURE_LORD_CHAOS - kCreatureTypeRedDragon = 24, // @ C24_CREATURE_RED_DRAGON - kCreatureTypeLordOrder = 25, // @ C25_CREATURE_LORD_ORDER - kCreatureTypeGreyLord = 26, // @ C26_CREATURE_GREY_LORD - kCreatureTypeSingleCenteredCreature = 255 // @ C255_SINGLE_CENTERED_CREATURE + k0_CreatureTypeGiantScorpionScorpion = 0, // @ C00_CREATURE_GIANT_SCORPION_SCORPION + k1_CreatureTypeSwampSlimeSlime = 1, // @ C01_CREATURE_SWAMP_SLIME_SLIME_DEVIL + k2_CreatureTypeGiggler = 2, // @ C02_CREATURE_GIGGLER + k3_CreatureTypeWizardEyeFlyingEye = 3, // @ C03_CREATURE_WIZARD_EYE_FLYING_EYE + k4_CreatureTypePainRatHellHound = 4, // @ C04_CREATURE_PAIN_RAT_HELLHOUND + k5_CreatureTypeRuster = 5, // @ C05_CREATURE_RUSTER + k6_CreatureTypeScreamer = 6, // @ C06_CREATURE_SCREAMER + k7_CreatureTypeRockpile = 7, // @ C07_CREATURE_ROCK_ROCKPILE + k8_CreatureTypeGhostRive = 8, // @ C08_CREATURE_GHOST_RIVE + k9_CreatureTypeStoneGolem = 9, // @ C09_CREATURE_STONE_GOLEM + k10_CreatureTypeMummy = 10, // @ C10_CREATURE_MUMMY + k11_CreatureTypeBlackFlame = 11, // @ C11_CREATURE_BLACK_FLAME + k12_CreatureTypeSkeleton = 12, // @ C12_CREATURE_SKELETON + k13_CreatureTypeCouatl = 13, // @ C13_CREATURE_COUATL + k14_CreatureTypeVexirk = 14, // @ C14_CREATURE_VEXIRK + k15_CreatureTypeMagnetaWormWorm = 15, // @ C15_CREATURE_MAGENTA_WORM_WORM + k16_CreatureTypeTrolinAntman = 16, // @ C16_CREATURE_TROLIN_ANTMAN + k17_CreatureTypeGiantWaspMuncher = 17, // @ C17_CREATURE_GIANT_WASP_MUNCHER + k18_CreatureTypeAnimatedArmourDethKnight = 18, // @ C18_CREATURE_ANIMATED_ARMOUR_DETH_KNIGHT + k19_CreatureTypeMaterializerZytaz = 19, // @ C19_CREATURE_MATERIALIZER_ZYTAZ + k20_CreatureTypeWaterElemental = 20, // @ C20_CREATURE_WATER_ELEMENTAL + k21_CreatureTypeOitu = 21, // @ C21_CREATURE_OITU + k22_CreatureTypeDemon = 22, // @ C22_CREATURE_DEMON + k23_CreatureTypeLordChaos = 23, // @ C23_CREATURE_LORD_CHAOS + k24_CreatureTypeRedDragon = 24, // @ C24_CREATURE_RED_DRAGON + k25_CreatureTypeLordOrder = 25, // @ C25_CREATURE_LORD_ORDER + k26_CreatureTypeGreyLord = 26, // @ C26_CREATURE_GREY_LORD + k255_CreatureTypeSingleCenteredCreature = 255 // @ C255_SINGLE_CENTERED_CREATURE }; -#define kMaskCreatureSizeQuarter 0 // @ C0_SIZE_QUARTER_SQUARE -#define kMaskCreatureSizeHalf 1 // @ C1_SIZE_HALF_SQUARE -#define kMaskCreatureSizeFull 2 // @ C2_SIZE_FULL_SQUARE +#define k0_MaskCreatureSizeQuarter 0 // @ C0_SIZE_QUARTER_SQUARE +#define k1_MaskCreatureSizeHalf 1 // @ C1_SIZE_HALF_SQUARE +#define k2_MaskCreatureSizeFull 2 // @ C2_SIZE_FULL_SQUARE -#define kMaskCreatureInfo_size 0x0003 // @ MASK0x0003_SIZE -#define kMaskCreatureInfo_sideAttack 0x0004 // @ MASK0x0004_SIDE_ATTACK -#define kMaskCreatureInfo_preferBackRow 0x0008 // @ MASK0x0008_PREFER_BACK_ROW -#define kMaskCreatureInfo_attackAnyChamp 0x0010 // @ MASK0x0010_ATTACK_ANY_CHAMPION -#define kMaskCreatureInfo_levitation 0x0020 // @ MASK0x0020_LEVITATION -#define kMaskCreatureInfo_nonMaterial 0x0040 // @ MASK0x0040_NON_MATERIAL -#define kMaskCreatureInfo_dropFixedPoss 0x0200 // @ MASK0x0200_DROP_FIXED_POSSESSIONS -#define kMaskCreatureInfo_keepThrownSharpWeapon 0x0400 // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS -#define kMaskCreatureInfo_seeInvisible 0x0800 // @ MASK0x0800_SEE_INVISIBLE -#define kMaskCreatureInfo_nightVision 0x1000 // @ MASK0x1000_NIGHT_VISION -#define kMaskCreatureInfo_archenemy 0x2000 // @ MASK0x2000_ARCHENEMY -#define kMaskCreatureInfo_magicmap 0x4000 // @ MASK0x4000_MAGICMAP +#define k0x0003_MaskCreatureInfo_size 0x0003 // @ MASK0x0003_SIZE +#define k0x0004_MaskCreatureInfo_sideAttack 0x0004 // @ MASK0x0004_SIDE_ATTACK +#define k0x0008_MaskCreatureInfo_preferBackRow 0x0008 // @ MASK0x0008_PREFER_BACK_ROW +#define k0x0010_MaskCreatureInfo_attackAnyChamp 0x0010 // @ MASK0x0010_ATTACK_ANY_CHAMPION +#define k0x0020_MaskCreatureInfo_levitation 0x0020 // @ MASK0x0020_LEVITATION +#define k0x0040_MaskCreatureInfo_nonMaterial 0x0040 // @ MASK0x0040_NON_MATERIAL +#define k0x0200_MaskCreatureInfo_dropFixedPoss 0x0200 // @ MASK0x0200_DROP_FIXED_POSSESSIONS +#define k0x0400_MaskCreatureInfo_keepThrownSharpWeapon 0x0400 // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS +#define k0x0800_MaskCreatureInfo_seeInvisible 0x0800 // @ MASK0x0800_SEE_INVISIBLE +#define k0x1000_MaskCreatureInfo_nightVision 0x1000 // @ MASK0x1000_NIGHT_VISION +#define k0x2000_MaskCreatureInfo_archenemy 0x2000 // @ MASK0x2000_ARCHENEMY +#define k0x4000_MaskCreatureInfo_magicmap 0x4000 // @ MASK0x4000_MAGICMAP -#define kMaskActiveGroupFlipBitmap 0x0040 // @ MASK0x0040_FLIP_BITMAP -#define kMaskActiveGroupIsAttacking 0x0080 // @ MASK0x0080_IS_ATTACKING +#define k0x0040_MaskActiveGroupFlipBitmap 0x0040 // @ MASK0x0040_FLIP_BITMAP +#define k0x0080_MaskActiveGroupIsAttacking 0x0080 // @ MASK0x0080_IS_ATTACKING class ActiveGroup { public: @@ -133,8 +133,8 @@ public: class GroupMan { DMEngine *_vm; public: - uint16 _maxActiveGroupCount = 60; // @ G0376_ui_MaximumActiveGroupCount - ActiveGroup *_activeGroups; // @ G0375_ps_ActiveGroups + uint16 _g376_maxActiveGroupCount = 60; // @ G0376_ui_MaximumActiveGroupCount + ActiveGroup *_g375_activeGroups; // @ G0375_ps_ActiveGroups GroupMan(DMEngine *vm); ~GroupMan(); void initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp index 0a95b7b63e..1d7bd95b80 100644 --- a/engines/dm/inventory.cpp +++ b/engines/dm/inventory.cpp @@ -36,18 +36,18 @@ namespace DM { -Box gBoxFloppyZzzCross = Box(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross -Box gBoxPanel = Box(80, 223, 52, 124); // @ G0032_s_Graphic562_Box_Panel -Box gBoxFood = Box(112, 159, 60, 68); // @ G0035_s_Graphic562_Box_Food -Box gBoxWater = Box(112, 159, 83, 91); // @ G0036_s_Graphic562_Box_Water -Box gBoxPoisoned = Box(112, 207, 105, 119); // @ G0037_s_Graphic562_Box_Poisoned +Box g41_BoxFloppyZzzCross = Box(174, 218, 2, 12); // @ G0041_s_Graphic562_Box_ViewportFloppyZzzCross +Box g32_BoxPanel = Box(80, 223, 52, 124); // @ G0032_s_Graphic562_Box_Panel +Box g35_BoxFood = Box(112, 159, 60, 68); // @ G0035_s_Graphic562_Box_Food +Box g36_BoxWater = Box(112, 159, 83, 91); // @ G0036_s_Graphic562_Box_Water +Box g37_BoxPoisoned = Box(112, 207, 105, 119); // @ G0037_s_Graphic562_Box_Poisoned InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) { - _panelContent = kPanelContentFoodWaterPoisoned; + _g424_panelContent = k0_PanelContentFoodWaterPoisoned; for (uint16 i = 0; i < 8; ++i) - _chestSlots[i] = Thing::_none; - _openChest = Thing::_none; - _openChest = Thing::_none; + _g425_chestSlots[i] = Thing::_none; + _g426_openChest = Thing::_none; + _g426_openChest = Thing::_none; } void InventoryMan::toggleInventory(ChampionIndex championIndex) { @@ -60,14 +60,14 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) { if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth) return; _vm->_g321_stopWaitingForPlayerInput = true; - int16 invChampOrdinal = _inventoryChampionOrdinal; // copy, as the original will be edited + int16 invChampOrdinal = _g432_inventoryChampionOrdinal; // copy, as the original will be edited if (_vm->indexToOrdinal(championIndex) == invChampOrdinal) { championIndex = k4_ChampionCloseInventory; } Champion *champion; if (invChampOrdinal) { - _inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); + _g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone); closeChest(); champion = &cm._champions[_vm->ordinalToIndex(invChampOrdinal)]; if (champion->_currHealth && !cm._g299_candidateChampionOrdinal) { @@ -88,7 +88,7 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) { } dm._g578_useByteBoxCoordinates = false; - _inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex); + _g432_inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex); if (!invChampOrdinal) { warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox"); } @@ -98,7 +98,7 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) { int16 h = dm.getHeight(k17_InventoryGraphicIndice); dm.blitToScreen(dm.getBitmap(k17_InventoryGraphicIndice), w, 0, 0, 0, w, 0, h, k255_ColorNoTransparency, g296_DungeonViewport); if (cm._g299_candidateChampionOrdinal) { - dm.clearScreenBox(k12_ColorDarkestGray, gBoxFloppyZzzCross, g296_DungeonViewport); + dm.clearScreenBox(k12_ColorDarkestGray, g41_BoxFloppyZzzCross, g296_DungeonViewport); } _vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "HEALTH"); _vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "STAMINA"); @@ -128,7 +128,7 @@ void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) { Box box; box._y1 = 0; box._y2 = 28 + 1; - box._x1 = championIndex * kChampionStatusBoxSpacing + 7; + box._x1 = championIndex * k69_ChampionStatusBoxSpacing + 7; box._x2 = box._x1 + 31 + 1; dispMan.blitToScreen(_vm->_championMan->_champions[championIndex]._portrait, 32, 0, 0, box, k255_ColorNoTransparency); } @@ -160,22 +160,22 @@ void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) { } void InventoryMan::drawPanelFoodWaterPoisoned() { - Champion &champ = _vm->_championMan->_champions[_inventoryChampionOrdinal]; + Champion &champ = _vm->_championMan->_champions[_g432_inventoryChampionOrdinal]; closeChest(); DisplayMan &dispMan = *_vm->_displayMan; - dispMan.blitToScreen(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, gBoxPanel, k8_ColorRed); - dispMan.blitToScreen(dispMan.getBitmap(k30_FoodLabelIndice), 48, 0, 0, gBoxFood, k12_ColorDarkestGray); - dispMan.blitToScreen(dispMan.getBitmap(k31_WaterLabelIndice), 48, 0, 0, gBoxWater, k12_ColorDarkestGray); + dispMan.blitToScreen(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed); + dispMan.blitToScreen(dispMan.getBitmap(k30_FoodLabelIndice), 48, 0, 0, g35_BoxFood, k12_ColorDarkestGray); + dispMan.blitToScreen(dispMan.getBitmap(k31_WaterLabelIndice), 48, 0, 0, g36_BoxWater, k12_ColorDarkestGray); if (champ._poisonEventCount) { - dispMan.blitToScreen(dispMan.getBitmap(k32_PoisionedLabelIndice), 96, 0, 0, gBoxPoisoned, k12_ColorDarkestGray); + dispMan.blitToScreen(dispMan.getBitmap(k32_PoisionedLabelIndice), 96, 0, 0, g37_BoxPoisoned, k12_ColorDarkestGray); } drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown); drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue); } void InventoryMan::drawPanelResurrectReincarnate() { - _panelContent = kPanelContentResurrectReincarnate; - _vm->_displayMan->blitToScreen(_vm->_displayMan->getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0, gBoxPanel, k6_ColorDarkGreen, g296_DungeonViewport); + _g424_panelContent = k5_PanelContentResurrectReincarnate; + _vm->_displayMan->blitToScreen(_vm->_displayMan->getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0, g32_BoxPanel, k6_ColorDarkGreen, g296_DungeonViewport); } void InventoryMan::drawPanel() { @@ -188,15 +188,15 @@ void InventoryMan::drawPanel() { return; } - Thing thing = cm._champions[_vm->ordinalToIndex(_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand); + Thing thing = cm._champions[_vm->ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand); - _panelContent = kPanelContentFoodWaterPoisoned; + _g424_panelContent = k0_PanelContentFoodWaterPoisoned; switch (thing.getType()) { case k9_ContainerThingType: - _panelContent = kPanelContentChest; + _g424_panelContent = k4_PanelContentChest; break; case k7_ScrollThingType: - _panelContent = kPanelContentScroll; + _g424_panelContent = k2_PanelContentScroll; break; default: thing = Thing::_none; @@ -213,16 +213,16 @@ void InventoryMan::closeChest() { DungeonMan &dunMan = *_vm->_dungeonMan; bool processFirstChestSlot = true; - if (_openChest == Thing::_none) + if (_g426_openChest == Thing::_none) return; - Container *container = (Container*)dunMan.getThingData(_openChest); - _openChest = Thing::_none; + Container *container = (Container*)dunMan.getThingData(_g426_openChest); + _g426_openChest = Thing::_none; container->getSlot() = Thing::_endOfList; Thing prevThing; for (int16 chestSlotIndex = 0; chestSlotIndex < 8; ++chestSlotIndex) { - Thing thing = _chestSlots[chestSlotIndex]; + Thing thing = _g425_chestSlots[chestSlotIndex]; if (thing != Thing::_none) { - _chestSlots[chestSlotIndex] = Thing::_none; // CHANGE8_09_FIX + _g425_chestSlots[chestSlotIndex] = Thing::_none; // CHANGE8_09_FIX if (processFirstChestSlot) { processFirstChestSlot = false; @@ -258,7 +258,7 @@ void InventoryMan::drawPanelScroll(Scroll* scroll) { charRed++; } *charRed = '\0'; - dispMan.blitToScreen(dispMan.getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, gBoxPanel, k8_ColorRed, g296_DungeonViewport); + dispMan.blitToScreen(dispMan.getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed, g296_DungeonViewport); int16 lineCount = 1; charRed++; char *charGreen = charRed; // first char of the second line @@ -299,18 +299,18 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is DisplayMan &dispMan = *_vm->_displayMan; ObjectMan &objMan = *_vm->_objectMan; - if (_openChest == thingToOpen) + if (_g426_openChest == thingToOpen) return; warning("CHANGE8_09_FIX"); - if (_openChest != Thing::_none) + if (_g426_openChest != Thing::_none) closeChest(); // CHANGE8_09_FIX - _openChest = thingToOpen; + _g426_openChest = thingToOpen; if (!isPressingEye) { - objMan.drawIconInSlotBox(kSlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen); + objMan.drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen); } - dispMan.blitToScreen(dispMan.getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, gBoxPanel, k8_ColorRed); + dispMan.blitToScreen(dispMan.getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed); int16 chestSlotIndex = 0; Thing thing = chest->getSlot(); @@ -320,13 +320,13 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is if (++thingCount > 8) break; // CHANGE8_08_FIX, make sure that no more than the first 8 objects in a chest are drawn - objMan.drawIconInSlotBox(chestSlotIndex + kSlotBoxChestFirstSlot, objMan.getIconIndex(thing)); - _chestSlots[chestSlotIndex++] = thing; + objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.getIconIndex(thing)); + _g425_chestSlots[chestSlotIndex++] = thing; thing = _vm->_dungeonMan->getNextThing(thing); } while (chestSlotIndex < 8) { - objMan.drawIconInSlotBox(chestSlotIndex + kSlotBoxChestFirstSlot, kM1_IconIndiceNone); - _chestSlots[chestSlotIndex++] = Thing::_none; + objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone); + _g425_chestSlots[chestSlotIndex++] = Thing::_none; } } @@ -373,8 +373,8 @@ void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 a void InventoryMan::drawPanelObjectDescriptionString(char* descString) { if (descString[0] == '\f') { // form feed descString++; - _objDescTextXpos = 108; - _objDescTextYpos = 59; + _g421_objDescTextXpos = 108; + _g422_objDescTextYpos = 59; } if (descString[0]) { @@ -394,8 +394,8 @@ void InventoryMan::drawPanelObjectDescriptionString(char* descString) { severalLines = true; } - _vm->_textMan->printToViewport(_objDescTextXpos, _objDescTextYpos, k13_ColorLightestGray, stringLine); - _objDescTextYpos += 7; + _vm->_textMan->printToViewport(_g421_objDescTextXpos, _g422_objDescTextYpos, k13_ColorLightestGray, stringLine); + _g422_objDescTextYpos += 7; if (severalLines) { severalLines = false; stringLine = ++string; @@ -406,21 +406,21 @@ void InventoryMan::drawPanelObjectDescriptionString(char* descString) { } } -Box gBoxArrowOrEye = Box(83, 98, 57, 65); // @ G0033_s_Graphic562_Box_ArrowOrEye +Box g33_BoxArrowOrEye = Box(83, 98, 57, 65); // @ G0033_s_Graphic562_Box_ArrowOrEye void InventoryMan::drawPanelArrowOrEye(bool pressingEye) { DisplayMan &dispMan = *_vm->_displayMan; dispMan.blitToScreen(dispMan.getBitmap(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice), - 16, 0, 0, gBoxArrowOrEye, k8_ColorRed, g296_DungeonViewport); + 16, 0, 0, g33_BoxArrowOrEye, k8_ColorRed, g296_DungeonViewport); } -Box gBoxObjectDescCircle = Box(105, 136, 53, 79); // @ G0034_s_Graphic562_Box_ObjectDescriptionCircle +Box g34_BoxObjectDescCircle = Box(105, 136, 53, 79); // @ G0034_s_Graphic562_Box_ObjectDescriptionCircle -#define kDescriptionMaskConsumable 0x0001 // @ MASK0x0001_DESCRIPTION_CONSUMABLE -#define kDescriptionMaskPoisoned 0x0002 // @ MASK0x0002_DESCRIPTION_POISONED -#define kDescriptionMaskBroken 0x0004 // @ MASK0x0004_DESCRIPTION_BROKEN -#define kDescriptionMaskCursed 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED +#define k0x0001_DescriptionMaskConsumable 0x0001 // @ MASK0x0001_DESCRIPTION_CONSUMABLE +#define k0x0002_DescriptionMaskPoisoned 0x0002 // @ MASK0x0002_DESCRIPTION_POISONED +#define k0x0004_DescriptionMaskBroken 0x0004 // @ MASK0x0004_DESCRIPTION_BROKEN +#define k0x0008_DescriptionMaskCursed 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { DungeonMan &dunMan = *_vm->_dungeonMan; @@ -443,27 +443,27 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { openAndDrawChest(thingToDraw, (Container*)rawThingPtr, pressingEye); } else { IconIndice iconIndex = objMan.getIconIndex(thingToDraw); - dispMan.blitToScreen(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, gBoxPanel, k8_ColorRed, g296_DungeonViewport); - dispMan.blitToScreen(dispMan.getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0, gBoxObjectDescCircle, k12_ColorDarkestGray, g296_DungeonViewport); + dispMan.blitToScreen(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0, g32_BoxPanel, k8_ColorRed, g296_DungeonViewport); + dispMan.blitToScreen(dispMan.getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0, g34_BoxObjectDescCircle, k12_ColorDarkestGray, g296_DungeonViewport); char *descString = nullptr; char str[40]; if (iconIndex == k147_IconIndiceJunkChampionBones) { strcpy(str, champMan._champions[((Junk*)rawThingPtr)->getChargeCount()]._name); // TODO: localization strcat(str, " "); // TODO: localization - strcat(str, objMan._objectNames[iconIndex]); // TODO: localization + strcat(str, objMan._g352_objectNames[iconIndex]); // TODO: localization descString = str; } else if ((thingType == k8_PotionThingType) && (iconIndex != k163_IconIndicePotionWaterFlask) - && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) { + && (champMan.getSkillLevel((ChampionIndex)_vm->ordinalToIndex(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) { str[0] = '_' + ((Potion*)rawThingPtr)->getPower() / 40; str[1] = ' '; str[2] = '\0'; - strcat(str, objMan._objectNames[iconIndex]); + strcat(str, objMan._g352_objectNames[iconIndex]); descString = str; } else { - descString = objMan._objectNames[iconIndex]; + descString = objMan._g352_objectNames[iconIndex]; } textMan.printToViewport(134, 68, k13_ColorLightestGray, descString); @@ -471,13 +471,13 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { char *attribString[4] = {"CONSUMABLE", "POISONED", "BROKEN", "CURSED"}; // TODO: localization - _objDescTextYpos = 87; + _g422_objDescTextYpos = 87; uint16 potentialAttribMask; uint16 actualAttribMask; switch (thingType) { case k5_WeaponThingType: { - potentialAttribMask = kDescriptionMaskCursed | kDescriptionMaskPoisoned | kDescriptionMaskBroken; + potentialAttribMask = k0x0008_DescriptionMaskCursed | k0x0002_DescriptionMaskPoisoned | k0x0004_DescriptionMaskBroken; Weapon *weapon = (Weapon*)rawThingPtr; actualAttribMask = (weapon->getCursed() << 3) | (weapon->getPoisoned() << 1) | (weapon->getBroken() << 2); if ((iconIndex >= k4_IconIndiceWeaponTorchUnlit) @@ -488,13 +488,13 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { break; } case k6_ArmourThingType: { - potentialAttribMask = kDescriptionMaskCursed | kDescriptionMaskBroken; + potentialAttribMask = k0x0008_DescriptionMaskCursed | k0x0004_DescriptionMaskBroken; Armour *armour = (Armour*)rawThingPtr; actualAttribMask = (armour->getCursed() << 3) | (armour->getBroken() << 2); break; } case k8_PotionThingType: { - actualAttribMask = kDescriptionMaskConsumable; + actualAttribMask = k0x0001_DescriptionMaskConsumable; Potion *potion = (Potion*)rawThingPtr; actualAttribMask = g237_ObjectInfo[k2_ObjectInfoIndexFirstPotion + potion->getType()].getAllowedSlots(); break; @@ -525,7 +525,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) { strcat(str, directionName[iconIndex]); drawPanelObjectDescriptionString(str); } else { - potentialAttribMask = kDescriptionMaskConsumable; + potentialAttribMask = k0x0001_DescriptionMaskConsumable; actualAttribMask = g237_ObjectInfo[k127_ObjectInfoIndexFirstJunk + junk->getType()].getAllowedSlots(); } break; diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h index 952511d9e8..82865f5cc5 100644 --- a/engines/dm/inventory.h +++ b/engines/dm/inventory.h @@ -34,17 +34,17 @@ namespace DM { -#define kChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING -#define kSlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT +#define k69_ChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING +#define k38_SlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT -extern Box gBoxPanel; // @ G0032_s_Graphic562_Box_Panel +extern Box g32_BoxPanel; // @ G0032_s_Graphic562_Box_Panel enum PanelContent { - kPanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED - kPanelContentScroll = 2, // @ C02_PANEL_SCROLL - kPanelContentChest = 4, // @ C04_PANEL_CHEST - kPanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE + k0_PanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED + k2_PanelContentScroll = 2, // @ C02_PANEL_SCROLL + k4_PanelContentChest = 4, // @ C04_PANEL_CHEST + k5_PanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE }; @@ -54,12 +54,12 @@ class InventoryMan { public: explicit InventoryMan(DMEngine *vm); - int16 _inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal - PanelContent _panelContent; // @ G0424_i_PanelContent - Thing _chestSlots[8]; // @ G0425_aT_ChestSlots - Thing _openChest; // @ G0426_T_OpenChest - int16 _objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX - int16 _objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY + int16 _g432_inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal + PanelContent _g424_panelContent; // @ G0424_i_PanelContent + Thing _g425_chestSlots[8]; // @ G0425_aT_ChestSlots + Thing _g426_openChest; // @ G0426_T_OpenChest + int16 _g421_objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX + int16 _g422_objDescTextYpos; // @ G0422_i_ObjectDescriptionTextY void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index bd99345c41..aabe88f032 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -62,7 +62,7 @@ LoadgameResponse LoadsaveMan::loadgame() { // MISSING CODE: load game } cm._303_partyDead = false; - return kLoadgameSuccess; + return k1_LoadgameSuccess; } }
\ No newline at end of file diff --git a/engines/dm/loadsave.h b/engines/dm/loadsave.h index 71043a223c..0ee7118582 100644 --- a/engines/dm/loadsave.h +++ b/engines/dm/loadsave.h @@ -33,8 +33,8 @@ namespace DM { enum LoadgameResponse { - kLoadgameFailure = -1, // @ CM1_LOAD_GAME_FAILURE - kLoadgameSuccess = 1// @ C01_LOAD_GAME_SUCCESS + kM1_LoadgameFailure = -1, // @ CM1_LOAD_GAME_FAILURE + k1_LoadgameSuccess = 1// @ C01_LOAD_GAME_SUCCESS }; class LoadsaveMan { diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp index 20d0f53646..ee27ee0f6b 100644 --- a/engines/dm/menus.cpp +++ b/engines/dm/menus.cpp @@ -36,26 +36,26 @@ namespace DM {
-Box gBoxActionArea3ActionMenu = Box(224, 319, 77, 121); // @ G0499_s_Graphic560_Box_ActionArea3ActionsMenu
-Box gBoxActionArea2ActionMenu = Box(224, 319, 77, 109); // @ G0500_s_Graphic560_Box_ActionArea2ActionsMenu
-Box gBoxActionArea1ActionMenu = Box(224, 319, 77, 97); // @ G0501_s_Graphic560_Box_ActionArea1ActionMenu
-Box gBoxActionArea = Box(224, 319, 77, 121); // @ G0001_s_Graphic562_Box_ActionArea
-byte gPalChangesActionAreaObjectIcon[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0}; // @ G0498_auc_Graphic560_PaletteChanges_ActionAreaObjectIcon
+Box g499_BoxActionArea3ActionMenu = Box(224, 319, 77, 121); // @ G0499_s_Graphic560_Box_ActionArea3ActionsMenu
+Box g500_BoxActionArea2ActionMenu = Box(224, 319, 77, 109); // @ G0500_s_Graphic560_Box_ActionArea2ActionsMenu
+Box g501_BoxActionArea1ActionMenu = Box(224, 319, 77, 97); // @ G0501_s_Graphic560_Box_ActionArea1ActionMenu
+Box g1_BoxActionArea = Box(224, 319, 77, 121); // @ G0001_s_Graphic562_Box_ActionArea
+byte g498_PalChangesActionAreaObjectIcon[16] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 0, 0, 0}; // @ G0498_auc_Graphic560_PaletteChanges_ActionAreaObjectIcon
-Box gBoxSpellAreaLine = Box(0, 95, 0, 11); // @ K0074_s_Box_SpellAreaLine
-Box gBoxSpellAreaLine2 = Box(224, 319, 50, 61); // @ K0075_s_Box_SpellAreaLine2
-Box gBoxSpellAreaLine3 = Box(224, 319, 62, 73); // @ K0076_s_Box_SpellAreaLine3
-Box gBoxSpellArea = Box(224, 319, 77, 121);
+Box gK74_BoxSpellAreaLine = Box(0, 95, 0, 11); // @ K0074_s_Box_SpellAreaLine
+Box gK75_BoxSpellAreaLine2 = Box(224, 319, 50, 61); // @ K0075_s_Box_SpellAreaLine2
+Box gK76_BoxSpellAreaLine3 = Box(224, 319, 62, 73); // @ K0076_s_Box_SpellAreaLine3
+Box g0_BoxSpellArea = Box(224, 319, 77, 121);
MenuMan::MenuMan(DMEngine *vm) : _vm(vm) {
- _refreshActionArea = false;
- _actionAreaContainsIcons = false;
- _actionDamage = 0;
- _bitmapSpellAreaLine = new byte[96 * 12];
+ _g508_refreshActionArea = false;
+ _g509_actionAreaContainsIcons = false;
+ _g513_actionDamage = 0;
+ _gK72_bitmapSpellAreaLine = new byte[96 * 12];
}
MenuMan::~MenuMan() {
- delete[] _bitmapSpellAreaLine;
+ delete[] _gK72_bitmapSpellAreaLine;
}
void MenuMan::drawMovementArrows() {
@@ -73,12 +73,12 @@ void MenuMan::clearActingChampion() { cm._champions[cm._g506_actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
cm.drawChampionState((ChampionIndex)cm._g506_actingChampionOrdinal);
cm._g506_actingChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
- _refreshActionArea = true;
+ _g508_refreshActionArea = true;
}
}
void MenuMan::drawActionIcon(ChampionIndex championIndex) {
- if (!_actionAreaContainsIcons)
+ if (!_g509_actionAreaContainsIcons)
return;
DisplayMan &dm = *_vm->_displayMan;
Champion &champion = _vm->_championMan->_champions[championIndex];
@@ -105,7 +105,7 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) { goto T0386006;
}
_vm->_objectMan->extractIconFromBitmap(iconIndex, bitmapIcon);
- dm.blitToBitmapShrinkWithPalChange(bitmapIcon, 16, 16, bitmapIcon, 16, 16, gPalChangesActionAreaObjectIcon);
+ dm.blitToBitmapShrinkWithPalChange(bitmapIcon, 16, 16, bitmapIcon, 16, 16, g498_PalChangesActionAreaObjectIcon);
T0386006:
dm.clearScreenBox(k4_ColorCyan, box);
Box box2;
@@ -123,8 +123,8 @@ void MenuMan::drawDisabledMenu() { if (!_vm->_championMan->_g300_partyIsSleeping) {
warning("MISSING CODE: F0363_COMMAND_HighlightBoxDisable");
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
- if (_vm->_inventoryMan->_inventoryChampionOrdinal) {
- if (_vm->_inventoryMan->_panelContent == kPanelContentChest) {
+ if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
+ if (_vm->_inventoryMan->_g424_panelContent == k4_PanelContentChest) {
_vm->_inventoryMan->closeChest();
}
} else {
@@ -170,17 +170,17 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() { } while (champIndex < champMan._g305_partyChampionCount);
}
- if (_refreshActionArea) {
+ if (_g508_refreshActionArea) {
if (!champMan._g506_actingChampionOrdinal) {
- if (_actionDamage) {
+ if (_g513_actionDamage) {
warning("MISSING CODE: F0385_MENUS_DrawActionDamage");
- _actionDamage = 0;
+ _g513_actionDamage = 0;
} else {
- _actionAreaContainsIcons = true;
+ _g509_actionAreaContainsIcons = true;
drawActionArea();
}
} else {
- _actionAreaContainsIcons = false;
+ _g509_actionAreaContainsIcons = false;
champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal));
warning("MISSING CODE: F0387_MENUS_DrawActionArea");
@@ -188,8 +188,8 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() { }
}
-#define kChampionNameMaximumLength 7 // @ C007_CHAMPION_NAME_MAXIMUM_LENGTH
-#define kActionNameMaximumLength 12 // @ C012_ACTION_NAME_MAXIMUM_LENGTH
+#define k7_ChampionNameMaximumLength 7 // @ C007_CHAMPION_NAME_MAXIMUM_LENGTH
+#define k12_ActionNameMaximumLength 12 // @ C012_ACTION_NAME_MAXIMUM_LENGTH
void MenuMan::drawActionArea() {
DisplayMan &dispMan = *_vm->_displayMan;
@@ -198,30 +198,30 @@ void MenuMan::drawActionArea() { warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
dispMan._g578_useByteBoxCoordinates = false;
- dispMan.clearScreenBox(k0_ColorBlack, gBoxActionArea);
- if (_actionAreaContainsIcons) {
+ dispMan.clearScreenBox(k0_ColorBlack, g1_BoxActionArea);
+ if (_g509_actionAreaContainsIcons) {
for (uint16 champIndex = k0_ChampionFirst; champIndex < champMan._g305_partyChampionCount; ++champIndex)
drawActionIcon((ChampionIndex)champIndex);
} else if (champMan._g506_actingChampionOrdinal) {
- Box box = gBoxActionArea3ActionMenu;
- if (_actionList._actionIndices[2] == k255_ChampionActionNone)
- box = gBoxActionArea2ActionMenu;
- if (_actionList._actionIndices[1] == k255_ChampionActionNone)
- box = gBoxActionArea1ActionMenu;
+ Box box = g499_BoxActionArea3ActionMenu;
+ if (_g713_actionList._actionIndices[2] == k255_ChampionActionNone)
+ box = g500_BoxActionArea2ActionMenu;
+ if (_g713_actionList._actionIndices[1] == k255_ChampionActionNone)
+ box = g501_BoxActionArea1ActionMenu;
dispMan.blitToScreen(dispMan.getBitmap(k10_MenuActionAreaIndice), 96, 0, 0, box, k255_ColorNoTransparency);
textMan.printWithTrailingSpacesToScreen(235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal)]._name,
- kChampionNameMaximumLength);
+ k7_ChampionNameMaximumLength);
for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) {
textMan.printWithTrailingSpacesToScreen(241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
- getActionName(_actionList._actionIndices[actionListIndex]),
- kActionNameMaximumLength);
+ getActionName(_g713_actionList._actionIndices[actionListIndex]),
+ k12_ActionNameMaximumLength);
}
}
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
- _refreshActionArea = false;
+ _g508_refreshActionArea = false;
}
-const char *gChampionActionNames[44] = {
+const char *g490_ChampionActionNames[44] = { // @ G0490_ac_Graphic560_ActionNames
"N", "BLOCK", "CHOP", "X", "BLOW HORN", "FLIP", "PUNCH",
"KICK", "WAR CRY", "STAB", "CLIMB DOWN", "FREEZE LIFE",
"HIT", "SWING", "STAB", "THRUST", "JAB", "PARRY", "HACK",
@@ -232,11 +232,11 @@ const char *gChampionActionNames[44] = { "BRANDISH", "THROW", "FUSE"};
const char* MenuMan::getActionName(ChampionAction actionIndex) {
- return (actionIndex == k255_ChampionActionNone) ? "" : gChampionActionNames[actionIndex];
+ return (actionIndex == k255_ChampionActionNone) ? "" : g490_ChampionActionNames[actionIndex];
}
-Box gBoxSpellAreaControls = Box(233, 319, 42, 49); // @ G0504_s_Graphic560_Box_SpellAreaControls
+Box g504_BoxSpellAreaControls = Box(233, 319, 42, 49); // @ G0504_s_Graphic560_Box_SpellAreaControls
void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
ChampionMan &champMan = *_vm->_championMan;
@@ -248,7 +248,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) { for (uint16 i = 0; i < 4; ++i)
champCurrHealth[i] = champMan._champions[i]._currHealth;
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
- dispMan.clearScreenBox(k0_ColorBlack, gBoxSpellAreaControls);
+ dispMan.clearScreenBox(k0_ColorBlack, g504_BoxSpellAreaControls);
int16 champCount = champMan._g305_partyChampionCount;
switch (champIndex) {
case k0_ChampionFirst:
@@ -306,32 +306,32 @@ labelChamp3: warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}
-#define kSpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS
-#define kSpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS
+#define k2_SpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS
+#define k3_SpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS
void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) {
DisplayMan &dispMan = *_vm->_displayMan;
Champion &champ = _vm->_championMan->_champions[_vm->_championMan->_g514_magicCasterChampionIndex];
- if (spellAreaBitmapLine == kSpellAreaAvailableSymbols) {
+ if (spellAreaBitmapLine == k2_SpellAreaAvailableSymbols) {
dispMan._g578_useByteBoxCoordinates = false;
- dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 12, _bitmapSpellAreaLine, 96, gBoxSpellAreaLine, k255_ColorNoTransparency);
+ dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 12, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency);
int16 x = 1;
byte c = 96 + (6 * champ._symbolStep);
char spellSymbolString[2] = {'\0', '\0'};
for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) {
spellSymbolString[0] = c++;
- _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 96, x += 14, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
+ _vm->_textMan->printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 14, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
}
- } else if (spellAreaBitmapLine == kSpellAreaChampionSymbols) {
+ } else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) {
dispMan._g578_useByteBoxCoordinates = false;
- dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 24, _bitmapSpellAreaLine, 96, gBoxSpellAreaLine, k255_ColorNoTransparency);
+ dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 24, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency);
char spellSymbolString[2] = {'\0', '\0'};
int16 x = 8;
for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) {
if ((spellSymbolString[0] = champ._symbols[symbolIndex]) == '\0')
break;
- _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 96, x += 9, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
+ _vm->_textMan->printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 9, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
}
}
}
@@ -345,25 +345,25 @@ void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex) { return;
if (champMan._g514_magicCasterChampionIndex == kM1_ChampionNone) {
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
- dispMan.blitToScreen(dispMan.getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, gBoxSpellArea);
+ dispMan.blitToScreen(dispMan.getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, g0_BoxSpellArea);
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}
if (champIndex == kM1_ChampionNone) {
champMan._g514_magicCasterChampionIndex = kM1_ChampionNone;
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
dispMan._g578_useByteBoxCoordinates = false;
- dispMan.clearScreenBox(k0_ColorBlack, gBoxSpellArea);
+ dispMan.clearScreenBox(k0_ColorBlack, g0_BoxSpellArea);
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
return;
}
champMan._g514_magicCasterChampionIndex = (ChampionIndex)champIndex;
- buildSpellAreaLine(kSpellAreaAvailableSymbols);
+ buildSpellAreaLine(k2_SpellAreaAvailableSymbols);
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
drawSpellAreaControls((ChampionIndex)champIndex);
- dispMan.blitToScreen(_bitmapSpellAreaLine, 96, 0, 0, gBoxSpellAreaLine2);
- buildSpellAreaLine(kSpellAreaChampionSymbols);
- dispMan.blitToScreen(_bitmapSpellAreaLine, 96, 0, 0, gBoxSpellAreaLine3);
+ dispMan.blitToScreen(_gK72_bitmapSpellAreaLine, 96, 0, 0, gK75_BoxSpellAreaLine2);
+ buildSpellAreaLine(k3_SpellAreaChampionSymbols);
+ dispMan.blitToScreen(_gK72_bitmapSpellAreaLine, 96, 0, 0, gK76_BoxSpellAreaLine3);
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
}
}
diff --git a/engines/dm/menus.h b/engines/dm/menus.h index b591872011..30bf01c542 100644 --- a/engines/dm/menus.h +++ b/engines/dm/menus.h @@ -33,8 +33,8 @@ namespace DM { -extern Box gBoxActionArea; // @ G0001_s_Graphic562_Box_ActionArea -extern Box gBoxSpellArea; // @ G0000_s_Graphic562_Box_SpellArea +extern Box g1_BoxActionArea; // @ G0001_s_Graphic562_Box_ActionArea +extern Box g0_BoxSpellArea; // @ G0000_s_Graphic562_Box_SpellArea class ActionList { public: @@ -54,11 +54,11 @@ public: explicit MenuMan(DMEngine *vm); ~MenuMan(); - bool _refreshActionArea; // @ G0508_B_RefreshActionArea - bool _actionAreaContainsIcons; // @ G0509_B_ActionAreaContainsIcons - int16 _actionDamage; // @ G0513_i_ActionDamage - ActionList _actionList; // @ G0713_s_ActionList - byte *_bitmapSpellAreaLine; // @ K0072_puc_Bitmap_SpellAreaLine + bool _g508_refreshActionArea; // @ G0508_B_RefreshActionArea + bool _g509_actionAreaContainsIcons; // @ G0509_B_ActionAreaContainsIcons + int16 _g513_actionDamage; // @ G0513_i_ActionDamage + ActionList _g713_actionList; // @ G0713_s_ActionList + byte *_gK72_bitmapSpellAreaLine; // @ K0072_puc_Bitmap_SpellAreaLine void clearActingChampion(); // @ F0388_MENUS_ClearActingChampion void drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp index 810847caad..9c3b2284bc 100644 --- a/engines/dm/objectman.cpp +++ b/engines/dm/objectman.cpp @@ -31,9 +31,9 @@ namespace DM { -int16 gIconGraphicHeight[7] = {32, 32, 32, 32, 32, 32, 32}; // @ K0077_ai_IconGraphicHeight +int16 gK77_IconGraphicHeight[7] = {32, 32, 32, 32, 32, 32, 32}; // @ K0077_ai_IconGraphicHeight -int16 gIconGraphicFirstIndex[7] = { // G0026_ai_Graphic562_IconGraphicFirstIconIndex +int16 g26_IconGraphicFirstIndex[7] = { // G0026_ai_Graphic562_IconGraphicFirstIconIndex 0, /* First icon index in graphic #42 */ 32, /* First icon index in graphic #43 */ 64, /* First icon index in graphic #44 */ @@ -44,73 +44,73 @@ int16 gIconGraphicFirstIndex[7] = { // G0026_ai_Graphic562_IconGraphicFirstIconI ObjectMan::ObjectMan(DMEngine *vm) : _vm(vm) { /* 8 for champion hands in status boxes, 30 for champion inventory, 8 for chest */ - _slotBoxes[0] = SlotBox(4, 10, 0); /* Champion Status Box 0 Ready Hand */ - _slotBoxes[1] = SlotBox(24, 10, 0); /* Champion Status Box 0 Action Hand */ - _slotBoxes[2] = SlotBox(73, 10, 0); /* Champion Status Box 1 Ready Hand */ - _slotBoxes[3] = SlotBox(93, 10, 0); /* Champion Status Box 1 Action Hand */ - _slotBoxes[4] = SlotBox(142, 10, 0); /* Champion Status Box 2 Ready Hand */ - _slotBoxes[5] = SlotBox(162, 10, 0); /* Champion Status Box 2 Action Hand */ - _slotBoxes[6] = SlotBox(211, 10, 0); /* Champion Status Box 3 Ready Hand */ - _slotBoxes[7] = SlotBox(231, 10, 0); /* Champion Status Box 3 Action Hand */ - _slotBoxes[8] = SlotBox(6, 53, 0); /* Ready Hand */ - _slotBoxes[9] = SlotBox(62, 53, 0); /* Action Hand */ - _slotBoxes[10] = SlotBox(34, 26, 0); /* Head */ - _slotBoxes[11] = SlotBox(34, 46, 0); /* Torso */ - _slotBoxes[12] = SlotBox(34, 66, 0); /* Legs */ - _slotBoxes[13] = SlotBox(34, 86, 0); /* Feet */ - _slotBoxes[14] = SlotBox(6, 90, 0); /* Pouch 2 */ - _slotBoxes[15] = SlotBox(79, 73, 0); /* Quiver Line2 1 */ - _slotBoxes[16] = SlotBox(62, 90, 0); /* Quiver Line1 2 */ - _slotBoxes[17] = SlotBox(79, 90, 0); /* Quiver Line2 2 */ - _slotBoxes[18] = SlotBox(6, 33, 0); /* Neck */ - _slotBoxes[19] = SlotBox(6, 73, 0); /* Pouch 1 */ - _slotBoxes[20] = SlotBox(62, 73, 0); /* Quiver Line1 1 */ - _slotBoxes[21] = SlotBox(66, 33, 0); /* Backpack Line1 1 */ - _slotBoxes[22] = SlotBox(83, 16, 0); /* Backpack Line2 2 */ - _slotBoxes[23] = SlotBox(100, 16, 0); /* Backpack Line2 3 */ - _slotBoxes[24] = SlotBox(117, 16, 0); /* Backpack Line2 4 */ - _slotBoxes[25] = SlotBox(134, 16, 0); /* Backpack Line2 5 */ - _slotBoxes[26] = SlotBox(151, 16, 0); /* Backpack Line2 6 */ - _slotBoxes[27] = SlotBox(168, 16, 0); /* Backpack Line2 7 */ - _slotBoxes[28] = SlotBox(185, 16, 0); /* Backpack Line2 8 */ - _slotBoxes[29] = SlotBox(202, 16, 0); /* Backpack Line2 9 */ - _slotBoxes[30] = SlotBox(83, 33, 0); /* Backpack Line1 2 */ - _slotBoxes[31] = SlotBox(100, 33, 0); /* Backpack Line1 3 */ - _slotBoxes[32] = SlotBox(117, 33, 0); /* Backpack Line1 4 */ - _slotBoxes[33] = SlotBox(134, 33, 0); /* Backpack Line1 5 */ - _slotBoxes[34] = SlotBox(151, 33, 0); /* Backpack Line1 6 */ - _slotBoxes[35] = SlotBox(168, 33, 0); /* Backpack Line1 7 */ - _slotBoxes[36] = SlotBox(185, 33, 0); /* Backpack Line1 8 */ - _slotBoxes[37] = SlotBox(202, 33, 0); /* Backpack Line1 9 */ - _slotBoxes[38] = SlotBox(117, 59, 0); /* Chest 1 */ - _slotBoxes[39] = SlotBox(106, 76, 0); /* Chest 2 */ - _slotBoxes[40] = SlotBox(111, 93, 0); /* Chest 3 */ - _slotBoxes[41] = SlotBox(128, 98, 0); /* Chest 4 */ - _slotBoxes[42] = SlotBox(145, 101, 0); /* Chest 5 */ - _slotBoxes[43] = SlotBox(162, 103, 0); /* Chest 6 */ - _slotBoxes[44] = SlotBox(179, 104, 0); /* Chest 7 */ - _slotBoxes[45] = SlotBox(196, 105, 0); /* Chest 8 */ - - _objectIconForMousePointer = nullptr; + _g30_slotBoxes[0] = SlotBox(4, 10, 0); /* Champion Status Box 0 Ready Hand */ + _g30_slotBoxes[1] = SlotBox(24, 10, 0); /* Champion Status Box 0 Action Hand */ + _g30_slotBoxes[2] = SlotBox(73, 10, 0); /* Champion Status Box 1 Ready Hand */ + _g30_slotBoxes[3] = SlotBox(93, 10, 0); /* Champion Status Box 1 Action Hand */ + _g30_slotBoxes[4] = SlotBox(142, 10, 0); /* Champion Status Box 2 Ready Hand */ + _g30_slotBoxes[5] = SlotBox(162, 10, 0); /* Champion Status Box 2 Action Hand */ + _g30_slotBoxes[6] = SlotBox(211, 10, 0); /* Champion Status Box 3 Ready Hand */ + _g30_slotBoxes[7] = SlotBox(231, 10, 0); /* Champion Status Box 3 Action Hand */ + _g30_slotBoxes[8] = SlotBox(6, 53, 0); /* Ready Hand */ + _g30_slotBoxes[9] = SlotBox(62, 53, 0); /* Action Hand */ + _g30_slotBoxes[10] = SlotBox(34, 26, 0); /* Head */ + _g30_slotBoxes[11] = SlotBox(34, 46, 0); /* Torso */ + _g30_slotBoxes[12] = SlotBox(34, 66, 0); /* Legs */ + _g30_slotBoxes[13] = SlotBox(34, 86, 0); /* Feet */ + _g30_slotBoxes[14] = SlotBox(6, 90, 0); /* Pouch 2 */ + _g30_slotBoxes[15] = SlotBox(79, 73, 0); /* Quiver Line2 1 */ + _g30_slotBoxes[16] = SlotBox(62, 90, 0); /* Quiver Line1 2 */ + _g30_slotBoxes[17] = SlotBox(79, 90, 0); /* Quiver Line2 2 */ + _g30_slotBoxes[18] = SlotBox(6, 33, 0); /* Neck */ + _g30_slotBoxes[19] = SlotBox(6, 73, 0); /* Pouch 1 */ + _g30_slotBoxes[20] = SlotBox(62, 73, 0); /* Quiver Line1 1 */ + _g30_slotBoxes[21] = SlotBox(66, 33, 0); /* Backpack Line1 1 */ + _g30_slotBoxes[22] = SlotBox(83, 16, 0); /* Backpack Line2 2 */ + _g30_slotBoxes[23] = SlotBox(100, 16, 0); /* Backpack Line2 3 */ + _g30_slotBoxes[24] = SlotBox(117, 16, 0); /* Backpack Line2 4 */ + _g30_slotBoxes[25] = SlotBox(134, 16, 0); /* Backpack Line2 5 */ + _g30_slotBoxes[26] = SlotBox(151, 16, 0); /* Backpack Line2 6 */ + _g30_slotBoxes[27] = SlotBox(168, 16, 0); /* Backpack Line2 7 */ + _g30_slotBoxes[28] = SlotBox(185, 16, 0); /* Backpack Line2 8 */ + _g30_slotBoxes[29] = SlotBox(202, 16, 0); /* Backpack Line2 9 */ + _g30_slotBoxes[30] = SlotBox(83, 33, 0); /* Backpack Line1 2 */ + _g30_slotBoxes[31] = SlotBox(100, 33, 0); /* Backpack Line1 3 */ + _g30_slotBoxes[32] = SlotBox(117, 33, 0); /* Backpack Line1 4 */ + _g30_slotBoxes[33] = SlotBox(134, 33, 0); /* Backpack Line1 5 */ + _g30_slotBoxes[34] = SlotBox(151, 33, 0); /* Backpack Line1 6 */ + _g30_slotBoxes[35] = SlotBox(168, 33, 0); /* Backpack Line1 7 */ + _g30_slotBoxes[36] = SlotBox(185, 33, 0); /* Backpack Line1 8 */ + _g30_slotBoxes[37] = SlotBox(202, 33, 0); /* Backpack Line1 9 */ + _g30_slotBoxes[38] = SlotBox(117, 59, 0); /* Chest 1 */ + _g30_slotBoxes[39] = SlotBox(106, 76, 0); /* Chest 2 */ + _g30_slotBoxes[40] = SlotBox(111, 93, 0); /* Chest 3 */ + _g30_slotBoxes[41] = SlotBox(128, 98, 0); /* Chest 4 */ + _g30_slotBoxes[42] = SlotBox(145, 101, 0); /* Chest 5 */ + _g30_slotBoxes[43] = SlotBox(162, 103, 0); /* Chest 6 */ + _g30_slotBoxes[44] = SlotBox(179, 104, 0); /* Chest 7 */ + _g30_slotBoxes[45] = SlotBox(196, 105, 0); /* Chest 8 */ + + _g412_objectIconForMousePointer = nullptr; } ObjectMan::~ObjectMan() { - delete[] _objectIconForMousePointer; - delete[] _objectNames[0]; + delete[] _g412_objectIconForMousePointer; + delete[] _g352_objectNames[0]; } -#define kObjectNamesGraphicIndice 556 // @ C556_GRAPHIC_OBJECT_NAMES +#define k556_ObjectNamesGraphicIndice 556 // @ C556_GRAPHIC_OBJECT_NAMES void ObjectMan::loadObjectNames() { DisplayMan &dispMan = *_vm->_displayMan; - _objectIconForMousePointer = new byte[16 * 16]; + _g412_objectIconForMousePointer = new byte[16 * 16]; - char *objectNames = new char[dispMan.getCompressedDataSize(kObjectNamesGraphicIndice) + kObjectNameCount]; - Common::MemoryReadStream stream = dispMan.getCompressedData(kObjectNamesGraphicIndice); + char *objectNames = new char[dispMan.getCompressedDataSize(k556_ObjectNamesGraphicIndice) + k199_ObjectNameCount]; + Common::MemoryReadStream stream = dispMan.getCompressedData(k556_ObjectNamesGraphicIndice); - for (uint16 objNameIndex = 0; objNameIndex < kObjectNameCount; ++objNameIndex) { - _objectNames[objNameIndex] = objectNames; + for (uint16 objNameIndex = 0; objNameIndex < k199_ObjectNameCount; ++objNameIndex) { + _g352_objectNames[objNameIndex] = objectNames; byte tmpByte; for (tmpByte = stream.readByte(); !(tmpByte & 0x80); tmpByte = stream.readByte()) // last char of object name has 7th bit on @@ -132,7 +132,7 @@ IconIndice ObjectMan::getObjectType(Thing thing) { return (IconIndice)objectInfoIndex; } -byte gChargeCountToTorchType[16] = {0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3}; // @ G0029_auc_Graphic562_ChargeCountToTorchType +byte g29_ChargeCountToTorchType[16] = {0, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3}; // @ G0029_auc_Graphic562_ChargeCountToTorchType IconIndice ObjectMan::getIconIndex(Thing thing) { IconIndice iconIndex = getObjectType(thing); @@ -150,7 +150,7 @@ IconIndice ObjectMan::getIconIndex(Thing thing) { case k4_IconIndiceWeaponTorchUnlit: { Weapon weapon(rawType); if (weapon.isLit()) { - iconIndex = (IconIndice)(iconIndex + gChargeCountToTorchType[weapon.getChargeCount()]); + iconIndex = (IconIndice)(iconIndex + g29_ChargeCountToTorchType[weapon.getChargeCount()]); } break; } @@ -187,19 +187,19 @@ IconIndice ObjectMan::getIconIndex(Thing thing) { void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) { int16 i; for (i = 0; i < 7; ++i) { - if (gIconGraphicFirstIndex[i] > iconIndex) + if (g26_IconGraphicFirstIndex[i] > iconIndex) break; } --i; byte *srcBitmap = _vm->_displayMan->getBitmap(k42_ObjectIcons_000_TO_031 + i); - iconIndex -= gIconGraphicFirstIndex[i]; + iconIndex -= g26_IconGraphicFirstIndex[i]; _vm->_displayMan->_g578_useByteBoxCoordinates = true; _vm->_displayMan->blitToBitmap(srcBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, destBitmap, 16, 0, 16, 0, 16, k255_ColorNoTransparency); } void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { - SlotBox *slotBox = &_slotBoxes[slotBoxIndex]; + SlotBox *slotBox = &_g30_slotBoxes[slotBoxIndex]; slotBox->_iconIndex = iconIndex; // yes, this modifies the global array if (slotBox->_iconIndex == kM1_IconIndiceNone) { return; @@ -213,16 +213,16 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { uint16 iconGraphicIndex; for (iconGraphicIndex = 0; iconGraphicIndex < 7; ++iconGraphicIndex) { - if (gIconGraphicFirstIndex[iconGraphicIndex] > iconIndex) { + if (g26_IconGraphicFirstIndex[iconGraphicIndex] > iconIndex) { break; } } iconGraphicIndex--; byte *iconsBitmap = _vm->_displayMan->getBitmap(iconGraphicIndex + k42_ObjectIcons_000_TO_031); - iconIndex -= gIconGraphicFirstIndex[iconGraphicIndex]; + iconIndex -= g26_IconGraphicFirstIndex[iconGraphicIndex]; _vm->_displayMan->_g578_useByteBoxCoordinates = false; - if (slotBoxIndex >= kSlotBoxInventoryFirstSlot) { + if (slotBoxIndex >= k8_SlotBoxInventoryFirstSlot) { _vm->_displayMan->blitToScreen(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, box, k255_ColorNoTransparency, g296_DungeonViewport); } else { @@ -231,7 +231,7 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) { } } -#define kObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH +#define k14_ObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH void ObjectMan::drawLeaderObjectName(Thing thing) { IconIndice iconIndex = getIconIndex(thing); @@ -240,15 +240,15 @@ void ObjectMan::drawLeaderObjectName(Thing thing) { if (iconIndex == k147_IconIndiceJunkChampionBones) { Junk *junk = (Junk*)_vm->_dungeonMan->getThingData(thing); strcpy(objectNameBuffer, _vm->_championMan->_champions[junk->getChargeCount()]._name); - strcat(objectNameBuffer, _objectNames[iconIndex]); + strcat(objectNameBuffer, _g352_objectNames[iconIndex]); objName = objectNameBuffer; } else { - objName = _objectNames[iconIndex]; + objName = _g352_objectNames[iconIndex]; } - _vm->_textMan->printWithTrailingSpacesToScreen(233, 37, k4_ColorCyan, k0_ColorBlack, objName, kObjectNameMaximumLength); + _vm->_textMan->printWithTrailingSpacesToScreen(233, 37, k4_ColorCyan, k0_ColorBlack, objName, k14_ObjectNameMaximumLength); } IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) { - return (IconIndice)_slotBoxes[slotBoxIndex]._iconIndex; + return (IconIndice)_g30_slotBoxes[slotBoxIndex]._iconIndex; } } diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h index f075076439..f0d2bedf07 100644 --- a/engines/dm/objectman.h +++ b/engines/dm/objectman.h @@ -31,11 +31,11 @@ namespace DM { -#define kSlotBoxInventoryFirstSlot 8 // @ C08_SLOT_BOX_INVENTORY_FIRST_SLOT -#define kSlotBoxInventoryActionHand 9 // @ C09_SLOT_BOX_INVENTORY_ACTION_HAND -#define kSlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT +#define k8_SlotBoxInventoryFirstSlot 8 // @ C08_SLOT_BOX_INVENTORY_FIRST_SLOT +#define k9_SlotBoxInventoryActionHand 9 // @ C09_SLOT_BOX_INVENTORY_ACTION_HAND +#define k38_SlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT -#define kObjectNameCount 199 // @ C199_OBJECT_NAME_COUNT +#define k199_ObjectNameCount 199 // @ C199_OBJECT_NAME_COUNT class SlotBox { public: @@ -54,9 +54,9 @@ public: ~ObjectMan(); void loadObjectNames(); // @ F0031_OBJECT_LoadNames - SlotBox _slotBoxes[46]; // @ G0030_as_Graphic562_SlotBoxes; - char *_objectNames[kObjectNameCount]; // @ G0352_apc_ObjectNames - byte *_objectIconForMousePointer; // @ G0412_puc_Bitmap_ObjectIconForMousePointer + SlotBox _g30_slotBoxes[46]; // @ G0030_as_Graphic562_SlotBoxes; + char *_g352_objectNames[k199_ObjectNameCount]; // @ G0352_apc_ObjectNames + byte *_g412_objectIconForMousePointer; // @ G0412_puc_Bitmap_ObjectIconForMousePointer IconIndice getObjectType(Thing thing); // @ F0032_OBJECT_GetType IconIndice getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp index 8f4e04c6be..f526faad88 100644 --- a/engines/dm/text.cpp +++ b/engines/dm/text.cpp @@ -32,8 +32,8 @@ namespace DM { TextMan::TextMan(DMEngine* vm) : _vm(vm) {} -#define kLetterWidth 5 -#define kLetterHeight 6 +#define k5_LetterWidth 5 +#define k6_LetterHeight 6 void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text, uint16 destHeight, Viewport &viewport) { @@ -46,22 +46,22 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 byte *srcBitmap = _vm->_displayMan->getBitmap(k557_FontGraphicIndice); byte *tmp = _vm->_displayMan->_g74_tmpBitmap; - for (uint16 i = 0; i < (kLetterWidth + 1) * kLetterHeight * 128; ++i) { + for (uint16 i = 0; i < (k5_LetterWidth + 1) * k6_LetterHeight * 128; ++i) { tmp[i] = srcBitmap[i] ? textColor : bgColor; } srcBitmap = tmp; for (const char *begin = text, *end = text + textLength; begin != end; ++begin) { - if (nextX + kLetterWidth + 1 >= (viewport._posX + viewport._width) || (*begin == '\n')) { + if (nextX + k5_LetterWidth + 1 >= (viewport._posX + viewport._width) || (*begin == '\n')) { nextX = destX; - nextY += kLetterHeight + 1; + nextY += k6_LetterHeight + 1; } - if (nextY + kLetterHeight >= (viewport._posY + viewport._height)) + if (nextY + k6_LetterHeight >= (viewport._posY + viewport._height)) break; uint16 srcX = (1 + 5) * toupper(*begin); // 1 + 5 is not the letter width, arbitrary choice of the unpacking code _vm->_displayMan->blitToBitmap(srcBitmap, 6 * 128, (nextX == destX) ? (srcX + 1) : srcX, 0, destBitmap, destPixelWidth, - (nextX == destX) ? (nextX + 1) : nextX, nextX + kLetterWidth + 1, nextY, nextY + kLetterHeight, k255_ColorNoTransparency, viewport); - nextX += kLetterWidth + 1; + (nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth + 1, nextY, nextY + k6_LetterHeight, k255_ColorNoTransparency, viewport); + nextX += k5_LetterWidth + 1; } } diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp index 101fccad42..d9e7806b35 100644 --- a/engines/dm/timeline.cpp +++ b/engines/dm/timeline.cpp @@ -32,23 +32,23 @@ namespace DM { Timeline::Timeline(DMEngine* vm) : _vm(vm) { - _events = nullptr; - _timeline = nullptr; + _g370_events = nullptr; + _g371_timeline = nullptr; } Timeline::~Timeline() { - delete[] _events; - delete[] _timeline; + delete[] _g370_events; + delete[] _g371_timeline; } void Timeline::initTimeline() { - _events = new TimelineEvent[_eventMaxCount]; - _timeline = new uint16[_eventMaxCount]; + _g370_events = new TimelineEvent[_g369_eventMaxCount]; + _g371_timeline = new uint16[_g369_eventMaxCount]; if (_vm->_dungeonMan->_messages._g298_newGame) { - for (int16 i = 0; i < _eventMaxCount; ++i) - _events->_type = kTMEventTypeNone; - _eventCount = 0; - _firstUnusedEventIndex = 0; + for (int16 i = 0; i < _g369_eventMaxCount; ++i) + _g370_events->_type = k0_TMEventTypeNone; + _g372_eventCount = 0; + _g373_firstUnusedEventIndex = 0; } } diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h index f773530917..47d339eb33 100644 --- a/engines/dm/timeline.h +++ b/engines/dm/timeline.h @@ -35,62 +35,62 @@ namespace DM { /* Event types */ enum TimelineEventType { /* Used when a creature in a group was damaged or killed by a Poison Cloud or by a closing door or if Lord Chaos is surrounded by = 3, Fluxcages */ -kTMEventTypeCreateReactionEvent29DangerOnSquare = 253, // @ CM3_EVENT_CREATE_REACTION_EVENT_29_DANGER_ON_SQUARE +kM3_TMEventTypeCreateReactionEvent29DangerOnSquare = -3, // @ CM3_EVENT_CREATE_REACTION_EVENT_29_DANGER_ON_SQUARE /* Used when a projectile impacts with a creature in a group */ -kTMEventTypeCreateReactionEvent30HitByProjectile = 254, // @ CM2_EVENT_CREATE_REACTION_EVENT_30_HIT_BY_PROJECTILE +kM2_TMEventTypeCreateReactionEvent30HitByProjectile = -2, // @ CM2_EVENT_CREATE_REACTION_EVENT_30_HIT_BY_PROJECTILE /* Used when the party bumps into a group or performs a melee attack */ -kTMEventTypeCreateReactionEvent31ParyIsAdjacent = 255, // @ CM1_EVENT_CREATE_REACTION_EVENT_31_PARTY_IS_ADJACENT -kTMEventTypeNone = 0, // @ C00_EVENT_NONE -kTMEventTypeDoorAnimation = 1, // @ C01_EVENT_DOOR_ANIMATION -kTMEventTypeDoorDestruction = 2, // @ C02_EVENT_DOOR_DESTRUCTION -kTMEventTypeCorridor = 5, // @ C05_EVENT_CORRIDOR -kTMEventTypeWall = 6, // @ C06_EVENT_WALL -kTMEventTypeFakeWall = 7, // @ C07_EVENT_FAKEWALL -kTMEventTypeTeleporter = 8, // @ C08_EVENT_TELEPORTER -kTMEventTypePit = 9, // @ C09_EVENT_PIT -kTMEventTypeDoor = 10, // @ C10_EVENT_DOOR -kTMEventTypeEnableChampionAction = 11, // @ C11_EVENT_ENABLE_CHAMPION_ACTION -kTMEventTypeHideDamageReceived = 12, // @ C12_EVENT_HIDE_DAMAGE_RECEIVED -kTMEventTypeViAltarRebirth = 13, // @ C13_EVENT_VI_ALTAR_REBIRTH -kTMEventTypePlaySound = 20, // @ C20_EVENT_PLAY_SOUND -kTMEventTypeCPSE = 22, // @ C22_EVENT_CPSE -kTMEventTypeRemoveFluxcage = 24, // @ C24_EVENT_REMOVE_FLUXCAGE -kTMEventTypeExplosion = 25, // @ C25_EVENT_EXPLOSION -kTMEventTypeGroupReactionDangerOnSquare = 29, // @ C29_EVENT_GROUP_REACTION_DANGER_ON_SQUARE -kTMEventTypeGroupReacionHitByProjectile = 30, // @ C30_EVENT_GROUP_REACTION_HIT_BY_PROJECTILE -kTMEventTypeGroupReactionPartyIsAdjecent = 31, // @ C31_EVENT_GROUP_REACTION_PARTY_IS_ADJACENT -kTMEventTypeUpdateAspectGroup = 32, // @ C32_EVENT_UPDATE_ASPECT_GROUP +kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent = -1, // @ CM1_EVENT_CREATE_REACTION_EVENT_31_PARTY_IS_ADJACENT +k0_TMEventTypeNone = 0, // @ C00_EVENT_NONE +k1_TMEventTypeDoorAnimation = 1, // @ C01_EVENT_DOOR_ANIMATION +k2_TMEventTypeDoorDestruction = 2, // @ C02_EVENT_DOOR_DESTRUCTION +k5_TMEventTypeCorridor = 5, // @ C05_EVENT_CORRIDOR +k6_TMEventTypeWall = 6, // @ C06_EVENT_WALL +k7_TMEventTypeFakeWall = 7, // @ C07_EVENT_FAKEWALL +k8_TMEventTypeTeleporter = 8, // @ C08_EVENT_TELEPORTER +k9_TMEventTypePit = 9, // @ C09_EVENT_PIT +k10_TMEventTypeDoor = 10, // @ C10_EVENT_DOOR +k11_TMEventTypeEnableChampionAction = 11, // @ C11_EVENT_ENABLE_CHAMPION_ACTION +k12_TMEventTypeHideDamageReceived = 12, // @ C12_EVENT_HIDE_DAMAGE_RECEIVED +k13_TMEventTypeViAltarRebirth = 13, // @ C13_EVENT_VI_ALTAR_REBIRTH +k20_TMEventTypePlaySound = 20, // @ C20_EVENT_PLAY_SOUND +k22_TMEventTypeCPSE = 22, // @ C22_EVENT_CPSE +k24_TMEventTypeRemoveFluxcage = 24, // @ C24_EVENT_REMOVE_FLUXCAGE +k25_TMEventTypeExplosion = 25, // @ C25_EVENT_EXPLOSION +k29_TMEventTypeGroupReactionDangerOnSquare = 29, // @ C29_EVENT_GROUP_REACTION_DANGER_ON_SQUARE +k30_TMEventTypeGroupReacionHitByProjectile = 30, // @ C30_EVENT_GROUP_REACTION_HIT_BY_PROJECTILE +k31_TMEventTypeGroupReactionPartyIsAdjecent = 31, // @ C31_EVENT_GROUP_REACTION_PARTY_IS_ADJACENT +k32_TMEventTypeUpdateAspectGroup = 32, // @ C32_EVENT_UPDATE_ASPECT_GROUP /* Events = 33,-36 and = 38,-41 are used for individual creatures only while the group is attacking the party */ -kTMEventTypeUpdateAspectCreature_0 = 33, // @ C33_EVENT_UPDATE_ASPECT_CREATURE_0 -kTMEventTypeUpdateAspectCreature_1 = 34, // @ C34_EVENT_UPDATE_ASPECT_CREATURE_1 -kTMEventTypeUpdateAspectCreature_2 = 35, // @ C35_EVENT_UPDATE_ASPECT_CREATURE_2 -kTMEventTypeUpdateAspectCreature_3 = 36, // @ C36_EVENT_UPDATE_ASPECT_CREATURE_3 -kTMEventTypeUpdateBehaviourGroup = 37, // @ C37_EVENT_UPDATE_BEHAVIOR_GROUP -kTMEventTypeUpdateBehaviour_0 = 38, // @ C38_EVENT_UPDATE_BEHAVIOR_CREATURE_0 -kTMEventTypeUpdateBehaviour_1 = 39, // @ C39_EVENT_UPDATE_BEHAVIOR_CREATURE_1 -kTMEventTypeUpdateBehaviour_2 = 40, // @ C40_EVENT_UPDATE_BEHAVIOR_CREATURE_2 -kTMEventTypeUpdateBehaviour_3 = 41, // @ C41_EVENT_UPDATE_BEHAVIOR_CREATURE_3 +k33_TMEventTypeUpdateAspectCreature_0 = 33, // @ C33_EVENT_UPDATE_ASPECT_CREATURE_0 +k34_TMEventTypeUpdateAspectCreature_1 = 34, // @ C34_EVENT_UPDATE_ASPECT_CREATURE_1 +k35_TMEventTypeUpdateAspectCreature_2 = 35, // @ C35_EVENT_UPDATE_ASPECT_CREATURE_2 +k36_TMEventTypeUpdateAspectCreature_3 = 36, // @ C36_EVENT_UPDATE_ASPECT_CREATURE_3 +k37_TMEventTypeUpdateBehaviourGroup = 37, // @ C37_EVENT_UPDATE_BEHAVIOR_GROUP +k38_TMEventTypeUpdateBehaviour_0 = 38, // @ C38_EVENT_UPDATE_BEHAVIOR_CREATURE_0 +k39_TMEventTypeUpdateBehaviour_1 = 39, // @ C39_EVENT_UPDATE_BEHAVIOR_CREATURE_1 +k40_TMEventTypeUpdateBehaviour_2 = 40, // @ C40_EVENT_UPDATE_BEHAVIOR_CREATURE_2 +k41_TMEventTypeUpdateBehaviour_3 = 41, // @ C41_EVENT_UPDATE_BEHAVIOR_CREATURE_3 /* Projectiles created by a champion (by casting a spell, shooting a weapon or throwing an object) or by a creature (by casting a spell) ignore impacts during their first movement otherwise an impact would always occur immediately as these projectiles are created on the champion or creature square */ -kTMEventTypeMoveProjectileIgnoreImpacts = 48, // @ C48_EVENT_MOVE_PROJECTILE_IGNORE_IMPACTS +k48_TMEventTypeMoveProjectileIgnoreImpacts = 48, // @ C48_EVENT_MOVE_PROJECTILE_IGNORE_IMPACTS /* Projectiles created by projectile launcher sensors never ignore impacts as well as all other projectiles after their first movement */ -kTMEventTypeMoveProjectile = 49, // @ C49_EVENT_MOVE_PROJECTILE -kTMEventTypeWatchdoge = 53, // @ C53_EVENT_WATCHDOG -kTMEventTypeMoveGroupSilent = 60, // @ C60_EVENT_MOVE_GROUP_SILENT -kTMEventTypeMoveGroupAudible = 61, // @ C61_EVENT_MOVE_GROUP_AUDIBLE -kTMEventTypeEnableGroupGenerator = 65, // @ C65_EVENT_ENABLE_GROUP_GENERATOR -kTMEventTypeLight = 70, // @ C70_EVENT_LIGHT -kTMEventTypeInvisibility = 71, // @ C71_EVENT_INVISIBILITY -kTMEventTypeChampionShield = 72, // @ C72_EVENT_CHAMPION_SHIELD -kTMEventTypeThievesEye = 73, // @ C73_EVENT_THIEVES_EYE -kTMEventTypePartyShield = 74, // @ C74_EVENT_PARTY_SHIELD -kTMEventTypePoisonChampion = 75, // @ C75_EVENT_POISON_CHAMPION -kTMEventTypeSpellShield = 77, // @ C77_EVENT_SPELLSHIELD -kTMEventTypeFireShield = 78, // @ C78_EVENT_FIRESHIELD -kTMEventTypeFootprints = 79, // @ C79_EVENT_FOOTPRINTS -kTMEventTypeMagicMap_C80 = 80, // @ C80_EVENT_MAGIC_MAP -kTMEventTypeMagicMap_C81 = 81, // @ C81_EVENT_MAGIC_MAP -kTMEventTypeMagicMap_C82 = 82, // @ C82_EVENT_MAGIC_MAP -kTMEventTypeMagicMap_C83 = 83 // @ C83_EVENT_MAGIC_MAP +k49_TMEventTypeMoveProjectile = 49, // @ C49_EVENT_MOVE_PROJECTILE +k53_TMEventTypeWatchdoge = 53, // @ C53_EVENT_WATCHDOG +k60_TMEventTypeMoveGroupSilent = 60, // @ C60_EVENT_MOVE_GROUP_SILENT +k61_TMEventTypeMoveGroupAudible = 61, // @ C61_EVENT_MOVE_GROUP_AUDIBLE +k65_TMEventTypeEnableGroupGenerator = 65, // @ C65_EVENT_ENABLE_GROUP_GENERATOR +k70_TMEventTypeLight = 70, // @ C70_EVENT_LIGHT +k71_TMEventTypeInvisibility = 71, // @ C71_EVENT_INVISIBILITY +k72_TMEventTypeChampionShield = 72, // @ C72_EVENT_CHAMPION_SHIELD +k73_TMEventTypeThievesEye = 73, // @ C73_EVENT_THIEVES_EYE +k74_TMEventTypePartyShield = 74, // @ C74_EVENT_PARTY_SHIELD +k75_TMEventTypePoisonChampion = 75, // @ C75_EVENT_POISON_CHAMPION +k77_TMEventTypeSpellShield = 77, // @ C77_EVENT_SPELLSHIELD +k78_TMEventTypeFireShield = 78, // @ C78_EVENT_FIRESHIELD +k79_TMEventTypeFootprints = 79, // @ C79_EVENT_FOOTPRINTS +k80_TMEventTypeMagicMap_C80 = 80, // @ C80_EVENT_MAGIC_MAP +k81_TMEventTypeMagicMap_C81 = 81, // @ C81_EVENT_MAGIC_MAP +k82_TMEventTypeMagicMap_C82 = 82, // @ C82_EVENT_MAGIC_MAP +k83_TMEventTypeMagicMap_C83 = 83 // @ C83_EVENT_MAGIC_MAP }; class TimelineEvent { @@ -145,11 +145,11 @@ public: class Timeline { DMEngine *_vm; public: - uint16 _eventMaxCount; // @ G0369_ui_EventMaximumCount - TimelineEvent *_events; // @ G0370_ps_Events - uint16 _eventCount; // @ G0372_ui_EventCount - uint16 *_timeline; // @ G0371_pui_Timeline - uint16 _firstUnusedEventIndex; // @ G0373_ui_FirstUnusedEventIndex + uint16 _g369_eventMaxCount; // @ G0369_ui_EventMaximumCount + TimelineEvent *_g370_events; // @ G0370_ps_Events + uint16 _g372_eventCount; // @ G0372_ui_EventCount + uint16 *_g371_timeline; // @ G0371_pui_Timeline + uint16 _g373_firstUnusedEventIndex; // @ G0373_ui_FirstUnusedEventIndex Timeline(DMEngine *vm); ~Timeline(); |