[Scummvm-cvs-logs] scummvm master -> 5425ff6e9965c59957a2fbe11747d171a36dc0b2

m-kiewitz m_kiewitz at users.sourceforge.net
Sat Feb 20 15:47:10 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5425ff6e99 SCI32: Splitting up GfxFrameout::kernelIsOnMe() into 2 methods


Commit: 5425ff6e9965c59957a2fbe11747d171a36dc0b2
    https://github.com/scummvm/scummvm/commit/5425ff6e9965c59957a2fbe11747d171a36dc0b2
Author: Martin Kiewitz (m_kiewitz at users.sourceforge.net)
Date: 2016-02-20T15:46:12+01:00

Commit Message:
SCI32: Splitting up GfxFrameout::kernelIsOnMe() into 2 methods

Changed paths:
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h



diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index fcf5fcf..d3c566f 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 0239b2d..08ff3c0 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






More information about the Scummvm-git-logs mailing list