From 93072407bc1f0389a4e5195f96715e4b5acdcc65 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 29 Jun 2015 21:53:40 -0400 Subject: SHERLOCK: RT: Fix display of lines in inventory dialog --- engines/sherlock/tattoo/widget_inventory.cpp | 29 +++++++++++++++++++++++++++- engines/sherlock/tattoo/widget_inventory.h | 5 +++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp index 84a26049e2..ed7ca8fc61 100644 --- a/engines/sherlock/tattoo/widget_inventory.cpp +++ b/engines/sherlock/tattoo/widget_inventory.cpp @@ -67,7 +67,7 @@ void WidgetInventoryTooltip::setText(const Common::String &str) { } else { line1 = Common::String(str.c_str(), space); line2 = Common::String(space + 1); - int height = _surface.stringHeight(line1) + _surface.stringHeight(line2) + 4; + height = _surface.stringHeight(line1) + _surface.stringHeight(line2) + 4; } break; } else { @@ -292,9 +292,36 @@ void WidgetInventory::load(int mode) { // Draw the window background and then the inventory on top of it makeInfoArea(_surface); + drawBars(); drawInventory(); } +void WidgetInventory::drawBars() { + TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui; + ImageFile &images = *ui._interfaceImages; + int x; + + _surface.hLine(3, INVENTORY_YSIZE + 3, _bounds.width() - 4, INFO_TOP); + _surface.hLine(3, INVENTORY_YSIZE + 4, _bounds.width() - 4, INFO_MIDDLE); + _surface.hLine(3, INVENTORY_YSIZE + 5, _bounds.width() - 4, INFO_BOTTOM); + _surface.transBlitFrom(images[4], Common::Point(0, INVENTORY_YSIZE + 2)); + + for (int idx = 1; idx <= NUM_INVENTORY_SHOWN / 2; ++idx) { + x = idx * (INVENTORY_XSIZE + 3); + + _surface.vLine(x, 3, _bounds.height() - 4, INFO_TOP); + _surface.vLine(x + 1, 3, _bounds.height() - 4, INFO_MIDDLE); + _surface.vLine(x + 2, 3, _bounds.height() - 4, INFO_BOTTOM); + + _surface.transBlitFrom(images[6], Common::Point(x - 1, 1)); + _surface.transBlitFrom(images[7], Common::Point(x - 1, _bounds.height() - 4)); + _surface.transBlitFrom(images[6], Common::Point(x - 1, INVENTORY_YSIZE + 5)); + _surface.transBlitFrom(images[7], Common::Point(x - 1, INVENTORY_YSIZE + 2)); + } + + _surface.hLine(x + 2, INVENTORY_YSIZE + 2, INVENTORY_YSIZE + 8, INFO_BOTTOM); +} + void WidgetInventory::drawInventory() { Inventory &inv = *_vm->_inventory; diff --git a/engines/sherlock/tattoo/widget_inventory.h b/engines/sherlock/tattoo/widget_inventory.h index ac0a8d4e38..99086ad801 100644 --- a/engines/sherlock/tattoo/widget_inventory.h +++ b/engines/sherlock/tattoo/widget_inventory.h @@ -81,6 +81,11 @@ private: Common::Rect _menuBounds, _oldMenuBounds; Surface _menuSurface; + /** + * Draw the bars within the dialog + */ + void drawBars(); + /** * Draw the scrollbar for the dialog */ -- cgit v1.2.3