[Scummvm-git-logs] scummvm master -> 4a4e4af95beef2ac462847a3ab6d59e6b9a24a8d

sev- noreply at scummvm.org
Fri Sep 26 23:12:48 UTC 2025


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:
4a4e4af95b DIRECTOR: LINGO: Implement enterMouse and leaveMouse events


Commit: 4a4e4af95beef2ac462847a3ab6d59e6b9a24a8d
    https://github.com/scummvm/scummvm/commit/4a4e4af95beef2ac462847a3ab6d59e6b9a24a8d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-27T01:11:28+02:00

Commit Message:
DIRECTOR: LINGO: Implement enterMouse and leaveMouse events

Testing showed that the events are not present in D5

Changed paths:
    engines/director/events.cpp
    engines/director/lingo/lingo-events.cpp
    engines/director/movie.cpp
    engines/director/movie.h


diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 9bd521c8960..658399c3d5e 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -187,6 +187,26 @@ bool Movie::processEvent(Common::Event &event) {
 				_currentDraggedChannel = nullptr;
 			}
 		}
+
+		if (g_director->getVersion() >= 600) {
+			spriteId = sc->getMouseSpriteIDFromPos(pos);
+
+			if (spriteId > 0) {
+				if (spriteId != _lastEnteredChannelId) {
+					if (_lastEnteredChannelId) {
+						processEvent(kEventMouseLeave, _lastEnteredChannelId);
+					}
+
+					_lastEnteredChannelId = spriteId;
+					processEvent(kEventMouseEnter, spriteId);
+				}
+			} else {
+				if (_lastEnteredChannelId) {
+					processEvent(kEventMouseLeave, _lastEnteredChannelId);
+					_lastEnteredChannelId = 0;
+				}
+			}
+		}
 		return true;
 
 	case Common::EVENT_LBUTTONDOWN:
diff --git a/engines/director/lingo/lingo-events.cpp b/engines/director/lingo/lingo-events.cpp
index 7a91d4c8bba..61fd41efd5e 100644
--- a/engines/director/lingo/lingo-events.cpp
+++ b/engines/director/lingo/lingo-events.cpp
@@ -69,10 +69,10 @@ struct EventHandlerType {
 	{ kEventMouseDown,			"mouseDown" },			// D2 w	D3
 	{ kEventRightMouseDown,		"rightMouseDown" },		//				D5
 	{ kEventRightMouseUp,		"rightMouseUp" },		//				D5
-	{ kEventMouseEnter,			"mouseEnter" },			//				D5
-	{ kEventMouseLeave,			"mouseLeave" },			//				D5
+	{ kEventMouseEnter,			"mouseEnter" },			//					D6
+	{ kEventMouseLeave,			"mouseLeave" },			//					D6
 	{ kEventMouseUpOutSide,		"mouseUpOutSide" },		// 					D6
-	{ kEventMouseWithin,		"mouseWithin" },		//				D5
+	{ kEventMouseWithin,		"mouseWithin" },		//					D6
 
 	{ kEventTimeout,			"timeout" },			// D2 as when
 
diff --git a/engines/director/movie.cpp b/engines/director/movie.cpp
index 4c5987bf146..7222e795e72 100644
--- a/engines/director/movie.cpp
+++ b/engines/director/movie.cpp
@@ -69,6 +69,7 @@ Movie::Movie(Window *window) {
 	_currentDraggedChannel = nullptr;
 	_currentHiliteChannelId = 0;
 	_mouseDownWasInButton = false;
+	_lastEnteredChannelId = 0;
 
 	_version = 0;
 	_platform = Common::kPlatformMacintosh;
diff --git a/engines/director/movie.h b/engines/director/movie.h
index a414523e50c..7d964eadc31 100644
--- a/engines/director/movie.h
+++ b/engines/director/movie.h
@@ -194,6 +194,7 @@ public:
 	int _checkBoxAccess;
 
 	uint16 _currentHiliteChannelId;
+	uint16 _lastEnteredChannelId;
 
 	int _lastTimeOut;
 	int _timeOutLength;




More information about the Scummvm-git-logs mailing list