Restructure settings struct

This commit is contained in:
twinaphex 2017-04-28 00:00:43 +02:00
parent d257ec51a0
commit ae1c26cbc4
4 changed files with 13 additions and 8 deletions

View file

@ -1003,6 +1003,9 @@ static struct config_int_setting *populate_settings_int(settings_t *settings, in
static void config_set_defaults(void)
{
unsigned i, j;
#ifdef HAVE_MENU
static bool first_initialized = true;
#endif
int float_settings_size = 0;
int bool_settings_size = 0;
int int_settings_size = 0;
@ -1022,9 +1025,6 @@ static void config_set_defaults(void)
struct config_bool_setting *bool_settings = NULL;
struct config_float_setting *float_settings = NULL;
struct config_int_setting *int_settings = NULL;
#ifdef HAVE_MENU
static bool first_initialized = true;
#endif
float_settings = populate_settings_float (settings, &float_settings_size);
bool_settings = populate_settings_bool (settings, &bool_settings_size);
int_settings = populate_settings_int (settings, &int_settings_size);

View file

@ -42,6 +42,12 @@ RETRO_BEGIN_DECLS
typedef struct settings
{
struct
{
bool placeholder;
bool bundle_finished;
} bools;
bool modified;
video_viewport_t video_viewport_custom;
@ -49,7 +55,6 @@ typedef struct settings
char playlist_names[PATH_MAX_LENGTH];
char playlist_cores[PATH_MAX_LENGTH];
bool bundle_finished;
struct
{

View file

@ -163,7 +163,7 @@ static void bundle_decompressed(void *task_data,
settings->bundle_assets_extract_last_version =
settings->bundle_assets_extract_version_current;
configuration_set_bool(settings, settings->bundle_finished, true);
configuration_set_bool(settings, settings->bools.bundle_finished, true);
command_event(CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, NULL);
}

View file

@ -208,10 +208,10 @@ int menu_dialog_iterate(char *s, size_t len, const char *label)
menu_hash_get_help_enum(MENU_ENUM_LABEL_VALUE_EXTRACTING_PLEASE_WAIT,
s, len);
if (settings->bundle_finished)
if (settings->bools.bundle_finished)
{
settings->bundle_finished = false;
do_exit = true;
settings->bools.bundle_finished = false;
do_exit = true;
}
break;
case MENU_DIALOG_QUIT_CONFIRM: