aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-06-20 22:20:58 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit8c007d02faf933ae633a5f10694e9d1667d424c3 (patch)
treec9efecc00f2a397b5ccdefe25df08a8d4176b6a1
parent3385a3dd5cc21a3e8b05ad065dd46fc38e39ba33 (diff)
downloadscummvm-rg350-8c007d02faf933ae633a5f10694e9d1667d424c3.tar.gz
scummvm-rg350-8c007d02faf933ae633a5f10694e9d1667d424c3.tar.bz2
scummvm-rg350-8c007d02faf933ae633a5f10694e9d1667d424c3.zip
DM: Add F0344_INVENTORY_DrawPanel_FoodOrWaterBar
-rw-r--r--engines/dm/inventory.cpp16
-rw-r--r--engines/dm/inventory.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index ea643dac4d..98713d01ce 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -107,4 +107,20 @@ void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Co
_vm->_displayMan->clearScreenBox(color, box);
}
+void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
+ if (amount < -512) {
+ color = kColorRed;
+ } else if(amount < 0) {
+ color = kColorYellow;
+ }
+
+ int16 pixelWidth = amount + 1024;
+ if (pixelWidth == 3072) {
+ pixelWidth = 3071;
+ }
+ pixelWidth /= 32;
+ drawPanelHorizontalBar(115, y + 2, pixelWidth, kColorBlack);
+ drawPanelHorizontalBar(113, y, pixelWidth, color);
+}
+
}
diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h
index 192b68964a..bd6f18d788 100644
--- a/engines/dm/inventory.h
+++ b/engines/dm/inventory.h
@@ -16,6 +16,7 @@ public:
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
};
} \ No newline at end of file