mirror of
https://github.com/libretro/RetroArch
synced 2025-02-04 03:40:03 +00:00
start/stop/restart ifdeffed for RARCH_CONSOLE instead of
HAVE_RMENU - transfer of control bypasses initialization of variables in RGUI - issues fixed
This commit is contained in:
parent
96dd31fcf2
commit
e741cc77c6
2
driver.h
2
driver.h
@ -250,7 +250,7 @@ typedef struct video_driver
|
|||||||
const char *ident;
|
const char *ident;
|
||||||
|
|
||||||
// Callbacks essentially useless on PC, but useful on consoles where the drivers are used for more stuff.
|
// Callbacks essentially useless on PC, but useful on consoles where the drivers are used for more stuff.
|
||||||
#if defined(RARCH_CONSOLE)
|
#ifdef RARCH_CONSOLE
|
||||||
void (*start)(void);
|
void (*start)(void);
|
||||||
void (*stop)(void);
|
void (*stop)(void);
|
||||||
void (*restart)(void);
|
void (*restart)(void);
|
||||||
|
@ -1646,13 +1646,17 @@ bool menu_iterate(void)
|
|||||||
static uint16_t old_input_state = 0;
|
static uint16_t old_input_state = 0;
|
||||||
static bool initial_held = true;
|
static bool initial_held = true;
|
||||||
static bool first_held = false;
|
static bool first_held = false;
|
||||||
|
bool do_held;
|
||||||
|
int input_entry_ret, input_process_ret;
|
||||||
|
rgui_action_t action;
|
||||||
|
uint16_t input_state;
|
||||||
|
|
||||||
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_DRAW);
|
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_DRAW);
|
||||||
device_ptr->should_resize = true;
|
device_ptr->should_resize = true;
|
||||||
|
|
||||||
g_extern.frame_count++;
|
g_extern.frame_count++;
|
||||||
|
|
||||||
uint16_t input_state = 0;
|
input_state = 0;
|
||||||
|
|
||||||
driver.input->poll(NULL);
|
driver.input->poll(NULL);
|
||||||
|
|
||||||
@ -1705,7 +1709,7 @@ bool menu_iterate(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
trigger_state = input_state & ~old_input_state;
|
trigger_state = input_state & ~old_input_state;
|
||||||
bool do_held = (input_state & ((1ULL << GX_DEVICE_NAV_UP) | (1ULL << GX_DEVICE_NAV_DOWN) | (1ULL << GX_DEVICE_NAV_LEFT) | (1ULL << GX_DEVICE_NAV_RIGHT))) && !(input_state & ((1ULL << GX_DEVICE_NAV_MENU) | (1ULL << GX_DEVICE_NAV_QUIT)));
|
do_held = (input_state & ((1ULL << GX_DEVICE_NAV_UP) | (1ULL << GX_DEVICE_NAV_DOWN) | (1ULL << GX_DEVICE_NAV_LEFT) | (1ULL << GX_DEVICE_NAV_RIGHT))) && !(input_state & ((1ULL << GX_DEVICE_NAV_MENU) | (1ULL << GX_DEVICE_NAV_QUIT)));
|
||||||
|
|
||||||
if(do_held)
|
if(do_held)
|
||||||
{
|
{
|
||||||
@ -1730,8 +1734,7 @@ bool menu_iterate(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
old_input_state = input_state;
|
old_input_state = input_state;
|
||||||
|
action = RGUI_ACTION_NOOP;
|
||||||
rgui_action_t action = RGUI_ACTION_NOOP;
|
|
||||||
|
|
||||||
// don't run anything first frame, only capture held inputs for old_input_state
|
// don't run anything first frame, only capture held inputs for old_input_state
|
||||||
if (trigger_state & (1ULL << GX_DEVICE_NAV_UP))
|
if (trigger_state & (1ULL << GX_DEVICE_NAV_UP))
|
||||||
@ -1758,8 +1761,8 @@ bool menu_iterate(void)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int input_entry_ret = 0;
|
input_entry_ret = 0;
|
||||||
int input_process_ret = 0;
|
input_process_ret = 0;
|
||||||
|
|
||||||
input_entry_ret = rgui_iterate(rgui, action);
|
input_entry_ret = rgui_iterate(rgui, action);
|
||||||
|
|
||||||
|
@ -251,10 +251,12 @@ void texture_image_border_load(const char *path)
|
|||||||
|
|
||||||
static bool gfx_ctx_rmenu_init(void)
|
static bool gfx_ctx_rmenu_init(void)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_RMENU
|
||||||
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE))
|
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU_LOW_RAM_MODE_ENABLE))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
texture_image_border_load(g_extern.console.menu_texture_path);
|
texture_image_border_load(g_extern.console.menu_texture_path);
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
8
gfx/gl.c
8
gfx/gl.c
@ -2021,7 +2021,7 @@ static bool gl_read_viewport(void *data, uint8_t *buffer)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef RARCH_CONSOLE
|
||||||
static void gl_get_poke_interface(void *data, const video_poke_interface_t **iface);
|
static void gl_get_poke_interface(void *data, const video_poke_interface_t **iface);
|
||||||
|
|
||||||
static void gl_start(void)
|
static void gl_start(void)
|
||||||
@ -2046,17 +2046,17 @@ static void gl_start(void)
|
|||||||
gl_t *gl = (gl_t*)driver.video_data;
|
gl_t *gl = (gl_t*)driver.video_data;
|
||||||
gl_get_poke_interface(gl, &driver.video_poke);
|
gl_get_poke_interface(gl, &driver.video_poke);
|
||||||
|
|
||||||
#ifdef RARCH_CONSOLE
|
|
||||||
// Comes too early for console - moved to gl_start
|
// Comes too early for console - moved to gl_start
|
||||||
gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size);
|
gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size);
|
||||||
|
|
||||||
|
#ifdef HAVE_FBO
|
||||||
if (!g_settings.video.render_to_texture)
|
if (!g_settings.video.render_to_texture)
|
||||||
gl_deinit_fbo(gl);
|
gl_deinit_fbo(gl);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAVE_RMENU
|
||||||
context_get_available_resolutions_func();
|
context_get_available_resolutions_func();
|
||||||
|
|
||||||
#ifdef HAVE_RMENU
|
|
||||||
if (gl->ctx_driver->rmenu_init)
|
if (gl->ctx_driver->rmenu_init)
|
||||||
context_rmenu_init_func();
|
context_rmenu_init_func();
|
||||||
#endif
|
#endif
|
||||||
@ -2315,7 +2315,7 @@ const video_driver_t video_gl = {
|
|||||||
gl_free,
|
gl_free,
|
||||||
"gl",
|
"gl",
|
||||||
|
|
||||||
#ifdef HAVE_RMENU
|
#ifdef RARCH_CONSOLE
|
||||||
gl_start,
|
gl_start,
|
||||||
gl_stop,
|
gl_stop,
|
||||||
gl_restart,
|
gl_restart,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user