diff options
author | Martin Kiewitz | 2016-02-20 15:46:12 +0100 |
---|---|---|
committer | Martin Kiewitz | 2016-02-20 15:46:12 +0100 |
commit | 5425ff6e9965c59957a2fbe11747d171a36dc0b2 (patch) | |
tree | 1ae355f382253c8092c7e230b82c80f218051f38 /engines/sci | |
parent | 4ad1bbf108ac408be0ae7d53768d040fd9e32500 (diff) | |
download | scummvm-rg350-5425ff6e9965c59957a2fbe11747d171a36dc0b2.tar.gz scummvm-rg350-5425ff6e9965c59957a2fbe11747d171a36dc0b2.tar.bz2 scummvm-rg350-5425ff6e9965c59957a2fbe11747d171a36dc0b2.zip |
SCI32: Splitting up GfxFrameout::kernelIsOnMe() into 2 methods
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 16 | ||||
-rw-r--r-- | engines/sci/graphics/frameout.h | 1 |
2 files changed, 12 insertions, 5 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index fcf5fcf49d..d3c566f4f8 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -1869,26 +1869,32 @@ void GfxFrameout::kernelFrameout(const bool shouldShowBits) { uint16 GfxFrameout::kernelIsOnMe(int16 x, int16 y, uint16 checkPixels, reg_t screenObject) { reg_t planeObject = readSelector(_segMan, screenObject, SELECTOR(plane)); - Plane *screenObjPlane = _planes.findByObject(planeObject); + Plane *screenItemPlane = _visiblePlanes.findByObject(planeObject); ScreenItem *screenItem = nullptr; - if (!screenObjPlane) { + if (!screenItemPlane) { // Specified plane not found return 0; } - screenItem = screenObjPlane->_screenItemList.findByObject(screenObject); + screenItem = screenItemPlane->_screenItemList.findByObject(screenObject); if (!screenItem) { // Specified screen object not in item list return 0; } + // Original SCI32 seems to have made a copy (?) of the screenitem? + // there is also a "or [ebp+arg_56], 1 - not sure what that did + return isOnMe(screenItemPlane, screenItem, x, y, checkPixels); +} + +uint16 GfxFrameout::isOnMe(Plane *screenItemPlane, ScreenItem *screenItem, int16 x, int16 y, uint16 checkPixels) { // adjust coordinate according to resolution int32 adjustedX = x * getCurrentBuffer().screenWidth / getCurrentBuffer().scriptWidth; int32 adjustedY = y * getCurrentBuffer().screenHeight / getCurrentBuffer().scriptHeight; - adjustedX += screenObjPlane->_planeRect.left; - adjustedY += screenObjPlane->_planeRect.top; + adjustedX += screenItemPlane->_planeRect.left; + adjustedY += screenItemPlane->_planeRect.top; //warning("kIsOnMe %s %d (%d, %d -> %d, %d) mouse %d, %d", _segMan->getObjectName(screenObject), checkPixels, screenItem->_screenRect.left, screenItem->_screenRect.top, screenItem->_screenRect.right, screenItem->_screenRect.bottom, adjustedX, adjustedY); diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h index 0239b2d7b4..08ff3c05d8 100644 --- a/engines/sci/graphics/frameout.h +++ b/engines/sci/graphics/frameout.h @@ -491,6 +491,7 @@ public: }; uint16 kernelIsOnMe(int16 x, int16 y, uint16 checkPixels, reg_t screenObject); + uint16 isOnMe(Plane *screenItemPlane, ScreenItem *screenItem, int16 x, int16 y, uint16 checkPixels); #pragma mark - #pragma mark Debugging |