aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/gui.cpp
diff options
context:
space:
mode:
authorBorja Lorente2016-07-13 19:09:14 +0200
committerBorja Lorente2016-08-14 18:54:52 +0200
commitf8efc58a59bd94579dd58f46bbcaeb059f691995 (patch)
tree0fdc96e14c40b288d704cf818b3d390e55e0def9 /engines/macventure/gui.cpp
parentc36f8c429fd213aa9b3fbe58c894036a1dc26473 (diff)
downloadscummvm-rg350-f8efc58a59bd94579dd58f46bbcaeb059f691995.tar.gz
scummvm-rg350-f8efc58a59bd94579dd58f46bbcaeb059f691995.tar.bz2
scummvm-rg350-f8efc58a59bd94579dd58f46bbcaeb059f691995.zip
MACVENTURE: Fix inventory window selection
Diffstat (limited to 'engines/macventure/gui.cpp')
-rw-r--r--engines/macventure/gui.cpp24
1 files changed, 7 insertions, 17 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp
index 0b7606ce51..415e02e35b 100644
--- a/engines/macventure/gui.cpp
+++ b/engines/macventure/gui.cpp
@@ -308,9 +308,6 @@ void Gui::updateWindowInfo(WindowReference ref, ObjID objID, const Common::Array
}
void Gui::addChild(WindowReference target, ObjID child) {
- // HACK WRONG!! Please delete me when you are done testing!
- if (child == 92) return; // Avoid adding the stones in the waterfall
-
findWindowData(target).children.push_back(DrawableObject(child, kBlitBIC));
}
@@ -609,7 +606,7 @@ void Gui::drawInventories() {
Graphics::ManagedSurface *srf;
for (uint i = 0; i < _inventoryWindows.size(); i++) {
const WindowData &data = getWindowData((WindowReference)(kInventoryStart + i));
- srf = findWindow(data.refcon)->getSurface(); // HACK
+ srf = findWindow(data.refcon)->getSurface();
BorderBounds border = borderBounds(data.type);
srf->fillRect(Common::Rect(
border.leftOffset,
@@ -858,11 +855,12 @@ void Gui::moveDraggedObject(Common::Point target) {
}
WindowReference Gui::findWindowAtPoint(Common::Point point) {
- // HACK, MIGHT NEED TO LOOK INTO THE Graphcis::MacWindow dimensions to account for window movement
Common::List<WindowData>::iterator it;
+ Graphics::MacWindow *win;
for (it = _windowData->begin(); it != _windowData->end(); it++) {
- if (it->bounds.contains(point) && it->refcon != kDiplomaWindow) { //HACK, diploma should be cosnidered
- if (findWindow(it->refcon)->isActive())
+ win = findWindow(it->refcon);
+ if (win && win->getDimensions().contains(point) && it->refcon != kDiplomaWindow) { //HACK, diploma should be cosnidered
+ if (win->isActive())
return it->refcon;
}
}
@@ -1286,6 +1284,8 @@ bool Gui::processInventoryEvents(WindowClick click, Common::Event & event) {
// Find the appropriate window
WindowReference ref = findWindowAtPoint(event.mouse);
+ // TODO DELETE MEEEE!
+ debug("WindowFound: %d", ref);
if (ref == kNoWindow) return false;
Graphics::MacWindow *win = findWindow(ref);
WindowData &data = findWindowData((WindowReference) ref);
@@ -1306,21 +1306,11 @@ void Gui::processCursorTick() {
void Gui::handleSingleClick(Common::Point pos) {
debug("Single Click");
handleDragRelease(pos, false, false);
-
- // HACK For test, please delete me
- //WindowReference destinationWindow = findWindowAtPoint(pos);
- //_engine->handleObjectSelect(_draggedObj.id, destinationWindow, false, false);
- //_draggedObj.id = 0;
}
void Gui::handleDoubleClick(Common::Point pos) {
debug("Double Click");
handleDragRelease(pos, false, true);
-
- // HACK For test, please delete me
- //WindowReference destinationWindow = findWindowAtPoint(pos);
- //_engine->handleObjectSelect(_draggedObj.id, destinationWindow, false, true);
- //_draggedObj.id = 0;
}
/* Ugly switches */