mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-18 16:03:05 +00:00
LAB: Fix a bug pointed out by wjp in getObject
This commit is contained in:
parent
7e047b45b7
commit
6981d750ea
@ -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;
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user