[Scummvm-cvs-logs] scummvm master -> 4cc2bcabe1e59a2074a5aef466911ae1bbbf351f

dreammaster dreammaster at scummvm.org
Fri Jul 31 23:35:01 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:
4cc2bcabe1 SHERLOCK: RT: Fix inventory tooltips when in a scene with a mask


Commit: 4cc2bcabe1e59a2074a5aef466911ae1bbbf351f
    https://github.com/scummvm/scummvm/commit/4cc2bcabe1e59a2074a5aef466911ae1bbbf351f
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-31T17:32:38-04:00

Commit Message:
SHERLOCK: RT: Fix inventory tooltips when in a scene with a mask

ScummVM simplifies tooltip handling by drawing tooltips directly to the
screen surface. This works well in most cases, but in mask scenes, the
screen is recopied at the end of rendering to apply the mask overlay,
so the tooltip needs to be redrawn after again in order to be seen

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



diff --git a/engines/sherlock/tattoo/tattoo_scene.cpp b/engines/sherlock/tattoo/tattoo_scene.cpp
index f851a0a..13206f0 100644
--- a/engines/sherlock/tattoo/tattoo_scene.cpp
+++ b/engines/sherlock/tattoo/tattoo_scene.cpp
@@ -377,9 +377,14 @@ void TattooScene::doBgAnim() {
 	_doBgAnimDone = true;
 	ui._drawMenu = false;
 
-	// Handle drawing the text tooltip if necessary
+	// Handle drawing tooltips
 	if (ui._menuMode == STD_MODE || ui._menuMode == LAB_MODE)
 		ui._tooltipWidget.draw();
+	if (!ui._postRenderWidgets.empty()) {
+		for (WidgetList::iterator i = ui._postRenderWidgets.begin(); i != ui._postRenderWidgets.end(); ++i)
+			(*i)->draw();
+		ui._postRenderWidgets.clear();
+	}
 
 	if (!vm._fastMode)
 		events.wait(3);
diff --git a/engines/sherlock/tattoo/tattoo_user_interface.h b/engines/sherlock/tattoo/tattoo_user_interface.h
index f8c00569..a93743c 100644
--- a/engines/sherlock/tattoo/tattoo_user_interface.h
+++ b/engines/sherlock/tattoo/tattoo_user_interface.h
@@ -110,6 +110,7 @@ public:
 	WidgetText _textWidget;
 	WidgetSceneTooltip _tooltipWidget;
 	WidgetVerbs _verbsWidget;
+	WidgetList _postRenderWidgets;
 public:
 	TattooUserInterface(SherlockEngine *vm);
 	virtual ~TattooUserInterface();
diff --git a/engines/sherlock/tattoo/widget_inventory.cpp b/engines/sherlock/tattoo/widget_inventory.cpp
index c2de61f..88507d8 100644
--- a/engines/sherlock/tattoo/widget_inventory.cpp
+++ b/engines/sherlock/tattoo/widget_inventory.cpp
@@ -122,6 +122,12 @@ void WidgetInventoryTooltip::handleEvents() {
 	Common::String strWith = fixedText.getText(kFixedText_With);
 	Common::String strUse = fixedText.getText(kFixedText_Use);
 
+	// Register the tooltip for requiring post-rendering drawing, since we draw directly to the screen if a scene
+	// mask is active, since the initial draw to the screen will be covered by the mask rendering
+	if (ui._mask) {
+		ui._postRenderWidgets.push_back(this);
+	}
+
 	// If we are using an inventory item on an object in the room, display the appropriate text above the mouse cursor
 	if (_owner->_invVerbMode == 3) {
 		select = ui._bgFound;






More information about the Scummvm-git-logs mailing list