mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(Apple) Refactor do_iteration
This commit is contained in:
parent
e86efd320c
commit
1a62614c78
@ -30,6 +30,14 @@
|
||||
|
||||
//#define DEBUG_RUNLOOP
|
||||
|
||||
#ifdef DEBUG_RUNLOOP
|
||||
#include "../../retroarch_logger.h"
|
||||
|
||||
#define CF_LOG(...) RARCH_LOG(__VA_ARGS__)
|
||||
#else
|
||||
#define CF_LOG(...)
|
||||
#endif
|
||||
|
||||
void apple_start_iteration(void);
|
||||
|
||||
void apple_stop_iteration(void);
|
||||
@ -48,43 +56,25 @@ static int do_ra_iteration(void)
|
||||
static void do_iteration(CFRunLoopObserverRef observer, CFRunLoopActivity activity,
|
||||
void *info)
|
||||
{
|
||||
#ifdef DEBUG_RUNLOOP
|
||||
if (activity & kCFRunLoopEntry)
|
||||
switch (activity)
|
||||
{
|
||||
RARCH_LOG("RUNLOOP ENTRY, frame: %d.\n", g_runloop.frames.video.count);
|
||||
}
|
||||
if (activity & kCFRunLoopBeforeTimers)
|
||||
case kCFRunLoopEntry:
|
||||
CF_LOG("RUNLOOP ENTRY, frame: %d.\n", g_runloop.frames.video.count);
|
||||
break;
|
||||
case kCFRunLoopBeforeTimers:
|
||||
CF_LOG("RUNLOOP BEFORE TIMERS, frame: %d.\n", g_runloop.frames.video.count);
|
||||
break;
|
||||
case kCFRunLoopAfterWaiting:
|
||||
CF_LOG("RUNLOOP AFTER WAITING, frame: %d.\n", g_runloop.frames.video.count);
|
||||
break;
|
||||
case kCFRunLoopBeforeWaiting:
|
||||
{
|
||||
RARCH_LOG("RUNLOOP BEFORE TIMERS, frame: %d.\n", g_runloop.frames.video.count);
|
||||
}
|
||||
if (activity & kCFRunLoopAfterWaiting)
|
||||
{
|
||||
RARCH_LOG("RUNLOOP AFTER WAITING, frame: %d.\n", g_runloop.frames.video.count);
|
||||
}
|
||||
if (activity & kCFRunLoopBeforeSources)
|
||||
{
|
||||
RARCH_LOG("RUNLOOP BEFORE SOURCES, frame: %d\n.", g_runloop.frames.video.count);
|
||||
}
|
||||
if (activity & kCFRunLoopExit)
|
||||
{
|
||||
RARCH_LOG("RUNLOOP EXIT, frame: %d.\n", g_runloop.frames.video.count);
|
||||
}
|
||||
if (activity & kCFRunLoopAllActivities)
|
||||
{
|
||||
RARCH_LOG("RUNLOOP ALL ACTIVITIES, frame: %d.\n", g_runloop.frames.video.count);
|
||||
}
|
||||
if (activity & kCFRunLoopBeforeWaiting)
|
||||
#endif
|
||||
{
|
||||
#ifdef DEBUG_RUNLOOP
|
||||
RARCH_LOG("RUNLOOP BEFORE WAITING, frame: %d.\n", g_runloop.frames.video.count);
|
||||
#endif
|
||||
CF_LOG("RUNLOOP BEFORE WAITING, frame: %d.\n", g_runloop.frames.video.count);
|
||||
int ret = do_ra_iteration();
|
||||
if (ret == -1)
|
||||
return;
|
||||
CFRunLoopWakeUp(CFRunLoopGetMain());
|
||||
}
|
||||
|
||||
CFRunLoopWakeUp(CFRunLoopGetMain());
|
||||
|
||||
/* TODO/FIXME
|
||||
I am almost positive that this is not necessary and is actually a
|
||||
@ -144,6 +134,18 @@ static void do_iteration(CFRunLoopObserverRef observer, CFRunLoopActivity activi
|
||||
safe. Other eyeballs should decide if it isn't necessary.
|
||||
*/
|
||||
}
|
||||
break;
|
||||
case kCFRunLoopBeforeSources:
|
||||
CF_LOG("RUNLOOP BEFORE SOURCES, frame: %d\n.", g_runloop.frames.video.count);
|
||||
break;
|
||||
case kCFRunLoopExit:
|
||||
CF_LOG("RUNLOOP EXIT, frame: %d.\n", g_runloop.frames.video.count);
|
||||
break;
|
||||
case kCFRunLoopAllActivities:
|
||||
CF_LOG("RUNLOOP ALL ACTIVITIES, frame: %d.\n", g_runloop.frames.video.count);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void apple_start_iteration(void)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user