[Scummvm-cvs-logs] scummvm master -> 93072407bc1f0389a4e5195f96715e4b5acdcc65

dreammaster dreammaster at scummvm.org
Tue Jun 30 03:54:43 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
93072407bc SHERLOCK: RT: Fix display of lines in inventory dialog


Commit: 93072407bc1f0389a4e5195f96715e4b5acdcc65
    https://github.com/scummvm/scummvm/commit/93072407bc1f0389a4e5195f96715e4b5acdcc65
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-06-29T21:53:40-04:00

Commit Message:
SHERLOCK: RT: Fix display of lines in inventory dialog

Changed paths:
    engines/sherlock/tattoo/widget_inventory.cpp
    engines/sherlock/tattoo/widget_inventory.h



diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index 84a2604..ed7ca8f 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 ac0a8d4..99086ad 100644
--- a/engines/sherlock/tattoo/widget_inventory.h
+++ b/engines/sherlock/tattoo/widget_inventory.h
@@ -82,6 +82,11 @@ private:
 	Surface _menuSurface;
 
 	/**
+	 * Draw the bars within the dialog
+	 */
+	void drawBars();
+
+	/**
 	 * Draw the scrollbar for the dialog
 	 */
 	void drawScrollBar();






More information about the Scummvm-git-logs mailing list