aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBendegúz Nagy2016-06-28 20:33:04 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit5ba83b8b4dfb3ed4bf4789c528d0c5d0d169fae8 (patch)
treee136f35f8cf17ee5e87f270fb8bc6450c5b16522 /engines
parentae6f2d711ccf3a2351be2d98da07ed2daf95c017 (diff)
downloadscummvm-rg350-5ba83b8b4dfb3ed4bf4789c528d0c5d0d169fae8.tar.gz
scummvm-rg350-5ba83b8b4dfb3ed4bf4789c528d0c5d0d169fae8.tar.bz2
scummvm-rg350-5ba83b8b4dfb3ed4bf4789c528d0c5d0d169fae8.zip
DM: Add F0295_CHAMPION_HasObjectIconInSlotBoxChanged, F0039_OBJECT_GetIconIndexInSlotBox
Diffstat (limited to 'engines')
-rw-r--r--engines/dm/TODOs/methodtree.txt7
-rw-r--r--engines/dm/champion.cpp21
-rw-r--r--engines/dm/champion.h2
-rw-r--r--engines/dm/objectman.cpp6
-rw-r--r--engines/dm/objectman.h3
5 files changed, 35 insertions, 4 deletions
diff --git a/engines/dm/TODOs/methodtree.txt b/engines/dm/TODOs/methodtree.txt
index 92bbd38658..d213c03ab6 100644
--- a/engines/dm/TODOs/methodtree.txt
+++ b/engines/dm/TODOs/methodtree.txt
@@ -104,10 +104,11 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
F0077_MOUSE_HidePointer_CPSE // skip
F0078_MOUSE_ShowPointer // skip
F0034_OBJECT_DrawLeaderHandObjectName // done
- F0386_MENUS_DrawActionIcon
- F0295_CHAMPION_HasObjectIconInSlotBoxChanged
+ F0386_MENUS_DrawActionIcon // done
+ F0295_CHAMPION_HasObjectIconInSlotBoxChanged // done
+ F0039_OBJECT_GetIconIndexInSlotBox // done
M70_HAND_SLOT_INDEX
- G0420_B_MousePointerHiddenToDrawChangedObjectIconOnScreen
+ G0420_B_MousePointerHiddenToDrawChangedObjectIconOnScreen // done
G0412_puc_Bitmap_ObjectIconForMousePointer
G0413_i_LeaderHandObjectIconIndex
G0414_T_LeaderHandObject
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index deae8b4247..d2df2ac022 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -267,6 +267,27 @@ T0299044_ApplyModifier:
}
+bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing) {
+ ObjectMan &objMan = *_vm->_objectMan;
+
+ IconIndice currIconIndex = objMan.getIconIndexInSlotBox(slotBoxIndex);
+ if (((currIconIndex < kIconIndiceWeaponDagger) && (currIconIndex >= kIconIndiceJunkCompassNorth))
+ || ((currIconIndex >= kIconIndicePotionMaPotionMonPotion) && (currIconIndex <= kIconIndicePotionWaterFlask))
+ || (currIconIndex == kIconIndicePotionEmptyFlask)) {
+ IconIndice newIconIndex = objMan.getIconIndex(thing);
+ if (newIconIndex != currIconIndex) {
+ if ((slotBoxIndex < kSlotBoxInventoryFirstSlot) && !_mousePointerHiddenToDrawChangedObjIconOnScreen) {
+ _mousePointerHiddenToDrawChangedObjIconOnScreen = true;
+ warning("MISSING CODE: F0077_MOUSE_HidePointer_CPSE");
+ }
+ objMan.drawIconInSlotBox(slotBoxIndex, newIconIndex);
+ return true;
+ }
+ }
+
+ return false;
+}
+
ChampionIndex ChampionMan::getIndexInCell(ViewCell cell) {
for (uint16 i = 0; i < _partyChampionCount; ++i) {
if ((_champions[i]._cell == cell) && _champions[i]._currHealth)
diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index c61dbe4d70..a85ab57537 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -443,6 +443,7 @@ public:
bool _leaderEmptyHanded; // @ G0415_B_LeaderEmptyHanded
Party _party; // @ G0407_s_Party
ChampionIndex _magicCasterChampionIndex; // @ G0514_i_MagicCasterChampionIndex
+ bool _mousePointerHiddenToDrawChangedObjIconOnScreen; // @ G0420_B_MousePointerHiddenToDrawChangedObjectIconOnScreen
explicit ChampionMan(DMEngine *vm);
void resetDataToStartGame(); // @ F0278_CHAMPION_ResetDataToStartGame
@@ -459,6 +460,7 @@ public:
Common::String getStringFromInteger(uint16 val, bool padding, uint16 paddingCharCount); // @ F0288_CHAMPION_GetStringFromInteger
void applyModifiersToStatistics(Champion *champ, ChampionSlot slotIndex, IconIndice iconIndex,
int16 modifierFactor, Thing thing); // @ F0299_CHAMPION_ApplyObjectModifiersToStatistics
+ bool hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing); // @ F0295_CHAMPION_HasObjectIconInSlotBoxChanged
};
diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp
index 0f04fb4c96..aed1c13a1d 100644
--- a/engines/dm/objectman.cpp
+++ b/engines/dm/objectman.cpp
@@ -230,7 +230,7 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
box, kColorNoTransparency, gDefultViewPort);
}
}
-
+
#define kObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH
void ObjectMan::drawLeaderObjectName(Thing thing) {
@@ -247,4 +247,8 @@ void ObjectMan::drawLeaderObjectName(Thing thing) {
}
_vm->_textMan->printWithTrailingSpacesToScreen(233, 37, kColorCyan, kColorBlack, objName, kObjectNameMaximumLength);
}
+
+IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) {
+ return (IconIndice)_slotBoxes[slotBoxIndex]._iconIndex;
+}
}
diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h
index e5e4cf3a21..f075076439 100644
--- a/engines/dm/objectman.h
+++ b/engines/dm/objectman.h
@@ -63,6 +63,9 @@ public:
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
+
+
};
}