aboutsummaryrefslogtreecommitdiff
path: root/engines/lab
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2015-12-25 11:18:22 +0100
committerWillem Jan Palenstijn2015-12-25 11:20:03 +0100
commit23ace32e09f4673b5741f34adeb869c65169f3c6 (patch)
treee2221705d92c83c8ed55e29b243102a3bfa743fe /engines/lab
parent374056015382987479ef543b4edf2aad3adfc1d2 (diff)
downloadscummvm-rg350-23ace32e09f4673b5741f34adeb869c65169f3c6.tar.gz
scummvm-rg350-23ace32e09f4673b5741f34adeb869c65169f3c6.tar.bz2
scummvm-rg350-23ace32e09f4673b5741f34adeb869c65169f3c6.zip
LAB: Simplify tab handling
Diffstat (limited to 'engines/lab')
-rw-r--r--engines/lab/engine.cpp13
-rw-r--r--engines/lab/processroom.cpp7
2 files changed, 8 insertions, 12 deletions
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
index a01df7ec26..c46910c9b2 100644
--- a/engines/lab/engine.cpp
+++ b/engines/lab/engine.cpp
@@ -616,18 +616,7 @@ bool LabEngine::fromCrumbs(uint32 tmpClass, uint16 code, uint16 qualifier, Commo
// get next close-up in list after the one pointed to by curPos
setCurrentClose(curPos, &tmpClosePtr, true, true);
- if (tmpClosePtr == _closeDataPtr) {
- tmpClosePtr = nullptr;
- if (!_closeDataPtr) {
- ViewData *vptr = getViewData(_roomNum, _direction);
- if (!vptr->_closeUps.empty())
- tmpClosePtr = &(*vptr->_closeUps.begin());
- } else {
- if (!_closeDataPtr->_subCloseUps.empty())
- tmpClosePtr = &(*_closeDataPtr->_subCloseUps.begin());
- }
- }
- if (tmpClosePtr)
+ if (tmpClosePtr != _closeDataPtr)
_event->setMousePos(Common::Point(_utils->scaleX((tmpClosePtr->_x1 + tmpClosePtr->_x2) / 2), _utils->scaleY((tmpClosePtr->_y1 + tmpClosePtr->_y2) / 2)));
}
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
index c096c75e21..1a9e7a8566 100644
--- a/engines/lab/processroom.cpp
+++ b/engines/lab/processroom.cpp
@@ -202,6 +202,13 @@ void LabEngine::setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, b
return;
}
}
+
+ // If we got here, no match was found. If we want the "next" close-up,
+ // return the first one in the list, if any.
+ if (next) {
+ if (!list->empty())
+ *closePtrList = &(*list->begin());
+ }
}
bool LabEngine::takeItem(Common::Point pos, CloseDataPtr *closePtrList) {