mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-14 07:48:58 +00:00
DM: Add F0336_INVENTORY_DrawPanel_BuildObjectAttributesString
This commit is contained in:
parent
17f2a7f2e6
commit
cb9979fade
@ -53,7 +53,7 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
|
||||
F0333_INVENTORY_OpenAndDrawChest // done
|
||||
F0303_CHAMPION_GetSkillLevel // done
|
||||
F0332_INVENTORY_DrawIconToViewport // done
|
||||
F0336_INVENTORY_DrawPanel_BuildObjectAttributesString
|
||||
F0336_INVENTORY_DrawPanel_BuildObjectAttributesString // done
|
||||
F0335_INVENTORY_DrawPanel_ObjectDescriptionString
|
||||
F0339_INVENTORY_DrawPanel_ArrowOrEye
|
||||
G0430_apc_DirectionNames
|
||||
|
@ -338,4 +338,35 @@ void InventoryMan::drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yP
|
||||
_vm->_objectMan->extractIconFromBitmap(iconIndex, iconBitmap);
|
||||
_vm->_displayMan->blitToScreen(iconBitmap, 16, 0, 0, box, kColorNoTransparency, gDungeonViewport);
|
||||
}
|
||||
|
||||
void InventoryMan::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) {
|
||||
if (attribMask & potentialAttribMask & actualAttribMask) {
|
||||
identicalBitCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (identicalBitCount == 0) {
|
||||
*destString = '\0';
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy(destString, prefixString);
|
||||
|
||||
attribMask = 1;
|
||||
for (uint16 stringIndex = 0; stringIndex < 16; stringIndex++, attribMask <<= 1) {
|
||||
if (attribMask & potentialAttribMask & actualAttribMask) {
|
||||
strcat(destString, attribStrings[stringIndex]);
|
||||
if (identicalBitCount-- > 2) {
|
||||
strcat(destString, ", ");
|
||||
} else if (identicalBitCount == 1) {
|
||||
strcat(destString, " AND "); // TODO: localization
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
strcat(destString, suffixString);
|
||||
}
|
||||
}
|
||||
|
@ -71,6 +71,8 @@ public:
|
||||
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,
|
||||
char *destString, char *prefixString, char *suffixString); // @ F0336_INVENTORY_DrawPanel_BuildObjectAttributesString
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user