[Scummvm-git-logs] scummvm master -> 874110c81722ce82fb4e5e5ef1d1f11aa50fb4e9

AndywinXp noreply at scummvm.org
Wed Jul 9 07:14:20 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:
874110c817 LASTEXPRESS: Allow the engine to update the screen every 17ms


Commit: 874110c81722ce82fb4e5e5ef1d1f11aa50fb4e9
    https://github.com/scummvm/scummvm/commit/874110c81722ce82fb4e5e5ef1d1f11aa50fb4e9
Author: AndywinXp (andywinxp at gmail.com)
Date: 2025-07-09T09:14:14+02:00

Commit Message:
LASTEXPRESS: Allow the engine to update the screen every 17ms

Unless other events will be triggering the update.
This should fix screen rotation issues in Android and iOS.

Changed paths:
    engines/lastexpress/lastexpress.cpp
    engines/lastexpress/lastexpress.h


diff --git a/engines/lastexpress/lastexpress.cpp b/engines/lastexpress/lastexpress.cpp
index cd51271991f..96ac13f86f2 100644
--- a/engines/lastexpress/lastexpress.cpp
+++ b/engines/lastexpress/lastexpress.cpp
@@ -467,13 +467,7 @@ bool LastExpressEngine::handleEvents() {
 	// Handle input
 	Common::Event ev;
 	int32 curFlags = 0;
-
-#ifdef USE_IMGUI
-	// Allow the debugger to pick up the changes...
-	if (gDebugLevel >= 3) {
-		_system->updateScreen();
-	}
-#endif
+	bool eventWillUpdateScreen = false;
 
 	while (_eventMan->pollEvent(ev)) {
 		switch (ev.type) {
@@ -498,6 +492,7 @@ bool LastExpressEngine::handleEvents() {
 				curFlags |= kMouseFlagRightButton;
 
 			getMessageManager()->addEvent(kEventChannelMouse, ev.mouse.x, ev.mouse.y, curFlags);
+			eventWillUpdateScreen = true;
 			break;
 		case Common::EVENT_LBUTTONUP:
 			_systemEventLeftMouseDown = false;
@@ -506,6 +501,7 @@ bool LastExpressEngine::handleEvents() {
 				curFlags |= kMouseFlagRightButton;
 
 			getMessageManager()->addEvent(kEventChannelMouse, ev.mouse.x, ev.mouse.y, curFlags);
+			eventWillUpdateScreen = true;
 			break;
 
 		case Common::EVENT_RBUTTONDOWN:
@@ -516,6 +512,7 @@ bool LastExpressEngine::handleEvents() {
 				curFlags |= kMouseFlagLeftButton;
 
 			getMessageManager()->addEvent(kEventChannelMouse, ev.mouse.x, ev.mouse.y, curFlags);
+			eventWillUpdateScreen = true;
 			break;
 		case Common::EVENT_RBUTTONUP:
 			_systemEventRightMouseDown = false;
@@ -524,6 +521,7 @@ bool LastExpressEngine::handleEvents() {
 				curFlags |= kMouseFlagLeftButton;
 
 			getMessageManager()->addEvent(kEventChannelMouse, ev.mouse.x, ev.mouse.y, curFlags);
+			eventWillUpdateScreen = true;
 			break;
 
 		case Common::EVENT_MOUSEMOVE:
@@ -535,7 +533,7 @@ bool LastExpressEngine::handleEvents() {
 			if (!getLogicManager()->_doubleClickFlag) {
 				if (_systemEventLeftMouseDown)
 					curFlags |= kMouseFlagLeftButton;
-			
+
 				if (_systemEventRightMouseDown)
 					curFlags |= kMouseFlagRightButton;
 			}
@@ -544,6 +542,7 @@ bool LastExpressEngine::handleEvents() {
 			_systemEventLastMouseCoords.y = ev.mouse.y;
 
 			getMessageManager()->addEvent(kEventChannelMouse, ev.mouse.x, ev.mouse.y, curFlags);
+			eventWillUpdateScreen = true;
 			break;
 
 		case Common::EVENT_QUIT:
@@ -563,6 +562,23 @@ bool LastExpressEngine::handleEvents() {
 	if (_exitFromMenuButton)
 		_exitFromMenuButton = false;
 
+#ifdef USE_IMGUI
+	// Allow the debugger to pick up the changes...
+	if (gDebugLevel >= 3) {
+		_system->updateScreen();
+	} else {
+#endif
+
+		// Force the update only if it hasn't been already triggered by an event...
+		if (!eventWillUpdateScreen && (_system->getMillis() - _lastForcedScreenUpdateTicks >= 17)) {
+			_lastForcedScreenUpdateTicks = _system->getMillis();
+			_system->updateScreen();
+		}
+
+#ifdef USE_IMGUI
+	}
+#endif
+
 	return true;
 }
 
diff --git a/engines/lastexpress/lastexpress.h b/engines/lastexpress/lastexpress.h
index b2ca4f63a6a..4e1759477a4 100644
--- a/engines/lastexpress/lastexpress.h
+++ b/engines/lastexpress/lastexpress.h
@@ -622,6 +622,7 @@ public:
 
 	bool _pendingExitEvent = false;
 	bool _exitFromMenuButton = false;
+	int32 _lastForcedScreenUpdateTicks = 0; // Not in the original
 
 	Seq *_doorSeqs[8] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
 	Seq *_clockHandsSeqs[2] = { nullptr, nullptr };




More information about the Scummvm-git-logs mailing list