From 8c007d02faf933ae633a5f10694e9d1667d424c3 Mon Sep 17 00:00:00 2001 From: Bendegúz Nagy Date: Mon, 20 Jun 2016 22:20:58 +0200 Subject: DM: Add F0344_INVENTORY_DrawPanel_FoodOrWaterBar --- engines/dm/inventory.cpp | 16 ++++++++++++++++ engines/dm/inventory.h | 1 + 2 files changed, 17 insertions(+) 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 -- cgit v1.2.3