Refine check_oneshot function - we no longer need g_extern.is_oneshot

anymore
This commit is contained in:
twinaphex 2014-10-05 05:18:46 +02:00
parent 5dc171c8a6
commit 54c2522979
3 changed files with 6 additions and 9 deletions

View File

@ -676,7 +676,7 @@ extern rarch_joypad_driver_t *joypad_drivers[];
#define check_netplay_flip_func(trigger_input) check_netplay_flip(BIND_PRESSED(trigger_input, RARCH_NETPLAY_FLIP), BIND_PRESSED(trigger_input, RARCH_FULLSCREEN_TOGGLE_KEY))
#define check_overlay_func(input, old_input) rarch_check_overlay(BIND_PRESSED(input, RARCH_OVERLAY_NEXT), BIND_PRESSED(old_input, RARCH_OVERLAY_NEXT))
#define check_oneshot_func(trigger_input) check_oneshot(BIND_PRESSED(trigger_input, RARCH_FRAMEADVANCE), BIND_PRESSED(trigger_input, RARCH_REWIND))
#define check_oneshot_func(trigger_input) (check_is_oneshot(BIND_PRESSED(trigger_input, RARCH_FRAMEADVANCE), BIND_PRESSED(trigger_input, RARCH_REWIND)))
#define check_slowmotion_func(input) check_slowmotion(BIND_PRESSED(input, RARCH_SLOWMOTION))
#define check_shader_dir_func(trigger_input) check_shader_dir(BIND_PRESSED(trigger_input, RARCH_SHADER_NEXT), BIND_PRESSED(trigger_input, RARCH_SHADER_PREV))
#define check_enter_menu_func(input) BIND_PRESSED(input, RARCH_MENU_TOGGLE)

View File

@ -645,7 +645,6 @@ struct global
/* Lifecycle state checks. */
bool is_paused;
bool is_oneshot;
bool is_menu;
bool is_slowmotion;

View File

@ -137,11 +137,11 @@ static void check_pause(bool pressed, bool frameadvance_pressed)
}
}
static inline void check_oneshot(bool oneshot_pressed, bool rewind_pressed)
/* Rewind buttons works like FRAMEREWIND when paused.
* We will one-shot in that case. */
static inline bool check_is_oneshot(bool oneshot_pressed, bool rewind_pressed)
{
/* Rewind buttons works like FRAMEREWIND when paused.
* We will one-shot in that case. */
g_extern.is_oneshot = oneshot_pressed | rewind_pressed;
return (oneshot_pressed | rewind_pressed);
}
/* To avoid continous switching if we hold the button down, we require
@ -464,12 +464,10 @@ static int do_state_checks(
#endif
check_pause_func(trigger_input);
check_oneshot_func(trigger_input);
if (check_fullscreen_func(trigger_input) && g_extern.is_paused)
rarch_render_cached_frame();
if (g_extern.is_paused && !g_extern.is_oneshot)
if (g_extern.is_paused && !check_oneshot_func(trigger_input))
return 1;
check_fast_forward_button_func(input, old_input, trigger_input);