Get rid of some RARCH_CTL_ commands

This commit is contained in:
LibretroAdmin 2022-10-10 20:14:54 +02:00
parent cc3a339011
commit da68e73f94
5 changed files with 14 additions and 12 deletions

View File

@ -28,6 +28,7 @@
#include "font_driver.h"
#include "../retroarch.h"
#include "../runloop.h"
#include "../verbosity.h"
static void *video_thread_init_never_call(const video_info_t *video,
@ -492,12 +493,15 @@ static void video_thread_loop(void *data)
static bool video_thread_alive(void *data)
{
bool ret;
uint32_t runloop_flags;
thread_video_t *thr = (thread_video_t*)data;
if (!thr)
return false;
runloop_flags = runloop_get_flags();
if (retroarch_ctl(RARCH_CTL_IS_PAUSED, NULL))
if (runloop_flags & RUNLOOP_FLAG_PAUSED)
{
thread_packet_t pkt;
pkt.type = CMD_ALIVE;

View File

@ -44,6 +44,7 @@
#include "../../configuration.h"
#include "../../retroarch.h"
#include "../../runloop.h"
#define MAX_TOUCH 16
#define MAX_NUM_KEYBOARDS 3
@ -1491,7 +1492,8 @@ static void android_input_poll(void *data)
if (android_app->reinitRequested != 0)
{
if (retroarch_ctl(RARCH_CTL_IS_PAUSED, NULL))
uint32_t runloop_flags = runloop_get_flags();
if (runloop_flags & RUNLOOP_FLAG_PAUSED)
command_event(CMD_EVENT_REINIT, NULL);
android_app_write_cmd(android_app, APP_CMD_REINIT_DONE);
return;
@ -1515,7 +1517,8 @@ bool android_run_events(void *data)
if (android_app->reinitRequested != 0)
{
if (retroarch_ctl(RARCH_CTL_IS_PAUSED, NULL))
uint32_t runloop_flags = runloop_get_flags();
if (runloop_flags & RUNLOOP_FLAG_PAUSED)
command_event(CMD_EVENT_REINIT, NULL);
android_app_write_cmd(android_app, APP_CMD_REINIT_DONE);
}

View File

@ -5820,8 +5820,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
sizeof(input_st->analog_requested));
}
break;
case RARCH_CTL_IS_IDLE:
return ((runloop_st->flags & RUNLOOP_FLAG_IDLE) > 0);
case RARCH_CTL_SET_IDLE:
{
bool *ptr = (bool*)data;
@ -5844,8 +5842,6 @@ bool retroarch_ctl(enum rarch_ctl_state state, void *data)
runloop_st->flags &= ~RUNLOOP_FLAG_PAUSED;
}
break;
case RARCH_CTL_IS_PAUSED:
return ((runloop_st->flags & RUNLOOP_FLAG_PAUSED) > 0);
case RARCH_CTL_SET_SHUTDOWN:
runloop_st->flags |= RUNLOOP_FLAG_SHUTDOWN_INITIATED;
break;

View File

@ -81,7 +81,6 @@ enum rarch_ctl_state
RARCH_CTL_HAS_SET_SUBSYSTEMS,
RARCH_CTL_IS_IDLE,
RARCH_CTL_SET_IDLE,
RARCH_CTL_SET_WINDOWED_SCALE,
@ -96,7 +95,6 @@ enum rarch_ctl_state
RARCH_CTL_SET_MISSING_BIOS,
RARCH_CTL_UNSET_MISSING_BIOS,
RARCH_CTL_IS_PAUSED,
RARCH_CTL_SET_PAUSED,
RARCH_CTL_SET_SHUTDOWN,

View File

@ -81,6 +81,7 @@ static void ui_companion_cocoatouch_event_command(
static void rarch_draw_observer(CFRunLoopObserverRef observer,
CFRunLoopActivity activity, void *info)
{
uint32_t runloop_flags;
int ret = runloop_iterate();
task_queue_check();
@ -93,9 +94,9 @@ static void rarch_draw_observer(CFRunLoopObserverRef observer,
return;
}
if (retroarch_ctl(RARCH_CTL_IS_IDLE, NULL))
return;
CFRunLoopWakeUp(CFRunLoopGetMain());
runloop_flags = runloop_get_flags();
if (!(runloop_flags & RUNLOOP_FLAG_IDLE))
CFRunLoopWakeUp(CFRunLoopGetMain());
}
apple_frontend_settings_t apple_frontend_settings;