From 75c05a5d7f48fb7aa7337029c02c75905c66c247 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 2 Mar 2016 06:20:36 +0100 Subject: [PATCH] Do away with no_content member --- content.c | 5 ++++- content.h | 2 ++ dynamic.c | 7 ++++++- frontend/frontend.c | 4 ++-- system.h | 1 - 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/content.c b/content.c index 763b6c415b..e4f13b41ea 100644 --- a/content.c +++ b/content.c @@ -1578,7 +1578,7 @@ static bool init_content_file_set_attribs( attr.i = system->info.block_extract; attr.i |= system->info.need_fullpath << 1; - attr.i |= (!system->no_content) << 2; + attr.i |= (!content_ctl(CONTENT_CTL_DOES_NOT_NEED_CONTENT, NULL)) << 2; if (content_ctl(CONTENT_CTL_DOES_NOT_NEED_CONTENT, NULL) && settings->set_supports_no_game_enable) @@ -1684,6 +1684,9 @@ bool content_ctl(enum content_ctl_state state, void *data) case CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT: core_does_not_need_content = true; break; + case CONTENT_CTL_UNSET_DOES_NOT_NEED_CONTENT: + core_does_not_need_content = false; + break; case CONTENT_CTL_GET_CRC: { uint32_t **content_crc_ptr = (uint32_t**)data; diff --git a/content.h b/content.h index f06eed1688..e1088acac4 100644 --- a/content.h +++ b/content.h @@ -40,6 +40,8 @@ enum content_ctl_state CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT, + CONTENT_CTL_UNSET_DOES_NOT_NEED_CONTENT, + /* Initializes and loads a content file for the currently * selected libretro core. */ CONTENT_CTL_INIT, diff --git a/dynamic.c b/dynamic.c index 5629317eec..70966aaeb2 100644 --- a/dynamic.c +++ b/dynamic.c @@ -40,6 +40,7 @@ #include "cores/internal_cores.h" #include "frontend/frontend_driver.h" +#include "content.h" #include "retroarch.h" #include "configuration.h" #include "general.h" @@ -953,7 +954,11 @@ bool rarch_environment_cb(unsigned cmd, void *data) { bool state = *(const bool*)data; RARCH_LOG("Environ SET_SUPPORT_NO_GAME: %s.\n", state ? "yes" : "no"); - system->no_content = state; + + if (state) + content_ctl(CONTENT_CTL_SET_DOES_NOT_NEED_CONTENT, NULL); + else + content_ctl(CONTENT_CTL_UNSET_DOES_NOT_NEED_CONTENT, NULL); break; } diff --git a/frontend/frontend.c b/frontend/frontend.c index 6fa0a981d0..469697d2ca 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -133,7 +133,7 @@ int rarch_main(int argc, char *argv[], void *data) runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &system); runloop_ctl(RUNLOOP_CTL_GET_CONTENT_PATH, &fullpath); - if (content_ctl(CONTENT_CTL_IS_INITED, NULL) || system->no_content) + if (content_ctl(CONTENT_CTL_IS_INITED, NULL) || content_ctl(CONTENT_CTL_DOES_NOT_NEED_CONTENT, NULL)) { char tmp[PATH_MAX_LENGTH]; struct retro_system_info *info = system ? &system->info : NULL; @@ -149,7 +149,7 @@ int rarch_main(int argc, char *argv[], void *data) if (rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL) || !info) content_push_to_history_playlist( - system->no_content || *tmp, + content_ctl(CONTENT_CTL_DOES_NOT_NEED_CONTENT, NULL) || *tmp, *tmp ? tmp : NULL, info); } diff --git a/system.h b/system.h index e7708f62e9..ec4419bb6b 100644 --- a/system.h +++ b/system.h @@ -40,7 +40,6 @@ typedef struct rarch_system_info unsigned performance_level; bool force_nonblock; - bool no_content; const char *input_desc_btn[MAX_USERS][RARCH_FIRST_META_KEY]; char valid_extensions[PATH_MAX_LENGTH];