mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 19:16:21 +00:00
DM: Rename functions
This commit is contained in:
parent
31b10d6d0d
commit
d69236e674
@ -93,22 +93,22 @@ Box gBoxChampionPortrait = Box(0, 31, 0, 28); // @ G0047_s_Graphic562_Box_Champi
|
||||
ChampionMan::ChampionMan(DMEngine *vm) : _vm(vm) {
|
||||
_g411_leaderIndex = kM1_ChampionNone;
|
||||
|
||||
_303_partyDead = false;
|
||||
_g303_partyDead = false;
|
||||
_g300_partyIsSleeping = false;
|
||||
_g413_leaderHandObjectIconIndex = kM1_IconIndiceNone;
|
||||
_g415_leaderEmptyHanded = true;
|
||||
_g514_magicCasterChampionIndex = kM1_ChampionNone;
|
||||
}
|
||||
|
||||
uint16 ChampionMan::getChampionPortraitX(uint16 index) {
|
||||
uint16 ChampionMan::M27_getChampionPortraitX(uint16 index) {
|
||||
return ((index) & 0x7) << 5;
|
||||
}
|
||||
|
||||
uint16 ChampionMan::getChampionPortraitY(uint16 index) {
|
||||
uint16 ChampionMan::M28_getChampionPortraitY(uint16 index) {
|
||||
return ((index) >> 3) * 29;
|
||||
}
|
||||
|
||||
int16 ChampionMan::getDecodedValue(char *string, uint16 characterCount) {
|
||||
int16 ChampionMan::f279_getDecodedValue(char *string, uint16 characterCount) {
|
||||
int val = 0;
|
||||
for (uint16 i = 0; i < characterCount; ++i) {
|
||||
val = (val << 4) + (string[i] - 'A');
|
||||
@ -116,19 +116,19 @@ int16 ChampionMan::getDecodedValue(char *string, uint16 characterCount) {
|
||||
return val;
|
||||
}
|
||||
|
||||
void ChampionMan::drawHealthOrStaminaOrManaValue(int16 posY, int16 currVal, int16 maxVal) {
|
||||
Common::String tmp = getStringFromInteger(currVal, true, 3).c_str();
|
||||
_vm->_textMan->printToViewport(55, posY, k13_ColorLightestGray, tmp.c_str());
|
||||
_vm->_textMan->printToViewport(73, posY, k13_ColorLightestGray, "/");
|
||||
tmp = getStringFromInteger(maxVal, true, 3);
|
||||
_vm->_textMan->printToViewport(79, posY, k13_ColorLightestGray, tmp.c_str());
|
||||
void ChampionMan::f289_drawHealthOrStaminaOrManaValue(int16 posY, int16 currVal, int16 maxVal) {
|
||||
Common::String tmp = f288_getStringFromInteger(currVal, true, 3).c_str();
|
||||
_vm->_textMan->f52_printToViewport(55, posY, k13_ColorLightestGray, tmp.c_str());
|
||||
_vm->_textMan->f52_printToViewport(73, posY, k13_ColorLightestGray, "/");
|
||||
tmp = f288_getStringFromInteger(maxVal, true, 3);
|
||||
_vm->_textMan->f52_printToViewport(79, posY, k13_ColorLightestGray, tmp.c_str());
|
||||
}
|
||||
|
||||
uint16 ChampionMan::handSlotIndex(uint16 slotBoxIndex) {
|
||||
uint16 ChampionMan::M70_handSlotIndex(uint16 slotBoxIndex) {
|
||||
return slotBoxIndex & 0x1;
|
||||
}
|
||||
|
||||
Common::String ChampionMan::getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount) {
|
||||
Common::String ChampionMan::f288_getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount) {
|
||||
using namespace Common;
|
||||
String valToStr = String::format("%d", val);
|
||||
String result;
|
||||
@ -138,15 +138,15 @@ Common::String ChampionMan::getStringFromInteger(uint16 val, bool padding, uint1
|
||||
return result += valToStr;
|
||||
}
|
||||
|
||||
void ChampionMan::applyModifiersToStatistics(Champion* champ, ChampionSlot slotIndex, IconIndice iconIndex, int16 modifierFactor, Thing thing) {
|
||||
void ChampionMan::f299_pplyModifiersToStatistics(Champion* champ, ChampionSlot slotIndex, IconIndice iconIndex, int16 modifierFactor, Thing thing) {
|
||||
int16 statIndex;
|
||||
int16 modifier = 0;
|
||||
ThingType thingType = thing.getType();
|
||||
if (((thingType == k5_WeaponThingType) || (thingType == k6_ArmourThingType))
|
||||
&& (slotIndex >= k0_ChampionSlotReadyHand)
|
||||
&& (slotIndex <= k12_ChampionSlotQuiverLine_1_1)) {
|
||||
Weapon *weapon = (Weapon*)_vm->_dungeonMan->getThingData(thing);
|
||||
Armour *armour = (Armour*)_vm->_dungeonMan->getThingData(thing);
|
||||
Weapon *weapon = (Weapon*)_vm->_dungeonMan->f156_getThingData(thing);
|
||||
Armour *armour = (Armour*)_vm->_dungeonMan->f156_getThingData(thing);
|
||||
if (((thingType == k5_WeaponThingType) && weapon->getCursed())
|
||||
|| ((thingType == k6_ArmourThingType) && armour->getCursed())) {
|
||||
statIndex = k0_ChampionStatLuck;
|
||||
@ -273,20 +273,20 @@ T0299044_ApplyModifier:
|
||||
|
||||
}
|
||||
|
||||
bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) {
|
||||
bool ChampionMan::f295_hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) {
|
||||
ObjectMan &objMan = *_vm->_objectMan;
|
||||
|
||||
IconIndice currIconIndex = objMan.getIconIndexInSlotBox(slotBoxIndex);
|
||||
IconIndice currIconIndex = objMan.f39_getIconIndexInSlotBox(slotBoxIndex);
|
||||
if (((currIconIndex < k32_IconIndiceWeaponDagger) && (currIconIndex >= k0_IconIndiceJunkCompassNorth))
|
||||
|| ((currIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (currIconIndex <= k163_IconIndicePotionWaterFlask))
|
||||
|| (currIconIndex == k195_IconIndicePotionEmptyFlask)) {
|
||||
IconIndice newIconIndex = objMan.getIconIndex(thing);
|
||||
IconIndice newIconIndex = objMan.f33_getIconIndex(thing);
|
||||
if (newIconIndex != currIconIndex) {
|
||||
if ((slotBoxIndex < k8_SlotBoxInventoryFirstSlot) && !_g420_mousePointerHiddenToDrawChangedObjIconOnScreen) {
|
||||
_g420_mousePointerHiddenToDrawChangedObjIconOnScreen = true;
|
||||
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
|
||||
}
|
||||
objMan.drawIconInSlotBox(slotBoxIndex, newIconIndex);
|
||||
objMan.f38_drawIconInSlotBox(slotBoxIndex, newIconIndex);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -294,7 +294,7 @@ bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing)
|
||||
return false;
|
||||
}
|
||||
|
||||
void ChampionMan::drawChangedObjectIcons() {
|
||||
void ChampionMan::f296_drawChangedObjectIcons() {
|
||||
InventoryMan &invMan = *_vm->_inventoryMan;
|
||||
ObjectMan &objMan = *_vm->_objectMan;
|
||||
MenuMan &menuMan = *_vm->_menuMan;
|
||||
@ -309,52 +309,52 @@ void ChampionMan::drawChangedObjectIcons() {
|
||||
if (((leaderHandObjIconIndex < k32_IconIndiceWeaponDagger) && (leaderHandObjIconIndex >= k0_IconIndiceJunkCompassNorth)) // < instead of <= is correct
|
||||
|| ((leaderHandObjIconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (leaderHandObjIconIndex <= k163_IconIndicePotionWaterFlask))
|
||||
|| (leaderHandObjIconIndex == k195_IconIndicePotionEmptyFlask)) {
|
||||
IconIndice iconIndex = objMan.getIconIndex(_414_leaderHandObject);
|
||||
IconIndice iconIndex = objMan.f33_getIconIndex(_g414_leaderHandObject);
|
||||
if (iconIndex != leaderHandObjIconIndex) {
|
||||
_g420_mousePointerHiddenToDrawChangedObjIconOnScreen = true;
|
||||
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
|
||||
objMan.extractIconFromBitmap(iconIndex, objMan._g412_objectIconForMousePointer);
|
||||
objMan.f36_extractIconFromBitmap(iconIndex, objMan._g412_objectIconForMousePointer);
|
||||
warning("MISSING CODE: F0068_MOUSE_SetPointerToObject");
|
||||
_g413_leaderHandObjectIconIndex = iconIndex;
|
||||
objMan.drawLeaderObjectName(_414_leaderHandObject);
|
||||
objMan.f34_drawLeaderObjectName(_g414_leaderHandObject);
|
||||
}
|
||||
}
|
||||
|
||||
for (uint16 slotBoxIndex = 0; slotBoxIndex < (_g305_partyChampionCount * 2); ++slotBoxIndex) {
|
||||
int16 champIndex = slotBoxIndex >> 1;
|
||||
if (invChampOrdinal == _vm->indexToOrdinal(champIndex))
|
||||
if (invChampOrdinal == _vm->M0_indexToOrdinal(champIndex))
|
||||
continue;
|
||||
|
||||
if (hasObjectIconInSlotBoxChanged(slotBoxIndex, _champions[champIndex].getSlot((ChampionSlot)handSlotIndex(slotBoxIndex)))
|
||||
&& (handSlotIndex(slotBoxIndex) == k1_ChampionSlotActionHand)) {
|
||||
if (f295_hasObjectIconInSlotBoxChanged(slotBoxIndex, _gK71_champions[champIndex].getSlot((ChampionSlot)M70_handSlotIndex(slotBoxIndex)))
|
||||
&& (M70_handSlotIndex(slotBoxIndex) == k1_ChampionSlotActionHand)) {
|
||||
|
||||
menuMan.drawActionIcon((ChampionIndex)champIndex);
|
||||
menuMan.f386_drawActionIcon((ChampionIndex)champIndex);
|
||||
}
|
||||
}
|
||||
|
||||
if (invChampOrdinal) {
|
||||
Champion *champ = &_champions[_vm->ordinalToIndex(invChampOrdinal)];
|
||||
Champion *champ = &_gK71_champions[_vm->M1_ordinalToIndex(invChampOrdinal)];
|
||||
Thing *thing = &champ->getSlot(k0_ChampionSlotReadyHand);
|
||||
uint16 drawViewport = 0;
|
||||
|
||||
for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++, thing++) {
|
||||
uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
|
||||
uint16 objIconChanged = f295_hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
|
||||
drawViewport |= objIconChanged;
|
||||
if (objIconChanged && (slotIndex == k1_ChampionSlotActionHand)) {
|
||||
menuMan.drawActionIcon((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
|
||||
menuMan.f386_drawActionIcon((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal));
|
||||
}
|
||||
}
|
||||
|
||||
if (invMan._g424_panelContent = k4_PanelContentChest) {
|
||||
thing = invMan._g425_chestSlots;
|
||||
for (int16 slotIndex = 0; slotIndex < 8; ++slotIndex, thing++) {
|
||||
drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0);
|
||||
drawViewport |= (f295_hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (drawViewport) {
|
||||
champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true);
|
||||
drawChampionState((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
|
||||
f292_drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal));
|
||||
}
|
||||
}
|
||||
|
||||
@ -362,7 +362,7 @@ void ChampionMan::drawChangedObjectIcons() {
|
||||
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
|
||||
}
|
||||
|
||||
void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex) {
|
||||
void ChampionMan::f301_addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex) {
|
||||
InventoryMan &invMan = *_vm->_inventoryMan;
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
ObjectMan &objMan = *_vm->_objectMan;
|
||||
@ -371,7 +371,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
|
||||
if (thing == Thing::_none)
|
||||
return;
|
||||
|
||||
Champion *champ = &_champions[champIndex];
|
||||
Champion *champ = &_gK71_champions[champIndex];
|
||||
|
||||
if (slotIndex >= k30_ChampionSlotChest_1) {
|
||||
invMan._g425_chestSlots[slotIndex - k30_ChampionSlotChest_1] = thing;
|
||||
@ -379,30 +379,30 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
|
||||
champ->setSlot(slotIndex, thing);
|
||||
}
|
||||
|
||||
champ->_load += dunMan.getObjectWeight(thing);
|
||||
champ->_load += dunMan.f140_getObjectWeight(thing);
|
||||
champ->setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
|
||||
IconIndice iconIndex = objMan.getIconIndex(thing);
|
||||
bool isInventoryChampion = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
|
||||
applyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing);
|
||||
uint16 *rawObjPtr = dunMan.getThingData(thing);
|
||||
IconIndice iconIndex = objMan.f33_getIconIndex(thing);
|
||||
bool isInventoryChampion = (_vm->M0_indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
|
||||
f299_pplyModifiersToStatistics(champ, slotIndex, iconIndex, 1, thing);
|
||||
uint16 *rawObjPtr = dunMan.f156_getThingData(thing);
|
||||
|
||||
if (slotIndex < k2_ChampionSlotHead) {
|
||||
|
||||
if (slotIndex == k1_ChampionSlotActionHand) {
|
||||
champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
|
||||
if (_g506_actingChampionOrdinal == _vm->indexToOrdinal(champIndex))
|
||||
menuMan.clearActingChampion();
|
||||
if (_g506_actingChampionOrdinal == _vm->M0_indexToOrdinal(champIndex))
|
||||
menuMan.f388_clearActingChampion();
|
||||
|
||||
if ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)) {
|
||||
((Scroll*)rawObjPtr)->setClosed(false);
|
||||
drawChangedObjectIcons();
|
||||
f296_drawChangedObjectIcons();
|
||||
}
|
||||
}
|
||||
|
||||
if (iconIndex = k4_IconIndiceWeaponTorchUnlit) {
|
||||
((Weapon*)rawObjPtr)->setLit(true);
|
||||
warning("MISSING CODE: F0337_INVENTORY_SetDungeonViewPalette");
|
||||
drawChangedObjectIcons();
|
||||
f296_drawChangedObjectIcons();
|
||||
} else if (isInventoryChampion && (slotIndex == k1_ChampionSlotActionHand) &&
|
||||
((iconIndex == k144_IconIndiceContainerChestClosed) || ((iconIndex >= k30_IconIndiceScrollOpen) && (iconIndex <= k31_IconIndiceScrollClosed)))) {
|
||||
champ->setAttributeFlag(k0x0800_ChampionAttributePanel, true);
|
||||
@ -422,33 +422,33 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
|
||||
|
||||
}
|
||||
|
||||
drawSlot(champIndex, slotIndex);
|
||||
f291_drawSlot(champIndex, slotIndex);
|
||||
if (isInventoryChampion)
|
||||
champ->setAttributeFlag(k0x4000_ChampionAttributeViewport, true);
|
||||
}
|
||||
|
||||
ChampionIndex ChampionMan::getIndexInCell(ViewCell cell) {
|
||||
ChampionIndex ChampionMan::f285_getIndexInCell(ViewCell cell) {
|
||||
for (uint16 i = 0; i < _g305_partyChampionCount; ++i) {
|
||||
if ((_champions[i]._cell == cell) && _champions[i]._currHealth)
|
||||
if ((_gK71_champions[i]._cell == cell) && _gK71_champions[i]._currHealth)
|
||||
return (ChampionIndex)i;
|
||||
}
|
||||
|
||||
return kM1_ChampionNone;
|
||||
}
|
||||
|
||||
void ChampionMan::resetDataToStartGame() {
|
||||
void ChampionMan::f278_resetDataToStartGame() {
|
||||
if (!_vm->_g298_newGame) {
|
||||
warning("MISSING CODE: stuff for resetting for loaded games");
|
||||
assert(false);
|
||||
}
|
||||
|
||||
_414_leaderHandObject = Thing::_none;
|
||||
_g414_leaderHandObject = Thing::_none;
|
||||
_g413_leaderHandObjectIconIndex = kM1_IconIndiceNone;
|
||||
_g415_leaderEmptyHanded = true;
|
||||
}
|
||||
|
||||
|
||||
void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
void ChampionMan::f280_addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
|
||||
@ -456,12 +456,12 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
return;
|
||||
|
||||
uint16 prevChampCount = _g305_partyChampionCount;
|
||||
Champion *champ = &_champions[prevChampCount];
|
||||
Champion *champ = &_gK71_champions[prevChampCount];
|
||||
champ->resetToZero();
|
||||
dispMan._g578_useByteBoxCoordinates = true;
|
||||
{ // limit destBox scope
|
||||
Box &destBox = gBoxChampionPortrait;
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k26_ChampionPortraitsIndice), 256, getChampionPortraitX(championPortraitIndex), getChampionPortraitY(championPortraitIndex),
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k26_ChampionPortraitsIndice), 256, M27_getChampionPortraitX(championPortraitIndex), M28_getChampionPortraitY(championPortraitIndex),
|
||||
champ->_portrait, 32, destBox, k255_ColorNoTransparency);
|
||||
}
|
||||
|
||||
@ -470,7 +470,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
champ->_hideDamageReceivedIndex = -1;
|
||||
champ->_dir = dunMan._g308_partyDir;
|
||||
ViewCell AL_0_viewCell = k0_ViewCellFronLeft;
|
||||
while (getIndexInCell((ViewCell)((AL_0_viewCell + dunMan._g308_partyDir) & 3)) != kM1_ChampionNone)
|
||||
while (f285_getIndexInCell((ViewCell)((AL_0_viewCell + dunMan._g308_partyDir) & 3)) != kM1_ChampionNone)
|
||||
AL_0_viewCell = (ViewCell)(AL_0_viewCell + 1);
|
||||
champ->_cell = (ViewCell)((AL_0_viewCell + dunMan._g308_partyDir) & 3);
|
||||
champ->clearAttributes(k0x0400_ChampionAttributeIcon);
|
||||
@ -481,13 +481,13 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
for (AL_0_slotIndex_Red = k0_ChampionSlotReadyHand; AL_0_slotIndex_Red < k30_ChampionSlotChest_1; ++AL_0_slotIndex_Red) {
|
||||
champ->setSlot((ChampionSlot)AL_0_slotIndex_Red, Thing::_none);
|
||||
}
|
||||
Thing thing = dunMan.getSquareFirstThing(dunMan._g306_partyMapX, dunMan._g307_partyMapY);
|
||||
Thing thing = dunMan.f161_getSquareFirstThing(dunMan._g306_partyMapX, dunMan._g307_partyMapY);
|
||||
while (thing.getType() != k2_TextstringType) {
|
||||
thing = dunMan.getNextThing(thing);
|
||||
thing = dunMan.f159_getNextThing(thing);
|
||||
}
|
||||
char decodedChampionText[77];
|
||||
char* character_Green = decodedChampionText;
|
||||
dunMan.decodeText(character_Green, thing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible));
|
||||
dunMan.f168_decodeText(character_Green, thing, (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible));
|
||||
int16 AL_0_characterIndex = 0;
|
||||
uint16 AL_2_character;
|
||||
while ((AL_2_character = *character_Green++) != '\n') {
|
||||
@ -511,18 +511,18 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
champ->setAttributeFlag(k0x0010_ChampionAttributeMale, true);
|
||||
}
|
||||
character_Green++;
|
||||
champ->_currHealth = champ->_maxHealth = getDecodedValue(character_Green, 4);
|
||||
champ->_currHealth = champ->_maxHealth = f279_getDecodedValue(character_Green, 4);
|
||||
character_Green += 4;
|
||||
champ->_currStamina = champ->_maxStamina = getDecodedValue(character_Green, 4);
|
||||
champ->_currStamina = champ->_maxStamina = f279_getDecodedValue(character_Green, 4);
|
||||
character_Green += 4;
|
||||
champ->_currMana = champ->_maxMana = getDecodedValue(character_Green, 4);
|
||||
champ->_currMana = champ->_maxMana = f279_getDecodedValue(character_Green, 4);
|
||||
character_Green += 4;
|
||||
character_Green++;
|
||||
|
||||
int16 AL_0_statisticIndex;
|
||||
for (AL_0_statisticIndex = k0_ChampionStatLuck; AL_0_statisticIndex <= k6_ChampionStatAntifire; ++AL_0_statisticIndex) {
|
||||
champ->setStatistic((ChampionStatisticType)AL_0_statisticIndex, k2_ChampionStatMinimum, 30);
|
||||
uint16 currMaxVal = getDecodedValue(character_Green, 2);
|
||||
uint16 currMaxVal = f279_getDecodedValue(character_Green, 2);
|
||||
champ->setStatistic((ChampionStatisticType)AL_0_statisticIndex, k1_ChampionStatCurrent, currMaxVal);
|
||||
champ->setStatistic((ChampionStatisticType)AL_0_statisticIndex, k0_ChampionStatMaximum, currMaxVal);
|
||||
character_Green += 2;
|
||||
@ -550,11 +550,11 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
|
||||
_g299_candidateChampionOrdinal = prevChampCount + 1;
|
||||
if (++_g305_partyChampionCount == 1) {
|
||||
_vm->_eventMan->commandSetLeader(k0_ChampionFirst);
|
||||
_vm->_eventMan->f368_commandSetLeader(k0_ChampionFirst);
|
||||
_vm->_menuMan->_g508_refreshActionArea = true;
|
||||
} else {
|
||||
_vm->_menuMan->clearActingChampion();
|
||||
_vm->_menuMan->drawActionIcon((ChampionIndex)(_g305_partyChampionCount - 1));
|
||||
_vm->_menuMan->f388_clearActingChampion();
|
||||
_vm->_menuMan->f386_drawActionIcon((ChampionIndex)(_g305_partyChampionCount - 1));
|
||||
}
|
||||
|
||||
int16 mapX = _vm->_dungeonMan->_g306_partyMapX;
|
||||
@ -563,13 +563,13 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
|
||||
uint16 championObjectsCell = returnOppositeDir((direction)(dunMan._g308_partyDir));
|
||||
mapX += _vm->_dirIntoStepCountEast[dunMan._g308_partyDir];
|
||||
mapY += _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir];
|
||||
thing = dunMan.getSquareFirstThing(mapX, mapY);
|
||||
thing = dunMan.f161_getSquareFirstThing(mapX, mapY);
|
||||
AL_0_slotIndex_Red = k13_ChampionSlotBackpackLine_1_1;
|
||||
uint16 slotIndex_Green;
|
||||
while (thing != Thing::_endOfList) {
|
||||
ThingType AL_2_thingType = thing.getType();
|
||||
if ((AL_2_thingType > k3_SensorThingType) && (thing.getCell() == championObjectsCell)) {
|
||||
int16 objectAllowedSlots = g237_ObjectInfo[dunMan.getObjectInfoIndex(thing)].getAllowedSlots();
|
||||
int16 objectAllowedSlots = g237_ObjectInfo[dunMan.f141_getObjectInfoIndex(thing)].getAllowedSlots();
|
||||
switch (AL_2_thingType) {
|
||||
case k6_ArmourThingType:
|
||||
for (slotIndex_Green = k2_ChampionSlotHead; slotIndex_Green <= k5_ChampionSlotFeet; slotIndex_Green++) {
|
||||
@ -616,18 +616,18 @@ T0280048:
|
||||
if (champ->getSlot((ChampionSlot)slotIndex_Green) != Thing::_none) {
|
||||
goto T0280046;
|
||||
}
|
||||
addObjectInSlot((ChampionIndex)prevChampCount, thing, (ChampionSlot)slotIndex_Green);
|
||||
f301_addObjectInSlot((ChampionIndex)prevChampCount, thing, (ChampionSlot)slotIndex_Green);
|
||||
}
|
||||
thing = dunMan.getNextThing(thing);
|
||||
thing = dunMan.f159_getNextThing(thing);
|
||||
}
|
||||
|
||||
_vm->_inventoryMan->toggleInventory((ChampionIndex)prevChampCount);
|
||||
_vm->_menuMan->drawDisabledMenu();
|
||||
_vm->_inventoryMan->f355_toggleInventory((ChampionIndex)prevChampCount);
|
||||
_vm->_menuMan->f456_drawDisabledMenu();
|
||||
}
|
||||
|
||||
void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {
|
||||
void ChampionMan::f287_drawChampionBarGraphs(ChampionIndex champIndex) {
|
||||
|
||||
Champion *curChampion = &_champions[champIndex];
|
||||
Champion *curChampion = &_gK71_champions[champIndex];
|
||||
int16 barGraphIndex = 0;
|
||||
int16 barGraphHeightArray[3];
|
||||
|
||||
@ -676,12 +676,12 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {
|
||||
if (barGraphHeight < 25) {
|
||||
box._y1 = 2;
|
||||
box._y1 = 27 - barGraphHeight + 1;
|
||||
_vm->_displayMan->clearScreenBox(g46_ChampionColor[champIndex], box);
|
||||
_vm->_displayMan->D24_clearScreenBox(g46_ChampionColor[champIndex], box);
|
||||
}
|
||||
if (barGraphHeight) {
|
||||
box._y1 = 27 - barGraphHeight;
|
||||
box._y2 = 26 + 1;
|
||||
_vm->_displayMan->clearScreenBox(g46_ChampionColor[champIndex], box);
|
||||
_vm->_displayMan->D24_clearScreenBox(g46_ChampionColor[champIndex], box);
|
||||
}
|
||||
box._x1 += 7;
|
||||
box._x2 += 7;
|
||||
@ -690,7 +690,7 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {
|
||||
}
|
||||
|
||||
|
||||
uint16 ChampionMan::getStaminaAdjustedValue(Champion *champ, int16 val) {
|
||||
uint16 ChampionMan::f306_getStaminaAdjustedValue(Champion *champ, int16 val) {
|
||||
int16 currStamina = champ->_currStamina;
|
||||
int16 halfMaxStamina = champ->_maxStamina / 2;
|
||||
if (currStamina < halfMaxStamina) {
|
||||
@ -701,14 +701,14 @@ uint16 ChampionMan::getStaminaAdjustedValue(Champion *champ, int16 val) {
|
||||
return val;
|
||||
}
|
||||
|
||||
uint16 ChampionMan::getMaximumLoad(Champion *champ) {
|
||||
uint16 ChampionMan::f309_getMaximumLoad(Champion *champ) {
|
||||
uint16 maximumLoad = champ->getStatistic(k1_ChampionStatStrength, k1_ChampionStatCurrent) * 8 + 100;
|
||||
maximumLoad = getStaminaAdjustedValue(champ, maximumLoad);
|
||||
maximumLoad = f306_getStaminaAdjustedValue(champ, maximumLoad);
|
||||
int16 wounds = champ->getWounds();
|
||||
if (wounds) {
|
||||
maximumLoad -= maximumLoad >> (champ->getWoundsFlag(k0x0010_ChampionWoundLegs) ? 2 : 3);
|
||||
}
|
||||
if (_vm->_objectMan->getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == k119_IconIndiceArmourElvenBoots) {
|
||||
if (_vm->_objectMan->f33_getIconIndex(champ->getSlot(k5_ChampionSlotFeet)) == k119_IconIndiceArmourElvenBoots) {
|
||||
maximumLoad += maximumLoad * 16;
|
||||
}
|
||||
maximumLoad += 9;
|
||||
@ -716,7 +716,7 @@ uint16 ChampionMan::getMaximumLoad(Champion *champ) {
|
||||
return maximumLoad;
|
||||
}
|
||||
|
||||
void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
void ChampionMan::f292_drawChampionState(ChampionIndex champIndex) {
|
||||
InventoryMan &invMan = *_vm->_inventoryMan;
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
MenuMan &menuMan = *_vm->_menuMan;
|
||||
@ -724,14 +724,14 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
|
||||
Box box;
|
||||
int16 champStatusBoxX = champIndex * k69_ChampionStatusBoxSpacing;
|
||||
Champion *champ = &_champions[champIndex];
|
||||
Champion *champ = &_gK71_champions[champIndex];
|
||||
uint16 champAttributes = champ->getAttributes();
|
||||
if (!((champAttributes) & (k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x0200_ChampionAttributeLoad | k0x0400_ChampionAttributeIcon |
|
||||
k0x0800_ChampionAttributePanel | k0x1000_ChampionAttributeStatusBox | k0x2000_ChampionAttributeWounds | k0x4000_ChampionAttributeViewport |
|
||||
k0x8000_ChampionAttributeActionHand))) {
|
||||
return;
|
||||
}
|
||||
bool isInventoryChamp = (_vm->indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
|
||||
bool isInventoryChamp = (_vm->M0_indexToOrdinal(champIndex) == invMan._g432_inventoryChampionOrdinal);
|
||||
dispMan._g578_useByteBoxCoordinates = false;
|
||||
if (champAttributes & k0x1000_ChampionAttributeStatusBox) {
|
||||
box._y1 = 0;
|
||||
@ -739,7 +739,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
box._x1 = champStatusBoxX;
|
||||
box._x2 = box._x1 + 66 + 1;
|
||||
if (champ->_currHealth) {
|
||||
dispMan.clearScreenBox(k12_ColorDarkestGray, box);
|
||||
dispMan.D24_clearScreenBox(k12_ColorDarkestGray, box);
|
||||
int16 nativeBitmapIndices[3];
|
||||
for (int16 i = 0; i < 3; ++i)
|
||||
nativeBitmapIndices[i] = 0;
|
||||
@ -751,20 +751,20 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
if (_g407_party._shieldDefense > 0)
|
||||
nativeBitmapIndices[AL_0_borderCount++] = k37_BorderPartyShieldIndice;
|
||||
while (AL_0_borderCount--) {
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(nativeBitmapIndices[AL_0_borderCount]), 80, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(nativeBitmapIndices[AL_0_borderCount]), 80, 0, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k10_ColorFlesh);
|
||||
}
|
||||
if (isInventoryChamp) {
|
||||
invMan.drawStatusBoxPortrait(champIndex);
|
||||
invMan.f354_drawStatusBoxPortrait(champIndex);
|
||||
champAttributes |= k0x0100_ChampionAttributeStatistics;
|
||||
} else {
|
||||
champAttributes |= (k0x0080_ChampionAttributeNameTitle | k0x0100_ChampionAttributeStatistics | k0x2000_ChampionAttributeWounds | k0x8000_ChampionAttributeActionHand);
|
||||
}
|
||||
} else {
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k8_StatusBoxDeadChampion), 80, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k8_StatusBoxDeadChampion), 80, 0, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
|
||||
_vm->_textMan->f53_printToLogicalScreen(champStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, champ->_name);
|
||||
menuMan.drawActionIcon(champIndex);
|
||||
menuMan.f386_drawActionIcon(champIndex);
|
||||
goto T0292042_green;
|
||||
}
|
||||
}
|
||||
@ -776,35 +776,35 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
Color AL_0_colorIndex = (champIndex == _g411_leaderIndex) ? k9_ColorGold : k13_ColorLightestGray; // unused because of missing functions
|
||||
if (isInventoryChamp) {
|
||||
char *champName = champ->_name;
|
||||
_vm->_textMan->printToViewport(3, 7, AL_0_colorIndex, champName);
|
||||
_vm->_textMan->f52_printToViewport(3, 7, AL_0_colorIndex, champName);
|
||||
int16 champTitleX = 6 * strlen(champName) + 3;
|
||||
char champTitleFirstChar = champ->_title[0];
|
||||
if ((champTitleFirstChar != ',') && (champTitleFirstChar != ';') && (champTitleFirstChar != '-')) {
|
||||
champTitleX += 6;
|
||||
}
|
||||
_vm->_textMan->printToViewport(champTitleX, 7, AL_0_colorIndex, champ->_title);
|
||||
_vm->_textMan->f52_printToViewport(champTitleX, 7, AL_0_colorIndex, champ->_title);
|
||||
champAttributes |= k0x4000_ChampionAttributeViewport;
|
||||
} else {
|
||||
box._y1 = 0;
|
||||
box._y2 = 6 + 1;
|
||||
box._x1 = champStatusBoxX;
|
||||
box._x2 = box._x1 + 42 + 1;
|
||||
dispMan.clearScreenBox(k1_ColorDarkGary, box);
|
||||
dispMan.D24_clearScreenBox(k1_ColorDarkGary, box);
|
||||
_vm->_textMan->f53_printToLogicalScreen(champStatusBoxX + 1, 5, AL_0_colorIndex, k1_ColorDarkGary, champ->_name);
|
||||
}
|
||||
}
|
||||
|
||||
if (champAttributes & k0x0100_ChampionAttributeStatistics) {
|
||||
drawChampionBarGraphs(champIndex);
|
||||
f287_drawChampionBarGraphs(champIndex);
|
||||
if (isInventoryChamp) {
|
||||
drawHealthStaminaManaValues(champ);
|
||||
f290_drawHealthStaminaManaValues(champ);
|
||||
int16 AL_2_nativeBitmapIndex;
|
||||
if ((champ->_food < 0) || (champ->_water < 0) || (champ->_poisonEventCount)) {
|
||||
AL_2_nativeBitmapIndex = k34_SlotBoxWoundedIndice;
|
||||
} else {
|
||||
AL_2_nativeBitmapIndex = k33_SlotBoxNormalIndice;
|
||||
}
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0,
|
||||
dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, gBoxMouth, k12_ColorDarkestGray);
|
||||
AL_2_nativeBitmapIndex = k33_SlotBoxNormalIndice;
|
||||
for (int16 AL_0_statisticIndex = k1_ChampionStatStrength; AL_0_statisticIndex <= k6_ChampionStatAntifire; AL_0_statisticIndex++) {
|
||||
@ -814,7 +814,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(AL_2_nativeBitmapIndex), 32, 0, 0,
|
||||
dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, gBoxEye, k12_ColorDarkestGray);
|
||||
champAttributes |= k0x4000_ChampionAttributeViewport;
|
||||
}
|
||||
@ -822,7 +822,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
|
||||
if (champAttributes & k0x2000_ChampionAttributeWounds) {
|
||||
for (int16 AL_0_slotIndex = isInventoryChamp ? k5_ChampionSlotFeet : k1_ChampionSlotActionHand; AL_0_slotIndex >= k0_ChampionSlotReadyHand; AL_0_slotIndex--) {
|
||||
drawSlot(champIndex, (ChampionSlot)AL_0_slotIndex);
|
||||
f291_drawSlot(champIndex, (ChampionSlot)AL_0_slotIndex);
|
||||
}
|
||||
if (isInventoryChamp) {
|
||||
champAttributes |= k0x4000_ChampionAttributeViewport;
|
||||
@ -831,7 +831,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
|
||||
if ((champAttributes & k0x0200_ChampionAttributeLoad) && isInventoryChamp) {
|
||||
Color loadColor;
|
||||
int16 champMaxLoad = getMaximumLoad(champ);
|
||||
int16 champMaxLoad = f309_getMaximumLoad(champ);
|
||||
if (champ->_load > champMaxLoad) {
|
||||
loadColor = k8_ColorRed;
|
||||
} else if (((int32)champ->_load) * 8 > ((int32)champMaxLoad) * 5) {
|
||||
@ -839,46 +839,46 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
|
||||
} else {
|
||||
loadColor = k13_ColorLightestGray;
|
||||
}
|
||||
_vm->_textMan->printToViewport(104, 132, loadColor, "LOAD ");
|
||||
_vm->_textMan->f52_printToViewport(104, 132, loadColor, "LOAD ");
|
||||
|
||||
int16 loadTmp = champ->_load / 10;
|
||||
Common::String str = getStringFromInteger(loadTmp, true, 3);
|
||||
Common::String str = f288_getStringFromInteger(loadTmp, true, 3);
|
||||
str += '.';
|
||||
loadTmp = champ->_load - (loadTmp * 10);
|
||||
str += getStringFromInteger(loadTmp, false, 1);
|
||||
str += f288_getStringFromInteger(loadTmp, false, 1);
|
||||
str += '/';
|
||||
loadTmp = (getMaximumLoad(champ) + 5) / 10;
|
||||
loadTmp = (f309_getMaximumLoad(champ) + 5) / 10;
|
||||
str += "KG";
|
||||
_vm->_textMan->printToViewport(148, 132, loadColor, str.c_str());
|
||||
_vm->_textMan->f52_printToViewport(148, 132, loadColor, str.c_str());
|
||||
champAttributes |= k0x4000_ChampionAttributeViewport;
|
||||
}
|
||||
|
||||
{ // block so goto won't skip AL_0_championIconIndex initialization
|
||||
int16 AL_0_championIconIndex = championIconIndex(champ->_cell, _vm->_dungeonMan->_g308_partyDir);
|
||||
int16 AL_0_championIconIndex = M26_championIconIndex(champ->_cell, _vm->_dungeonMan->_g308_partyDir);
|
||||
|
||||
if ((champAttributes & k28_ChampionIcons) && (eventMan._g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(AL_0_championIconIndex))) {
|
||||
dispMan.clearScreenBox(g46_ChampionColor[champIndex], g54_BoxChampionIcons[AL_0_championIconIndex]);
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k28_ChampionIcons), 80, championIconIndex(champ->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0,
|
||||
if ((champAttributes & k28_ChampionIcons) && (eventMan._g599_useChampionIconOrdinalAsMousePointerBitmap != _vm->M0_indexToOrdinal(AL_0_championIconIndex))) {
|
||||
dispMan.D24_clearScreenBox(g46_ChampionColor[champIndex], g54_BoxChampionIcons[AL_0_championIconIndex]);
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k28_ChampionIcons), 80, M26_championIconIndex(champ->_dir, _vm->_dungeonMan->_g308_partyDir) * 19, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g54_BoxChampionIcons[AL_0_championIconIndex], k12_ColorDarkestGray);
|
||||
}
|
||||
}
|
||||
|
||||
if ((champAttributes & k0x0800_ChampionAttributePanel) && isInventoryChamp) {
|
||||
if (_vm->_g333_pressingMouth) {
|
||||
invMan.drawPanelFoodWaterPoisoned();
|
||||
invMan.f345_drawPanelFoodWaterPoisoned();
|
||||
} else if (_vm->_g331_pressingEye) {
|
||||
if (_g415_leaderEmptyHanded) {
|
||||
warning("MISSING CODE: F0351_INVENTORY_DrawChampionSkillsAndStatistics");
|
||||
}
|
||||
} else {
|
||||
invMan.drawPanel();
|
||||
invMan.f347_drawPanel();
|
||||
}
|
||||
champAttributes |= k0x4000_ChampionAttributeViewport;
|
||||
}
|
||||
|
||||
if (champAttributes & k0x8000_ChampionAttributeActionHand) {
|
||||
drawSlot(champIndex, k1_ChampionSlotActionHand);
|
||||
menuMan.drawActionIcon(champIndex);
|
||||
f291_drawSlot(champIndex, k1_ChampionSlotActionHand);
|
||||
menuMan.f386_drawActionIcon(champIndex);
|
||||
if (isInventoryChamp) {
|
||||
champAttributes |= k0x4000_ChampionAttributeViewport;
|
||||
}
|
||||
@ -896,24 +896,24 @@ T0292042_green:
|
||||
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
|
||||
}
|
||||
|
||||
uint16 ChampionMan::championIconIndex(int16 val, direction dir) {
|
||||
uint16 ChampionMan::M26_championIconIndex(int16 val, direction dir) {
|
||||
return ((val + 4 - dir) & 0x3);
|
||||
}
|
||||
|
||||
void ChampionMan::drawHealthStaminaManaValues(Champion* champ) {
|
||||
drawHealthOrStaminaOrManaValue(116, champ->_currHealth, champ->_maxHealth);
|
||||
drawHealthOrStaminaOrManaValue(124, champ->_currStamina, champ->_maxStamina);
|
||||
drawHealthOrStaminaOrManaValue(132, champ->_currMana, champ->_maxMana);
|
||||
void ChampionMan::f290_drawHealthStaminaManaValues(Champion* champ) {
|
||||
f289_drawHealthOrStaminaOrManaValue(116, champ->_currHealth, champ->_maxHealth);
|
||||
f289_drawHealthOrStaminaOrManaValue(124, champ->_currStamina, champ->_maxStamina);
|
||||
f289_drawHealthOrStaminaOrManaValue(132, champ->_currMana, champ->_maxMana);
|
||||
}
|
||||
|
||||
void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) {
|
||||
void ChampionMan::f291_drawSlot(uint16 champIndex, ChampionSlot slotIndex) {
|
||||
int16 nativeBitmapIndex = -1;
|
||||
Champion *champ = &_champions[champIndex];
|
||||
bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->indexToOrdinal(champIndex));
|
||||
Champion *champ = &_gK71_champions[champIndex];
|
||||
bool isInventoryChamp = (_vm->_inventoryMan->_g432_inventoryChampionOrdinal == _vm->M0_indexToOrdinal(champIndex));
|
||||
|
||||
uint16 slotBoxIndex;
|
||||
if (!isInventoryChamp) { /* If drawing a slot for a champion other than the champion whose inventory is open */
|
||||
if ((slotIndex > k1_ChampionSlotActionHand) || (_g299_candidateChampionOrdinal == _vm->indexToOrdinal(champIndex))) {
|
||||
if ((slotIndex > k1_ChampionSlotActionHand) || (_g299_candidateChampionOrdinal == _vm->M0_indexToOrdinal(champIndex))) {
|
||||
return;
|
||||
}
|
||||
slotBoxIndex = (champIndex << 1) + slotIndex;
|
||||
@ -959,7 +959,7 @@ void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) {
|
||||
}
|
||||
} else {
|
||||
warning("BUG0_35");
|
||||
iconIndex = _vm->_objectMan->getIconIndex(thing); // BUG0_35
|
||||
iconIndex = _vm->_objectMan->f33_getIconIndex(thing); // BUG0_35
|
||||
if (isInventoryChamp && (slotIndex == k1_ChampionSlotActionHand) && ((iconIndex == k144_IconIndiceContainerChestClosed) || (iconIndex == k30_IconIndiceScrollOpen))) {
|
||||
warning("BUG2_00");
|
||||
iconIndex++;
|
||||
@ -973,29 +973,29 @@ void ChampionMan::drawSlot(uint16 champIndex, ChampionSlot slotIndex) {
|
||||
}
|
||||
}
|
||||
|
||||
if ((slotIndex == k1_ChampionSlotActionHand) && (_vm->indexToOrdinal(champIndex) == _g506_actingChampionOrdinal)) {
|
||||
if ((slotIndex == k1_ChampionSlotActionHand) && (_vm->M0_indexToOrdinal(champIndex) == _g506_actingChampionOrdinal)) {
|
||||
nativeBitmapIndex = k35_SlotBoxActingHandIndice;
|
||||
}
|
||||
|
||||
if (nativeBitmapIndex != -1) {
|
||||
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
|
||||
if (isInventoryChamp) {
|
||||
_vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(nativeBitmapIndex), 32, 0, 0,
|
||||
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getBitmap(nativeBitmapIndex), 32, 0, 0,
|
||||
_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, box, k12_ColorDarkestGray);
|
||||
} else {
|
||||
_vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(nativeBitmapIndex), 32, 0, 0,
|
||||
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getBitmap(nativeBitmapIndex), 32, 0, 0,
|
||||
_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, box, k12_ColorDarkestGray);
|
||||
}
|
||||
}
|
||||
|
||||
_vm->_objectMan->drawIconInSlotBox(slotBoxIndex, iconIndex);
|
||||
_vm->_objectMan->f38_drawIconInSlotBox(slotBoxIndex, iconIndex);
|
||||
|
||||
if (!isInventoryChamp) {
|
||||
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
|
||||
}
|
||||
}
|
||||
|
||||
void ChampionMan::renameChampion(Champion* champ) {
|
||||
void ChampionMan::f281_renameChampion(Champion* champ) {
|
||||
warning("STUB METHOD: Champion::renameChampion, F0281_CHAMPION_Rename");
|
||||
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
@ -1008,15 +1008,15 @@ void ChampionMan::renameChampion(Champion* champ) {
|
||||
box._x2 = box._x1 + 167;
|
||||
|
||||
dispMan.f135_fillBoxBitmap(dispMan._g296_bitmapViewport, box, k12_ColorDarkestGray, k112_byteWidthViewport * 2, k136_heightViewport);
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k27_PanelRenameChampionIndice), 144, 0, 0,
|
||||
dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k4_ColorCyan);
|
||||
textMan.printToViewport(177, 58, k13_ColorLightestGray, "_______");
|
||||
textMan.printToViewport(105, 76, k13_ColorLightestGray, "___________________");
|
||||
textMan.f52_printToViewport(177, 58, k13_ColorLightestGray, "_______");
|
||||
textMan.f52_printToViewport(105, 76, k13_ColorLightestGray, "___________________");
|
||||
Common::Point clickPos;
|
||||
static Box okButtonBox(197, 215, 147, 155); // inclusive boundaries, constructor adds +1
|
||||
for (;;) {
|
||||
_vm->_eventMan->processInput();
|
||||
if (_vm->_eventMan->hasPendingClick(clickPos, k1_LeftMouseButton) && okButtonBox.isPointInside(clickPos)) {
|
||||
if (_vm->_eventMan->f360_hasPendingClick(clickPos, k1_LeftMouseButton) && okButtonBox.isPointInside(clickPos)) {
|
||||
return;
|
||||
}
|
||||
dispMan.f97_drawViewport(k0_viewportNotDungeonView);
|
||||
@ -1024,14 +1024,14 @@ void ChampionMan::renameChampion(Champion* champ) {
|
||||
}
|
||||
}
|
||||
|
||||
uint16 ChampionMan::getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex) {
|
||||
uint16 ChampionMan::f303_getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex) {
|
||||
if (_g300_partyIsSleeping)
|
||||
return 1;
|
||||
|
||||
bool ignoreTempExp = skillIndex & k0x8000_IgnoreTemporaryExperience;
|
||||
bool ignoreObjModifiers = skillIndex & k0x4000_IgnoreObjectModifiers;
|
||||
skillIndex = (ChampionSkill)(skillIndex & ~(ignoreTempExp | ignoreObjModifiers));
|
||||
Champion *champ = &_champions[champIndex];
|
||||
Champion *champ = &_gK71_champions[champIndex];
|
||||
Skill *skill = &champ->getSkill(skillIndex);
|
||||
int32 experience = skill->_experience;
|
||||
|
||||
@ -1054,14 +1054,14 @@ uint16 ChampionMan::getSkillLevel(ChampionIndex champIndex, ChampionSkill skillI
|
||||
}
|
||||
|
||||
if (!ignoreObjModifiers) {
|
||||
IconIndice actionHandIconIndex = _vm->_objectMan->getIconIndex(champ->getSlot(k1_ChampionSlotActionHand));
|
||||
IconIndice actionHandIconIndex = _vm->_objectMan->f33_getIconIndex(champ->getSlot(k1_ChampionSlotActionHand));
|
||||
if (actionHandIconIndex == k27_IconIndiceWeaponTheFirestaff) {
|
||||
skillLevel++;
|
||||
} else if (actionHandIconIndex == k28_IconIndiceWeaponTheFirestaffComplete) {
|
||||
skillLevel += 2;
|
||||
}
|
||||
|
||||
IconIndice neckIconIndice = _vm->_objectMan->getIconIndex(champ->getSlot(k10_ChampionSlotNeck));
|
||||
IconIndice neckIconIndice = _vm->_objectMan->f33_getIconIndex(champ->getSlot(k10_ChampionSlotNeck));
|
||||
switch (skillIndex) {
|
||||
case k3_ChampionSkillWizard:
|
||||
if (neckIconIndice == k124_IconIndiceJunkPendantFeral)
|
||||
|
@ -426,18 +426,18 @@ public:
|
||||
class ChampionMan {
|
||||
DMEngine *_vm;
|
||||
|
||||
uint16 getChampionPortraitX(uint16 index); // @ M27_PORTRAIT_X
|
||||
uint16 getChampionPortraitY(uint16 index); // @ M28_PORTRAIT_Y
|
||||
uint16 M27_getChampionPortraitX(uint16 index); // @ M27_PORTRAIT_X
|
||||
uint16 M28_getChampionPortraitY(uint16 index); // @ M28_PORTRAIT_Y
|
||||
|
||||
ChampionIndex getIndexInCell(ViewCell cell); // @ F0285_CHAMPION_GetIndexInCell
|
||||
int16 getDecodedValue(char *string, uint16 characterCount); // @ F0279_CHAMPION_GetDecodedValue
|
||||
void drawHealthOrStaminaOrManaValue(int16 posy, int16 currVal, int16 maxVal); // @ F0289_CHAMPION_DrawHealthOrStaminaOrManaValue
|
||||
uint16 handSlotIndex(uint16 slotBoxIndex);// @ M70_HAND_SLOT_INDEX
|
||||
ChampionIndex f285_getIndexInCell(ViewCell cell); // @ F0285_CHAMPION_GetIndexInCell
|
||||
int16 f279_getDecodedValue(char *string, uint16 characterCount); // @ F0279_CHAMPION_GetDecodedValue
|
||||
void f289_drawHealthOrStaminaOrManaValue(int16 posy, int16 currVal, int16 maxVal); // @ F0289_CHAMPION_DrawHealthOrStaminaOrManaValue
|
||||
uint16 M70_handSlotIndex(uint16 slotBoxIndex);// @ M70_HAND_SLOT_INDEX
|
||||
public:
|
||||
Champion _champions[4];
|
||||
Champion _gK71_champions[4]; // @ K0071_as_Champions
|
||||
uint16 _g305_partyChampionCount; // @ G0305_ui_PartyChampionCount
|
||||
bool _303_partyDead; // @ G0303_B_PartyDead
|
||||
Thing _414_leaderHandObject; // @ G0414_T_LeaderHandObject
|
||||
bool _g303_partyDead; // @ G0303_B_PartyDead
|
||||
Thing _g414_leaderHandObject; // @ G0414_T_LeaderHandObject
|
||||
ChampionIndex _g411_leaderIndex; // @ G0411_i_LeaderIndex
|
||||
uint16 _g299_candidateChampionOrdinal; // @ G0299_ui_CandidateChampionOrdinal
|
||||
bool _g300_partyIsSleeping; // @ G0300_B_PartyIsSleeping
|
||||
@ -449,23 +449,23 @@ public:
|
||||
bool _g420_mousePointerHiddenToDrawChangedObjIconOnScreen; // @ G0420_B_MousePointerHiddenToDrawChangedObjectIconOnScreen
|
||||
|
||||
explicit ChampionMan(DMEngine *vm);
|
||||
void resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame
|
||||
void addCandidateChampionToParty(uint16 championPortraitIndex); // @ F0280_CHAMPION_AddCandidateChampionToParty
|
||||
void drawChampionBarGraphs(ChampionIndex champIndex); // @ F0287_CHAMPION_DrawBarGraphs
|
||||
uint16 getStaminaAdjustedValue(Champion *champ, int16 val); // @ F0306_CHAMPION_GetStaminaAdjustedValue
|
||||
uint16 getMaximumLoad(Champion *champ); // @ F0309_CHAMPION_GetMaximumLoad
|
||||
void drawChampionState(ChampionIndex champIndex); // @ F0292_CHAMPION_DrawState
|
||||
uint16 championIconIndex(int16 val, direction dir); // @ M26_CHAMPION_ICON_INDEX
|
||||
void drawHealthStaminaManaValues(Champion *champ); // @ F0290_CHAMPION_DrawHealthStaminaManaValues
|
||||
void drawSlot(uint16 champIndex, ChampionSlot slotIndex); // @ F0291_CHAMPION_DrawSlot
|
||||
void renameChampion(Champion* champ); // @ F0281_CHAMPION_Rename
|
||||
uint16 getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex);// @ F0303_CHAMPION_GetSkillLevel
|
||||
Common::String getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount); // @ F0288_CHAMPION_GetStringFromInteger
|
||||
void applyModifiersToStatistics(Champion *champ, ChampionSlot slotIndex, IconIndice iconIndex,
|
||||
void f278_resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame
|
||||
void f280_addCandidateChampionToParty(uint16 championPortraitIndex); // @ F0280_CHAMPION_AddCandidateChampionToParty
|
||||
void f287_drawChampionBarGraphs(ChampionIndex champIndex); // @ F0287_CHAMPION_DrawBarGraphs
|
||||
uint16 f306_getStaminaAdjustedValue(Champion *champ, int16 val); // @ F0306_CHAMPION_GetStaminaAdjustedValue
|
||||
uint16 f309_getMaximumLoad(Champion *champ); // @ F0309_CHAMPION_GetMaximumLoad
|
||||
void f292_drawChampionState(ChampionIndex champIndex); // @ F0292_CHAMPION_DrawState
|
||||
uint16 M26_championIconIndex(int16 val, direction dir); // @ M26_CHAMPION_ICON_INDEX
|
||||
void f290_drawHealthStaminaManaValues(Champion *champ); // @ F0290_CHAMPION_DrawHealthStaminaManaValues
|
||||
void f291_drawSlot(uint16 champIndex, ChampionSlot slotIndex); // @ F0291_CHAMPION_DrawSlot
|
||||
void f281_renameChampion(Champion* champ); // @ F0281_CHAMPION_Rename
|
||||
uint16 f303_getSkillLevel(ChampionIndex champIndex, ChampionSkill skillIndex);// @ F0303_CHAMPION_GetSkillLevel
|
||||
Common::String f288_getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount); // @ F0288_CHAMPION_GetStringFromInteger
|
||||
void f299_pplyModifiersToStatistics(Champion *champ, ChampionSlot slotIndex, IconIndice iconIndex,
|
||||
int16 modifierFactor, Thing thing); // @ F0299_CHAMPION_ApplyObjectModifiersToStatistics
|
||||
bool hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing); // @ F0295_CHAMPION_HasObjectIconInSlotBoxChanged
|
||||
void drawChangedObjectIcons(); // @ F0296_CHAMPION_DrawChangedObjectIcons
|
||||
void addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex); // @ F0301_CHAMPION_AddObjectInSlot
|
||||
bool f295_hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing); // @ F0295_CHAMPION_HasObjectIconInSlotBoxChanged
|
||||
void f296_drawChangedObjectIcons(); // @ F0296_CHAMPION_DrawChangedObjectIcons
|
||||
void f301_addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex); // @ F0301_CHAMPION_AddObjectInSlot
|
||||
};
|
||||
|
||||
|
||||
|
@ -141,26 +141,26 @@ DMEngine::~DMEngine() {
|
||||
DebugMan.clearAllDebugChannels();
|
||||
}
|
||||
|
||||
void DMEngine::initializeGame() {
|
||||
_displayMan->loadGraphics();
|
||||
_displayMan->initializeGraphicData();
|
||||
void DMEngine::f463_initializeGame() {
|
||||
_displayMan->f479_loadGraphics();
|
||||
_displayMan->f460_initializeGraphicData();
|
||||
// DUMMY CODE: next line
|
||||
_displayMan->loadPalette(g19_PalCredits);
|
||||
|
||||
_eventMan->initMouse();
|
||||
|
||||
while (_loadsaveMan->loadgame() != k1_LoadgameSuccess) {
|
||||
while (_loadsaveMan->f435_loadgame() != k1_LoadgameSuccess) {
|
||||
warning("TODO: F0441_STARTEND_ProcessEntrance");
|
||||
}
|
||||
|
||||
_displayMan->loadFloorSet(k0_FloorSetStone);
|
||||
_displayMan->loadWallSet(k0_WallSetStone);
|
||||
_displayMan->f94_loadFloorSet(k0_FloorSetStone);
|
||||
_displayMan->f95_loadWallSet(k0_WallSetStone);
|
||||
_objectMan->loadObjectNames();
|
||||
|
||||
// There was some memory wizardy for the Amiga platform, I skipped that part
|
||||
_displayMan->f461_allocateFlippedWallBitmaps();
|
||||
|
||||
startGame();
|
||||
f462_startGame();
|
||||
warning("MISSING CODE: F0267_MOVE_GetMoveResult_CPSCE (if newGame)");
|
||||
_eventMan->showMouse(true);
|
||||
warning("MISSING CODE: F0357_COMMAND_DiscardAllInput");
|
||||
@ -173,7 +173,7 @@ void DMEngine::initializeGame() {
|
||||
_displayMan->_g347_paletteTopAndBottomScreen[i] = g21_PalDungeonView[0][i];
|
||||
}
|
||||
|
||||
void DMEngine::startGame() {
|
||||
void DMEngine::f462_startGame() {
|
||||
_g331_pressingEye = false;
|
||||
_g332_stopPressingEye = false;
|
||||
_g333_pressingMouth = false;
|
||||
@ -181,15 +181,15 @@ void DMEngine::initializeGame() {
|
||||
_g340_highlightBoxInversionRequested = false;
|
||||
_eventMan->_g341_highlightBoxEnabled = false;
|
||||
_championMan->_g300_partyIsSleeping = false;
|
||||
_championMan->_g506_actingChampionOrdinal = indexToOrdinal(kM1_ChampionNone);
|
||||
_championMan->_g506_actingChampionOrdinal = M0_indexToOrdinal(kM1_ChampionNone);
|
||||
_menuMan->_g509_actionAreaContainsIcons = true;
|
||||
_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = indexToOrdinal(kM1_ChampionNone);
|
||||
_eventMan->_g599_useChampionIconOrdinalAsMousePointerBitmap = M0_indexToOrdinal(kM1_ChampionNone);
|
||||
|
||||
_eventMan->_g441_primaryMouseInput = g447_PrimaryMouseInput_Interface;
|
||||
_eventMan->_g442_secondaryMouseInput = g448_SecondaryMouseInput_Movement;
|
||||
warning("MISSING CODE: set primary/secondary keyboard input");
|
||||
|
||||
processNewPartyMap(_dungeonMan->_g309_partyMapIndex);
|
||||
f3_processNewPartyMap(_dungeonMan->_g309_partyMapIndex);
|
||||
|
||||
if (!_g298_newGame) {
|
||||
warning("TODO: loading game");
|
||||
@ -199,15 +199,15 @@ void DMEngine::initializeGame() {
|
||||
}
|
||||
|
||||
warning("TODO: build copper");
|
||||
_menuMan->drawMovementArrows();
|
||||
_championMan->resetDataToStartGame();
|
||||
_menuMan->f395_drawMovementArrows();
|
||||
_championMan->f278_resetDataToStartGame();
|
||||
_g301_gameTimeTicking = true;
|
||||
}
|
||||
|
||||
void DMEngine::processNewPartyMap(uint16 mapIndex) {
|
||||
void DMEngine::f3_processNewPartyMap(uint16 mapIndex) {
|
||||
warning("MISSING CODE: F0194_GROUP_RemoveAllActiveGroups");
|
||||
_dungeonMan->setCurrentMapAndPartyMap(mapIndex);
|
||||
_displayMan->loadCurrentMapGraphics();
|
||||
_dungeonMan->f174_setCurrentMapAndPartyMap(mapIndex);
|
||||
_displayMan->f96_loadCurrentMapGraphics();
|
||||
warning("MISSING CODE: F0195_GROUP_AddAllActiveGroups");
|
||||
warning("MISSING CODE: F0337_INVENTORY_SetDungeonViewPalette");
|
||||
}
|
||||
@ -232,16 +232,16 @@ Common::Error DMEngine::run() {
|
||||
_timeline = new Timeline(this);
|
||||
_displayMan->setUpScreens(320, 200);
|
||||
|
||||
initializeGame(); // @ F0463_START_InitializeGame_CPSADEF
|
||||
f463_initializeGame(); // @ F0463_START_InitializeGame_CPSADEF
|
||||
while (true) {
|
||||
gameloop();
|
||||
f2_gameloop();
|
||||
warning("TODO: F0444_STARTEND_Endgame(G0303_B_PartyDead);");
|
||||
}
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
void DMEngine::gameloop() {
|
||||
void DMEngine::f2_gameloop() {
|
||||
warning("DUMMY CODE SETTING PARTY POS AND DIRECTION");
|
||||
_dungeonMan->_g306_partyMapX = 10;
|
||||
_dungeonMan->_g307_partyMapY = 4;
|
||||
@ -254,21 +254,21 @@ void DMEngine::gameloop() {
|
||||
while (true) {
|
||||
_g321_stopWaitingForPlayerInput = false;
|
||||
|
||||
_menuMan->refreshActionAreaAndSetChampDirMaxDamageReceived();
|
||||
_menuMan->f390_refreshActionAreaAndSetChampDirMaxDamageReceived();
|
||||
|
||||
//do {
|
||||
_eventMan->processInput();
|
||||
_eventMan->processCommandQueue();
|
||||
_eventMan->f380_processCommandQueue();
|
||||
//} while (!_g321_stopWaitingForPlayerInput || !_g301_gameTimeTicking);
|
||||
|
||||
if (!_inventoryMan->_g432_inventoryChampionOrdinal && !_championMan->_g300_partyIsSleeping) {
|
||||
Box box(0, 224, 0, 126);
|
||||
_displayMan->f135_fillBoxBitmap(_displayMan->_g296_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport * 2, k136_heightViewport); // dummy code
|
||||
_displayMan->drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
|
||||
_displayMan->f128_drawDungeon(_dungeonMan->_g308_partyDir, _dungeonMan->_g306_partyMapX, _dungeonMan->_g307_partyMapY);
|
||||
}
|
||||
|
||||
// DUMMY CODE: next 2 lines
|
||||
_menuMan->drawMovementArrows();
|
||||
_menuMan->f395_drawMovementArrows();
|
||||
_displayMan->f97_drawViewport(k1_viewportDungeonView);
|
||||
|
||||
_displayMan->updateScreen();
|
||||
@ -276,11 +276,11 @@ void DMEngine::gameloop() {
|
||||
}
|
||||
}
|
||||
|
||||
int16 DMEngine::ordinalToIndex(int16 val) {
|
||||
int16 DMEngine::M1_ordinalToIndex(int16 val) {
|
||||
return val - 1;
|
||||
}
|
||||
|
||||
int16 DMEngine::indexToOrdinal(int16 val) {
|
||||
int16 DMEngine::M0_indexToOrdinal(int16 val) {
|
||||
return val + 1;
|
||||
}
|
||||
|
||||
|
@ -142,19 +142,19 @@ enum {
|
||||
};
|
||||
|
||||
class DMEngine : public Engine {
|
||||
void startGame(); // @ F0462_START_StartGame_CPSF
|
||||
void processNewPartyMap(uint16 mapIndex); // @ F0003_MAIN_ProcessNewPartyMap_CPSE
|
||||
void initializeGame(); // @ F0463_START_InitializeGame_CPSADEF
|
||||
void f462_startGame(); // @ F0462_START_StartGame_CPSF
|
||||
void f3_processNewPartyMap(uint16 mapIndex); // @ F0003_MAIN_ProcessNewPartyMap_CPSE
|
||||
void f463_initializeGame(); // @ F0463_START_InitializeGame_CPSADEF
|
||||
void f448_initMemoryManager(); // @ F0448_STARTUP1_InitializeMemoryManager_CPSADEF
|
||||
void gameloop(); // @ F0002_MAIN_GameLoop_CPSDF
|
||||
void f2_gameloop(); // @ F0002_MAIN_GameLoop_CPSDF
|
||||
void initArrays();
|
||||
|
||||
public:
|
||||
explicit DMEngine(OSystem *syst);
|
||||
~DMEngine();
|
||||
|
||||
int16 ordinalToIndex(int16 val); // @ M01_ORDINAL_TO_INDEX
|
||||
int16 indexToOrdinal(int16 val); // @ M00_INDEX_TO_ORDINAL
|
||||
int16 M1_ordinalToIndex(int16 val); // @ M01_ORDINAL_TO_INDEX
|
||||
int16 M0_indexToOrdinal(int16 val); // @ M00_INDEX_TO_ORDINAL
|
||||
virtual Common::Error run(); // @ main
|
||||
|
||||
private:
|
||||
|
@ -360,7 +360,7 @@ CreatureInfo g243_CreatureInfo[k27_CreatureTypeCount] = { // @ G0243_as_Graphic5
|
||||
{25, 0, 0x38AA, 0x0000, 12, 22, 255, 180, 210, 0, 130, 0x6369, 0xFF37, 0x0FBF, 0x0564, 0xFB52, 5},
|
||||
{26, 0, 0x38AA, 0x0000, 12, 22, 255, 180, 210, 0, 130, 0x6369, 0xFF37, 0x0FBF, 0x0564, 0xFB52, 5}};
|
||||
|
||||
void DungeonMan::mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) {
|
||||
void DungeonMan::f150_mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY) {
|
||||
posX += _vm->_dirIntoStepCountEast[dir] * stepsForward;
|
||||
posY += _vm->_dirIntoStepCountNorth[dir] * stepsForward;
|
||||
turnDirRight(dir);
|
||||
@ -438,7 +438,7 @@ DungeonMan::~DungeonMan() {
|
||||
}
|
||||
}
|
||||
|
||||
void DungeonMan::decompressDungeonFile() {
|
||||
void DungeonMan::f455_decompressDungeonFile() {
|
||||
Common::File f;
|
||||
f.open("Dungeon.dat");
|
||||
if (f.readUint16BE() == 0x8104) {
|
||||
@ -550,9 +550,9 @@ const Thing Thing::_explRebirthStep1(0xFFE4); // @ C0xFFE4_THING_EXPLOSION_REBIR
|
||||
const Thing Thing::_explRebirthStep2(0xFFE5); // @ C0xFFE5_THING_EXPLOSION_REBIRTH_STEP2
|
||||
const Thing Thing::_party(0xFFFF); // @ C0xFFFF_THING_PARTY
|
||||
|
||||
void DungeonMan::loadDungeonFile() {
|
||||
void DungeonMan::f434_loadDungeonFile() {
|
||||
if (_vm->_g298_newGame)
|
||||
decompressDungeonFile();
|
||||
f455_decompressDungeonFile();
|
||||
|
||||
Common::MemoryReadStream dunDataStream(_rawDunFileData, _rawDunFileDataSize, DisposeAfterUse::NO);
|
||||
|
||||
@ -728,7 +728,7 @@ void DungeonMan::loadDungeonFile() {
|
||||
}
|
||||
}
|
||||
|
||||
void DungeonMan::setCurrentMap(uint16 mapIndex) {
|
||||
void DungeonMan::f173_setCurrentMap(uint16 mapIndex) {
|
||||
_g272_currMapIndex = mapIndex;
|
||||
_g271_currMapData = _g279_dungeonMapData[mapIndex];
|
||||
_g269_currMap = _g277_dungeonMaps + mapIndex;
|
||||
@ -738,8 +738,8 @@ void DungeonMan::setCurrentMap(uint16 mapIndex) {
|
||||
= &_g280_dungeonColumnsCumulativeSquareThingCount[_g281_dungeonMapsFirstColumnIndex[mapIndex]];
|
||||
}
|
||||
|
||||
void DungeonMan::setCurrentMapAndPartyMap(uint16 mapIndex) {
|
||||
setCurrentMap(mapIndex);
|
||||
void DungeonMan::f174_setCurrentMapAndPartyMap(uint16 mapIndex) {
|
||||
f173_setCurrentMap(mapIndex);
|
||||
|
||||
byte *metaMapData = _g271_currMapData[_g273_currMapWidth - 1] + _g274_currMapHeight;
|
||||
_vm->_displayMan->_g264_currMapAllowedCreatureTypes = metaMapData;
|
||||
@ -758,7 +758,7 @@ void DungeonMan::setCurrentMapAndPartyMap(uint16 mapIndex) {
|
||||
}
|
||||
|
||||
|
||||
Square DungeonMan::getSquare(int16 mapX, int16 mapY) {
|
||||
Square DungeonMan::f151_getSquare(int16 mapX, int16 mapY) {
|
||||
bool isInXBounds = (mapX >= 0) && (mapX < _g273_currMapWidth);
|
||||
bool isInYBounds = (mapY >= 0) && (mapY < _g274_currMapHeight);
|
||||
|
||||
@ -788,12 +788,12 @@ Square DungeonMan::getSquare(int16 mapX, int16 mapY) {
|
||||
return Square(k0_WallElemType);
|
||||
}
|
||||
|
||||
Square DungeonMan::getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) {
|
||||
mapCoordsAfterRelMovement(dir, stepsForward, stepsForward, posX, posY);
|
||||
return getSquare(posX, posY);
|
||||
Square DungeonMan::f152_getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) {
|
||||
f150_mapCoordsAfterRelMovement(dir, stepsForward, stepsForward, posX, posY);
|
||||
return f151_getSquare(posX, posY);
|
||||
}
|
||||
|
||||
int16 DungeonMan::getSquareFirstThingIndex(int16 mapX, int16 mapY) {
|
||||
int16 DungeonMan::f160_getSquareFirstThingIndex(int16 mapX, int16 mapY) {
|
||||
if (mapX < 0 || mapX >= _g273_currMapWidth || mapY < 0 || mapY >= _g274_currMapHeight || !Square(_g271_currMapData[mapX][mapY]).get(k0x0010_ThingListPresent))
|
||||
return -1;
|
||||
|
||||
@ -807,8 +807,8 @@ int16 DungeonMan::getSquareFirstThingIndex(int16 mapX, int16 mapY) {
|
||||
return index;
|
||||
}
|
||||
|
||||
Thing DungeonMan::getSquareFirstThing(int16 mapX, int16 mapY) {
|
||||
int16 index = getSquareFirstThingIndex(mapX, mapY);
|
||||
Thing DungeonMan::f161_getSquareFirstThing(int16 mapX, int16 mapY) {
|
||||
int16 index = f160_getSquareFirstThingIndex(mapX, mapY);
|
||||
if (index == -1)
|
||||
return Thing::_endOfList;
|
||||
return _g283_squareFirstThings[index];
|
||||
@ -816,14 +816,14 @@ Thing DungeonMan::getSquareFirstThing(int16 mapX, int16 mapY) {
|
||||
|
||||
|
||||
// TODO: get rid of the GOTOs
|
||||
void DungeonMan::setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY) { // complete, except where marked
|
||||
void DungeonMan::f172_setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY) { // complete, except where marked
|
||||
_vm->_displayMan->_g289_championPortraitOrdinal = 0; // BUG0_75, possible fix
|
||||
|
||||
for (uint16 i = 0; i < 5; ++i)
|
||||
aspectArray[i] = 0;
|
||||
|
||||
Thing thing = getSquareFirstThing(mapX, mapY);
|
||||
Square square = getSquare(mapX, mapY);
|
||||
Thing thing = f161_getSquareFirstThing(mapX, mapY);
|
||||
Square square = f151_getSquare(mapX, mapY);
|
||||
|
||||
aspectArray[k0_ElemAspect] = square.getType();
|
||||
|
||||
@ -860,25 +860,25 @@ void DungeonMan::setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX,
|
||||
}
|
||||
|
||||
T0172010_ClosedFakeWall:
|
||||
setSquareAspectOrnOrdinals(aspectArray, leftOrnAllowed, frontOrnAllowed, rightOrnAllowed, dir, mapX, mapY, squareIsFakeWall);
|
||||
f171_setSquareAspectOrnOrdinals(aspectArray, leftOrnAllowed, frontOrnAllowed, rightOrnAllowed, dir, mapX, mapY, squareIsFakeWall);
|
||||
|
||||
while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) {
|
||||
int16 sideIndex = (thing.getCell() - dir) & 3;
|
||||
if (sideIndex) {
|
||||
if (thing.getType() == k2_TextstringType) {
|
||||
if (TextString(getThingData(thing)).isVisible()) {
|
||||
if (TextString(f156_getThingData(thing)).isVisible()) {
|
||||
aspectArray[sideIndex + 1] = _g265_currMapInscriptionWallOrnIndex + 1;
|
||||
_vm->_displayMan->_g290_inscriptionThing = thing; // BUG0_76
|
||||
}
|
||||
} else {
|
||||
Sensor sensor(getThingData(thing));
|
||||
Sensor sensor(f156_getThingData(thing));
|
||||
aspectArray[sideIndex + 1] = sensor.getOrnOrdinal();
|
||||
if (sensor.getType() == k127_SensorWallChampionPortrait) {
|
||||
_vm->_displayMan->_g289_championPortraitOrdinal = _vm->indexToOrdinal(sensor.getData());
|
||||
_vm->_displayMan->_g289_championPortraitOrdinal = _vm->M0_indexToOrdinal(sensor.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
thing = getNextThing(thing);
|
||||
thing = f159_getNextThing(thing);
|
||||
}
|
||||
if (squareIsFakeWall && (_g306_partyMapX != mapX) && (_g307_partyMapY != mapY)) {
|
||||
aspectArray[k1_FirstGroupOrObjectAspect] = Thing::_endOfList.toUint16();
|
||||
@ -906,14 +906,14 @@ T0172010_ClosedFakeWall:
|
||||
square = Square(footPrintsAllowed ? 8 : 0);
|
||||
// intentional fallthrough
|
||||
case k1_CorridorElemType:
|
||||
aspectArray[k4_FloorOrnOrdAspect] = getRandomOrnOrdinal(square.get(k0x0008_CorridorRandOrnAllowed), _g269_currMap->_randFloorOrnCount, mapX, mapY, 30);
|
||||
aspectArray[k4_FloorOrnOrdAspect] = f170_getRandomOrnOrdinal(square.get(k0x0008_CorridorRandOrnAllowed), _g269_currMap->_randFloorOrnCount, mapX, mapY, 30);
|
||||
T0172029_Teleporter:
|
||||
footPrintsAllowed = true;
|
||||
T0172030_Pit:
|
||||
while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType)) {
|
||||
if (thing.getType() == k3_SensorThingType)
|
||||
aspectArray[k4_FloorOrnOrdAspect] = Sensor(getThingData(thing)).getOrnOrdinal();
|
||||
thing = getNextThing(thing);
|
||||
aspectArray[k4_FloorOrnOrdAspect] = Sensor(f156_getThingData(thing)).getOrnOrdinal();
|
||||
thing = f159_getNextThing(thing);
|
||||
}
|
||||
goto T0172049_Footprints;
|
||||
case k5_TeleporterElemType:
|
||||
@ -930,12 +930,12 @@ T0172030_Pit:
|
||||
} else {
|
||||
aspectArray[k0_ElemAspect] = k17_DoorFrontElemType;
|
||||
aspectArray[k2_DoorStateAspect] = square.getDoorState();
|
||||
aspectArray[k3_DoorThingIndexAspect] = getSquareFirstThing(mapX, mapY).getIndex();
|
||||
aspectArray[k3_DoorThingIndexAspect] = f161_getSquareFirstThing(mapX, mapY).getIndex();
|
||||
}
|
||||
footPrintsAllowed = true;
|
||||
T0172046_Stairs:
|
||||
while ((thing != Thing::_endOfList) && (thing.getType() <= k3_SensorThingType))
|
||||
thing = getNextThing(thing);
|
||||
thing = f159_getNextThing(thing);
|
||||
T0172049_Footprints:
|
||||
unsigned char scentOrdinal; // see next line comment
|
||||
if (footPrintsAllowed) // TODO: I skipped some party query code, must come back later and complete
|
||||
@ -947,36 +947,36 @@ T0172049_Footprints:
|
||||
aspectArray[k1_FirstGroupOrObjectAspect] = thing.toUint16();
|
||||
}
|
||||
|
||||
void DungeonMan::setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir,
|
||||
void DungeonMan::f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir,
|
||||
int16 mapX, int16 mapY, bool isFakeWall) {
|
||||
int16 ornCount = _g269_currMap->_randWallOrnCount;
|
||||
|
||||
turnDirRight(dir);
|
||||
aspectArray[k2_RightWallOrnOrdAspect] = getRandomOrnOrdinal(leftAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
|
||||
aspectArray[k2_RightWallOrnOrdAspect] = f170_getRandomOrnOrdinal(leftAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
|
||||
turnDirRight(dir);
|
||||
aspectArray[k3_FrontWallOrnOrdAspect] = getRandomOrnOrdinal(frontAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
|
||||
aspectArray[k3_FrontWallOrnOrdAspect] = f170_getRandomOrnOrdinal(frontAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
|
||||
turnDirRight(dir);
|
||||
aspectArray[k4_LeftWallOrnOrdAspect] = getRandomOrnOrdinal(rightAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
|
||||
aspectArray[k4_LeftWallOrnOrdAspect] = f170_getRandomOrnOrdinal(rightAllowed, ornCount, mapX, ++mapY * (dir + 1), 30);
|
||||
|
||||
if (isFakeWall || mapX < 0 || mapX >= _g273_currMapWidth || mapY < 0 || mapY >= _g274_currMapHeight) {
|
||||
for (uint16 i = k2_RightWallOrnOrdAspect; i <= k4_LeftWallOrnOrdAspect; ++i) {
|
||||
if (isWallOrnAnAlcove(_vm->ordinalToIndex(aspectArray[i])))
|
||||
if (f149_isWallOrnAnAlcove(_vm->M1_ordinalToIndex(aspectArray[i])))
|
||||
aspectArray[i] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int16 DungeonMan::getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) {
|
||||
int16 DungeonMan::f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo) {
|
||||
int16 index = (((((2000 + (mapX << 5) + mapY) * 31417) >> 1)
|
||||
+ (3000 + (_g272_currMapIndex << 6) + _g273_currMapWidth + _g274_currMapHeight) * 11
|
||||
+ _g278_dungeonFileHeader._ornamentRandomSeed) >> 2) % modulo;
|
||||
if (allowed && index < count)
|
||||
return _vm->indexToOrdinal(index);
|
||||
return _vm->M0_indexToOrdinal(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool DungeonMan::isWallOrnAnAlcove(int16 wallOrnIndex) {
|
||||
bool DungeonMan::f149_isWallOrnAnAlcove(int16 wallOrnIndex) {
|
||||
if (wallOrnIndex >= 0)
|
||||
for (uint16 i = 0; i < k3_AlcoveOrnCount; ++i)
|
||||
if (_vm->_displayMan->_g267_currMapAlcoveOrnIndices[i] == wallOrnIndex)
|
||||
@ -984,16 +984,16 @@ bool DungeonMan::isWallOrnAnAlcove(int16 wallOrnIndex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint16 *DungeonMan::getThingData(Thing thing) {
|
||||
uint16 *DungeonMan::f156_getThingData(Thing thing) {
|
||||
return _g284_thingData[thing.getType()][thing.getIndex()];
|
||||
}
|
||||
|
||||
uint16* DungeonMan::getSquareFirstThingData(int16 mapX, int16 mapY) {
|
||||
return getThingData(getSquareFirstThing(mapX, mapY));
|
||||
uint16* DungeonMan::f157_getSquareFirstThingData(int16 mapX, int16 mapY) {
|
||||
return f156_getThingData(f161_getSquareFirstThing(mapX, mapY));
|
||||
}
|
||||
|
||||
Thing DungeonMan::getNextThing(Thing thing) {
|
||||
return getThingData(thing)[0]; // :)
|
||||
Thing DungeonMan::f159_getNextThing(Thing thing) {
|
||||
return Thing(f156_getThingData(thing)[0]); // :)
|
||||
}
|
||||
|
||||
char g255_MessageAndScrollEscReplacementStrings[32][8] = { // @ G0255_aac_Graphic559_MessageAndScrollEscapeReplacementStrings
|
||||
@ -1097,7 +1097,7 @@ char g257_InscriptionEscReplacementStrings[32][8] = { // @ G0257_aac_Graphic559_
|
||||
{0, 0, 0, 0, 0, 0, 0, 0}};
|
||||
|
||||
|
||||
void DungeonMan::decodeText(char *destString, Thing thing, TextType type) {
|
||||
void DungeonMan::f168_decodeText(char *destString, Thing thing, TextType type) {
|
||||
char sepChar;
|
||||
TextString textString(_g284_thingData[k2_TextstringType][thing.getIndex()]);
|
||||
if ((textString.isVisible()) || (type & k0x8000_DecodeEvenIfInvisible)) {
|
||||
@ -1165,7 +1165,7 @@ void DungeonMan::decodeText(char *destString, Thing thing, TextType type) {
|
||||
}
|
||||
|
||||
|
||||
uint16 DungeonMan::getObjectWeight(Thing thing) {
|
||||
uint16 DungeonMan::f140_getObjectWeight(Thing thing) {
|
||||
static const uint16 g241_junkInfo[] = { // @ G0241_auc_Graphic559_JunkInfo
|
||||
// COMPASS - WATERSKIN - JEWEL SYMAL - ILLUMULET - ASHES
|
||||
1, 3, 2, 2, 4,
|
||||
@ -1195,11 +1195,11 @@ uint16 DungeonMan::getObjectWeight(Thing thing) {
|
||||
return 0;
|
||||
switch (thing.getType()) {
|
||||
case k5_WeaponThingType:
|
||||
return g238_WeaponInfo[Weapon(getThingData(thing)).getType()]._weight;
|
||||
return g238_WeaponInfo[Weapon(f156_getThingData(thing)).getType()]._weight;
|
||||
case k6_ArmourThingType:
|
||||
return g239_ArmourInfo[Armour(getThingData(thing)).getType()]._weight;
|
||||
return g239_ArmourInfo[Armour(f156_getThingData(thing)).getType()]._weight;
|
||||
case k10_JunkThingType: {
|
||||
Junk junk(getThingData(thing));
|
||||
Junk junk(f156_getThingData(thing));
|
||||
uint16 weight = g241_junkInfo[junk.getType()];
|
||||
if (junk.getType() == k1_JunkTypeWaterskin)
|
||||
weight += junk.getChargeCount() * 2;
|
||||
@ -1207,16 +1207,16 @@ uint16 DungeonMan::getObjectWeight(Thing thing) {
|
||||
}
|
||||
case k9_ContainerThingType: {
|
||||
uint16 weight = 50;
|
||||
Container container(getThingData(thing));
|
||||
Container container(f156_getThingData(thing));
|
||||
Thing slotThing = container.getSlot();
|
||||
while (slotThing != Thing::_endOfList) {
|
||||
weight += getObjectWeight(slotThing);
|
||||
slotThing = getNextThing(slotThing);
|
||||
weight += f140_getObjectWeight(slotThing);
|
||||
slotThing = f159_getNextThing(slotThing);
|
||||
}
|
||||
return weight;
|
||||
}
|
||||
case k8_PotionThingType:
|
||||
if (Junk(getThingData(thing)).getType() == k20_PotionTypeEmptyFlask) {
|
||||
if (Junk(f156_getThingData(thing)).getType() == k20_PotionTypeEmptyFlask) {
|
||||
return 1;
|
||||
} else {
|
||||
return 3;
|
||||
@ -1232,8 +1232,8 @@ uint16 DungeonMan::getObjectWeight(Thing thing) {
|
||||
}
|
||||
|
||||
|
||||
int16 DungeonMan::getObjectInfoIndex(Thing thing) {
|
||||
uint16 *rawType = getThingData(thing);
|
||||
int16 DungeonMan::f141_getObjectInfoIndex(Thing thing) {
|
||||
uint16 *rawType = f156_getThingData(thing);
|
||||
switch (thing.getType()) {
|
||||
case k7_ScrollThingType:
|
||||
return k0_ObjectInfoIndexFirstScroll;
|
||||
@ -1252,17 +1252,17 @@ int16 DungeonMan::getObjectInfoIndex(Thing thing) {
|
||||
}
|
||||
}
|
||||
|
||||
void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY) {
|
||||
void DungeonMan::f163_linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY) {
|
||||
if (thingToLink == Thing::_endOfList)
|
||||
return;
|
||||
|
||||
uint16 *rawObjPtr = getThingData(thingToLink);
|
||||
uint16 *rawObjPtr = f156_getThingData(thingToLink);
|
||||
*rawObjPtr = Thing::_endOfList.toUint16();
|
||||
|
||||
if (mapX >= 0) {
|
||||
Square *squarePtr = (Square*)&_g271_currMapData[mapX][mapY];
|
||||
if (squarePtr->get(k0x0010_ThingListPresent)) {
|
||||
thingInList = getSquareFirstThing(mapX, mapY);
|
||||
thingInList = f161_getSquareFirstThing(mapX, mapY);
|
||||
} else {
|
||||
squarePtr->set(k0x0010_ThingListPresent);
|
||||
uint16 *cumulativeCount = &_g270_currMapColCumulativeSquareFirstThingCount[mapX + 1];
|
||||
@ -1286,43 +1286,43 @@ void DungeonMan::linkThingToList(Thing thingToLink, Thing thingInList, int16 map
|
||||
}
|
||||
}
|
||||
|
||||
Thing thing = getNextThing(thingInList);
|
||||
Thing thing = f159_getNextThing(thingInList);
|
||||
while (thing != Thing::_endOfList) {
|
||||
thing = getNextThing(thing);
|
||||
thing = f159_getNextThing(thing);
|
||||
thingInList = thing;
|
||||
}
|
||||
rawObjPtr = getThingData(thingInList);
|
||||
rawObjPtr = f156_getThingData(thingInList);
|
||||
*rawObjPtr = thingToLink.toUint16();
|
||||
}
|
||||
|
||||
WeaponInfo* DungeonMan::getWeaponInfo(Thing thing) {
|
||||
Weapon* weapon = (Weapon*)getThingData(thing);
|
||||
WeaponInfo* DungeonMan::f158_getWeaponInfo(Thing thing) {
|
||||
Weapon* weapon = (Weapon*)f156_getThingData(thing);
|
||||
return &g238_WeaponInfo[weapon->getType()];
|
||||
}
|
||||
|
||||
int16 DungeonMan::getProjectileAspect(Thing thing) {
|
||||
int16 DungeonMan::f142_getProjectileAspect(Thing thing) {
|
||||
ThingType thingType;
|
||||
int16 projAspOrd;
|
||||
WeaponInfo *weaponInfo;
|
||||
|
||||
if ((thingType = thing.getType()) == k15_ExplosionThingType) {
|
||||
if (thing == Thing::_explFireBall)
|
||||
return -_vm->indexToOrdinal(k10_ProjectileAspectExplosionFireBall);
|
||||
return -_vm->M0_indexToOrdinal(k10_ProjectileAspectExplosionFireBall);
|
||||
if (thing == Thing::_explSlime)
|
||||
return -_vm->indexToOrdinal(k12_ProjectileAspectExplosionSlime);
|
||||
return -_vm->M0_indexToOrdinal(k12_ProjectileAspectExplosionSlime);
|
||||
if (thing == Thing::_explLightningBolt)
|
||||
return -_vm->indexToOrdinal(k3_ProjectileAspectExplosionLightningBolt);
|
||||
return -_vm->M0_indexToOrdinal(k3_ProjectileAspectExplosionLightningBolt);
|
||||
if ((thing == Thing::_explPoisonBolt) || (thing == Thing::_explPoisonCloud))
|
||||
return -_vm->indexToOrdinal(k13_ProjectileAspectExplosionPoisonBoltCloud);
|
||||
return -_vm->M0_indexToOrdinal(k13_ProjectileAspectExplosionPoisonBoltCloud);
|
||||
|
||||
return -_vm->indexToOrdinal(k11_ProjectileAspectExplosionDefault);
|
||||
return -_vm->M0_indexToOrdinal(k11_ProjectileAspectExplosionDefault);
|
||||
} else if (thingType == k5_WeaponThingType) {
|
||||
weaponInfo = getWeaponInfo(thing);
|
||||
weaponInfo = f158_getWeaponInfo(thing);
|
||||
if (projAspOrd = weaponInfo->getProjectileAspectOrdinal())
|
||||
return -projAspOrd;
|
||||
}
|
||||
|
||||
return g237_ObjectInfo[getObjectInfoIndex(thing)]._objectAspectIndex;
|
||||
return g237_ObjectInfo[f141_getObjectInfoIndex(thing)]._objectAspectIndex;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -601,45 +601,45 @@ class DungeonMan {
|
||||
DungeonMan(const DungeonMan &other); // no implementation on purpose
|
||||
void operator=(const DungeonMan &rhs); // no implementation on purpose
|
||||
|
||||
Square getSquare(int16 mapX, int16 mapY); // @ F0151_DUNGEON_GetSquare
|
||||
Square getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY); // @ F0152_DUNGEON_GetRelativeSquare
|
||||
Square f151_getSquare(int16 mapX, int16 mapY); // @ F0151_DUNGEON_GetSquare
|
||||
Square f152_getRelSquare(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY); // @ F0152_DUNGEON_GetRelativeSquare
|
||||
|
||||
void decompressDungeonFile(); // @ F0455_FLOPPY_DecompressDungeon
|
||||
void f455_decompressDungeonFile(); // @ F0455_FLOPPY_DecompressDungeon
|
||||
|
||||
int16 getSquareFirstThingIndex(int16 mapX, int16 mapY); // @ F0160_DUNGEON_GetSquareFirstThingIndex
|
||||
int16 f160_getSquareFirstThingIndex(int16 mapX, int16 mapY); // @ F0160_DUNGEON_GetSquareFirstThingIndex
|
||||
|
||||
int16 getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo); // @ F0170_DUNGEON_GetRandomOrnamentOrdinal
|
||||
void setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir,
|
||||
int16 f170_getRandomOrnOrdinal(bool allowed, int16 count, int16 mapX, int16 mapY, int16 modulo); // @ F0170_DUNGEON_GetRandomOrnamentOrdinal
|
||||
void f171_setSquareAspectOrnOrdinals(uint16 *aspectArray, bool leftAllowed, bool frontAllowed, bool rightAllowed, direction dir,
|
||||
int16 mapX, int16 mapY, bool isFakeWall); // @ F0171_DUNGEON_SetSquareAspectRandomWallOrnamentOrdinals
|
||||
|
||||
void setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap
|
||||
void f173_setCurrentMap(uint16 mapIndex); // @ F0173_DUNGEON_SetCurrentMap
|
||||
|
||||
public:
|
||||
explicit DungeonMan(DMEngine *dmEngine);
|
||||
~DungeonMan();
|
||||
|
||||
Thing getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing
|
||||
Thing getNextThing(Thing thing); // @ F0159_DUNGEON_GetNextThing(THING P0280_T_Thing)
|
||||
uint16 *getThingData(Thing thing); // @ unsigned char* F0156_DUNGEON_GetThingData(register THING P0276_T_Thing)
|
||||
uint16 *getSquareFirstThingData(int16 mapX, int16 mapY); // @ F0157_DUNGEON_GetSquareFirstThingData
|
||||
Thing f161_getSquareFirstThing(int16 mapX, int16 mapY); // @ F0161_DUNGEON_GetSquareFirstThing
|
||||
Thing f159_getNextThing(Thing thing); // @ F0159_DUNGEON_GetNextThing(THING P0280_T_Thing)
|
||||
uint16 *f156_getThingData(Thing thing); // @ F0156_DUNGEON_GetThingData
|
||||
uint16 *f157_getSquareFirstThingData(int16 mapX, int16 mapY); // @ F0157_DUNGEON_GetSquareFirstThingData
|
||||
|
||||
// TODO: this does stuff other than load the file!
|
||||
void loadDungeonFile(); // @ F0434_STARTEND_IsLoadDungeonSuccessful_CPSC
|
||||
void setCurrentMapAndPartyMap(uint16 mapIndex); // @ F0174_DUNGEON_SetCurrentMapAndPartyMap
|
||||
void f434_loadDungeonFile(); // @ F0434_STARTEND_IsLoadDungeonSuccessful_CPSC
|
||||
void f174_setCurrentMapAndPartyMap(uint16 mapIndex); // @ F0174_DUNGEON_SetCurrentMapAndPartyMap
|
||||
|
||||
bool isWallOrnAnAlcove(int16 wallOrnIndex); // @ F0149_DUNGEON_IsWallOrnamentAnAlcove
|
||||
void mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY); // @ F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement
|
||||
SquareType getRelSquareType(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) {
|
||||
return Square(getRelSquare(dir, stepsForward, stepsRight, posX, posY)).getType();
|
||||
bool f149_isWallOrnAnAlcove(int16 wallOrnIndex); // @ F0149_DUNGEON_IsWallOrnamentAnAlcove
|
||||
void f150_mapCoordsAfterRelMovement(direction dir, int16 stepsForward, int16 stepsRight, int16 &posX, int16 &posY); // @ F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement
|
||||
SquareType f153_getRelSquareType(direction dir, int16 stepsForward, int16 stepsRight, int16 posX, int16 posY) {
|
||||
return Square(f152_getRelSquare(dir, stepsForward, stepsRight, posX, posY)).getType();
|
||||
} // @ F0153_DUNGEON_GetRelativeSquareType
|
||||
void setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY); // @ F0172_DUNGEON_SetSquareAspect
|
||||
void decodeText(char *destString, Thing thing, TextType type); // F0168_DUNGEON_DecodeText
|
||||
void f172_setSquareAspect(uint16 *aspectArray, direction dir, int16 mapX, int16 mapY); // @ F0172_DUNGEON_SetSquareAspect
|
||||
void f168_decodeText(char *destString, Thing thing, TextType type); // F0168_DUNGEON_DecodeText
|
||||
|
||||
uint16 getObjectWeight(Thing thing); // @ F0140_DUNGEON_GetObjectWeight
|
||||
int16 getObjectInfoIndex(Thing thing); // @ F0141_DUNGEON_GetObjectInfoIndex
|
||||
void linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY); // @ F0163_DUNGEON_LinkThingToList
|
||||
WeaponInfo *getWeaponInfo(Thing thing); // @ F0158_DUNGEON_GetWeaponInfo
|
||||
int16 getProjectileAspect(Thing thing); // @ F0142_DUNGEON_GetProjectileAspect
|
||||
uint16 f140_getObjectWeight(Thing thing); // @ F0140_DUNGEON_GetObjectWeight
|
||||
int16 f141_getObjectInfoIndex(Thing thing); // @ F0141_DUNGEON_GetObjectInfoIndex
|
||||
void f163_linkThingToList(Thing thingToLink, Thing thingInList, int16 mapX, int16 mapY); // @ F0163_DUNGEON_LinkThingToList
|
||||
WeaponInfo *f158_getWeaponInfo(Thing thing); // @ F0158_DUNGEON_GetWeaponInfo
|
||||
int16 f142_getProjectileAspect(Thing thing); // @ F0142_DUNGEON_GetProjectileAspect
|
||||
|
||||
uint32 _rawDunFileDataSize; // @ probably NONE
|
||||
byte *_rawDunFileData; // @ ???
|
||||
|
@ -316,16 +316,16 @@ void EventManager::processInput() {
|
||||
|
||||
switch (event.kbd.keycode) {
|
||||
case Common::KEYCODE_w:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
case Common::KEYCODE_a:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
case Common::KEYCODE_s:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
case Common::KEYCODE_d:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
case Common::KEYCODE_q:
|
||||
turnDirLeft(dungeonMan._g308_partyDir);
|
||||
@ -335,11 +335,11 @@ void EventManager::processInput() {
|
||||
break;
|
||||
case Common::KEYCODE_UP:
|
||||
if (_dummyMapIndex < 13)
|
||||
dungeonMan.setCurrentMapAndPartyMap(++_dummyMapIndex);
|
||||
dungeonMan.f174_setCurrentMapAndPartyMap(++_dummyMapIndex);
|
||||
break;
|
||||
case Common::KEYCODE_DOWN:
|
||||
if (_dummyMapIndex > 0)
|
||||
dungeonMan.setCurrentMapAndPartyMap(--_dummyMapIndex);
|
||||
dungeonMan.f174_setCurrentMapAndPartyMap(--_dummyMapIndex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -359,19 +359,19 @@ void EventManager::processInput() {
|
||||
}
|
||||
}
|
||||
|
||||
void EventManager::processPendingClick() {
|
||||
void EventManager::f360_processPendingClick() {
|
||||
if (_g436_pendingClickPresent) {
|
||||
_g436_pendingClickPresent = false;
|
||||
processClick(_g437_pendingClickPos, _g439_pendingClickButton);
|
||||
f359_processClick(_g437_pendingClickPos, _g439_pendingClickButton);
|
||||
}
|
||||
}
|
||||
|
||||
void EventManager::processClick(Common::Point mousePos, MouseButton button) {
|
||||
void EventManager::f359_processClick(Common::Point mousePos, MouseButton button) {
|
||||
CommandType commandType;
|
||||
|
||||
commandType = getCommandTypeFromMouseInput(_g441_primaryMouseInput, mousePos, button);
|
||||
commandType = f358_getCommandTypeFromMouseInput(_g441_primaryMouseInput, mousePos, button);
|
||||
if (commandType == k0_CommandNone)
|
||||
commandType = getCommandTypeFromMouseInput(_g442_secondaryMouseInput, mousePos, button);
|
||||
commandType = f358_getCommandTypeFromMouseInput(_g442_secondaryMouseInput, mousePos, button);
|
||||
|
||||
if (commandType != k0_CommandNone)
|
||||
_commandQueue.push(Command(mousePos, commandType));
|
||||
@ -379,7 +379,7 @@ void EventManager::processClick(Common::Point mousePos, MouseButton button) {
|
||||
_g435_isCommandQueueLocked = false;
|
||||
}
|
||||
|
||||
CommandType EventManager::getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button) {
|
||||
CommandType EventManager::f358_getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button) {
|
||||
if (!input)
|
||||
return k0_CommandNone;
|
||||
CommandType commandType = k0_CommandNone;
|
||||
@ -393,11 +393,11 @@ CommandType EventManager::getCommandTypeFromMouseInput(MouseInput *input, Common
|
||||
}
|
||||
|
||||
|
||||
void EventManager::processCommandQueue() {
|
||||
void EventManager::f380_processCommandQueue() {
|
||||
_g435_isCommandQueueLocked = true;
|
||||
if (_commandQueue.empty()) {
|
||||
_g435_isCommandQueueLocked = false;
|
||||
processPendingClick();
|
||||
f360_processPendingClick();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -407,29 +407,29 @@ void EventManager::processCommandQueue() {
|
||||
int16 commandY = cmd._pos.y;
|
||||
|
||||
_g435_isCommandQueueLocked = false;
|
||||
processPendingClick();
|
||||
f360_processPendingClick();
|
||||
|
||||
if ((cmd._type == k2_CommandTurnRight) || (cmd._type == k1_CommandTurnLeft)) {
|
||||
commandTurnParty(cmd._type);
|
||||
f365_commandTurnParty(cmd._type);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((cmd._type >= k3_CommandMoveForward) && (cmd._type <= k6_CommandMoveLeft)) {
|
||||
commandMoveParty(cmd._type);
|
||||
f366_commandMoveParty(cmd._type);
|
||||
return;
|
||||
}
|
||||
|
||||
if (cmd._type == k80_CommandClickInDungeonView) {
|
||||
commandProcessType80ClickInDungeonView(commandX, commandY);
|
||||
f377_commandProcessType80ClickInDungeonView(commandX, commandY);
|
||||
}
|
||||
if (cmd._type == k81_CommandClickInPanel) {
|
||||
commandProcess81ClickInPanel(commandX, commandY);
|
||||
f378_commandProcess81ClickInPanel(commandX, commandY);
|
||||
}
|
||||
|
||||
// MISSING CODE: the rest of the function
|
||||
}
|
||||
|
||||
void EventManager::commandTurnParty(CommandType cmdType) {
|
||||
void EventManager::f365_commandTurnParty(CommandType cmdType) {
|
||||
_vm->_g321_stopWaitingForPlayerInput = true;
|
||||
|
||||
// MISSING CODE: highlight turn left/right buttons
|
||||
@ -445,7 +445,7 @@ void EventManager::commandTurnParty(CommandType cmdType) {
|
||||
// MISSING CODE: process sensors
|
||||
}
|
||||
|
||||
void EventManager::commandMoveParty(CommandType cmdType) {
|
||||
void EventManager::f366_commandMoveParty(CommandType cmdType) {
|
||||
_vm->_g321_stopWaitingForPlayerInput = true;
|
||||
|
||||
// MISSING CODE: Lots of code
|
||||
@ -455,16 +455,16 @@ void EventManager::commandMoveParty(CommandType cmdType) {
|
||||
|
||||
switch (cmdType) {
|
||||
case k3_CommandMoveForward:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
case k6_CommandMoveLeft:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, -1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
case k5_CommandMoveBackward:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, -1, 0, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
case k4_CommandMoveRight:
|
||||
dungeonMan.mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
dungeonMan.f150_mapCoordsAfterRelMovement(dungeonMan._g308_partyDir, 0, 1, dungeonMan._g306_partyMapX, dungeonMan._g307_partyMapY);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -473,46 +473,46 @@ void EventManager::commandMoveParty(CommandType cmdType) {
|
||||
// MISSING CODE: Lots of code
|
||||
}
|
||||
|
||||
void EventManager::commandSetLeader(ChampionIndex champIndex) {
|
||||
void EventManager::f368_commandSetLeader(ChampionIndex champIndex) {
|
||||
ChampionMan &cm = *_vm->_championMan;
|
||||
ChampionIndex leaderIndex;
|
||||
|
||||
if ((cm._g411_leaderIndex == champIndex) || ((champIndex != kM1_ChampionNone) && !cm._champions[champIndex]._currHealth))
|
||||
if ((cm._g411_leaderIndex == champIndex) || ((champIndex != kM1_ChampionNone) && !cm._gK71_champions[champIndex]._currHealth))
|
||||
return;
|
||||
|
||||
if (cm._g411_leaderIndex != kM1_ChampionNone) {
|
||||
leaderIndex = cm._g411_leaderIndex;
|
||||
cm._champions[leaderIndex].setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
|
||||
cm._champions[leaderIndex].setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true);
|
||||
cm._champions[leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(cm._414_leaderHandObject);
|
||||
cm._gK71_champions[leaderIndex].setAttributeFlag(k0x0200_ChampionAttributeLoad, true);
|
||||
cm._gK71_champions[leaderIndex].setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true);
|
||||
cm._gK71_champions[leaderIndex]._load -= _vm->_dungeonMan->f140_getObjectWeight(cm._g414_leaderHandObject);
|
||||
cm._g411_leaderIndex = kM1_ChampionNone;
|
||||
cm.drawChampionState(leaderIndex);
|
||||
cm.f292_drawChampionState(leaderIndex);
|
||||
}
|
||||
if (champIndex == kM1_ChampionNone) {
|
||||
cm._g411_leaderIndex = kM1_ChampionNone;
|
||||
return;
|
||||
}
|
||||
cm._g411_leaderIndex = champIndex;
|
||||
Champion *champion = &cm._champions[cm._g411_leaderIndex];
|
||||
Champion *champion = &cm._gK71_champions[cm._g411_leaderIndex];
|
||||
champion->_dir = _vm->_dungeonMan->_g308_partyDir;
|
||||
cm._champions[champIndex]._load += _vm->_dungeonMan->getObjectWeight(cm._414_leaderHandObject);
|
||||
if (_vm->indexToOrdinal(champIndex) != cm._g299_candidateChampionOrdinal) {
|
||||
cm._gK71_champions[champIndex]._load += _vm->_dungeonMan->f140_getObjectWeight(cm._g414_leaderHandObject);
|
||||
if (_vm->M0_indexToOrdinal(champIndex) != cm._g299_candidateChampionOrdinal) {
|
||||
champion->setAttributeFlag(k0x0400_ChampionAttributeIcon, true);
|
||||
champion->setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true);
|
||||
cm.drawChampionState(champIndex);
|
||||
cm.f292_drawChampionState(champIndex);
|
||||
}
|
||||
}
|
||||
|
||||
void EventManager::commandProcessType80ClickInDungeonViewTouchFrontWall() {
|
||||
void EventManager::f372_commandProcessType80ClickInDungeonViewTouchFrontWall() {
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir];
|
||||
int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir];
|
||||
if ((mapX >= 0) && (mapX < dunMan._g273_currMapWidth) && (mapY >= 0) && (mapY < dunMan._g274_currMapHeight)) {
|
||||
_vm->_g321_stopWaitingForPlayerInput = _vm->_movsens->sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(dunMan._g308_partyDir));
|
||||
_vm->_g321_stopWaitingForPlayerInput = _vm->_movsens->f275_sensorIsTriggeredByClickOnWall(mapX, mapY, returnOppositeDir(dunMan._g308_partyDir));
|
||||
}
|
||||
}
|
||||
|
||||
void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY) {
|
||||
void EventManager::f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY) {
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
|
||||
@ -524,7 +524,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
|
||||
int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir];
|
||||
int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir];
|
||||
|
||||
if (Door(dunMan.getSquareFirstThingData(mapX, mapY)).hasButton() &&
|
||||
if (Door(dunMan.f157_getSquareFirstThingData(mapX, mapY)).hasButton() &&
|
||||
dunMan._g291_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(Common::Point(posX, posY - 33))) {
|
||||
_vm->_g321_stopWaitingForPlayerInput = true;
|
||||
warning("MISSING CODE: F0064_SOUND_RequestPlay_CPSD");
|
||||
@ -541,7 +541,7 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
|
||||
if (dunMan._g291_dungeonViewClickableBoxes[viewCell].isPointInside(Common::Point(posX, posY - 33))) {
|
||||
if (viewCell == k5_ViewCellDoorButtonOrWallOrn) {
|
||||
if (!dunMan._g286_isFacingAlcove) {
|
||||
commandProcessType80ClickInDungeonViewTouchFrontWall();
|
||||
f372_commandProcessType80ClickInDungeonViewTouchFrontWall();
|
||||
}
|
||||
} else {
|
||||
warning("MISSING CODE: F0373_COMMAND_ProcessType80_ClickInDungeonView_GrabLeaderHandObject");
|
||||
@ -550,8 +550,8 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Thing thing = champMan._414_leaderHandObject;
|
||||
uint16 *rawThingPointer = dunMan.getThingData(thing);
|
||||
Thing thing = champMan._g414_leaderHandObject;
|
||||
uint16 *rawThingPointer = dunMan.f156_getThingData(thing);
|
||||
if (dunMan._g285_squareAheadElement == k0_ElementTypeWall) {
|
||||
for (int16 viewCell = k0_ViewCellFronLeft; viewCell <= k1_ViewCellFrontRight; ++viewCell) {
|
||||
if (g462_BoxObjectPiles[viewCell].isPointInside(Common::Point(posX, posY))) {
|
||||
@ -565,8 +565,8 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
|
||||
warning("MISSING CODE: F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject");
|
||||
} else {
|
||||
if (dunMan._g288_isFacingFountain) {
|
||||
uint16 iconIndex = _vm->_objectMan->getIconIndex(thing);
|
||||
int16 weight = dunMan.getObjectWeight(thing);
|
||||
uint16 iconIndex = _vm->_objectMan->f33_getIconIndex(thing);
|
||||
int16 weight = dunMan.f140_getObjectWeight(thing);
|
||||
if ((iconIndex >= k8_IconIndiceJunkWater) && (iconIndex <= k9_IconIndiceJunkWaterSkin)) {
|
||||
((Junk*)rawThingPointer)->setChargeCount(3);
|
||||
} else if (iconIndex == k195_IconIndicePotionEmptyFlask) {
|
||||
@ -574,11 +574,11 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
|
||||
} else {
|
||||
goto T0377019;
|
||||
}
|
||||
champMan.drawChangedObjectIcons();
|
||||
champMan._champions[champMan._g411_leaderIndex]._load += dunMan.getObjectWeight(thing) - weight;
|
||||
champMan.f296_drawChangedObjectIcons();
|
||||
champMan._gK71_champions[champMan._g411_leaderIndex]._load += dunMan.f140_getObjectWeight(thing) - weight;
|
||||
}
|
||||
T0377019:
|
||||
commandProcessType80ClickInDungeonViewTouchFrontWall();
|
||||
f372_commandProcessType80ClickInDungeonViewTouchFrontWall();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@ -593,19 +593,19 @@ T0377019:
|
||||
}
|
||||
}
|
||||
|
||||
void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType) {
|
||||
void EventManager::f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType) {
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
InventoryMan &invMan = *_vm->_inventoryMan;
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
|
||||
uint16 championIndex = champMan._g305_partyChampionCount - 1;
|
||||
Champion *champ = &champMan._champions[championIndex];
|
||||
Champion *champ = &champMan._gK71_champions[championIndex];
|
||||
if (commandType == k162_CommandClickInPanelCancel) {
|
||||
invMan.toggleInventory(k4_ChampionCloseInventory);
|
||||
champMan._g299_candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
|
||||
invMan.f355_toggleInventory(k4_ChampionCloseInventory);
|
||||
champMan._g299_candidateChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
|
||||
if (champMan._g305_partyChampionCount == 1) {
|
||||
commandSetLeader(kM1_ChampionNone);
|
||||
f368_commandSetLeader(kM1_ChampionNone);
|
||||
}
|
||||
champMan._g305_partyChampionCount--;
|
||||
Box box;
|
||||
@ -614,14 +614,14 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
|
||||
box._x1 = championIndex * k69_ChampionStatusBoxSpacing;
|
||||
box._x2 = box._x1 + 66 + 1;
|
||||
dispMan._g578_useByteBoxCoordinates = false;
|
||||
dispMan.clearScreenBox(k0_ColorBlack, box);
|
||||
dispMan.clearScreenBox(k0_ColorBlack, g54_BoxChampionIcons[champMan.championIconIndex(champ->_cell, dunMan._g308_partyDir) * 2]);
|
||||
dispMan.D24_clearScreenBox(k0_ColorBlack, box);
|
||||
dispMan.D24_clearScreenBox(k0_ColorBlack, g54_BoxChampionIcons[champMan.M26_championIconIndex(champ->_cell, dunMan._g308_partyDir) * 2]);
|
||||
warning("F0457_START_DrawEnabledMenus_CPSF");
|
||||
warning("F0078_MOUSE_ShowPointer");
|
||||
return;
|
||||
}
|
||||
|
||||
champMan._g299_candidateChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
|
||||
champMan._g299_candidateChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
|
||||
int16 mapX = dunMan._g306_partyMapX + _vm->_dirIntoStepCountEast[dunMan._g308_partyDir];
|
||||
int16 mapY = dunMan._g307_partyMapY + _vm->_dirIntoStepCountNorth[dunMan._g308_partyDir];
|
||||
|
||||
@ -631,17 +631,17 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
|
||||
warning("MISSING CODE: F0164_DUNGEON_UnlinkThingFromList");
|
||||
}
|
||||
}
|
||||
Thing thing = dunMan.getSquareFirstThing(mapX, mapY);
|
||||
Thing thing = dunMan.f161_getSquareFirstThing(mapX, mapY);
|
||||
for (;;) { // infinite
|
||||
if (thing.getType() == k3_SensorThingType) {
|
||||
((Sensor*)dunMan.getThingData(thing))->setTypeDisabled();
|
||||
((Sensor*)dunMan.f156_getThingData(thing))->setTypeDisabled();
|
||||
break;
|
||||
}
|
||||
thing = dunMan.getNextThing(thing);
|
||||
thing = dunMan.f159_getNextThing(thing);
|
||||
}
|
||||
|
||||
if (commandType == k161_CommandClickInPanelReincarnate) {
|
||||
champMan.renameChampion(champ);
|
||||
champMan.f281_renameChampion(champ);
|
||||
champ->resetSkillsToZero();
|
||||
|
||||
for (uint16 i = 0; i < 12; i++) {
|
||||
@ -653,10 +653,10 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
|
||||
|
||||
if (champMan._g305_partyChampionCount == 1) {
|
||||
warning("MISSING CODE: setting time, G0362_l_LastPartyMovementTime , G0313_ul_GameTime");
|
||||
commandSetLeader(k0_ChampionFirst);
|
||||
_vm->_menuMan->setMagicCasterAndDrawSpellArea(k0_ChampionFirst);
|
||||
f368_commandSetLeader(k0_ChampionFirst);
|
||||
_vm->_menuMan->f394_setMagicCasterAndDrawSpellArea(k0_ChampionFirst);
|
||||
} else {
|
||||
_vm->_menuMan->drawSpellAreaControls(champMan._g514_magicCasterChampionIndex);
|
||||
_vm->_menuMan->f393_drawSpellAreaControls(champMan._g514_magicCasterChampionIndex);
|
||||
}
|
||||
|
||||
warning("MISSING CODE: F0051_TEXT_MESSAGEAREA_PrintLineFeed");
|
||||
@ -664,12 +664,12 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
|
||||
warning("MISSING CODE: F0047_TEXT_MESSAGEAREA_PrintMessage");
|
||||
warning("MISSING CODE: F0047_TEXT_MESSAGEAREA_PrintMessage");
|
||||
|
||||
invMan.toggleInventory(k4_ChampionCloseInventory);
|
||||
invMan.f355_toggleInventory(k4_ChampionCloseInventory);
|
||||
warning("MISSING CODE: F0457_START_DrawEnabledMenus_CPSF");
|
||||
warning("MISSING CODE: F0067_MOUSE_SetPointerToNormal");
|
||||
}
|
||||
|
||||
void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
|
||||
void EventManager::f378_commandProcess81ClickInPanel(int16 x, int16 y) {
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
InventoryMan &invMan = *_vm->_inventoryMan;
|
||||
|
||||
@ -678,23 +678,23 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
|
||||
case k4_PanelContentChest:
|
||||
if (champMan._g411_leaderIndex == kM1_ChampionNone) // if no leader
|
||||
return;
|
||||
commandType = getCommandTypeFromMouseInput(g456_MouseInput_PanelChest, Common::Point(x, y), k1_LeftMouseButton);
|
||||
commandType = f358_getCommandTypeFromMouseInput(g456_MouseInput_PanelChest, Common::Point(x, y), k1_LeftMouseButton);
|
||||
if (commandType != k0_CommandNone)
|
||||
warning("MISSING CODE: F0302_CHAMPION_ProcessCommands28To65_ClickOnSlotBox");
|
||||
break;
|
||||
case k5_PanelContentResurrectReincarnate:
|
||||
if (!champMan._g415_leaderEmptyHanded)
|
||||
break;
|
||||
commandType = getCommandTypeFromMouseInput(g457_MouseInput_PanelResurrectReincarnateCancel, Common::Point(x, y), k1_LeftMouseButton);
|
||||
commandType = f358_getCommandTypeFromMouseInput(g457_MouseInput_PanelResurrectReincarnateCancel, Common::Point(x, y), k1_LeftMouseButton);
|
||||
if (commandType != k0_CommandNone)
|
||||
commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType);
|
||||
f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(commandType);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool EventManager::hasPendingClick(Common::Point& point, MouseButton button) {
|
||||
bool EventManager::f360_hasPendingClick(Common::Point& point, MouseButton button) {
|
||||
if (_g439_pendingClickButton && button == _g439_pendingClickButton)
|
||||
point = _g437_pendingClickPos;
|
||||
|
||||
|
@ -225,8 +225,8 @@ class EventManager {
|
||||
bool _g435_isCommandQueueLocked; // @ G0435_B_CommandQueueLocked
|
||||
Common::Queue<Command> _commandQueue;
|
||||
|
||||
void commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty
|
||||
void commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty
|
||||
void f365_commandTurnParty(CommandType cmdType); // @ F0365_COMMAND_ProcessTypes1To2_TurnParty
|
||||
void f366_commandMoveParty(CommandType cmdType); // @ F0366_COMMAND_ProcessTypes3To6_MoveParty
|
||||
public:
|
||||
explicit EventManager(DMEngine *vm);
|
||||
|
||||
@ -242,18 +242,18 @@ public:
|
||||
|
||||
void setMousePos(Common::Point pos);
|
||||
void processInput(); // acknowledges mouse and keyboard input
|
||||
void processPendingClick(); // @ F0360_COMMAND_ProcessPendingClick
|
||||
void processClick(Common::Point mousePos, MouseButton button); // @ F0359_COMMAND_ProcessClick_CPSC
|
||||
CommandType getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button); // @ F0358_COMMAND_GetCommandFromMouseInput_CPSC
|
||||
void processCommandQueue(); // @ F0380_COMMAND_ProcessQueue_CPSC
|
||||
void f360_processPendingClick(); // @ F0360_COMMAND_ProcessPendingClick
|
||||
void f359_processClick(Common::Point mousePos, MouseButton button); // @ F0359_COMMAND_ProcessClick_CPSC
|
||||
CommandType f358_getCommandTypeFromMouseInput(MouseInput *input, Common::Point mousePos, MouseButton button); // @ F0358_COMMAND_GetCommandFromMouseInput_CPSC
|
||||
void f380_processCommandQueue(); // @ F0380_COMMAND_ProcessQueue_CPSC
|
||||
|
||||
void commandSetLeader(ChampionIndex index); // @ F0368_COMMAND_SetLeader
|
||||
void commandProcessType80ClickInDungeonViewTouchFrontWall(); // @ F0372_COMMAND_ProcessType80_ClickInDungeonView_TouchFrontWall
|
||||
void commandProcessType80ClickInDungeonView(int16 posX, int16 posY); // @ F0377_COMMAND_ProcessType80_ClickInDungeonView
|
||||
void commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType); // @ F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel
|
||||
void commandProcess81ClickInPanel(int16 x, int16 y); // @ F0378_COMMAND_ProcessType81_ClickInPanel
|
||||
void f368_commandSetLeader(ChampionIndex index); // @ F0368_COMMAND_SetLeader
|
||||
void f372_commandProcessType80ClickInDungeonViewTouchFrontWall(); // @ F0372_COMMAND_ProcessType80_ClickInDungeonView_TouchFrontWall
|
||||
void f377_commandProcessType80ClickInDungeonView(int16 posX, int16 posY); // @ F0377_COMMAND_ProcessType80_ClickInDungeonView
|
||||
void f282_commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType); // @ F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel
|
||||
void f378_commandProcess81ClickInPanel(int16 x, int16 y); // @ F0378_COMMAND_ProcessType81_ClickInPanel
|
||||
|
||||
bool hasPendingClick(Common::Point &point, MouseButton button);
|
||||
bool f360_hasPendingClick(Common::Point &point, MouseButton button); // @ F0360_COMMAND_ProcessPendingClick
|
||||
};
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -433,27 +433,27 @@ class DisplayMan {
|
||||
void f565_viewportSetPalette(uint16 * middleScreenPalette, uint16 * topAndBottomScreen); // @ F0565_VIEWPORT_SetPalette
|
||||
void f566_viewportBlitToScreen(); // @ F0566_VIEWPORT_BlitToScreen
|
||||
|
||||
void drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &frame); // @ F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally
|
||||
void drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &frame); // @ F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap
|
||||
void drawWallSetBitmap(byte *bitmap, Frame &f); // @ F0100_DUNGEONVIEW_DrawWallSetBitmap
|
||||
void drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f); // @ F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency
|
||||
void drawSquareD3L(direction dir, int16 posX, int16 posY); // @ F0116_DUNGEONVIEW_DrawSquareD3L
|
||||
void drawSquareD3R(direction dir, int16 posX, int16 posY); // @ F0117_DUNGEONVIEW_DrawSquareD3R
|
||||
void drawSquareD3C(direction dir, int16 posX, int16 posY); // @ F0118_DUNGEONVIEW_DrawSquareD3C_CPSF
|
||||
void drawSquareD2L(direction dir, int16 posX, int16 posY); // @ F0119_DUNGEONVIEW_DrawSquareD2L
|
||||
void drawSquareD2R(direction dir, int16 posX, int16 posY); // @ F0120_DUNGEONVIEW_DrawSquareD2R_CPSF
|
||||
void drawSquareD2C(direction dir, int16 posX, int16 posY); // @ F0121_DUNGEONVIEW_DrawSquareD2C
|
||||
void drawSquareD1L(direction dir, int16 posX, int16 posY); // @ F0122_DUNGEONVIEW_DrawSquareD1L
|
||||
void drawSquareD1R(direction dir, int16 posX, int16 posY); // @ F0122_DUNGEONVIEW_DrawSquareD1R
|
||||
void drawSquareD1C(direction dir, int16 posX, int16 posY); // @ F0124_DUNGEONVIEW_DrawSquareD1C
|
||||
void drawSquareD0L(direction dir, int16 posX, int16 posY); // @ F0125_DUNGEONVIEW_DrawSquareD0L
|
||||
void drawSquareD0R(direction dir, int16 posX, int16 posY); // @ F0126_DUNGEONVIEW_DrawSquareD0R
|
||||
void drawSquareD0C(direction dir, int16 posX, int16 posY); // @ F0127_DUNGEONVIEW_DrawSquareD0C
|
||||
void f105_drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &frame); // @ F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally
|
||||
void f104_drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &frame); // @ F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap
|
||||
void f100_drawWallSetBitmap(byte *bitmap, Frame &f); // @ F0100_DUNGEONVIEW_DrawWallSetBitmap
|
||||
void f101_drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f); // @ F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency
|
||||
void f116_drawSquareD3L(direction dir, int16 posX, int16 posY); // @ F0116_DUNGEONVIEW_DrawSquareD3L
|
||||
void f117_drawSquareD3R(direction dir, int16 posX, int16 posY); // @ F0117_DUNGEONVIEW_DrawSquareD3R
|
||||
void f118_drawSquareD3C(direction dir, int16 posX, int16 posY); // @ F0118_DUNGEONVIEW_DrawSquareD3C_CPSF
|
||||
void f119_drawSquareD2L(direction dir, int16 posX, int16 posY); // @ F0119_DUNGEONVIEW_DrawSquareD2L
|
||||
void f120_drawSquareD2R(direction dir, int16 posX, int16 posY); // @ F0120_DUNGEONVIEW_DrawSquareD2R_CPSF
|
||||
void f121_drawSquareD2C(direction dir, int16 posX, int16 posY); // @ F0121_DUNGEONVIEW_DrawSquareD2C
|
||||
void f122_drawSquareD1L(direction dir, int16 posX, int16 posY); // @ F0122_DUNGEONVIEW_DrawSquareD1L
|
||||
void f123_drawSquareD1R(direction dir, int16 posX, int16 posY); // @ F0123_DUNGEONVIEW_DrawSquareD1R
|
||||
void f124_drawSquareD1C(direction dir, int16 posX, int16 posY); // @ F0124_DUNGEONVIEW_DrawSquareD1C
|
||||
void f125_drawSquareD0L(direction dir, int16 posX, int16 posY); // @ F0125_DUNGEONVIEW_DrawSquareD0L
|
||||
void f126_drawSquareD0R(direction dir, int16 posX, int16 posY); // @ F0126_DUNGEONVIEW_DrawSquareD0R
|
||||
void f127_drawSquareD0C(direction dir, int16 posX, int16 posY); // @ F0127_DUNGEONVIEW_DrawSquareD0C
|
||||
|
||||
|
||||
void applyCreatureReplColors(int replacedColor, int replacementColor); // @ F0093_DUNGEONVIEW_ApplyCreatureReplacementColors
|
||||
void f93_applyCreatureReplColors(int replacedColor, int replacementColor); // @ F0093_DUNGEONVIEW_ApplyCreatureReplacementColors
|
||||
|
||||
bool isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex); // @ F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF
|
||||
bool f107_isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex); // @ F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF
|
||||
|
||||
uint16 *_g639_derivedBitmapByteCount; // @ G0639_pui_DerivedBitmapByteCount
|
||||
byte **_g638_derivedBitmaps; // @ G0638_pui_DerivedBitmapBlockIndices
|
||||
@ -527,14 +527,14 @@ public:
|
||||
explicit DisplayMan(DMEngine *dmEngine);
|
||||
~DisplayMan();
|
||||
|
||||
void loadWallSet(WallSet set); // @ F0095_DUNGEONVIEW_LoadWallSet
|
||||
void loadFloorSet(FloorSet set); // @ F0094_DUNGEONVIEW_LoadFloorSet
|
||||
void f95_loadWallSet(WallSet set); // @ F0095_DUNGEONVIEW_LoadWallSet
|
||||
void f94_loadFloorSet(FloorSet set); // @ F0094_DUNGEONVIEW_LoadFloorSet
|
||||
|
||||
void loadIntoBitmap(uint16 index, byte *destBitmap); // @ F0466_EXPAND_GraphicToBitmap
|
||||
void f466_loadIntoBitmap(uint16 index, byte *destBitmap); // @ F0466_EXPAND_GraphicToBitmap
|
||||
void setUpScreens(uint16 width, uint16 height);
|
||||
void loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader, F0460_START_InitializeGraphicData
|
||||
void initializeGraphicData(); // @ F0460_START_InitializeGraphicData
|
||||
void loadCurrentMapGraphics(); // @ F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF
|
||||
void f479_loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader
|
||||
void f460_initializeGraphicData(); // @ F0460_START_InitializeGraphicData
|
||||
void f96_loadCurrentMapGraphics(); // @ F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF
|
||||
void loadPalette(uint16 *palette);
|
||||
void f461_allocateFlippedWallBitmaps(); // @ F0461_START_AllocateFlippedWallBitmaps
|
||||
|
||||
@ -547,40 +547,40 @@ public:
|
||||
void f99_copyBitmapAndFlipHorizontal(byte *srcBitmap, byte *destBitmap, uint16 byteWidth, uint16 height);
|
||||
|
||||
|
||||
void blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY,
|
||||
byte *destBitmap, uint16 destWidth, Box &box, Color transparent = k255_ColorNoTransparency);
|
||||
void f132_blitToBitmap(byte *srcBitmap, uint16 srcWidth, uint16 srcX, uint16 srcY,
|
||||
byte *destBitmap, uint16 destWidth, Box &box, Color transparent = k255_ColorNoTransparency); // @ F0132_VIDEO_Blit
|
||||
|
||||
void blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex,
|
||||
void f133_blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box &box, int16 lastUnitIndex,
|
||||
int16 firstUnitIndex, int16 destPixelWidth, Color transparent,
|
||||
int16 xPos, int16 yPos, int16 destHeight, int16 height2); // @ F0133_VIDEO_BlitBoxFilledWithMaskedBitmap
|
||||
void blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHight,
|
||||
void f129_blitToBitmapShrinkWithPalChange(byte *srcBitmap, int16 srcWidth, int16 srcHight,
|
||||
byte *destBitmap, int16 destWidth, int16 destHeight, byte *palChange); // @ F0129_VIDEO_BlitShrinkWithPaletteChanges
|
||||
|
||||
void flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height); // @ F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally
|
||||
void f103_flipBitmapHorizontal(byte *bitmap, uint16 width, uint16 height); // @ F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally
|
||||
void flipBitmapVertical(byte *bitmap, uint16 width, uint16 height);
|
||||
byte *getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int16 &returnPixelWidth, int16 &returnHeight); // @ F0114_DUNGEONVIEW_GetExplosionBitmap
|
||||
byte *f114_getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int16 &returnPixelWidth, int16 &returnHeight); // @ F0114_DUNGEONVIEW_GetExplosionBitmap
|
||||
|
||||
void f134_fillBitmap(byte *bitmap, uint16 width, uint16 height, Color color); // @ F0134_VIDEO_FillBitmap
|
||||
void clearScreen(Color color);
|
||||
void clearScreenBox(Color color, Box &box); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox
|
||||
void D24_clearScreenBox(Color color, Box &box); // @ D24_FillScreenBox, F0550_VIDEO_FillScreenBox
|
||||
void f135_fillBoxBitmap(byte *destBitmap, Box &box, Color color, int16 pixelWidth, int16 height);
|
||||
void drawDungeon(direction dir, int16 posX, int16 posY); // @ F0128_DUNGEONVIEW_Draw_CPSF
|
||||
void f128_drawDungeon(direction dir, int16 posX, int16 posY); // @ F0128_DUNGEONVIEW_Draw_CPSF
|
||||
void updateScreen();
|
||||
void f97_drawViewport(int16 palSwitchingRequestedState); // @ F0097_DUNGEONVIEW_DrawViewport
|
||||
|
||||
byte* getBitmap(uint16 index);
|
||||
byte* f489_getBitmap(uint16 index); // @ F0489_MEMORY_GetNativeBitmapOrGraphic
|
||||
Common::MemoryReadStream getCompressedData(uint16 index);
|
||||
uint32 getCompressedDataSize(uint16 index);
|
||||
void drawField(FieldAspect *fieldAspect, Box &box); // @ F0113_DUNGEONVIEW_DrawField
|
||||
void f113_drawField(FieldAspect *fieldAspect, Box &box); // @ F0113_DUNGEONVIEW_DrawField
|
||||
|
||||
int16 getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale); // @ F0459_START_GetScaledBitmapByteCount
|
||||
int16 getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION
|
||||
void cthulhu(Thing thingParam, direction directionParam,
|
||||
int16 f459_getScaledBitmapPixelCount(int16 pixelWidth, int16 pixelHeight, int16 scale); // @ F0459_START_GetScaledBitmapByteCount
|
||||
int16 M78_getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION
|
||||
void f115_cthulhu(Thing thingParam, direction directionParam,
|
||||
int16 mapXpos, int16 mapYpos, int16 viewSquareIndex,
|
||||
uint16 orderedViewCellOrdinals); // @ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
|
||||
uint16 getNormalizedByteWidthM77(uint16 byteWidth); // @ M77_NORMALIZED_BYTE_WIDTH
|
||||
uint16 getVerticalOffsetM23(uint16 val); // @ M23_VERTICAL_OFFSET
|
||||
uint16 getHorizontalOffsetM22(uint16 val); // @ M22_HORIZONTAL_OFFSET
|
||||
uint16 M77_getNormalizedByteWidth(uint16 byteWidth); // @ M77_NORMALIZED_BYTE_WIDTH
|
||||
uint16 M23_getVerticalOffsetM23(uint16 val); // @ M23_VERTICAL_OFFSET
|
||||
uint16 M22_getHorizontalOffsetM22(uint16 val); // @ M22_HORIZONTAL_OFFSET
|
||||
|
||||
int16 _g289_championPortraitOrdinal; // @ G0289_i_DungeonView_ChampionPortraitOrdinal
|
||||
int16 _g267_currMapAlcoveOrnIndices[k3_AlcoveOrnCount]; // @ G0267_ai_CurrentMapAlcoveOrnamentIndices
|
||||
@ -602,8 +602,8 @@ public:
|
||||
bool _g578_useByteBoxCoordinates; // @ G0578_B_UseByteBoxCoordinates
|
||||
bool _g77_doNotDrawFluxcagesDuringEndgame; // @ G0077_B_DoNotDrawFluxcagesDuringEndgame
|
||||
|
||||
bool isDerivedBitmapInCache(int16 derivedBitmapIndex); // @ F0491_CACHE_IsDerivedBitmapInCache
|
||||
byte *getDerivedBitmap(int16 derivedBitmapIndex); // @ F0492_CACHE_GetDerivedBitmap
|
||||
bool f491_isDerivedBitmapInCache(int16 derivedBitmapIndex); // @ F0491_CACHE_IsDerivedBitmapInCache
|
||||
byte *f492_getDerivedBitmap(int16 derivedBitmapIndex); // @ F0492_CACHE_GetDerivedBitmap
|
||||
|
||||
|
||||
|
||||
|
@ -42,7 +42,7 @@ GroupMan::~GroupMan() {
|
||||
delete[] _g375_activeGroups;
|
||||
}
|
||||
|
||||
void GroupMan::initActiveGroups() {
|
||||
void GroupMan::f196_initActiveGroups() {
|
||||
if (_vm->_g298_newGame)
|
||||
_g376_maxActiveGroupCount = 60;
|
||||
if (_g375_activeGroups)
|
||||
@ -52,7 +52,7 @@ void GroupMan::initActiveGroups() {
|
||||
_g375_activeGroups[i]._groupThingIndex = -1;
|
||||
}
|
||||
|
||||
uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) {
|
||||
uint16 GroupMan::f145_getGroupCells(Group* group, int16 mapIndex) {
|
||||
byte cells;
|
||||
cells = group->_cells;
|
||||
if (mapIndex == _vm->_dungeonMan->_g309_partyMapIndex)
|
||||
@ -62,39 +62,39 @@ uint16 GroupMan::getGroupCells(Group* group, int16 mapIndex) {
|
||||
|
||||
byte gGroupDirections[4] = {0x00, 0x55, 0xAA, 0xFF}; // @ G0258_auc_Graphic559_GroupDirections
|
||||
|
||||
uint16 GroupMan::getGroupDirections(Group* group, int16 mapIndex) {
|
||||
uint16 GroupMan::f147_getGroupDirections(Group* group, int16 mapIndex) {
|
||||
if (mapIndex == _vm->_dungeonMan->_g309_partyMapIndex)
|
||||
return _g375_activeGroups[group->getActiveGroupIndex()]._directions;
|
||||
|
||||
return gGroupDirections[group->getDir()];
|
||||
}
|
||||
|
||||
int16 GroupMan::getCreatureOrdinalInCell(Group* group, uint16 cell) {
|
||||
int16 GroupMan::f176_getCreatureOrdinalInCell(Group* group, uint16 cell) {
|
||||
uint16 currMapIndex = _vm->_dungeonMan->_g272_currMapIndex;
|
||||
byte groupCells = getGroupCells(group, currMapIndex);
|
||||
byte groupCells = f145_getGroupCells(group, currMapIndex);
|
||||
if (groupCells == k255_CreatureTypeSingleCenteredCreature)
|
||||
return _vm->indexToOrdinal(0);
|
||||
return _vm->M0_indexToOrdinal(0);
|
||||
|
||||
byte creatureIndex = group->getCount();
|
||||
if (getFlag(g243_CreatureInfo[group->_type]._attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) {
|
||||
if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1))
|
||||
if ((f147_getGroupDirections(group, currMapIndex) & 1) == (cell & 1))
|
||||
cell = returnPrevVal(cell);
|
||||
|
||||
do {
|
||||
byte creatureCell = getCreatureValue(groupCells, creatureIndex);
|
||||
byte creatureCell = M50_getCreatureValue(groupCells, creatureIndex);
|
||||
if (creatureCell == cell || creatureCell == returnNextVal(cell))
|
||||
return _vm->indexToOrdinal(creatureIndex);
|
||||
return _vm->M0_indexToOrdinal(creatureIndex);
|
||||
} while (creatureIndex--);
|
||||
} else {
|
||||
do {
|
||||
if (getCreatureValue(groupCells, creatureIndex) == cell)
|
||||
return _vm->indexToOrdinal(creatureIndex);
|
||||
if (M50_getCreatureValue(groupCells, creatureIndex) == cell)
|
||||
return _vm->M0_indexToOrdinal(creatureIndex);
|
||||
} while (creatureIndex--);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint16 GroupMan::getCreatureValue(uint16 groupVal, uint16 creatureIndex) {
|
||||
uint16 GroupMan::M50_getCreatureValue(uint16 groupVal, uint16 creatureIndex) {
|
||||
return (groupVal >> (creatureIndex << 1)) & 0x3;
|
||||
}
|
||||
}
|
||||
|
@ -137,11 +137,11 @@ public:
|
||||
ActiveGroup *_g375_activeGroups; // @ G0375_ps_ActiveGroups
|
||||
GroupMan(DMEngine *vm);
|
||||
~GroupMan();
|
||||
void initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups
|
||||
uint16 getGroupCells(Group *group, int16 mapIndex); // @ F0145_DUNGEON_GetGroupCells
|
||||
uint16 getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections
|
||||
int16 getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell
|
||||
uint16 getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE
|
||||
void f196_initActiveGroups(); // @ F0196_GROUP_InitializeActiveGroups
|
||||
uint16 f145_getGroupCells(Group *group, int16 mapIndex); // @ F0145_DUNGEON_GetGroupCells
|
||||
uint16 f147_getGroupDirections(Group *group, int16 mapIndex); // @ F0147_DUNGEON_GetGroupDirections
|
||||
int16 f176_getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell
|
||||
uint16 M50_getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE
|
||||
};
|
||||
|
||||
|
||||
|
@ -50,36 +50,36 @@ InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
|
||||
_g426_openChest = Thing::_none;
|
||||
}
|
||||
|
||||
void InventoryMan::toggleInventory(ChampionIndex championIndex) {
|
||||
void InventoryMan::f355_toggleInventory(ChampionIndex championIndex) {
|
||||
ChampionMan &cm = *_vm->_championMan;
|
||||
EventManager &em = *_vm->_eventMan;
|
||||
DisplayMan &dm = *_vm->_displayMan;
|
||||
|
||||
if ((championIndex != k4_ChampionCloseInventory) && !cm._champions[championIndex]._currHealth)
|
||||
if ((championIndex != k4_ChampionCloseInventory) && !cm._gK71_champions[championIndex]._currHealth)
|
||||
return;
|
||||
if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth)
|
||||
return;
|
||||
_vm->_g321_stopWaitingForPlayerInput = true;
|
||||
int16 invChampOrdinal = _g432_inventoryChampionOrdinal; // copy, as the original will be edited
|
||||
if (_vm->indexToOrdinal(championIndex) == invChampOrdinal) {
|
||||
if (_vm->M0_indexToOrdinal(championIndex) == invChampOrdinal) {
|
||||
championIndex = k4_ChampionCloseInventory;
|
||||
}
|
||||
|
||||
Champion *champion;
|
||||
if (invChampOrdinal) {
|
||||
_g432_inventoryChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
|
||||
closeChest();
|
||||
champion = &cm._champions[_vm->ordinalToIndex(invChampOrdinal)];
|
||||
_g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
|
||||
f334_closeChest();
|
||||
champion = &cm._gK71_champions[_vm->M1_ordinalToIndex(invChampOrdinal)];
|
||||
if (champion->_currHealth && !cm._g299_candidateChampionOrdinal) {
|
||||
champion->setAttributeFlag(k0x1000_ChampionAttributeStatusBox, true);
|
||||
cm.drawChampionState((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
|
||||
cm.f292_drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(invChampOrdinal));
|
||||
}
|
||||
if (cm._g300_partyIsSleeping) {
|
||||
return;
|
||||
}
|
||||
if (championIndex == k4_ChampionCloseInventory) {
|
||||
em._g326_refreshMousePointerInMainLoop = true;
|
||||
_vm->_menuMan->drawMovementArrows();
|
||||
_vm->_menuMan->f395_drawMovementArrows();
|
||||
em._g442_secondaryMouseInput = g448_SecondaryMouseInput_Movement;
|
||||
warning("MISSING CODE: set G0444_ps_SecondaryKeyboardInput");
|
||||
warning("MISSING CODE: F0357_COMMAND_DiscardAllInput");
|
||||
@ -88,22 +88,22 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
|
||||
}
|
||||
|
||||
dm._g578_useByteBoxCoordinates = false;
|
||||
_g432_inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex);
|
||||
_g432_inventoryChampionOrdinal = _vm->M0_indexToOrdinal(championIndex);
|
||||
if (!invChampOrdinal) {
|
||||
warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox");
|
||||
}
|
||||
|
||||
champion = &cm._champions[championIndex];
|
||||
dm.loadIntoBitmap(k17_InventoryGraphicIndice, dm._g296_bitmapViewport);
|
||||
champion = &cm._gK71_champions[championIndex];
|
||||
dm.f466_loadIntoBitmap(k17_InventoryGraphicIndice, dm._g296_bitmapViewport);
|
||||
if (cm._g299_candidateChampionOrdinal) {
|
||||
dm.f135_fillBoxBitmap(dm._g296_bitmapViewport, g41_BoxFloppyZzzCross, k12_ColorDarkestGray, k112_byteWidthViewport * 2, k136_heightViewport);
|
||||
}
|
||||
_vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "HEALTH");
|
||||
_vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "STAMINA");
|
||||
_vm->_textMan->printToViewport(5, 132, k13_ColorLightestGray, "MANA");
|
||||
_vm->_textMan->f52_printToViewport(5, 116, k13_ColorLightestGray, "HEALTH");
|
||||
_vm->_textMan->f52_printToViewport(5, 124, k13_ColorLightestGray, "STAMINA");
|
||||
_vm->_textMan->f52_printToViewport(5, 132, k13_ColorLightestGray, "MANA");
|
||||
|
||||
for (uint16 slotIndex = k0_ChampionSlotReadyHand; slotIndex < k30_ChampionSlotChest_1; slotIndex++) {
|
||||
_vm->_championMan->drawSlot(championIndex, (ChampionSlot)slotIndex);
|
||||
_vm->_championMan->f291_drawSlot(championIndex, (ChampionSlot)slotIndex);
|
||||
}
|
||||
|
||||
champion->setAttributeFlag(k0x4000_ChampionAttributeViewport, true);
|
||||
@ -113,14 +113,14 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
|
||||
champion->setAttributeFlag(k0x0100_ChampionAttributeStatistics, true);
|
||||
champion->setAttributeFlag(k0x0080_ChampionAttributeNameTitle, true);
|
||||
|
||||
cm.drawChampionState(championIndex);
|
||||
cm.f292_drawChampionState(championIndex);
|
||||
em._g598_mousePointerBitmapUpdated = true;
|
||||
em._g442_secondaryMouseInput = g449_SecondaryMouseInput_ChampionInventory;
|
||||
warning("MISSING CODE: set G0444_ps_SecondaryKeyboardInput");
|
||||
warning("MISSING CODE: F0357_COMMAND_DiscardAllInput");
|
||||
}
|
||||
|
||||
void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) {
|
||||
void InventoryMan::f354_drawStatusBoxPortrait(ChampionIndex championIndex) {
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
dispMan._g578_useByteBoxCoordinates = false;
|
||||
Box box;
|
||||
@ -128,21 +128,21 @@ void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) {
|
||||
box._y2 = 28 + 1;
|
||||
box._x1 = championIndex * k69_ChampionStatusBoxSpacing + 7;
|
||||
box._x2 = box._x1 + 31 + 1;
|
||||
dispMan.blitToBitmap(_vm->_championMan->_champions[championIndex]._portrait, 32, 0, 0,
|
||||
dispMan.f132_blitToBitmap(_vm->_championMan->_gK71_champions[championIndex]._portrait, 32, 0, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) {
|
||||
void InventoryMan::f343_drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) {
|
||||
Box box;
|
||||
box._x1 = x;
|
||||
box._x2 = box._x1 + pixelWidth + 1;
|
||||
box._y1 = y;
|
||||
box._y2 = box._y1 + 6 + 1;
|
||||
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
|
||||
_vm->_displayMan->clearScreenBox(color, box);
|
||||
_vm->_displayMan->D24_clearScreenBox(color, box);
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
|
||||
void InventoryMan::f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
|
||||
if (amount < -512) {
|
||||
color = k8_ColorRed;
|
||||
} else if (amount < 0) {
|
||||
@ -154,45 +154,45 @@ void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
|
||||
pixelWidth = 3071;
|
||||
}
|
||||
pixelWidth /= 32;
|
||||
drawPanelHorizontalBar(115, y + 2, pixelWidth, k0_ColorBlack);
|
||||
drawPanelHorizontalBar(113, y, pixelWidth, color);
|
||||
f343_drawPanelHorizontalBar(115, y + 2, pixelWidth, k0_ColorBlack);
|
||||
f343_drawPanelHorizontalBar(113, y, pixelWidth, color);
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanelFoodWaterPoisoned() {
|
||||
Champion &champ = _vm->_championMan->_champions[_g432_inventoryChampionOrdinal];
|
||||
closeChest();
|
||||
void InventoryMan::f345_drawPanelFoodWaterPoisoned() {
|
||||
Champion &champ = _vm->_championMan->_gK71_champions[_g432_inventoryChampionOrdinal];
|
||||
f334_closeChest();
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k20_PanelEmptyIndice), 144, 0, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed);
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k30_FoodLabelIndice), 48, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k30_FoodLabelIndice), 48, 0, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g35_BoxFood, k12_ColorDarkestGray);
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k31_WaterLabelIndice), 48, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k31_WaterLabelIndice), 48, 0, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g36_BoxWater, k12_ColorDarkestGray);
|
||||
if (champ._poisonEventCount) {
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k32_PoisionedLabelIndice), 96, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k32_PoisionedLabelIndice), 96, 0, 0,
|
||||
dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g37_BoxPoisoned, k12_ColorDarkestGray);
|
||||
}
|
||||
drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown);
|
||||
drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue);
|
||||
f344_drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown);
|
||||
f344_drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue);
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanelResurrectReincarnate() {
|
||||
void InventoryMan::f346_drawPanelResurrectReincarnate() {
|
||||
_g424_panelContent = k5_PanelContentResurrectReincarnate;
|
||||
_vm->_displayMan->blitToBitmap(_vm->_displayMan->getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0,
|
||||
_vm->_displayMan->f132_blitToBitmap(_vm->_displayMan->f489_getBitmap(k40_PanelResurectReincaranteIndice), 144, 0, 0,
|
||||
_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k6_ColorDarkGreen);
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanel() {
|
||||
void InventoryMan::f347_drawPanel() {
|
||||
warning("possible reintroduction of BUG0_48");
|
||||
closeChest(); // possibility of BUG0_48
|
||||
f334_closeChest(); // possibility of BUG0_48
|
||||
|
||||
ChampionMan &cm = *_vm->_championMan;
|
||||
if (cm._g299_candidateChampionOrdinal) {
|
||||
drawPanelResurrectReincarnate();
|
||||
f346_drawPanelResurrectReincarnate();
|
||||
return;
|
||||
}
|
||||
|
||||
Thing thing = cm._champions[_vm->ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand);
|
||||
Thing thing = cm._gK71_champions[_vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal)].getSlot(k1_ChampionSlotActionHand);
|
||||
|
||||
_g424_panelContent = k0_PanelContentFoodWaterPoisoned;
|
||||
switch (thing.getType()) {
|
||||
@ -207,19 +207,19 @@ void InventoryMan::drawPanel() {
|
||||
break;
|
||||
}
|
||||
if (thing == Thing::_none) {
|
||||
drawPanelFoodWaterPoisoned();
|
||||
f345_drawPanelFoodWaterPoisoned();
|
||||
} else {
|
||||
drawPanelObject(thing, false);
|
||||
f342_drawPanelObject(thing, false);
|
||||
}
|
||||
}
|
||||
|
||||
void InventoryMan::closeChest() {
|
||||
void InventoryMan::f334_closeChest() {
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
|
||||
bool processFirstChestSlot = true;
|
||||
if (_g426_openChest == Thing::_none)
|
||||
return;
|
||||
Container *container = (Container*)dunMan.getThingData(_g426_openChest);
|
||||
Container *container = (Container*)dunMan.f156_getThingData(_g426_openChest);
|
||||
_g426_openChest = Thing::_none;
|
||||
container->getSlot() = Thing::_endOfList;
|
||||
Thing prevThing;
|
||||
@ -230,17 +230,17 @@ void InventoryMan::closeChest() {
|
||||
|
||||
if (processFirstChestSlot) {
|
||||
processFirstChestSlot = false;
|
||||
*dunMan.getThingData(thing) = Thing::_endOfList.toUint16();
|
||||
*dunMan.f156_getThingData(thing) = Thing::_endOfList.toUint16();
|
||||
container->getSlot() = prevThing = thing;
|
||||
} else {
|
||||
dunMan.linkThingToList(thing, prevThing, kM1_MapXNotOnASquare, 0);
|
||||
dunMan.f163_linkThingToList(thing, prevThing, kM1_MapXNotOnASquare, 0);
|
||||
prevThing = thing;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanelScrollTextLine(int16 yPos, char* text) {
|
||||
void InventoryMan::f340_drawPanelScrollTextLine(int16 yPos, char* text) {
|
||||
warning("CHANGE5_03_IMPROVEMENT");
|
||||
for (char* iter = text; *iter != '\0'; ++iter) {
|
||||
if ((*iter >= 'A') && (*iter <= 'Z')) {
|
||||
@ -249,20 +249,20 @@ void InventoryMan::drawPanelScrollTextLine(int16 yPos, char* text) {
|
||||
*iter -= 96;
|
||||
}
|
||||
}
|
||||
_vm->_textMan->printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite);
|
||||
_vm->_textMan->f52_printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite);
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanelScroll(Scroll* scroll) {
|
||||
void InventoryMan::f341_drawPanelScroll(Scroll* scroll) {
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
|
||||
char stringFirstLine[300];
|
||||
_vm->_dungeonMan->decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible));
|
||||
_vm->_dungeonMan->f168_decodeText(stringFirstLine, Thing(scroll->getTextStringThingIndex()), (TextType)(k2_TextTypeScroll | k0x8000_DecodeEvenIfInvisible));
|
||||
char *charRed = stringFirstLine;
|
||||
while (*charRed && (*charRed != '\n')) {
|
||||
charRed++;
|
||||
}
|
||||
*charRed = '\0';
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed);
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k23_PanelOpenScrollIndice), 144, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed);
|
||||
int16 lineCount = 1;
|
||||
charRed++;
|
||||
char *charGreen = charRed; // first char of the second line
|
||||
@ -283,7 +283,7 @@ void InventoryMan::drawPanelScroll(Scroll* scroll) {
|
||||
lineCount--;
|
||||
}
|
||||
int16 yPos = 92 - (7 * lineCount) / 2; // center the text vertically
|
||||
drawPanelScrollTextLine(yPos, stringFirstLine);
|
||||
f340_drawPanelScrollTextLine(yPos, stringFirstLine);
|
||||
charGreen = charRed;
|
||||
while (*charGreen) {
|
||||
yPos += 7;
|
||||
@ -294,12 +294,12 @@ void InventoryMan::drawPanelScroll(Scroll* scroll) {
|
||||
charRed[1] = '\0';
|
||||
}
|
||||
*charRed++ = '\0';
|
||||
drawPanelScrollTextLine(yPos, charGreen);
|
||||
f340_drawPanelScrollTextLine(yPos, charGreen);
|
||||
charGreen = charRed;
|
||||
}
|
||||
}
|
||||
|
||||
void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool isPressingEye) {
|
||||
void InventoryMan::f333_openAndDrawChest(Thing thingToOpen, Container* chest, bool isPressingEye) {
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
ObjectMan &objMan = *_vm->_objectMan;
|
||||
|
||||
@ -308,13 +308,13 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container* chest, bool is
|
||||
|
||||
warning("CHANGE8_09_FIX");
|
||||
if (_g426_openChest != Thing::_none)
|
||||
closeChest(); // CHANGE8_09_FIX
|
||||
f334_closeChest(); // CHANGE8_09_FIX
|
||||
|
||||
_g426_openChest = thingToOpen;
|
||||
if (!isPressingEye) {
|
||||
objMan.drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen);
|
||||
objMan.f38_drawIconInSlotBox(k9_SlotBoxInventoryActionHand, k145_IconIndiceContainerChestOpen);
|
||||
}
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed);
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k25_PanelOpenChestIndice), 144, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g32_BoxPanel, k8_ColorRed);
|
||||
|
||||
int16 chestSlotIndex = 0;
|
||||
Thing thing = chest->getSlot();
|
||||
@ -324,27 +324,27 @@ 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 + k38_SlotBoxChestFirstSlot, objMan.getIconIndex(thing));
|
||||
objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.f33_getIconIndex(thing));
|
||||
_g425_chestSlots[chestSlotIndex++] = thing;
|
||||
thing = _vm->_dungeonMan->getNextThing(thing);
|
||||
thing = _vm->_dungeonMan->f159_getNextThing(thing);
|
||||
}
|
||||
while (chestSlotIndex < 8) {
|
||||
objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone);
|
||||
objMan.f38_drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kM1_IconIndiceNone);
|
||||
_g425_chestSlots[chestSlotIndex++] = Thing::_none;
|
||||
}
|
||||
}
|
||||
|
||||
void InventoryMan::drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos) {
|
||||
void InventoryMan::f332_drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos) {
|
||||
static byte iconBitmap[16 * 16];
|
||||
Box box;
|
||||
box._x2 = (box._x1 = xPos) + 15 + 1;
|
||||
box._y2 = (box._y1 = yPos) + 15 + 1;
|
||||
_vm->_objectMan->extractIconFromBitmap(iconIndex, iconBitmap);
|
||||
_vm->_displayMan->blitToBitmap(iconBitmap, 16, 0, 0, _vm->_displayMan->_g296_bitmapViewport,
|
||||
_vm->_objectMan->f36_extractIconFromBitmap(iconIndex, iconBitmap);
|
||||
_vm->_displayMan->f132_blitToBitmap(iconBitmap, 16, 0, 0, _vm->_displayMan->_g296_bitmapViewport,
|
||||
k112_byteWidthViewport * 2, box, k255_ColorNoTransparency);
|
||||
}
|
||||
|
||||
void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char** attribStrings, char* destString, char* prefixString, char* suffixString) {
|
||||
void InventoryMan::f336_buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char** attribStrings, char* destString, char* prefixString, char* suffixString) {
|
||||
uint16 identicalBitCount = 0;
|
||||
int16 attribMask = 1;
|
||||
for (uint16 stringIndex = 0; stringIndex < 16; stringIndex++, attribMask <<= 1) {
|
||||
@ -375,7 +375,7 @@ void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 a
|
||||
strcat(destString, suffixString);
|
||||
}
|
||||
|
||||
void InventoryMan::drawPanelObjectDescriptionString(char* descString) {
|
||||
void InventoryMan::f335_drawPanelObjectDescriptionString(char* descString) {
|
||||
if (descString[0] == '\f') { // form feed
|
||||
descString++;
|
||||
_g421_objDescTextXpos = 108;
|
||||
@ -399,7 +399,7 @@ void InventoryMan::drawPanelObjectDescriptionString(char* descString) {
|
||||
severalLines = true;
|
||||
}
|
||||
|
||||
_vm->_textMan->printToViewport(_g421_objDescTextXpos, _g422_objDescTextYpos, k13_ColorLightestGray, stringLine);
|
||||
_vm->_textMan->f52_printToViewport(_g421_objDescTextXpos, _g422_objDescTextYpos, k13_ColorLightestGray, stringLine);
|
||||
_g422_objDescTextYpos += 7;
|
||||
if (severalLines) {
|
||||
severalLines = false;
|
||||
@ -413,9 +413,9 @@ void InventoryMan::drawPanelObjectDescriptionString(char* descString) {
|
||||
|
||||
Box g33_BoxArrowOrEye = Box(83, 98, 57, 65); // @ G0033_s_Graphic562_Box_ArrowOrEye
|
||||
|
||||
void InventoryMan::drawPanelArrowOrEye(bool pressingEye) {
|
||||
void InventoryMan::f339_drawPanelArrowOrEye(bool pressingEye) {
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice),
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice),
|
||||
16, 0, 0, dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g33_BoxArrowOrEye, k8_ColorRed);
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ Box g34_BoxObjectDescCircle = Box(105, 136, 53, 79); // @ G0034_s_Graphic562_Box
|
||||
#define k0x0004_DescriptionMaskBroken 0x0004 // @ MASK0x0004_DESCRIPTION_BROKEN
|
||||
#define k0x0008_DescriptionMaskCursed 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED
|
||||
|
||||
void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
|
||||
void InventoryMan::f342_drawPanelObject(Thing thingToDraw, bool pressingEye) {
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
ObjectMan &objMan = *_vm->_objectMan;
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
@ -436,34 +436,34 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
|
||||
|
||||
if (_vm->_g331_pressingEye || _vm->_g333_pressingMouth) {
|
||||
warning("BUG0_48 The contents of a chest are reorganized when an object with a statistic modifier is placed or removed on a champion");
|
||||
closeChest();
|
||||
f334_closeChest();
|
||||
}
|
||||
|
||||
uint16 *rawThingPtr = dunMan.getThingData(thingToDraw);
|
||||
drawPanelObjectDescriptionString("\f"); // form feed
|
||||
uint16 *rawThingPtr = dunMan.f156_getThingData(thingToDraw);
|
||||
f335_drawPanelObjectDescriptionString("\f"); // form feed
|
||||
ThingType thingType = thingToDraw.getType();
|
||||
if (thingType == k7_ScrollThingType) {
|
||||
drawPanelScroll((Scroll*)rawThingPtr);
|
||||
f341_drawPanelScroll((Scroll*)rawThingPtr);
|
||||
} else if (thingType == k9_ContainerThingType) {
|
||||
openAndDrawChest(thingToDraw, (Container*)rawThingPtr, pressingEye);
|
||||
f333_openAndDrawChest(thingToDraw, (Container*)rawThingPtr, pressingEye);
|
||||
} else {
|
||||
IconIndice iconIndex = objMan.getIconIndex(thingToDraw);
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k20_PanelEmptyIndice), 144, 0, 0,
|
||||
IconIndice iconIndex = objMan.f33_getIconIndex(thingToDraw);
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k20_PanelEmptyIndice), 144, 0, 0,
|
||||
dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g32_BoxPanel, k8_ColorRed);
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k29_ObjectDescCircleIndice), 32, 0, 0,
|
||||
dispMan._g296_bitmapViewport, k112_byteWidthViewport * 2, g34_BoxObjectDescCircle, k12_ColorDarkestGray);
|
||||
|
||||
char *descString = nullptr;
|
||||
char str[40];
|
||||
if (iconIndex == k147_IconIndiceJunkChampionBones) {
|
||||
strcpy(str, champMan._champions[((Junk*)rawThingPtr)->getChargeCount()]._name); // TODO: localization
|
||||
strcpy(str, champMan._gK71_champions[((Junk*)rawThingPtr)->getChargeCount()]._name); // TODO: localization
|
||||
strcat(str, " "); // 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(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) {
|
||||
&& (champMan.f303_getSkillLevel((ChampionIndex)_vm->M1_ordinalToIndex(_g432_inventoryChampionOrdinal), k2_ChampionSkillPriest) > 1)) {
|
||||
str[0] = '_' + ((Potion*)rawThingPtr)->getPower() / 40;
|
||||
str[1] = ' ';
|
||||
str[2] = '\0';
|
||||
@ -473,8 +473,8 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
|
||||
descString = objMan._g352_objectNames[iconIndex];
|
||||
}
|
||||
|
||||
textMan.printToViewport(134, 68, k13_ColorLightestGray, descString);
|
||||
drawIconToViewport(iconIndex, 111, 59);
|
||||
textMan.f52_printToViewport(134, 68, k13_ColorLightestGray, descString);
|
||||
f332_drawIconToViewport(iconIndex, 111, 59);
|
||||
|
||||
char *attribString[4] = {"CONSUMABLE", "POISONED", "BROKEN", "CURSED"}; // TODO: localization
|
||||
|
||||
@ -490,7 +490,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
|
||||
if ((iconIndex >= k4_IconIndiceWeaponTorchUnlit)
|
||||
&& (iconIndex <= k7_IconIndiceWeaponTorchLit)
|
||||
&& (weapon->getChargeCount() == 0)) {
|
||||
drawPanelObjectDescriptionString("(BURNT OUT)"); // TODO: localization
|
||||
f335_drawPanelObjectDescriptionString("(BURNT OUT)"); // TODO: localization
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -524,13 +524,13 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
|
||||
descString = "(FULL)"; // TODO: localization
|
||||
break;
|
||||
}
|
||||
drawPanelObjectDescriptionString(descString);
|
||||
f335_drawPanelObjectDescriptionString(descString);
|
||||
} else if ((iconIndex >= k0_IconIndiceJunkCompassNorth) && (iconIndex <= k3_IconIndiceJunkCompassWest)) {
|
||||
potentialAttribMask = 0;
|
||||
strcpy(str, "PARTY FACING "); // TODO: localization
|
||||
static char* directionName[4] = {"NORTH", "EAST", "SOUTH", "WEST"}; // G0430_apc_DirectionNames // TODO: localization
|
||||
strcat(str, directionName[iconIndex]);
|
||||
drawPanelObjectDescriptionString(str);
|
||||
f335_drawPanelObjectDescriptionString(str);
|
||||
} else {
|
||||
potentialAttribMask = k0x0001_DescriptionMaskConsumable;
|
||||
actualAttribMask = g237_ObjectInfo[k127_ObjectInfoIndexFirstJunk + junk->getType()].getAllowedSlots();
|
||||
@ -540,25 +540,25 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
|
||||
} // end of switch
|
||||
|
||||
if (potentialAttribMask) {
|
||||
buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, str, "(", ")");
|
||||
drawPanelObjectDescriptionString(str);
|
||||
f336_buildObjectAttributeString(potentialAttribMask, actualAttribMask, attribString, str, "(", ")");
|
||||
f335_drawPanelObjectDescriptionString(str);
|
||||
}
|
||||
|
||||
strcpy(str, "WEIGHS "); // TODO: localization
|
||||
|
||||
uint16 weight = dunMan.getObjectWeight(thingToDraw);
|
||||
strcat(str, champMan.getStringFromInteger(weight / 10, false, 3).c_str());
|
||||
uint16 weight = dunMan.f140_getObjectWeight(thingToDraw);
|
||||
strcat(str, champMan.f288_getStringFromInteger(weight / 10, false, 3).c_str());
|
||||
|
||||
strcat(str, "."); // TODO: localization
|
||||
|
||||
weight -= (weight / 10) * 10;
|
||||
strcat(str, champMan.getStringFromInteger(weight, false, 1).c_str());
|
||||
strcat(str, champMan.f288_getStringFromInteger(weight, false, 1).c_str());
|
||||
|
||||
strcat(str, " KG."); // TODO: localization
|
||||
|
||||
drawPanelObjectDescriptionString(str);
|
||||
f335_drawPanelObjectDescriptionString(str);
|
||||
}
|
||||
drawPanelArrowOrEye(pressingEye);
|
||||
f339_drawPanelArrowOrEye(pressingEye);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -61,23 +61,23 @@ public:
|
||||
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
|
||||
void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar
|
||||
void drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar
|
||||
void drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned
|
||||
void drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate
|
||||
void drawPanel(); // @ F0347_INVENTORY_DrawPanel
|
||||
void closeChest(); // @ F0334_INVENTORY_CloseChest
|
||||
void drawPanelScrollTextLine(int16 yPos, char *text); // @ F0340_INVENTORY_DrawPanel_ScrollTextLine
|
||||
void drawPanelScroll(Scroll *scoll); // @ F0341_INVENTORY_DrawPanel_Scroll
|
||||
void openAndDrawChest(Thing thingToOpen, Container *chest, bool isPressingEye); // @ F0333_INVENTORY_OpenAndDrawChest
|
||||
void drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport
|
||||
void buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char ** attribStrings,
|
||||
void f355_toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE
|
||||
void f354_drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait
|
||||
void f343_drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar
|
||||
void f344_drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar
|
||||
void f345_drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned
|
||||
void f346_drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate
|
||||
void f347_drawPanel(); // @ F0347_INVENTORY_DrawPanel
|
||||
void f334_closeChest(); // @ F0334_INVENTORY_CloseChest
|
||||
void f340_drawPanelScrollTextLine(int16 yPos, char *text); // @ F0340_INVENTORY_DrawPanel_ScrollTextLine
|
||||
void f341_drawPanelScroll(Scroll *scoll); // @ F0341_INVENTORY_DrawPanel_Scroll
|
||||
void f333_openAndDrawChest(Thing thingToOpen, Container *chest, bool isPressingEye); // @ F0333_INVENTORY_OpenAndDrawChest
|
||||
void f332_drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yPos); // @ F0332_INVENTORY_DrawIconToViewport
|
||||
void f336_buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, char ** attribStrings,
|
||||
char *destString, char *prefixString, char *suffixString); // @ F0336_INVENTORY_DrawPanel_BuildObjectAttributesString
|
||||
void drawPanelObjectDescriptionString(char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString
|
||||
void drawPanelArrowOrEye(bool pressingEye); // @ F0339_INVENTORY_DrawPanel_ArrowOrEye
|
||||
void drawPanelObject(Thing thingToDraw, bool pressingEye); // @ F0342_INVENTORY_DrawPanel_Object
|
||||
void f335_drawPanelObjectDescriptionString(char *descString); // @ F0335_INVENTORY_DrawPanel_ObjectDescriptionString
|
||||
void f339_drawPanelArrowOrEye(bool pressingEye); // @ F0339_INVENTORY_DrawPanel_ArrowOrEye
|
||||
void f342_drawPanelObject(Thing thingToDraw, bool pressingEye); // @ F0342_INVENTORY_DrawPanel_Object
|
||||
|
||||
};
|
||||
|
||||
|
@ -38,30 +38,30 @@ namespace DM {
|
||||
LoadsaveMan::LoadsaveMan(DMEngine *vm) : _vm(vm) {}
|
||||
|
||||
|
||||
LoadgameResponse LoadsaveMan::loadgame() {
|
||||
LoadgameResponse LoadsaveMan::f435_loadgame() {
|
||||
bool newGame = _vm->_g298_newGame;
|
||||
ChampionMan &cm = *_vm->_championMan;
|
||||
|
||||
if (newGame) {
|
||||
_vm->_g524_restartGameAllowed = false;
|
||||
cm._g305_partyChampionCount = 0;
|
||||
cm._414_leaderHandObject = Thing::_none;
|
||||
cm._g414_leaderHandObject = Thing::_none;
|
||||
_vm->_g525_gameId = _vm->_rnd->getRandomNumber(65536) * _vm->_rnd->getRandomNumber(65536);
|
||||
} else {
|
||||
assert(false);
|
||||
// MISSING CODE: load game
|
||||
}
|
||||
_vm->_dungeonMan->loadDungeonFile();
|
||||
_vm->_dungeonMan->f434_loadDungeonFile();
|
||||
|
||||
|
||||
if (newGame) {
|
||||
_vm->_timeline->initTimeline();
|
||||
_vm->_groupMan->initActiveGroups();
|
||||
_vm->_timeline->f233_initTimeline();
|
||||
_vm->_groupMan->f196_initActiveGroups();
|
||||
} else {
|
||||
assert(false);
|
||||
// MISSING CODE: load game
|
||||
}
|
||||
cm._303_partyDead = false;
|
||||
cm._g303_partyDead = false;
|
||||
return k1_LoadgameSuccess;
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class LoadsaveMan {
|
||||
public:
|
||||
explicit LoadsaveMan(DMEngine *vm);
|
||||
|
||||
LoadgameResponse loadgame(); // @ F0435_STARTEND_LoadGame_CPSF
|
||||
LoadgameResponse f435_loadgame(); // @ F0435_STARTEND_LoadGame_CPSF
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -58,30 +58,30 @@ MenuMan::~MenuMan() {
|
||||
delete[] _gK72_bitmapSpellAreaLine;
|
||||
}
|
||||
|
||||
void MenuMan::drawMovementArrows() {
|
||||
void MenuMan::f395_drawMovementArrows() {
|
||||
DisplayMan &disp = *_vm->_displayMan;
|
||||
byte *arrowsBitmap = disp.getBitmap(k13_MovementArrowsIndice);
|
||||
byte *arrowsBitmap = disp.f489_getBitmap(k13_MovementArrowsIndice);
|
||||
Box &dest = g2_BoxMovementArrows;
|
||||
uint16 w = disp.getWidth(k13_MovementArrowsIndice);
|
||||
|
||||
disp.blitToBitmap(arrowsBitmap, w, 0, 0, disp._g348_bitmapScreen, k160_byteWidthScreen * 2, dest, k255_ColorNoTransparency);
|
||||
disp.f132_blitToBitmap(arrowsBitmap, w, 0, 0, disp._g348_bitmapScreen, k160_byteWidthScreen * 2, dest, k255_ColorNoTransparency);
|
||||
}
|
||||
void MenuMan::clearActingChampion() {
|
||||
void MenuMan::f388_clearActingChampion() {
|
||||
ChampionMan &cm = *_vm->_championMan;
|
||||
if (cm._g506_actingChampionOrdinal) {
|
||||
cm._g506_actingChampionOrdinal--;
|
||||
cm._champions[cm._g506_actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
|
||||
cm.drawChampionState((ChampionIndex)cm._g506_actingChampionOrdinal);
|
||||
cm._g506_actingChampionOrdinal = _vm->indexToOrdinal(kM1_ChampionNone);
|
||||
cm._gK71_champions[cm._g506_actingChampionOrdinal].setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
|
||||
cm.f292_drawChampionState((ChampionIndex)cm._g506_actingChampionOrdinal);
|
||||
cm._g506_actingChampionOrdinal = _vm->M0_indexToOrdinal(kM1_ChampionNone);
|
||||
_g508_refreshActionArea = true;
|
||||
}
|
||||
}
|
||||
|
||||
void MenuMan::drawActionIcon(ChampionIndex championIndex) {
|
||||
void MenuMan::f386_drawActionIcon(ChampionIndex championIndex) {
|
||||
if (!_g509_actionAreaContainsIcons)
|
||||
return;
|
||||
DisplayMan &dm = *_vm->_displayMan;
|
||||
Champion &champion = _vm->_championMan->_champions[championIndex];
|
||||
Champion &champion = _vm->_championMan->_gK71_champions[championIndex];
|
||||
|
||||
Box box;
|
||||
box._x1 = championIndex * 22 + 233;
|
||||
@ -90,7 +90,7 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) {
|
||||
box._y2 = 120 + 1;
|
||||
dm._g578_useByteBoxCoordinates = false;
|
||||
if (!champion._currHealth) {
|
||||
dm.clearScreenBox(k0_ColorBlack, box);
|
||||
dm.D24_clearScreenBox(k0_ColorBlack, box);
|
||||
return;
|
||||
}
|
||||
byte *bitmapIcon = dm._g74_tmpBitmap;
|
||||
@ -98,34 +98,34 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) {
|
||||
IconIndice iconIndex;
|
||||
if (thing == Thing::_none) {
|
||||
iconIndex = k201_IconIndiceActionEmptyHand;
|
||||
} else if (g237_ObjectInfo[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) {
|
||||
iconIndex = _vm->_objectMan->getIconIndex(thing);
|
||||
} else if (g237_ObjectInfo[_vm->_dungeonMan->f141_getObjectInfoIndex(thing)]._actionSetIndex) {
|
||||
iconIndex = _vm->_objectMan->f33_getIconIndex(thing);
|
||||
} else {
|
||||
dm.f134_fillBitmap(bitmapIcon, 16, 16, k4_ColorCyan);
|
||||
goto T0386006;
|
||||
}
|
||||
_vm->_objectMan->extractIconFromBitmap(iconIndex, bitmapIcon);
|
||||
dm.blitToBitmapShrinkWithPalChange(bitmapIcon, 16, 16, bitmapIcon, 16, 16, g498_PalChangesActionAreaObjectIcon);
|
||||
_vm->_objectMan->f36_extractIconFromBitmap(iconIndex, bitmapIcon);
|
||||
dm.f129_blitToBitmapShrinkWithPalChange(bitmapIcon, 16, 16, bitmapIcon, 16, 16, g498_PalChangesActionAreaObjectIcon);
|
||||
T0386006:
|
||||
dm.clearScreenBox(k4_ColorCyan, box);
|
||||
dm.D24_clearScreenBox(k4_ColorCyan, box);
|
||||
Box box2;
|
||||
box2._x1 = box._x1 + 2;
|
||||
box2._x2 = box._x2 - 2; // no need to add +1 for exclusive boundaries, box already has that
|
||||
box2._y1 = 95;
|
||||
box2._y2 = 110 + 1;
|
||||
dm.blitToBitmap(bitmapIcon, 16, 0, 0, dm._g348_bitmapScreen, k160_byteWidthScreen * 2, box2);
|
||||
dm.f132_blitToBitmap(bitmapIcon, 16, 0, 0, dm._g348_bitmapScreen, k160_byteWidthScreen * 2, box2);
|
||||
if (champion.getAttributes(k0x0008_ChampionAttributeDisableAction) || _vm->_championMan->_g299_candidateChampionOrdinal || _vm->_championMan->_g300_partyIsSleeping) {
|
||||
warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox");
|
||||
}
|
||||
}
|
||||
|
||||
void MenuMan::drawDisabledMenu() {
|
||||
void MenuMan::f456_drawDisabledMenu() {
|
||||
if (!_vm->_championMan->_g300_partyIsSleeping) {
|
||||
warning("MISSING CODE: F0363_COMMAND_HighlightBoxDisable");
|
||||
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
|
||||
if (_vm->_inventoryMan->_g432_inventoryChampionOrdinal) {
|
||||
if (_vm->_inventoryMan->_g424_panelContent == k4_PanelContentChest) {
|
||||
_vm->_inventoryMan->closeChest();
|
||||
_vm->_inventoryMan->f334_closeChest();
|
||||
}
|
||||
} else {
|
||||
warning("MISSING CODE: F0136_VIDEO_ShadeScreenBox");
|
||||
@ -136,7 +136,7 @@ void MenuMan::drawDisabledMenu() {
|
||||
}
|
||||
}
|
||||
|
||||
void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
|
||||
void MenuMan::f390_refreshActionAreaAndSetChampDirMaxDamageReceived() {
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
|
||||
if (!champMan._g305_partyChampionCount)
|
||||
@ -145,24 +145,24 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
|
||||
Champion *champ = nullptr;
|
||||
if (champMan._g300_partyIsSleeping || champMan._g299_candidateChampionOrdinal) {
|
||||
if (champMan._g506_actingChampionOrdinal) {
|
||||
clearActingChampion();
|
||||
f388_clearActingChampion();
|
||||
return;
|
||||
}
|
||||
if (!champMan._g299_candidateChampionOrdinal)
|
||||
return;
|
||||
} else {
|
||||
champ = champMan._champions;
|
||||
champ = champMan._gK71_champions;
|
||||
int16 champIndex = k0_ChampionFirst;
|
||||
|
||||
do {
|
||||
if ((champIndex != champMan._g411_leaderIndex)
|
||||
&& (_vm->indexToOrdinal(champIndex) != champMan._g506_actingChampionOrdinal)
|
||||
&& (_vm->M0_indexToOrdinal(champIndex) != champMan._g506_actingChampionOrdinal)
|
||||
&& (champ->_maximumDamageReceived)
|
||||
&& (champ->_dir != champ->_directionMaximumDamageReceived)) {
|
||||
|
||||
champ->_dir = (direction)champ->_directionMaximumDamageReceived;
|
||||
champ->setAttributeFlag(k0x0400_ChampionAttributeIcon, true);
|
||||
champMan.drawChampionState((ChampionIndex)champIndex);
|
||||
champMan.f292_drawChampionState((ChampionIndex)champIndex);
|
||||
}
|
||||
champ->_maximumDamageReceived = 0;
|
||||
champ++;
|
||||
@ -177,12 +177,12 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
|
||||
_g513_actionDamage = 0;
|
||||
} else {
|
||||
_g509_actionAreaContainsIcons = true;
|
||||
drawActionArea();
|
||||
f387_drawActionArea();
|
||||
}
|
||||
} else {
|
||||
_g509_actionAreaContainsIcons = false;
|
||||
champ->setAttributeFlag(k0x8000_ChampionAttributeActionHand, true);
|
||||
champMan.drawChampionState((ChampionIndex)_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal));
|
||||
champMan.f292_drawChampionState((ChampionIndex)_vm->M1_ordinalToIndex(champMan._g506_actingChampionOrdinal));
|
||||
warning("MISSING CODE: F0387_MENUS_DrawActionArea");
|
||||
}
|
||||
}
|
||||
@ -191,29 +191,29 @@ void MenuMan::refreshActionAreaAndSetChampDirMaxDamageReceived() {
|
||||
#define k7_ChampionNameMaximumLength 7 // @ C007_CHAMPION_NAME_MAXIMUM_LENGTH
|
||||
#define k12_ActionNameMaximumLength 12 // @ C012_ACTION_NAME_MAXIMUM_LENGTH
|
||||
|
||||
void MenuMan::drawActionArea() {
|
||||
void MenuMan::f387_drawActionArea() {
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
TextMan &textMan = *_vm->_textMan;
|
||||
|
||||
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
|
||||
dispMan._g578_useByteBoxCoordinates = false;
|
||||
dispMan.clearScreenBox(k0_ColorBlack, g1_BoxActionArea);
|
||||
dispMan.D24_clearScreenBox(k0_ColorBlack, g1_BoxActionArea);
|
||||
if (_g509_actionAreaContainsIcons) {
|
||||
for (uint16 champIndex = k0_ChampionFirst; champIndex < champMan._g305_partyChampionCount; ++champIndex)
|
||||
drawActionIcon((ChampionIndex)champIndex);
|
||||
f386_drawActionIcon((ChampionIndex)champIndex);
|
||||
} else if (champMan._g506_actingChampionOrdinal) {
|
||||
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.blitToBitmap(dispMan.getBitmap(k10_MenuActionAreaIndice), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
|
||||
textMan.printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._g506_actingChampionOrdinal)]._name,
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k10_MenuActionAreaIndice), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
|
||||
textMan.f41_printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._gK71_champions[_vm->M1_ordinalToIndex(champMan._g506_actingChampionOrdinal)]._name,
|
||||
k7_ChampionNameMaximumLength, k200_heightScreen);
|
||||
for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) {
|
||||
textMan.printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
|
||||
getActionName(_g713_actionList._actionIndices[actionListIndex]),
|
||||
textMan.f41_printWithTrailingSpaces(dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
|
||||
f384_getActionName(_g713_actionList._actionIndices[actionListIndex]),
|
||||
k12_ActionNameMaximumLength, k200_heightScreen);
|
||||
}
|
||||
}
|
||||
@ -231,24 +231,24 @@ const char *g490_ChampionActionNames[44] = { // @ G0490_ac_Graphic560_ActionName
|
||||
"FLUXCAGE", "HEAL", "CALM", "LIGHT", "WINDOW", "SPIT",
|
||||
"BRANDISH", "THROW", "FUSE"};
|
||||
|
||||
const char* MenuMan::getActionName(ChampionAction actionIndex) {
|
||||
const char* MenuMan::f384_getActionName(ChampionAction actionIndex) {
|
||||
return (actionIndex == k255_ChampionActionNone) ? "" : g490_ChampionActionNames[actionIndex];
|
||||
}
|
||||
|
||||
|
||||
Box g504_BoxSpellAreaControls = Box(233, 319, 42, 49); // @ G0504_s_Graphic560_Box_SpellAreaControls
|
||||
|
||||
void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
|
||||
void MenuMan::f393_drawSpellAreaControls(ChampionIndex champIndex) {
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
TextMan &textMan = *_vm->_textMan;
|
||||
|
||||
Champion &champ = champMan._champions[champIndex];
|
||||
Champion &champ = champMan._gK71_champions[champIndex];
|
||||
int16 champCurrHealth[4];
|
||||
for (uint16 i = 0; i < 4; ++i)
|
||||
champCurrHealth[i] = champMan._champions[i]._currHealth;
|
||||
champCurrHealth[i] = champMan._gK71_champions[i]._currHealth;
|
||||
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
|
||||
dispMan.clearScreenBox(k0_ColorBlack, g504_BoxSpellAreaControls);
|
||||
dispMan.D24_clearScreenBox(k0_ColorBlack, g504_BoxSpellAreaControls);
|
||||
int16 champCount = champMan._g305_partyChampionCount;
|
||||
switch (champIndex) {
|
||||
case k0_ChampionFirst:
|
||||
@ -309,61 +309,61 @@ labelChamp3:
|
||||
#define k2_SpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS
|
||||
#define k3_SpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS
|
||||
|
||||
void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) {
|
||||
void MenuMan::f392_buildSpellAreaLine(int16 spellAreaBitmapLine) {
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
|
||||
Champion &champ = _vm->_championMan->_champions[_vm->_championMan->_g514_magicCasterChampionIndex];
|
||||
Champion &champ = _vm->_championMan->_gK71_champions[_vm->_championMan->_g514_magicCasterChampionIndex];
|
||||
if (spellAreaBitmapLine == k2_SpellAreaAvailableSymbols) {
|
||||
dispMan._g578_useByteBoxCoordinates = false;
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 12, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency);
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_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(_gK72_bitmapSpellAreaLine, 96, x += 14, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
|
||||
_vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 14, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
|
||||
}
|
||||
} else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) {
|
||||
dispMan._g578_useByteBoxCoordinates = false;
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k11_MenuSpellAreLinesIndice), 96, 0, 24, _gK72_bitmapSpellAreaLine, 96, gK74_BoxSpellAreaLine, k255_ColorNoTransparency);
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_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(_gK72_bitmapSpellAreaLine, 96, x += 9, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
|
||||
_vm->_textMan->f40_printTextToBitmap(_gK72_bitmapSpellAreaLine, 96, x += 9, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MenuMan::setMagicCasterAndDrawSpellArea(int16 champIndex) {
|
||||
void MenuMan::f394_setMagicCasterAndDrawSpellArea(int16 champIndex) {
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
DisplayMan &dispMan = *_vm->_displayMan;
|
||||
|
||||
if ((champIndex == champMan._g514_magicCasterChampionIndex)
|
||||
|| ((champIndex != kM1_ChampionNone) && !champMan._champions[champIndex]._currHealth))
|
||||
|| ((champIndex != kM1_ChampionNone) && !champMan._gK71_champions[champIndex]._currHealth))
|
||||
return;
|
||||
if (champMan._g514_magicCasterChampionIndex == kM1_ChampionNone) {
|
||||
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
|
||||
dispMan.blitToBitmap(dispMan.getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, g0_BoxSpellArea);
|
||||
dispMan.f132_blitToBitmap(dispMan.f489_getBitmap(k9_MenuSpellAreaBackground), 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, 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, g0_BoxSpellArea);
|
||||
dispMan.D24_clearScreenBox(k0_ColorBlack, g0_BoxSpellArea);
|
||||
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
|
||||
return;
|
||||
}
|
||||
|
||||
champMan._g514_magicCasterChampionIndex = (ChampionIndex)champIndex;
|
||||
buildSpellAreaLine(k2_SpellAreaAvailableSymbols);
|
||||
f392_buildSpellAreaLine(k2_SpellAreaAvailableSymbols);
|
||||
warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
|
||||
drawSpellAreaControls((ChampionIndex)champIndex);
|
||||
dispMan.blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK75_BoxSpellAreaLine2);
|
||||
buildSpellAreaLine(k3_SpellAreaChampionSymbols);
|
||||
dispMan.blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK76_BoxSpellAreaLine3);
|
||||
f393_drawSpellAreaControls((ChampionIndex)champIndex);
|
||||
dispMan.f132_blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK75_BoxSpellAreaLine2);
|
||||
f392_buildSpellAreaLine(k3_SpellAreaChampionSymbols);
|
||||
dispMan.f132_blitToBitmap(_gK72_bitmapSpellAreaLine, 96, 0, 0, dispMan._g348_bitmapScreen, k160_byteWidthScreen * 2, gK76_BoxSpellAreaLine3);
|
||||
warning("MISSING CODE: F0078_MOUSE_ShowPointer");
|
||||
}
|
||||
}
|
||||
|
@ -60,17 +60,17 @@ public:
|
||||
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
|
||||
void f388_clearActingChampion(); // @ F0388_MENUS_ClearActingChampion
|
||||
void f386_drawActionIcon(ChampionIndex championIndex); // @ F0386_MENUS_DrawActionIcon
|
||||
|
||||
void drawMovementArrows(); // @ F0395_MENUS_DrawMovementArrows
|
||||
void drawDisabledMenu(); // @ F0456_START_DrawDisabledMenus
|
||||
void refreshActionAreaAndSetChampDirMaxDamageReceived(); // @ F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived
|
||||
void drawActionArea(); // @ F0387_MENUS_DrawActionArea
|
||||
const char* getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName
|
||||
void drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls
|
||||
void buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine
|
||||
void setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea
|
||||
void f395_drawMovementArrows(); // @ F0395_MENUS_DrawMovementArrows
|
||||
void f456_drawDisabledMenu(); // @ F0456_START_DrawDisabledMenus
|
||||
void f390_refreshActionAreaAndSetChampDirMaxDamageReceived(); // @ F0390_MENUS_RefreshActionAreaAndSetChampionDirectionMaximumDamageReceived
|
||||
void f387_drawActionArea(); // @ F0387_MENUS_DrawActionArea
|
||||
const char* f384_getActionName(ChampionAction actionIndex); // @ F0384_MENUS_GetActionName
|
||||
void f393_drawSpellAreaControls(ChampionIndex champIndex); // @ F0393_MENUS_DrawSpellAreaControls
|
||||
void f392_buildSpellAreaLine(int16 spellAreaBitmapLine);// @ F0392_MENUS_BuildSpellAreaLine
|
||||
void f394_setMagicCasterAndDrawSpellArea(int16 champIndex); // @ F0394_MENUS_SetMagicCasterAndDrawSpellArea
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -37,21 +37,21 @@ namespace DM {
|
||||
|
||||
MovesensMan::MovesensMan(DMEngine* vm) : _vm(vm) {}
|
||||
|
||||
bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam) {
|
||||
bool MovesensMan::f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam) {
|
||||
ChampionMan &champMan = *_vm->_championMan;
|
||||
DungeonMan &dunMan = *_vm->_dungeonMan;
|
||||
ObjectMan &objMan = *_vm->_objectMan;
|
||||
|
||||
|
||||
bool atLeastOneSensorWasTriggered = false;
|
||||
Thing leaderHandObject = champMan._414_leaderHandObject;
|
||||
Thing leaderHandObject = champMan._g414_leaderHandObject;
|
||||
int16 sensorCountToProcessPerCell[4];
|
||||
uint16 cell;
|
||||
for (cell = k0_CellNorthWest; cell < k3_CellSouthWest; ++cell) {
|
||||
sensorCountToProcessPerCell[cell] = 0;
|
||||
}
|
||||
Thing squareFirstThing;
|
||||
Thing thingBeingProcessed = squareFirstThing = dunMan.getSquareFirstThing(mapX, mapY);
|
||||
Thing thingBeingProcessed = squareFirstThing = dunMan.f161_getSquareFirstThing(mapX, mapY);
|
||||
ThingType thingType;
|
||||
while (thingBeingProcessed != Thing::_endOfList) {
|
||||
thingType = thingBeingProcessed.getType();
|
||||
@ -60,7 +60,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
|
||||
} else if (thingType >= k4_GroupThingType) {
|
||||
break;
|
||||
}
|
||||
thingBeingProcessed = dunMan.getNextThing(thingBeingProcessed);
|
||||
thingBeingProcessed = dunMan.f159_getNextThing(thingBeingProcessed);
|
||||
}
|
||||
Thing lastProcessedThing = thingBeingProcessed = squareFirstThing;
|
||||
|
||||
@ -69,7 +69,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
|
||||
if (thingType == k3_SensorThingType) {
|
||||
cell = thingBeingProcessed.getCell();
|
||||
sensorCountToProcessPerCell[cell]--;
|
||||
Sensor *sensor = (Sensor*)dunMan.getThingData(thingBeingProcessed); // IF YOU CHECK ME, I'LL CALL THE COPS!
|
||||
Sensor *sensor = (Sensor*)dunMan.f156_getThingData(thingBeingProcessed); // IF YOU CHECK ME, I'LL CALL THE COPS!
|
||||
SensorType sensorType = sensor->getType();
|
||||
if (sensorType == k0_SensorDisabled)
|
||||
goto T0275058_ProceedToNextThing;
|
||||
@ -96,11 +96,11 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
|
||||
goto T0275058_ProceedToNextThing;
|
||||
case k3_SensorWallOrnClickWithSpecObj:
|
||||
case k4_SensorWallOrnClickWithSpecObjRemoved:
|
||||
doNotTriggerSensor = ((sensorData == objMan.getObjectType(leaderHandObject)) == sensor->getRevertEffectA());
|
||||
doNotTriggerSensor = ((sensorData == objMan.f32_getObjectType(leaderHandObject)) == sensor->getRevertEffectA());
|
||||
if (!doNotTriggerSensor && (sensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor)) {
|
||||
if (lastProcessedThing == thingBeingProcessed)
|
||||
break;
|
||||
((Sensor*)dunMan.getThingData(lastProcessedThing))->setNextThing(sensor->getNextThing());
|
||||
((Sensor*)dunMan.f156_getThingData(lastProcessedThing))->setNextThing(sensor->getNextThing());
|
||||
sensor->setNextThing(Thing::_none);
|
||||
thingBeingProcessed = lastProcessedThing;
|
||||
}
|
||||
@ -137,8 +137,8 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
|
||||
case k16_SensorWallObjExchanger: {
|
||||
if (sensorCountToProcessPerCell[cell])
|
||||
goto T0275058_ProceedToNextThing;
|
||||
Thing thingOnSquare = dunMan.getSquareFirstThing(mapX, mapY);
|
||||
if ((objMan.getObjectType(leaderHandObject) != sensorData) || (thingOnSquare == Thing::_none))
|
||||
Thing thingOnSquare = dunMan.f161_getSquareFirstThing(mapX, mapY);
|
||||
if ((objMan.f32_getObjectType(leaderHandObject) != sensorData) || (thingOnSquare == Thing::_none))
|
||||
goto T0275058_ProceedToNextThing;
|
||||
warning("MISSING CODE: F0164_DUNGEON_UnlinkThingFromList");
|
||||
warning("MISSING CODE: F0298_CHAMPION_GetObjectRemovedFromLeaderHand");
|
||||
@ -148,7 +148,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
|
||||
break;
|
||||
}
|
||||
case k127_SensorWallChampionPortrait:
|
||||
champMan.addCandidateChampionToParty(sensorData);
|
||||
champMan.f280_addCandidateChampionToParty(sensorData);
|
||||
goto T0275058_ProceedToNextThing;
|
||||
default:
|
||||
goto T0275058_ProceedToNextThing;
|
||||
@ -169,7 +169,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
|
||||
(sensorType == k11_SensorWallOrnClickWithSpecObjRemovedRotateSensors) ||
|
||||
(sensorType == k17_SensorWallOrnClickWithSpecObjRemovedSensor))) {
|
||||
|
||||
*((Thing*)dunMan.getThingData(leaderHandObject)) = Thing::_none;
|
||||
*((Thing*)dunMan.f156_getThingData(leaderHandObject)) = Thing::_none;
|
||||
warning("MISSING CODE: F0298_CHAMPION_GetObjectRemovedFromLeaderHand");
|
||||
leaderHandObject = Thing::_none;
|
||||
} else {
|
||||
@ -186,7 +186,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
|
||||
break;
|
||||
T0275058_ProceedToNextThing:
|
||||
lastProcessedThing = thingBeingProcessed;
|
||||
thingBeingProcessed = dunMan.getNextThing(thingBeingProcessed);
|
||||
thingBeingProcessed = dunMan.f159_getNextThing(thingBeingProcessed);
|
||||
}
|
||||
warning("MISSING CODE: F0271_SENSOR_ProcessRotationEffect");
|
||||
return atLeastOneSensorWasTriggered;
|
||||
|
@ -37,7 +37,7 @@ class MovesensMan {
|
||||
DMEngine *_vm;
|
||||
public:
|
||||
explicit MovesensMan(DMEngine *vm);
|
||||
bool sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam); // @ F0275_SENSOR_IsTriggeredByClickOnWall
|
||||
bool f275_sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16 cellParam); // @ F0275_SENSOR_IsTriggeredByClickOnWall
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -121,11 +121,11 @@ void ObjectMan::loadObjectNames() {
|
||||
}
|
||||
}
|
||||
|
||||
IconIndice ObjectMan::getObjectType(Thing thing) {
|
||||
IconIndice ObjectMan::f32_getObjectType(Thing thing) {
|
||||
if (thing == Thing::_none)
|
||||
return kM1_IconIndiceNone;
|
||||
|
||||
int16 objectInfoIndex = _vm->_dungeonMan->getObjectInfoIndex(thing);
|
||||
int16 objectInfoIndex = _vm->_dungeonMan->f141_getObjectInfoIndex(thing);
|
||||
if (objectInfoIndex != -1) {
|
||||
objectInfoIndex = g237_ObjectInfo[objectInfoIndex]._type;
|
||||
}
|
||||
@ -134,15 +134,15 @@ IconIndice ObjectMan::getObjectType(Thing thing) {
|
||||
|
||||
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);
|
||||
IconIndice ObjectMan::f33_getIconIndex(Thing thing) {
|
||||
IconIndice iconIndex = f32_getObjectType(thing);
|
||||
|
||||
if ((iconIndex != kM1_IconIndiceNone) &&
|
||||
(((iconIndex < k32_IconIndiceWeaponDagger) && (iconIndex >= k0_IconIndiceJunkCompassNorth)) || // < instead of <= is no error
|
||||
((iconIndex >= k148_IconIndicePotionMaPotionMonPotion) && (iconIndex <= k163_IconIndicePotionWaterFlask)) ||
|
||||
(iconIndex == k195_IconIndicePotionEmptyFlask))
|
||||
) {
|
||||
uint16 *rawType = _vm->_dungeonMan->getThingData(thing);
|
||||
uint16 *rawType = _vm->_dungeonMan->f156_getThingData(thing);
|
||||
switch (iconIndex) {
|
||||
case k0_IconIndiceJunkCompassNorth:
|
||||
iconIndex = (IconIndice)(iconIndex + _vm->_dungeonMan->_g308_partyDir);
|
||||
@ -184,7 +184,7 @@ IconIndice ObjectMan::getIconIndex(Thing thing) {
|
||||
return iconIndex;
|
||||
}
|
||||
|
||||
void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) {
|
||||
void ObjectMan::f36_extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) {
|
||||
int16 i;
|
||||
for (i = 0; i < 7; ++i) {
|
||||
if (g26_IconGraphicFirstIndex[i] > iconIndex)
|
||||
@ -192,14 +192,14 @@ void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) {
|
||||
}
|
||||
|
||||
--i;
|
||||
byte *srcBitmap = _vm->_displayMan->getBitmap(k42_ObjectIcons_000_TO_031 + i);
|
||||
byte *srcBitmap = _vm->_displayMan->f489_getBitmap(k42_ObjectIcons_000_TO_031 + i);
|
||||
iconIndex -= g26_IconGraphicFirstIndex[i];
|
||||
_vm->_displayMan->_g578_useByteBoxCoordinates = true;
|
||||
Box box(0, 0, 15, 15);
|
||||
_vm->_displayMan->blitToBitmap(srcBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, destBitmap, 16, box, k255_ColorNoTransparency);
|
||||
_vm->_displayMan->f132_blitToBitmap(srcBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, destBitmap, 16, box, k255_ColorNoTransparency);
|
||||
}
|
||||
|
||||
void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
|
||||
void ObjectMan::f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
|
||||
SlotBox *slotBox = &_g30_slotBoxes[slotBoxIndex];
|
||||
slotBox->_iconIndex = iconIndex; // yes, this modifies the global array
|
||||
if (slotBox->_iconIndex == kM1_IconIndiceNone) {
|
||||
@ -219,39 +219,39 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
|
||||
}
|
||||
}
|
||||
iconGraphicIndex--;
|
||||
byte *iconsBitmap = _vm->_displayMan->getBitmap(iconGraphicIndex + k42_ObjectIcons_000_TO_031);
|
||||
byte *iconsBitmap = _vm->_displayMan->f489_getBitmap(iconGraphicIndex + k42_ObjectIcons_000_TO_031);
|
||||
iconIndex -= g26_IconGraphicFirstIndex[iconGraphicIndex];
|
||||
|
||||
_vm->_displayMan->_g578_useByteBoxCoordinates = false;
|
||||
if (slotBoxIndex >= k8_SlotBoxInventoryFirstSlot) {
|
||||
_vm->_displayMan->blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
|
||||
_vm->_displayMan->f132_blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
|
||||
_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, box, k255_ColorNoTransparency);
|
||||
|
||||
} else {
|
||||
_vm->_displayMan->blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
|
||||
_vm->_displayMan->f132_blitToBitmap(iconsBitmap, 256, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0,
|
||||
_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, box, k255_ColorNoTransparency);
|
||||
}
|
||||
}
|
||||
|
||||
#define k14_ObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH
|
||||
|
||||
void ObjectMan::drawLeaderObjectName(Thing thing) {
|
||||
IconIndice iconIndex = getIconIndex(thing);
|
||||
void ObjectMan::f34_drawLeaderObjectName(Thing thing) {
|
||||
IconIndice iconIndex = f33_getIconIndex(thing);
|
||||
char *objName;
|
||||
char objectNameBuffer[16];
|
||||
if (iconIndex == k147_IconIndiceJunkChampionBones) {
|
||||
Junk *junk = (Junk*)_vm->_dungeonMan->getThingData(thing);
|
||||
strcpy(objectNameBuffer, _vm->_championMan->_champions[junk->getChargeCount()]._name);
|
||||
Junk *junk = (Junk*)_vm->_dungeonMan->f156_getThingData(thing);
|
||||
strcpy(objectNameBuffer, _vm->_championMan->_gK71_champions[junk->getChargeCount()]._name);
|
||||
strcat(objectNameBuffer, _g352_objectNames[iconIndex]);
|
||||
objName = objectNameBuffer;
|
||||
} else {
|
||||
objName = _g352_objectNames[iconIndex];
|
||||
}
|
||||
_vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, 233, 37,
|
||||
_vm->_textMan->f41_printWithTrailingSpaces(_vm->_displayMan->_g348_bitmapScreen, k160_byteWidthScreen * 2, 233, 37,
|
||||
k4_ColorCyan, k0_ColorBlack, objName, k14_ObjectNameMaximumLength, k200_heightScreen);
|
||||
}
|
||||
|
||||
IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) {
|
||||
IconIndice ObjectMan::f39_getIconIndexInSlotBox(uint16 slotBoxIndex) {
|
||||
return (IconIndice)_g30_slotBoxes[slotBoxIndex]._iconIndex;
|
||||
}
|
||||
}
|
||||
|
@ -58,12 +58,12 @@ public:
|
||||
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
|
||||
void extractIconFromBitmap(uint16 iconIndex, byte *destBitmap); // @ F0036_OBJECT_ExtractIconFromBitmap
|
||||
void drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex); // @ F0038_OBJECT_DrawIconInSlotBox
|
||||
void drawLeaderObjectName(Thing thing); // @ F0034_OBJECT_DrawLeaderHandObjectName
|
||||
IconIndice getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox
|
||||
IconIndice f32_getObjectType(Thing thing); // @ F0032_OBJECT_GetType
|
||||
IconIndice f33_getIconIndex(Thing thing); // @ F0033_OBJECT_GetIconIndex
|
||||
void f36_extractIconFromBitmap(uint16 iconIndex, byte *destBitmap); // @ F0036_OBJECT_ExtractIconFromBitmap
|
||||
void f38_drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex); // @ F0038_OBJECT_DrawIconInSlotBox
|
||||
void f34_drawLeaderObjectName(Thing thing); // @ F0034_OBJECT_DrawLeaderHandObjectName
|
||||
IconIndice f39_getIconIndexInSlotBox(uint16 slotBoxIndex); // @ F0039_OBJECT_GetIconIndexInSlotBox
|
||||
|
||||
|
||||
};
|
||||
|
@ -35,7 +35,7 @@ TextMan::TextMan(DMEngine* vm) : _vm(vm) {}
|
||||
#define k5_LetterWidth 5
|
||||
#define k6_LetterHeight 6
|
||||
|
||||
void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY,
|
||||
void TextMan::f40_printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY,
|
||||
Color textColor, Color bgColor, const char* text, uint16 destHeight) {
|
||||
destX -= 1; // fixes missalignment, to be checked
|
||||
destY -= 4; // fixes missalignment, to be checked
|
||||
@ -43,7 +43,7 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16
|
||||
uint16 textLength = strlen(text);
|
||||
uint16 nextX = destX;
|
||||
uint16 nextY = destY;
|
||||
byte *srcBitmap = _vm->_displayMan->getBitmap(k557_FontGraphicIndice);
|
||||
byte *srcBitmap = _vm->_displayMan->f489_getBitmap(k557_FontGraphicIndice);
|
||||
|
||||
byte *tmp = _vm->_displayMan->_g74_tmpBitmap;
|
||||
for (uint16 i = 0; i < (k5_LetterWidth + 1) * k6_LetterHeight * 128; ++i) {
|
||||
@ -61,7 +61,7 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16
|
||||
uint16 srcX = (1 + 5) * toupper(*begin); // 1 + 5 is not the letter width, arbitrary choice of the unpacking code
|
||||
|
||||
Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth + 1, nextY, nextY + k6_LetterHeight - 1);
|
||||
_vm->_displayMan->blitToBitmap(srcBitmap, 6 * 128, (nextX == destX) ? (srcX + 1) : srcX, 0, destBitmap, destPixelWidth,
|
||||
_vm->_displayMan->f132_blitToBitmap(srcBitmap, 6 * 128, (nextX == destX) ? (srcX + 1) : srcX, 0, destBitmap, destPixelWidth,
|
||||
box, k255_ColorNoTransparency);
|
||||
|
||||
nextX += k5_LetterWidth + 1;
|
||||
@ -69,19 +69,19 @@ void TextMan::printTextToBitmap(byte* destBitmap, uint16 destPixelWidth, uint16
|
||||
}
|
||||
|
||||
void TextMan::f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char* text) {
|
||||
printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_screenWidth, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight);
|
||||
f40_printTextToBitmap(_vm->_displayMan->_g348_bitmapScreen, _vm->_displayMan->_screenWidth, destX, destY, textColor, bgColor, text, _vm->_displayMan->_screenHeight);
|
||||
}
|
||||
|
||||
void TextMan::printToViewport(int16 posX, int16 posY, Color textColor, const char* text, Color bgColor) {
|
||||
printTextToBitmap(_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, posX, posY, textColor, bgColor, text, k200_heightScreen);
|
||||
void TextMan::f52_printToViewport(int16 posX, int16 posY, Color textColor, const char* text, Color bgColor) {
|
||||
f40_printTextToBitmap(_vm->_displayMan->_g296_bitmapViewport, k112_byteWidthViewport * 2, posX, posY, textColor, bgColor, text, k200_heightScreen);
|
||||
}
|
||||
|
||||
void TextMan::printWithTrailingSpaces(byte* destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor,
|
||||
void TextMan::f41_printWithTrailingSpaces(byte* destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor,
|
||||
Color bgColor, const char* text, int16 requiredTextLength, int16 destHeight) {
|
||||
Common::String str = text;
|
||||
for (int16 i = str.size(); i < requiredTextLength; ++i)
|
||||
str += ' ';
|
||||
printTextToBitmap(destBitmap, destPixelWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight);
|
||||
f40_printTextToBitmap(destBitmap, destPixelWidth, destX, destY, textColor, bgColor, str.c_str(), destHeight);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -37,11 +37,11 @@ class TextMan {
|
||||
DMEngine *_vm;
|
||||
public:
|
||||
explicit TextMan(DMEngine *vm);
|
||||
void printTextToBitmap(byte *destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY,
|
||||
void f40_printTextToBitmap(byte *destBitmap, uint16 destPixelWidth, uint16 destX, uint16 destY,
|
||||
Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print
|
||||
void f53_printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen
|
||||
void printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport
|
||||
void printWithTrailingSpaces(byte *destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
|
||||
void f52_printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport
|
||||
void f41_printWithTrailingSpaces(byte *destBitmap, int16 destPixelWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
|
||||
const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces
|
||||
};
|
||||
|
||||
|
@ -41,7 +41,7 @@ Timeline::~Timeline() {
|
||||
delete[] _g371_timeline;
|
||||
}
|
||||
|
||||
void Timeline::initTimeline() {
|
||||
void Timeline::f233_initTimeline() {
|
||||
_g370_events = new TimelineEvent[_g369_eventMaxCount];
|
||||
_g371_timeline = new uint16[_g369_eventMaxCount];
|
||||
if (_vm->_g298_newGame) {
|
||||
|
@ -153,7 +153,7 @@ public:
|
||||
|
||||
Timeline(DMEngine *vm);
|
||||
~Timeline();
|
||||
void initTimeline(); // @ F0233_TIMELINE_Initialize
|
||||
void f233_initTimeline(); // @ F0233_TIMELINE_Initialize
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user