LIBRETRO: move timer handler calls

This commit is contained in:
Giovanni Cascione 2023-05-05 20:52:12 +02:00
parent be013f27e9
commit 6be7019fb0
2 changed files with 3 additions and 4 deletions

View File

@ -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) {

View File

@ -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) {