mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-09 02:48:54 +00:00
Turn another runloop_ctl action into a static function
This commit is contained in:
parent
af2a33a8cb
commit
5d821f42a3
37
runloop.c
37
runloop.c
@ -144,6 +144,23 @@ static void runloop_msg_queue_unlock(void)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool runloop_msg_queue_push_internal(runloop_ctx_msg_info_t *msg_info)
|
||||||
|
{
|
||||||
|
if (!msg_info || !runloop_msg_queue)
|
||||||
|
return false;
|
||||||
|
msg_queue_push(runloop_msg_queue, msg_info->msg,
|
||||||
|
msg_info->prio, msg_info->duration);
|
||||||
|
|
||||||
|
if (ui_companion_is_on_foreground())
|
||||||
|
{
|
||||||
|
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
||||||
|
if (ui->msg_queue_push)
|
||||||
|
ui->msg_queue_push(msg_info->msg,
|
||||||
|
msg_info->prio, msg_info->duration, msg_info->flush);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void runloop_msg_queue_push(const char *msg,
|
void runloop_msg_queue_push(const char *msg,
|
||||||
unsigned prio, unsigned duration,
|
unsigned prio, unsigned duration,
|
||||||
bool flush)
|
bool flush)
|
||||||
@ -163,7 +180,7 @@ void runloop_msg_queue_push(const char *msg,
|
|||||||
msg_info.duration = duration;
|
msg_info.duration = duration;
|
||||||
msg_info.flush = flush;
|
msg_info.flush = flush;
|
||||||
|
|
||||||
runloop_ctl(RUNLOOP_CTL_MSG_QUEUE_PUSH, &msg_info);
|
runloop_msg_queue_push_internal(&msg_info);
|
||||||
|
|
||||||
runloop_msg_queue_unlock();
|
runloop_msg_queue_unlock();
|
||||||
}
|
}
|
||||||
@ -641,6 +658,7 @@ static bool runloop_is_frame_count_end(void)
|
|||||||
return runloop_max_frames && (*frame_count >= runloop_max_frames);
|
return runloop_max_frames && (*frame_count >= runloop_max_frames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
@ -967,23 +985,6 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data)
|
|||||||
break;
|
break;
|
||||||
case RUNLOOP_CTL_IS_PAUSED:
|
case RUNLOOP_CTL_IS_PAUSED:
|
||||||
return runloop_paused;
|
return runloop_paused;
|
||||||
case RUNLOOP_CTL_MSG_QUEUE_PUSH:
|
|
||||||
{
|
|
||||||
runloop_ctx_msg_info_t *msg_info = (runloop_ctx_msg_info_t*)data;
|
|
||||||
if (!msg_info || !runloop_msg_queue)
|
|
||||||
return false;
|
|
||||||
msg_queue_push(runloop_msg_queue, msg_info->msg,
|
|
||||||
msg_info->prio, msg_info->duration);
|
|
||||||
|
|
||||||
if (ui_companion_is_on_foreground())
|
|
||||||
{
|
|
||||||
const ui_companion_driver_t *ui = ui_companion_get_ptr();
|
|
||||||
if (ui->msg_queue_push)
|
|
||||||
ui->msg_queue_push(msg_info->msg,
|
|
||||||
msg_info->prio, msg_info->duration, msg_info->flush);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RUNLOOP_CTL_MSG_QUEUE_PULL:
|
case RUNLOOP_CTL_MSG_QUEUE_PULL:
|
||||||
runloop_msg_queue_lock();
|
runloop_msg_queue_lock();
|
||||||
{
|
{
|
||||||
|
@ -91,7 +91,6 @@ enum runloop_ctl_state
|
|||||||
|
|
||||||
RUNLOOP_CTL_MSG_QUEUE_FREE,
|
RUNLOOP_CTL_MSG_QUEUE_FREE,
|
||||||
RUNLOOP_CTL_MSG_QUEUE_PULL,
|
RUNLOOP_CTL_MSG_QUEUE_PULL,
|
||||||
RUNLOOP_CTL_MSG_QUEUE_PUSH,
|
|
||||||
RUNLOOP_CTL_MSG_QUEUE_CLEAR,
|
RUNLOOP_CTL_MSG_QUEUE_CLEAR,
|
||||||
RUNLOOP_CTL_HAS_CORE_OPTIONS,
|
RUNLOOP_CTL_HAS_CORE_OPTIONS,
|
||||||
RUNLOOP_CTL_GET_CORE_OPTION_SIZE,
|
RUNLOOP_CTL_GET_CORE_OPTION_SIZE,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user