More of aforementioend

This commit is contained in:
twinaphex 2014-09-16 09:48:47 +02:00
parent c391249e3f
commit a5e367d2f0
3 changed files with 24 additions and 22 deletions

View File

@ -310,6 +310,7 @@ bool menu_iterate(void)
if (!driver.menu) if (!driver.menu)
return false; return false;
if (g_extern.lifecycle_state & (1ULL << MODE_MENU_PREINIT)) if (g_extern.lifecycle_state & (1ULL << MODE_MENU_PREINIT))
{ {
driver.menu->need_refresh = true; driver.menu->need_refresh = true;
@ -317,14 +318,18 @@ bool menu_iterate(void)
} }
rarch_input_poll(); rarch_input_poll();
rarch_check_block_hotkey();
#ifdef HAVE_OVERLAY
rarch_check_overlay();
#endif
rarch_check_fullscreen();
if (input_key_pressed_func(RARCH_QUIT_KEY) retro_input_t input = input_keys_pressed_func(RARCH_FIRST_META_KEY);
|| !driver.video->alive(driver.video_data))
rarch_check_block_hotkey(BIT64_GET(input, RARCH_ENABLE_HOTKEY));
#ifdef HAVE_OVERLAY
rarch_check_overlay(BIT64_GET(input, RARCH_OVERLAY_NEXT));
#endif
rarch_check_fullscreen(BIT64_GET(input, RARCH_FULLSCREEN_TOGGLE_KEY));
if (
BIT64_GET(input, RARCH_QUIT_KEY) ||
!driver.video->alive(driver.video_data))
{ {
rarch_main_command(RARCH_CMD_RESUME); rarch_main_command(RARCH_CMD_RESUME);
return false; return false;

View File

@ -816,9 +816,9 @@ void rarch_main_deinit(void);
void rarch_render_cached_frame(void); void rarch_render_cached_frame(void);
void rarch_deinit_msg_queue(void); void rarch_deinit_msg_queue(void);
void rarch_input_poll(void); void rarch_input_poll(void);
void rarch_check_overlay(void); void rarch_check_overlay(bool pressed);
void rarch_check_block_hotkey(void); void rarch_check_block_hotkey(bool pressed);
bool rarch_check_fullscreen(void); bool rarch_check_fullscreen(bool pressed);
void rarch_disk_control_set_eject(bool state, bool log); void rarch_disk_control_set_eject(bool state, bool log);
void rarch_disk_control_set_index(unsigned index); void rarch_disk_control_set_index(unsigned index);
void rarch_disk_control_append_image(const char *path); void rarch_disk_control_append_image(const char *path);

View File

@ -2169,12 +2169,11 @@ static void set_fullscreen(bool fullscreen)
driver.input->poll(driver.input_data); driver.input->poll(driver.input_data);
} }
bool rarch_check_fullscreen(void) bool rarch_check_fullscreen(bool pressed)
{ {
/* If we go fullscreen we drop all drivers and /* If we go fullscreen we drop all drivers and
* reinitialize to be safe. */ * reinitialize to be safe. */
static bool was_pressed = false; static bool was_pressed = false;
bool pressed = input_key_pressed_func(RARCH_FULLSCREEN_TOGGLE_KEY);
bool toggle = pressed && !was_pressed; bool toggle = pressed && !was_pressed;
if (toggle) if (toggle)
@ -2870,15 +2869,15 @@ static void check_netplay_flip(retro_input_t input)
old_pressed = pressed; old_pressed = pressed;
rarch_check_fullscreen(); rarch_check_fullscreen(BIT64_GET(input, RARCH_FULLSCREEN_TOGGLE_KEY));
} }
#endif #endif
void rarch_check_block_hotkey(void) void rarch_check_block_hotkey(bool enable_hotkey)
{ {
static const struct retro_keybind *bind = static const struct retro_keybind *bind =
&g_settings.input.binds[0][RARCH_ENABLE_HOTKEY]; &g_settings.input.binds[0][RARCH_ENABLE_HOTKEY];
bool use_hotkey_enable, enable_hotkey; bool use_hotkey_enable;
/* Don't block the check to RARCH_ENABLE_HOTKEY /* Don't block the check to RARCH_ENABLE_HOTKEY
* unless we're really supposed to. */ * unless we're really supposed to. */
@ -2888,7 +2887,6 @@ void rarch_check_block_hotkey(void)
use_hotkey_enable = bind->key != RETROK_UNKNOWN || use_hotkey_enable = bind->key != RETROK_UNKNOWN ||
bind->joykey != NO_BTN || bind->joykey != NO_BTN ||
bind->joyaxis != AXIS_NONE; bind->joyaxis != AXIS_NONE;
enable_hotkey = input_key_pressed_func(RARCH_ENABLE_HOTKEY);
driver.block_hotkey = driver.block_input || driver.block_hotkey = driver.block_input ||
(use_hotkey_enable && !enable_hotkey); (use_hotkey_enable && !enable_hotkey);
@ -2899,10 +2897,9 @@ void rarch_check_block_hotkey(void)
} }
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
void rarch_check_overlay(void) void rarch_check_overlay(bool pressed)
{ {
static bool old_pressed = false; static bool old_pressed = false;
bool pressed = input_key_pressed_func(RARCH_OVERLAY_NEXT);
if (!driver.overlay) if (!driver.overlay)
return; return;
@ -2937,8 +2934,7 @@ static void check_grab_mouse_toggle(retro_input_t input)
static void do_state_checks(retro_input_t input) static void do_state_checks(retro_input_t input)
{ {
rarch_check_block_hotkey(); rarch_check_block_hotkey(BIT64_GET(input, RARCH_ENABLE_HOTKEY));
check_screenshot(input); check_screenshot(input);
check_mute(input); check_mute(input);
@ -2949,7 +2945,7 @@ static void do_state_checks(retro_input_t input)
check_grab_mouse_toggle(input); check_grab_mouse_toggle(input);
#ifdef HAVE_OVERLAY #ifdef HAVE_OVERLAY
rarch_check_overlay(); rarch_check_overlay(BIT64_GET(input, RARCH_OVERLAY_NEXT));
#endif #endif
#ifdef HAVE_NETPLAY #ifdef HAVE_NETPLAY
@ -2962,7 +2958,8 @@ static void do_state_checks(retro_input_t input)
check_pause(input); check_pause(input);
check_oneshot(input); check_oneshot(input);
if (rarch_check_fullscreen() && g_extern.is_paused) if (rarch_check_fullscreen(BIT64_GET(input, RARCH_FULLSCREEN_TOGGLE_KEY))
&& g_extern.is_paused)
rarch_render_cached_frame(); rarch_render_cached_frame();
if (g_extern.is_paused && !g_extern.is_oneshot) if (g_extern.is_paused && !g_extern.is_oneshot)