[Scummvm-git-logs] scummvm master -> 4565711254eb92de3dd857d8a2b72e9e2ab780a0

aquadran noreply at scummvm.org
Tue Jun 7 21:42:53 UTC 2022


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:
4565711254 GRIM: Improve special case for delay in loop for emscripten


Commit: 4565711254eb92de3dd857d8a2b72e9e2ab780a0
    https://github.com/scummvm/scummvm/commit/4565711254eb92de3dd857d8a2b72e9e2ab780a0
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2022-06-07T23:42:49+02:00

Commit Message:
GRIM: Improve special case for delay in loop for emscripten

Changed paths:
    engines/grim/grim.cpp


diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp
index 22fb162fe11..e427ee9f67f 100644
--- a/engines/grim/grim.cpp
+++ b/engines/grim/grim.cpp
@@ -1127,13 +1127,6 @@ void GrimEngine::mainLoop() {
 			g_imuseState = -1;
 		}
 
-#if defined(__EMSCRIPTEN__)
-		// If SDL_HINT_EMSCRIPTEN_ASYNCIFY is enabled, SDL pauses the application and gives
-		// back control to the browser automatically by calling emscripten_sleep via SDL_Delay.
-		// Without this the page would completely lock up.
-		g_system->delayMillis(0);
-#endif
-
 		uint32 endTime = g_system->getMillis();
 		if (startTime > endTime)
 			continue;
@@ -1144,6 +1137,14 @@ void GrimEngine::mainLoop() {
 			uint32 delayTime = _speedLimitMs - diffTime;
 			g_system->delayMillis(delayTime);
 		}
+#if defined(__EMSCRIPTEN__)
+		else {
+			// If SDL_HINT_EMSCRIPTEN_ASYNCIFY is enabled, SDL pauses the application and gives
+			// back control to the browser automatically by calling emscripten_sleep via SDL_Delay.
+			// Without this the page would completely lock up.
+			g_system->delayMillis(0);
+		}
+#endif
 	}
 }
 




More information about the Scummvm-git-logs mailing list