From 1037093d4507765071db7f2c26223185bbdc3685 Mon Sep 17 00:00:00 2001 From: radius Date: Mon, 30 Apr 2018 14:39:20 -0500 Subject: [PATCH] cleanup cheevos hardcore conditions --- command.c | 18 ++++++------------ menu/menu_displaylist.c | 6 ++---- retroarch.c | 10 ++++++---- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/command.c b/command.c index ebdd9cc345..ad29d7068b 100644 --- a/command.c +++ b/command.c @@ -1088,8 +1088,7 @@ static void command_event_load_auto_state(void) #endif #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_enable - && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) goto error; #endif @@ -1327,8 +1326,7 @@ static bool command_event_save_auto_state(void) goto error; #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_enable - && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) goto error; #endif @@ -1827,8 +1825,7 @@ bool command_event(enum event_command cmd, void *data) #ifdef HAVE_CHEEVOS { settings_t *settings = config_get_ptr(); - if (cheevos_loaded && settings->bools.cheevos_enable - && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) return false; } #endif @@ -1870,8 +1867,7 @@ bool command_event(enum event_command cmd, void *data) { settings_t *settings = config_get_ptr(); #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_enable - && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) return false; #endif @@ -1976,8 +1972,7 @@ bool command_event(enum event_command cmd, void *data) { #ifdef HAVE_CHEEVOS settings_t *settings = config_get_ptr(); - if (cheevos_loaded && settings->bools.cheevos_enable - && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) return false; #endif @@ -1988,8 +1983,7 @@ bool command_event(enum event_command cmd, void *data) { settings_t *settings = config_get_ptr(); #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_enable - && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) return false; #endif if (settings->bools.rewind_enable) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 1be60202f4..83faeb0b5e 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -2571,8 +2571,7 @@ static int menu_displaylist_parse_load_content_settings( if (settings->bools.quick_menu_show_save_load_state #ifdef HAVE_CHEEVOS - && !(settings->bools.cheevos_enable - && settings->bools.cheevos_hardcore_mode_enable && cheevos_loaded) + && !cheevos_hardcore_active #endif ) { @@ -2595,8 +2594,7 @@ static int menu_displaylist_parse_load_content_settings( if (settings->bools.quick_menu_show_save_load_state && settings->bools.quick_menu_show_undo_save_load_state #ifdef HAVE_CHEEVOS - && !(settings->bools.cheevos_enable && settings->bools.cheevos_hardcore_mode_enable - && cheevos_loaded) + && !cheevos_hardcore_active #endif ) { diff --git a/retroarch.c b/retroarch.c index c37c43f895..997edd15cf 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2986,9 +2986,12 @@ static enum runloop_state runloop_check_state( old_should_loadstate = should_loadstate; } + cheevos_hardcore_active = settings->bools.cheevos_enable + && settings->bools.cheevos_hardcore_mode_enable + && cheevos_loaded; + #ifdef HAVE_CHEEVOS - if (!cheevos_loaded || !settings->bools.cheevos_enable - || !settings->bools.cheevos_hardcore_mode_enable) + if (!cheevos_hardcore_active) #endif { char s[128]; @@ -3003,8 +3006,7 @@ static enum runloop_state runloop_check_state( /* Checks if slowmotion toggle/hold was being pressed and/or held. */ #ifdef HAVE_CHEEVOS - if (!cheevos_loaded || !settings->bools.cheevos_enable - || !settings->bools.cheevos_hardcore_mode_enable) + if (!cheevos_hardcore_active) #endif { static bool old_slowmotion_button_state = false;