mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-05 08:57:38 +00:00
Refactor ui_companion_is_on_foreground
This commit is contained in:
parent
5bafed71ea
commit
4cc71c0574
@ -871,7 +871,6 @@ void rarch_main_state_free(void)
|
||||
main_is_idle = false;
|
||||
main_is_paused = false;
|
||||
main_is_slowmotion = false;
|
||||
g_extern.ui_companion_is_on_foreground = false;
|
||||
g_extern.frames.limit.minimum_time = 0.0;
|
||||
g_extern.frames.limit.last_time = 0.0;
|
||||
g_extern.max_frames = 0;
|
||||
|
@ -42,9 +42,6 @@ typedef struct rarch_resolution
|
||||
|
||||
typedef struct global
|
||||
{
|
||||
/* Lifecycle state checks. */
|
||||
bool ui_companion_is_on_foreground;
|
||||
|
||||
struct
|
||||
{
|
||||
struct
|
||||
|
@ -44,18 +44,14 @@ void apple_rarch_exited(void);
|
||||
|
||||
static void rarch_enable_ui(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
global->ui_companion_is_on_foreground = true;
|
||||
ui_companion_set_foreground(true);
|
||||
rarch_main_set_pause(true);
|
||||
rarch_main_set_idle(true);
|
||||
}
|
||||
|
||||
static void rarch_disable_ui(void)
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
global->ui_companion_is_on_foreground = false;
|
||||
ui_companion_set_foreground(false);
|
||||
rarch_main_set_pause(false);
|
||||
rarch_main_set_idle(false);
|
||||
}
|
||||
@ -430,9 +426,7 @@ void apple_stop_iterate_timer(void)
|
||||
|
||||
- (void)toggleUI
|
||||
{
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
if (global->ui_companion_is_on_foreground)
|
||||
if (ui_companion_is_on_foreground())
|
||||
{
|
||||
[self showGameView];
|
||||
}
|
||||
|
@ -17,10 +17,14 @@
|
||||
#include "../driver.h"
|
||||
#include <string.h>
|
||||
|
||||
#include <boolean.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../config.h"
|
||||
#endif
|
||||
|
||||
static bool main_ui_companion_is_on_foreground;
|
||||
|
||||
static const ui_companion_driver_t *ui_companion_drivers[] = {
|
||||
#ifdef HAVE_COCOA
|
||||
&ui_companion_cocoa,
|
||||
@ -56,6 +60,16 @@ const ui_companion_driver_t *ui_companion_find_driver(const char *ident)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ui_companion_set_foreground(unsigned enable)
|
||||
{
|
||||
main_ui_companion_is_on_foreground = enable;
|
||||
}
|
||||
|
||||
bool ui_companion_is_on_foreground(void)
|
||||
{
|
||||
return main_ui_companion_is_on_foreground;
|
||||
}
|
||||
|
||||
/**
|
||||
* ui_companion_init_first:
|
||||
*
|
||||
|
@ -70,6 +70,10 @@ const ui_companion_driver_t *ui_companion_get_ptr(void);
|
||||
**/
|
||||
const ui_companion_driver_t *ui_companion_init_first(void);
|
||||
|
||||
bool ui_companion_is_on_foreground(void);
|
||||
|
||||
void ui_companion_set_foreground(unsigned enable);
|
||||
|
||||
void ui_companion_event_command(enum event_command action);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
x
Reference in New Issue
Block a user