Rewrite check_pausegp

This commit is contained in:
twinaphex 2014-09-17 17:45:44 +02:00
parent 3892c8326d
commit f7061e7233
2 changed files with 7 additions and 8 deletions

View File

@ -688,6 +688,7 @@ extern menu_ctx_driver_backend_t menu_ctx_backend_lakka;
#define check_grab_mouse_toggle_func(input, old_input) check_grab_mouse_toggle(BIND_PRESSED(input, RARCH_GRAB_MOUSE_TOGGLE), BIND_PRESSED(old_input, RARCH_GRAB_MOUSE_TOGGLE)) #define check_grab_mouse_toggle_func(input, old_input) check_grab_mouse_toggle(BIND_PRESSED(input, RARCH_GRAB_MOUSE_TOGGLE), BIND_PRESSED(old_input, RARCH_GRAB_MOUSE_TOGGLE))
#define check_stateslots_func(input, old_input) check_stateslots(BIND_PRESSED(input, RARCH_STATE_SLOT_PLUS), BIND_PRESSED(old_input, RARCH_STATE_SLOT_PLUS), BIND_PRESSED(input, RARCH_STATE_SLOT_MINUS), BIND_PRESSED(old_input, RARCH_STATE_SLOT_MINUS)) #define check_stateslots_func(input, old_input) check_stateslots(BIND_PRESSED(input, RARCH_STATE_SLOT_PLUS), BIND_PRESSED(old_input, RARCH_STATE_SLOT_PLUS), BIND_PRESSED(input, RARCH_STATE_SLOT_MINUS), BIND_PRESSED(old_input, RARCH_STATE_SLOT_MINUS))
#define check_savestates_func(input, old_input) check_savestates(BIND_PRESSED(input, RARCH_SAVE_STATE_KEY), BIND_PRESSED(old_input, RARCH_SAVE_STATE_KEY), BIND_PRESSED(input, RARCH_LOAD_STATE_KEY), BIND_PRESSED(old_input, RARCH_LOAD_STATE_KEY), g_extern.bsv.movie) #define check_savestates_func(input, old_input) check_savestates(BIND_PRESSED(input, RARCH_SAVE_STATE_KEY), BIND_PRESSED(old_input, RARCH_SAVE_STATE_KEY), BIND_PRESSED(input, RARCH_LOAD_STATE_KEY), BIND_PRESSED(old_input, RARCH_LOAD_STATE_KEY), g_extern.bsv.movie)
#define check_pause_func(input, old_input) check_pause(BIND_PRESSED(input, RARCH_PAUSE_TOGGLE), BIND_PRESSED(old_input, RARCH_PAUSE_TOGGLE), BIND_PRESSED(input, RARCH_FRAMEADVANCE))
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -2381,18 +2381,17 @@ static void check_movie(bool new_pressed, bool old_pressed)
check_movie_record(pressed); check_movie_record(pressed);
} }
static void check_pause(retro_input_t input, retro_input_t old_input) static void check_pause(
bool new_state, bool old_state,
bool frameadvance_pressed)
{ {
static bool old_state = false;
static bool old_focus = true; static bool old_focus = true;
bool focus = true; bool focus = true;
bool has_set_audio_stop = false; bool has_set_audio_stop = false;
bool has_set_audio_start = false; bool has_set_audio_start = false;
bool new_state = BIND_PRESSED(input, RARCH_PAUSE_TOGGLE);
/* FRAMEADVANCE will set us into pause mode. */ /* FRAMEADVANCE will set us into pause mode. */
new_state |= !g_extern.is_paused && new_state |= !g_extern.is_paused && frameadvance_pressed;
BIND_PRESSED(input, RARCH_FRAMEADVANCE);
if (g_settings.pause_nonactive) if (g_settings.pause_nonactive)
focus = driver.video->focus(driver.video_data); focus = driver.video->focus(driver.video_data);
@ -2434,7 +2433,6 @@ static void check_pause(retro_input_t input, retro_input_t old_input)
rarch_render_cached_frame(); rarch_render_cached_frame();
old_focus = focus; old_focus = focus;
old_state = new_state;
} }
static void check_oneshot( static void check_oneshot(
@ -2858,7 +2856,7 @@ static void do_state_checks(retro_input_t input, retro_input_t old_input)
return; return;
} }
#endif #endif
check_pause(input, old_input); check_pause_func(input, old_input);
check_oneshot_func(input, old_input); check_oneshot_func(input, old_input);
@ -3624,7 +3622,6 @@ bool rarch_main_iterate(void)
return true; return true;
} }
/* Run libretro for one frame. */
#if defined(HAVE_THREADS) #if defined(HAVE_THREADS)
lock_autosave(); lock_autosave();
#endif #endif
@ -3652,6 +3649,7 @@ bool rarch_main_iterate(void)
if ((g_settings.video.frame_delay > 0) && !driver.nonblock_state) if ((g_settings.video.frame_delay > 0) && !driver.nonblock_state)
rarch_sleep(g_settings.video.frame_delay); rarch_sleep(g_settings.video.frame_delay);
/* Run libretro for one frame. */
update_frame_time(); update_frame_time();
pretro_run(); pretro_run();
limit_frame_time(); limit_frame_time();