mirror of
https://github.com/libretro/RetroArch
synced 2025-02-04 03:40:03 +00:00
Add fullscreen toggle to RGUI.
Drop hotkey handling. Needed to add delay timer hackery in that case.
This commit is contained in:
parent
43dc80c430
commit
610f33962a
@ -439,9 +439,6 @@ bool menu_iterate(void)
|
||||
#ifdef HAVE_OVERLAY
|
||||
rarch_check_overlay();
|
||||
#endif
|
||||
#ifndef RARCH_PERFORMANCE_MODE
|
||||
rarch_check_fullscreen();
|
||||
#endif
|
||||
|
||||
if (input_key_pressed_func(RARCH_QUIT_KEY) || !video_alive_func())
|
||||
{
|
||||
@ -459,7 +456,7 @@ bool menu_iterate(void)
|
||||
g_extern.delay_timer[1] = g_extern.frame_count + (initial_held ? 15 : 7);
|
||||
}
|
||||
|
||||
if (!(g_extern.frame_count < g_extern.delay_timer[1]))
|
||||
if (g_extern.frame_count >= g_extern.delay_timer[1])
|
||||
{
|
||||
first_held = false;
|
||||
rgui->trigger_state = input_state; //second input frame set as current frame
|
||||
|
@ -121,6 +121,7 @@ typedef enum
|
||||
RGUI_SETTINGS_VIDEO_ASPECT_RATIO,
|
||||
RGUI_SETTINGS_CUSTOM_VIEWPORT,
|
||||
RGUI_SETTINGS_CUSTOM_VIEWPORT_2,
|
||||
RGUI_SETTINGS_TOGGLE_FULLSCREEN,
|
||||
RGUI_SETTINGS_VIDEO_ROTATION,
|
||||
RGUI_SETTINGS_AUDIO_MUTE,
|
||||
RGUI_SETTINGS_AUDIO_CONTROL_RATE,
|
||||
|
@ -529,6 +529,7 @@ static void render_text(rgui_handle_t *rgui)
|
||||
case RGUI_SETTINGS_SHADER_MANAGER:
|
||||
case RGUI_SETTINGS_SHADER_PRESET:
|
||||
case RGUI_SETTINGS_CUSTOM_VIEWPORT:
|
||||
case RGUI_SETTINGS_TOGGLE_FULLSCREEN:
|
||||
case RGUI_SETTINGS_CORE:
|
||||
case RGUI_SETTINGS_CONTROLLER_1:
|
||||
case RGUI_SETTINGS_CONTROLLER_2:
|
||||
@ -847,6 +848,15 @@ static int rgui_settings_toggle_setting(rgui_handle_t *rgui, unsigned setting, r
|
||||
if (driver.video_poke->set_aspect_ratio)
|
||||
driver.video_poke->set_aspect_ratio(driver.video_data, g_settings.video.aspect_ratio_idx);
|
||||
break;
|
||||
case RGUI_SETTINGS_TOGGLE_FULLSCREEN:
|
||||
if (action == RGUI_ACTION_OK)
|
||||
{
|
||||
rarch_set_fullscreen(!g_settings.video.fullscreen);
|
||||
// Delay timers have been reset.
|
||||
g_extern.delay_timer[0] = 15;
|
||||
g_extern.delay_timer[1] = 15;
|
||||
}
|
||||
break;
|
||||
case RGUI_SETTINGS_VIDEO_ROTATION:
|
||||
if (action == RGUI_ACTION_START)
|
||||
{
|
||||
@ -1070,6 +1080,9 @@ static void rgui_settings_populate_entries(rgui_handle_t *rgui)
|
||||
rgui_list_push(rgui->selection_buf, "Integer Scale", RGUI_SETTINGS_VIDEO_INTEGER_SCALE, 0);
|
||||
rgui_list_push(rgui->selection_buf, "Aspect Ratio", RGUI_SETTINGS_VIDEO_ASPECT_RATIO, 0);
|
||||
rgui_list_push(rgui->selection_buf, "Custom Ratio", RGUI_SETTINGS_CUSTOM_VIEWPORT, 0);
|
||||
#ifndef RARCH_CONSOLE
|
||||
rgui_list_push(rgui->selection_buf, "Toggle Fullscreen", RGUI_SETTINGS_TOGGLE_FULLSCREEN, 0);
|
||||
#endif
|
||||
rgui_list_push(rgui->selection_buf, "Rotation", RGUI_SETTINGS_VIDEO_ROTATION, 0);
|
||||
rgui_list_push(rgui->selection_buf, "Mute Audio", RGUI_SETTINGS_AUDIO_MUTE, 0);
|
||||
rgui_list_push(rgui->selection_buf, "Audio Control Rate", RGUI_SETTINGS_AUDIO_CONTROL_RATE, 0);
|
||||
@ -2051,7 +2064,7 @@ int rgui_input_postprocess(void *data, uint64_t old_state)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
if (!(g_extern.frame_count < g_extern.delay_timer[0]))
|
||||
if (g_extern.frame_count >= g_extern.delay_timer[0])
|
||||
{
|
||||
if ((rgui->trigger_state & (1ULL << DEVICE_NAV_MENU)) && g_extern.main_is_init)
|
||||
{
|
||||
|
@ -694,7 +694,7 @@ void rarch_input_poll(void);
|
||||
void rarch_check_overlay(void);
|
||||
void rarch_init_rewind(void);
|
||||
void rarch_deinit_rewind(void);
|
||||
bool rarch_check_fullscreen(void);
|
||||
void rarch_set_fullscreen(bool fullscreen);
|
||||
|
||||
void rarch_load_state(void);
|
||||
void rarch_save_state(void);
|
||||
|
25
retroarch.c
25
retroarch.c
@ -1965,7 +1965,19 @@ static void check_savestates(bool immutable)
|
||||
}
|
||||
|
||||
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||
bool rarch_check_fullscreen(void)
|
||||
void rarch_set_fullscreen(bool fullscreen)
|
||||
{
|
||||
g_settings.video.fullscreen = fullscreen;
|
||||
|
||||
uninit_drivers();
|
||||
init_drivers();
|
||||
|
||||
// Poll input to avoid possibly stale data to corrupt things.
|
||||
if (driver.input)
|
||||
input_poll_func();
|
||||
}
|
||||
|
||||
static bool check_fullscreen(void)
|
||||
{
|
||||
// If we go fullscreen we drop all drivers and reinit to be safe.
|
||||
static bool was_pressed = false;
|
||||
@ -1974,12 +1986,7 @@ bool rarch_check_fullscreen(void)
|
||||
if (toggle)
|
||||
{
|
||||
g_settings.video.fullscreen = !g_settings.video.fullscreen;
|
||||
uninit_drivers();
|
||||
init_drivers();
|
||||
|
||||
// Poll input to avoid possibly stale data to corrupt things.
|
||||
if (driver.input)
|
||||
input_poll_func();
|
||||
rarch_set_fullscreen(g_settings.video.fullscreen);
|
||||
}
|
||||
|
||||
was_pressed = pressed;
|
||||
@ -2653,7 +2660,7 @@ static void do_state_checks(void)
|
||||
check_pause();
|
||||
check_oneshot();
|
||||
|
||||
if (rarch_check_fullscreen() && g_extern.is_paused)
|
||||
if (check_fullscreen() && g_extern.is_paused)
|
||||
rarch_render_cached_frame();
|
||||
|
||||
if (g_extern.is_paused && !g_extern.is_oneshot)
|
||||
@ -2690,7 +2697,7 @@ static void do_state_checks(void)
|
||||
{
|
||||
check_netplay_flip();
|
||||
#if !defined(RARCH_PERFORMANCE_MODE)
|
||||
rarch_check_fullscreen();
|
||||
check_fullscreen();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user