Skip to content

Commit

Permalink
Move all bool settings
Browse files Browse the repository at this point in the history
  • Loading branch information
inactive123 committed Apr 28, 2017
1 parent 6bac458 commit ed53be7
Show file tree
Hide file tree
Showing 44 changed files with 522 additions and 513 deletions.
2 changes: 1 addition & 1 deletion camera/camera_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ bool camera_driver_ctl(enum rarch_camera_ctl_state state, void *data)
case RARCH_CAMERA_CTL_START:
if (camera_driver && camera_data && camera_driver->start)
{
if (settings->camera.allow)
if (settings->bools.camera_allow)
return camera_driver->start(camera_data);

runloop_msg_queue_push(
Expand Down
20 changes: 10 additions & 10 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,7 +2143,7 @@ static void cheevos_make_unlock_url(const cheevo_t *cheevo, char* url, size_t ur
url, url_size,
"http://retroachievements.org/dorequest.php?r=awardachievement&u=%s&t=%s&a=%u&h=%d",
settings->cheevos.username, cheevos_locals.token, cheevo->id,
settings->cheevos.hardcore_mode_enable ? 1 : 0
settings->bools.cheevos_hardcore_mode_enable ? 1 : 0
);

url[url_size - 1] = 0;
Expand Down Expand Up @@ -2180,7 +2180,7 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set)
const cheevo_t *end = set->cheevos + set->count;
int mode, valid;

if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
mode = CHEEVOS_ACTIVE_HARDCORE;
else
mode = CHEEVOS_ACTIVE_SOFTCORE;
Expand Down Expand Up @@ -2411,7 +2411,7 @@ static int cheevos_get_by_game_id(const char **json,
settings_t *settings = config_get_ptr();

/* Just return OK if cheevos are disabled. */
if (!settings->cheevos.enable)
if (!settings->bools.cheevos_enable)
return 0;

if (!cheevos_login(timeout))
Expand Down Expand Up @@ -3009,7 +3009,7 @@ bool cheevos_load(const void *data)

/* Bail out if cheevos are disabled.
* But set the above anyways, command_read_ram needs it. */
if (!settings->cheevos.enable)
if (!settings->bools.cheevos_enable)
return true;

/* Use the supported extensions as a hint
Expand Down Expand Up @@ -3094,7 +3094,7 @@ bool cheevos_load(const void *data)
if (cheevos_get_by_game_id(&json, game_id, &timeout) == 0 && json != NULL)
#endif
{
if (!settings->cheevos.enable || !cheevos_parse(json))
if (!settings->bools.cheevos_enable || !cheevos_parse(json))
{
cheevos_deactivate_unlocks(game_id, &timeout);
free((void*)json);
Expand Down Expand Up @@ -3178,7 +3178,7 @@ void cheevos_populate_menu(void *data, bool hardcore)
}
}

if (settings->cheevos.test_unofficial)
if (settings->bools.cheevos_test_unofficial)
{
cheevo = cheevos_locals.unofficial.cheevos;
end = cheevos_locals.unofficial.cheevos
Expand Down Expand Up @@ -3280,11 +3280,11 @@ bool cheevos_toggle_hardcore_mode(void)
settings_t *settings = config_get_ptr();

/* reset and deinit rewind to avoid cheat the score */
if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
{
/* send reset core cmd to avoid any user savestate previusly loaded */
command_event(CMD_EVENT_RESET, NULL);
if (settings->rewind_enable)
if (settings->bools.rewind_enable)
command_event(CMD_EVENT_REWIND_DEINIT, NULL);

RARCH_LOG("%s\n", msg_hash_to_str(MSG_CHEEVOS_HARDCORE_MODE_ENABLE));
Expand All @@ -3293,7 +3293,7 @@ bool cheevos_toggle_hardcore_mode(void)
}
else
{
if (settings->rewind_enable)
if (settings->bools.rewind_enable)
command_event(CMD_EVENT_REWIND_INIT, NULL);
}

Expand All @@ -3306,7 +3306,7 @@ void cheevos_test(void)

cheevos_test_cheevo_set(&cheevos_locals.core);

if (settings->cheevos.test_unofficial)
if (settings->bools.cheevos_test_unofficial)
cheevos_test_cheevo_set(&cheevos_locals.unofficial);

#ifdef CHEEVOS_ENABLE_LBOARDS
Expand Down
46 changes: 24 additions & 22 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,13 @@ static bool command_set_shader(const char *arg)
static bool command_read_ram(const char *arg)
{
cheevos_var_t var;
const uint8_t * data;
unsigned nbytes;
unsigned i;
unsigned nbytes;
char reply[256];
char *reply_at = NULL;
const uint8_t * data = NULL;
char *reply_at = NULL;

reply[0] = '\0';

strlcpy(reply, "READ_CORE_RAM ", sizeof(reply));
reply_at = reply + strlen("READ_CORE_RAM ");
Expand Down Expand Up @@ -1235,11 +1237,11 @@ static void command_event_load_auto_state(void)
#endif

#ifdef HAVE_CHEEVOS
if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
return;
#endif

if (!settings->savestate_auto_load)
if (!settings->bools.savestate_auto_load)
return;

if (global)
Expand Down Expand Up @@ -1271,7 +1273,7 @@ static void command_event_set_savestate_auto_index(void)
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();

if (!settings->savestate_auto_index)
if (!settings->bools.savestate_auto_index)
return;

if (global)
Expand Down Expand Up @@ -1369,7 +1371,7 @@ static bool command_event_init_core(enum rarch_core_type *data)
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_INIT, NULL);

/* auto overrides: apply overrides */
if(settings->auto_overrides_enable)
if(settings->bools.auto_overrides_enable)
{
if (config_load_override())
runloop_ctl(RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, NULL);
Expand All @@ -1378,7 +1380,7 @@ static bool command_event_init_core(enum rarch_core_type *data)
}

/* Auto-remap: apply shader preset files */
if(settings->auto_shaders_enable)
if(settings->bools.auto_shaders_enable)
config_load_shader_preset();


Expand All @@ -1389,7 +1391,7 @@ static bool command_event_init_core(enum rarch_core_type *data)
core_set_environment(&info);

/* Auto-remap: apply remap files */
if(settings->auto_remaps_enable)
if(settings->bools.auto_remaps_enable)
config_load_remap();

/* Per-core saves: reset redirection paths */
Expand Down Expand Up @@ -1447,7 +1449,7 @@ static bool command_event_save_auto_state(void)
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();

if (!settings || !settings->savestate_auto_save)
if (!settings || !settings->bools.savestate_auto_save)
return false;
if (!global)
return false;
Expand All @@ -1460,7 +1462,7 @@ static bool command_event_save_auto_state(void)
return false;

#ifdef HAVE_CHEEVOS
if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
return false;
#endif

Expand Down Expand Up @@ -1887,7 +1889,7 @@ bool command_event(enum event_command cmd, void *data)
return false;

#ifdef HAVE_CHEEVOS
if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
return false;
#endif

Expand Down Expand Up @@ -1930,11 +1932,11 @@ bool command_event(enum event_command cmd, void *data)
{
settings_t *settings = config_get_ptr();
#ifdef HAVE_CHEEVOS
if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
return false;
#endif

if (settings->savestate_auto_index)
if (settings->bools.savestate_auto_index)
{
int new_state_slot = settings->state_slot + 1;
configuration_set_int(settings, settings->state_slot, new_state_slot);
Expand Down Expand Up @@ -2022,7 +2024,7 @@ bool command_event(enum event_command cmd, void *data)
{
#ifdef HAVE_CHEEVOS
settings_t *settings = config_get_ptr();
if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
return false;
#endif

Expand All @@ -2033,18 +2035,18 @@ bool command_event(enum event_command cmd, void *data)
{
settings_t *settings = config_get_ptr();
#ifdef HAVE_CHEEVOS
if (settings->cheevos.hardcore_mode_enable)
if (settings->bools.cheevos_hardcore_mode_enable)
return false;
#endif

if (settings->rewind_enable)
if (settings->bools.rewind_enable)
state_manager_event_init((unsigned)settings->rewind_buffer_size);
}
break;
case CMD_EVENT_REWIND_TOGGLE:
{
settings_t *settings = config_get_ptr();
if (settings->rewind_enable)
if (settings->bools.rewind_enable)
command_event(CMD_EVENT_REWIND_INIT, NULL);
else
command_event(CMD_EVENT_REWIND_DEINIT, NULL);
Expand Down Expand Up @@ -2099,7 +2101,7 @@ bool command_event(enum event_command cmd, void *data)
settings_t *settings = config_get_ptr();
command_event(CMD_EVENT_OVERLAY_DEINIT, NULL);
#ifdef HAVE_OVERLAY
if (settings->input.overlay_enable)
if (settings->bools.input_overlay_enable)
task_push_overlay_load_default(input_overlay_loaded, NULL);
#endif
}
Expand Down Expand Up @@ -2173,7 +2175,7 @@ bool command_event(enum event_command cmd, void *data)
{
settings_t *settings = config_get_ptr();
command_event(CMD_EVENT_HISTORY_DEINIT, NULL);
if (!settings->history_list_enable)
if (!settings->bools.history_list_enable)
return false;

RARCH_LOG("%s: [%s].\n",
Expand Down Expand Up @@ -2393,15 +2395,15 @@ bool command_event(enum event_command cmd, void *data)
if (menu_driver_is_alive())
{
settings_t *settings = config_get_ptr();
if (settings->menu.pause_libretro)
if (settings->bools.menu_pause_libretro)
command_event(CMD_EVENT_AUDIO_STOP, NULL);
else
command_event(CMD_EVENT_AUDIO_START, NULL);
}
else
{
settings_t *settings = config_get_ptr();
if (settings->menu.pause_libretro)
if (settings->bools.menu_pause_libretro)
command_event(CMD_EVENT_AUDIO_START, NULL);
}
#endif
Expand Down
Loading

0 comments on commit ed53be7

Please sign in to comment.