[Scummvm-git-logs] scummvm master -> 6be7019fb0b5563b6c48136d8d5a3e3a86b9fbbb

spleen1981 noreply at scummvm.org
Sat May 6 11:31:11 UTC 2023


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:
6be7019fb0 LIBRETRO: move timer handler calls


Commit: 6be7019fb0b5563b6c48136d8d5a3e3a86b9fbbb
    https://github.com/scummvm/scummvm/commit/6be7019fb0b5563b6c48136d8d5a3e3a86b9fbbb
Author: Giovanni Cascione (ing.cascione at gmail.com)
Date: 2023-05-06T13:30:52+02:00

Commit Message:
LIBRETRO: move timer handler calls

Changed paths:
    backends/platform/libretro/src/libretro-os.cpp
    backends/platform/libretro/src/libretro-timer.cpp


diff --git a/backends/platform/libretro/src/libretro-os.cpp b/backends/platform/libretro/src/libretro-os.cpp
index 51f16ece38f..c8d38d96221 100644
--- a/backends/platform/libretro/src/libretro-os.cpp
+++ b/backends/platform/libretro/src/libretro-os.cpp
@@ -651,7 +651,7 @@ public:
 	virtual bool pollEvent(Common::Event &event) {
 		_threadSwitchCaller = THREAD_SWITCH_POLL;
 		((LibretroTimerManager *)_timerManager)->checkThread();
-
+		((LibretroTimerManager *)_timerManager)->handler();
 		if (!_events.empty()) {
 			event = _events.front();
 			_events.pop_front();
@@ -699,6 +699,7 @@ public:
 			elapsed_time = getMillis() - start_time;
 			time_remaining = time_remaining > elapsed_time ? time_remaining - elapsed_time : 0;
 		}
+		((LibretroTimerManager *)_timerManager)->handler();
 	}
 
 	virtual Common::MutexInternal *createMutex(void) {
diff --git a/backends/platform/libretro/src/libretro-timer.cpp b/backends/platform/libretro/src/libretro-timer.cpp
index 25a400d707b..5ac523d33cb 100644
--- a/backends/platform/libretro/src/libretro-timer.cpp
+++ b/backends/platform/libretro/src/libretro-timer.cpp
@@ -41,10 +41,8 @@ void LibretroTimerManager::switchThread(void) {
 }
 
 void LibretroTimerManager::checkThread(void) {
-	if (g_system->getMillis() >= _nextSwitchTime) {
+	if (g_system->getMillis() >= _nextSwitchTime)
 		switchThread();
-		handler();
-	}
 }
 
 uint32 LibretroTimerManager::timeToNextSwitch(void) {




More information about the Scummvm-git-logs mailing list