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

sev- noreply at scummvm.org
Sun Nov 21 00:21:45 UTC 2021


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

Summary:
7a01729d1f GUI: Fix cursor stuttering with vsync enabled
d272bc5d65 GUI: Fetch vsync capability from backend instead of ConfMan
d59b31238e GUI: Add comment regarding the 1ms delay we need with vsync enabled


Commit: 7a01729d1fca2c2346cebc4abbcfb5da5efba8e2
    https://github.com/scummvm/scummvm/commit/7a01729d1fca2c2346cebc4abbcfb5da5efba8e2
Author: Lothar Serra Mari (mail at serra.me)
Date: 2021-11-21T01:21:41+01:00

Commit Message:
GUI: Fix cursor stuttering with vsync enabled

Changed paths:
    gui/gui-manager.cpp


diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 06b7e43015..61649418a7 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -552,10 +552,16 @@ void GuiManager::runLoop() {
 
 		redraw();
 
-		// Delay until the allocated frame time is elapsed to match the target frame rate
-		uint32 actualFrameDuration = _system->getMillis(true) - frameStartTime;
-		if (actualFrameDuration < targetFrameDuration) {
-			_system->delayMillis(targetFrameDuration - actualFrameDuration);
+		// Delay until the allocated frame time is elapsed to match the target frame rate.
+		// In case we have vsync enabled, we force a minimum frame duration of 1 millisecond
+		// since otherwise, we'd have a very sluggish cursor on 60Hz displays.
+		if (ConfMan.getBool("vsync")) {
+			_system->delayMillis(1);
+		} else {
+			uint32 actualFrameDuration = _system->getMillis(true) - frameStartTime;
+			if (actualFrameDuration < targetFrameDuration) {
+				_system->delayMillis(targetFrameDuration - actualFrameDuration);
+			}
 		}
 		_system->updateScreen();
 	}


Commit: d272bc5d65e401c3fb23cdb4fee7bc11609fa3c0
    https://github.com/scummvm/scummvm/commit/d272bc5d65e401c3fb23cdb4fee7bc11609fa3c0
Author: Lothar Serra Mari (mail at serra.me)
Date: 2021-11-21T01:21:41+01:00

Commit Message:
GUI: Fetch vsync capability from backend instead of ConfMan

Changed paths:
    gui/gui-manager.cpp


diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 61649418a7..a77c98abee 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -555,7 +555,7 @@ void GuiManager::runLoop() {
 		// Delay until the allocated frame time is elapsed to match the target frame rate.
 		// In case we have vsync enabled, we force a minimum frame duration of 1 millisecond
 		// since otherwise, we'd have a very sluggish cursor on 60Hz displays.
-		if (ConfMan.getBool("vsync")) {
+		if (g_system->getFeatureState(OSystem::kFeatureVSync)) {
 			_system->delayMillis(1);
 		} else {
 			uint32 actualFrameDuration = _system->getMillis(true) - frameStartTime;


Commit: d59b31238e5df58b477e859e9cd3222d2c4bab5b
    https://github.com/scummvm/scummvm/commit/d59b31238e5df58b477e859e9cd3222d2c4bab5b
Author: Lothar Serra Mari (mail at serra.me)
Date: 2021-11-21T01:21:41+01:00

Commit Message:
GUI: Add comment regarding the 1ms delay we need with vsync enabled

Changed paths:
    gui/gui-manager.cpp


diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index a77c98abee..fc5785b498 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -553,8 +553,9 @@ void GuiManager::runLoop() {
 		redraw();
 
 		// Delay until the allocated frame time is elapsed to match the target frame rate.
-		// In case we have vsync enabled, we force a minimum frame duration of 1 millisecond
-		// since otherwise, we'd have a very sluggish cursor on 60Hz displays.
+		// In case we have vsync enabled, we should rely on vsync to do take care about frame times.
+		// With vsync enabled, we currently have to force a frame time of 1ms since otherwise
+		// CPU usage will skyrocket on one thread as soon as no updateScreen(); calls happening.
 		if (g_system->getFeatureState(OSystem::kFeatureVSync)) {
 			_system->delayMillis(1);
 		} else {




More information about the Scummvm-git-logs mailing list