Skip to content

Commit

Permalink
DM: Add F0345_INVENTORY_DrawPanel_FoodWaterPoisoned
Browse files Browse the repository at this point in the history
  • Loading branch information
Bendegúz Nagy committed Aug 26, 2016
1 parent 8c007d0 commit 6eea379
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
8 changes: 6 additions & 2 deletions engines/dm/gfx.h
Expand Up @@ -13,7 +13,7 @@ enum ViewCell {
kViewCellBackRight = 2, // @ C02_VIEW_CELL_BACK_RIGHT
kViewCellBackLeft = 3, // @ C03_VIEW_CELL_BACK_LEFT
kViewCellAlcove = 4, // @ C04_VIEW_CELL_ALCOVE
kViewCellDoorButtonOrWallOrn = 5 // @ C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT
kViewCellDoorButtonOrWallOrn = 5, // @ C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT
};

enum GraphicIndice {
Expand All @@ -28,7 +28,11 @@ enum GraphicIndice {
kObjectIcons_128_TO_159 = 46, // @ C046_GRAPHIC_OBJECT_ICONS_128_TO_159
kObjectIcons_160_TO_191 = 47, // @ C047_GRAPHIC_OBJECT_ICONS_160_TO_191
kObjectIcons_192_TO_223 = 48, // @ C048_GRAPHIC_OBJECT_ICONS_192_TO_223
kInventoryGraphicIndice = 17 // @ C017_GRAPHIC_INVENTORY
kInventoryGraphicIndice = 17, // @ C017_GRAPHIC_INVENTORY
kPanelEmptyIndice = 20, // @ C020_GRAPHIC_PANEL_EMPTY
kFoodLabelIndice = 30, // @ C030_GRAPHIC_FOOD_LABEL
kWaterLabelIndice = 31, // @ C031_GRAPHIC_WATER_LABEL
kPoisionedLabelIndice = 32 // @ C032_GRAPHIC_POISONED_LABEL
};

extern uint16 gPalSwoosh[16];
Expand Down
16 changes: 15 additions & 1 deletion engines/dm/inventory.cpp
Expand Up @@ -110,7 +110,7 @@ void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Co
void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
if (amount < -512) {
color = kColorRed;
} else if(amount < 0) {
} else if (amount < 0) {
color = kColorYellow;
}

Expand All @@ -123,4 +123,18 @@ void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
drawPanelHorizontalBar(113, y, pixelWidth, color);
}

void InventoryMan::drawPanelFoodWaterPoisoned() {
Champion &champ = _vm->_championMan->_champions[_inventoryChampionOrdinal];
warning("MISSING CODE: F0334_INVENTORY_CloseChest");
DisplayMan &dispMan = *_vm->_displayMan;
dispMan.blitToScreen(dispMan.getBitmap(kPanelEmptyIndice), 144, 0, 0, gBoxPanel, kColorRed);
dispMan.blitToScreen(dispMan.getBitmap(kFoodLabelIndice), 48, 0, 0, gBoxFood, kColorDarkestGray);
dispMan.blitToScreen(dispMan.getBitmap(kWaterLabelIndice), 48, 0, 0, gBoxWater, kColorDarkestGray);
if (champ._poisonEventCount) {
dispMan.blitToScreen(dispMan.getBitmap(kPoisionedLabelIndice), 96, 0, 0, gBoxPoisoned, kColorDarkestGray);
}
drawPanelFoodOrWaterBar(champ._food, 69, kColorLightBrown);
drawPanelFoodOrWaterBar(champ._water, 92, kColorBlue);
}

}
1 change: 1 addition & 0 deletions engines/dm/inventory.h
Expand Up @@ -17,6 +17,7 @@ class InventoryMan {
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
};

}

0 comments on commit 6eea379

Please sign in to comment.