aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/gui.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-07-08 12:32:42 +0200
committerBorja Lorente2016-08-14 18:49:11 +0200
commit6da240a6e75d9e79d6254a338b905fbb2568d0e0 (patch)
tree9bd9b4b241a60a69fdd552964fee1d6012dcd3a2 /engines/macventure/gui.cpp
parent87540eaa8f2b6664ff916605bd8bc57a7658cec3 (diff)
downloadscummvm-rg350-6da240a6e75d9e79d6254a338b905fbb2568d0e0.tar.gz
scummvm-rg350-6da240a6e75d9e79d6254a338b905fbb2568d0e0.tar.bz2
scummvm-rg350-6da240a6e75d9e79d6254a338b905fbb2568d0e0.zip
MACVENTURE: Fix object selection in inventory
Diffstat (limited to 'engines/macventure/gui.cpp')
-rw-r--r--engines/macventure/gui.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 1c626fef81..43dfe71883 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -683,18 +683,14 @@ void Gui::drawObjectsInWindow(WindowReference target, Graphics::ManagedSurface *
surface, pos.x, pos.y, kBlitOR);
// For test
- /*
- surface->frameRect(Common::Rect(
+ /*surface->frameRect(Common::Rect(
pos.x,
pos.y,
pos.x + _assets[child]->getWidth() + 1,
pos.y + _assets[child]->getHeight() + 1), kColorGreen);
*/
-
}
-
}
-
}
void Gui::drawWindowTitle(WindowReference target, Graphics::ManagedSurface * surface) {
@@ -1258,19 +1254,13 @@ bool Gui::processInventoryEvents(WindowClick click, Common::Event & event) {
if (click == kBorderInner && event.type == Common::EVENT_LBUTTONDOWN) {
// Find the appropriate window
- uint ref = 0;
- uint i;
- for (uint i = 0; i < _inventoryWindows.size(); i++) {
- if (_inventoryWindows[i]->hasAllFocus()) { // HACK
- ref = i;
- }
- }
-
+ WindowReference ref = findWindowAtPoint(event.mouse);
+ Graphics::MacWindow *win = findWindow(ref);
WindowData &data = findWindowData((WindowReference) ref);
ObjID child;
Common::Point pos;
// Click rect to local coordinates. We assume the click is inside the window ^
- Common::Rect clickRect = calculateClickRect(event.mouse, _inventoryWindows[i]->getDimensions());
+ Common::Rect clickRect = calculateClickRect(event.mouse, win->getDimensions());
for (Common::Array<DrawableObject>::const_iterator it = data.children.begin(); it != data.children.end(); it++) {
child = (*it).obj;
checkSelect(child, event, clickRect, (WindowReference)ref);