[Scummvm-git-logs] scummvm master -> fe73042f8faf74a84ec395d463041ba96fd7903f

AndywinXp noreply at scummvm.org
Sun Feb 8 01:21:10 UTC 2026


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

Summary:
fe73042f8f SCUMM: HE: Implement missing spriteFromPoint() section


Commit: fe73042f8faf74a84ec395d463041ba96fd7903f
    https://github.com/scummvm/scummvm/commit/fe73042f8faf74a84ec395d463041ba96fd7903f
Author: AndywinXp (andywinxp at gmail.com)
Date: 2026-02-08T02:21:00+01:00

Commit Message:
SCUMM: HE: Implement missing spriteFromPoint() section

This is from the source code, but I've always seen it
disabled via #ifdef macros. FunShop titles are the only
instances of this code being enabled, that I know of.

This fixes not being able to click on clip art sprites,
while building printable projects.

Changed paths:
    engines/scumm/he/sprite_he.cpp


diff --git a/engines/scumm/he/sprite_he.cpp b/engines/scumm/he/sprite_he.cpp
index 0201642f5f2..6e3d11e3a00 100644
--- a/engines/scumm/he/sprite_he.cpp
+++ b/engines/scumm/he/sprite_he.cpp
@@ -88,7 +88,7 @@ int Sprite::spriteFromPoint(int x, int y, int groupCheck, int quickCheck, int cl
 	if (!_activeSpriteCount)
 		return 0;
 
-	spritePtr = &_activeSprites [_activeSpriteCount - 1];
+	spritePtr = &_activeSprites[_activeSpriteCount - 1];
 
 	if (quickCheck != 0) {
 		for (int counter = 0; counter < _activeSpriteCount; counter++, spritePtr--) {
@@ -174,6 +174,42 @@ int Sprite::spriteFromPoint(int x, int y, int groupCheck, int quickCheck, int cl
 					state = (*spritePtr)->lastState;
 				}
 
+				// The following code seems to only be present in FunShop titles
+				// and is responsible for accurately passing the mouse hover check
+				// for clip art sprites...
+				if (_vm->_game.id == GID_FUNSHOP) {
+					int angle = (*spritePtr)->lastAngle;
+					int scale = (*spritePtr)->lastScale;
+
+					bool scaleSpecified = (kSFScaleSpecified & (*spritePtr)->flags);
+					bool angleSpecified = (kSFAngleSpecified & (*spritePtr)->flags);
+
+					if (scaleSpecified || angleSpecified) {
+						// Scale the incoming point into image relative position...
+						if (scaleSpecified) {
+							if (scale <= 0) {
+								continue;
+							}
+
+							testPointX = (testPointX * 256) / scale;
+							testPointY = (testPointY * 256) / scale;
+						}
+
+						// Rotate the test point...
+						if (angleSpecified) {
+							Common::Point testPoint((int16)testPointX, (int16)testPointY);
+							_vm->_wiz->polyRotatePoints(&testPoint, 1, ((360 - angle) % 360));
+						}
+
+						// Adjust the pos to image relative coords...
+						int32 w, h;
+
+						_vm->_wiz->getWizImageDim(image, state, w, h);
+						testPointX += (w / 2);
+						testPointY += (h / 2);
+					}
+				}
+
 				if (!_vm->_wiz->hitTestWiz(image, state, testPointX, testPointY, (*spritePtr)->lastRenderFlags)) {
 					continue;
 				}




More information about the Scummvm-git-logs mailing list