diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/lab/processroom.cpp | 2 | ||||
-rw-r--r-- | engines/lab/utils.cpp | 4 | ||||
-rw-r--r-- | engines/lab/utils.h | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp index b5979636a4..243c086a06 100644 --- a/engines/lab/processroom.cpp +++ b/engines/lab/processroom.cpp @@ -87,7 +87,7 @@ CloseData *LabEngine::getObject(Common::Point pos, CloseDataPtr closePtr) { Common::Rect objRect; while (wrkClosePtr) { - objRect = Common::Rect(_utils->scaleX(wrkClosePtr->_x1), _utils->scaleX(wrkClosePtr->_y1), _utils->scaleX(wrkClosePtr->_x2), _utils->scaleX(wrkClosePtr->_y2)); + objRect = _utils->rectScale(wrkClosePtr->_x1, wrkClosePtr->_y1, wrkClosePtr->_x2, wrkClosePtr->_y2); if (objRect.contains(pos)) return wrkClosePtr; diff --git a/engines/lab/utils.cpp b/engines/lab/utils.cpp index 3bd3057510..3de15404c9 100644 --- a/engines/lab/utils.cpp +++ b/engines/lab/utils.cpp @@ -60,6 +60,10 @@ uint16 Utils::scaleY(uint16 y) { return ((y * 10) / 24); } +Common::Rect Utils::rectScale(int16 x1, int16 y1, int16 x2, int16 y2) { + return Common::Rect(scaleX(x1), scaleY(y1), scaleX(x2), scaleY(y2)); +} + uint16 Utils::mapScaleX(uint16 x) { if (_vm->_isHiRes) return (x - 45); diff --git a/engines/lab/utils.h b/engines/lab/utils.h index f9a36ba546..333d532c9a 100644 --- a/engines/lab/utils.h +++ b/engines/lab/utils.h @@ -51,6 +51,7 @@ public: uint16 scaleX(uint16 x); uint16 scaleY(uint16 y); + Common::Rect rectScale(int16 x1, int16 y1, int16 x2, int16 y2); int16 vgaScaleX(int16 x); int16 vgaScaleY(int16 y); Common::Rect vgaRectScale(int16 x1, int16 y1, int16 x2, int16 y2); |