Start bookkeeping when we are modifying settings

This commit is contained in:
twinaphex 2017-04-23 13:24:17 +02:00
parent e192d4eaa6
commit 1febb963ae
2 changed files with 12 additions and 2 deletions

View File

@ -42,6 +42,8 @@ RETRO_BEGIN_DECLS
typedef struct settings
{
bool modified;
video_viewport_t video_viewport_custom;
char playlist_names[PATH_MAX_LENGTH];
@ -495,6 +497,10 @@ typedef struct settings
} settings_t;
#define configuration_set_int(settings, var, newvar) \
settings->modified = true; \
var = newvar
/**
* config_get_default_camera:
*

View File

@ -940,10 +940,11 @@ static enum runloop_state runloop_check_state(
if (runloop_cmd_triggered(trigger_input, RARCH_STATE_SLOT_PLUS))
{
char msg[128];
int new_state_slot = settings->state_slot + 1;
msg[0] = '\0';
settings->state_slot++;
configuration_set_int(settings, settings->state_slot, new_state_slot);
snprintf(msg, sizeof(msg), "%s: %d",
msg_hash_to_str(MSG_STATE_SLOT),
@ -956,11 +957,14 @@ static enum runloop_state runloop_check_state(
else if (runloop_cmd_triggered(trigger_input, RARCH_STATE_SLOT_MINUS))
{
char msg[128];
int new_state_slot = settings->state_slot - 1;
msg[0] = '\0';
if (settings->state_slot > 0)
settings->state_slot--;
{
configuration_set_int(settings, settings->state_slot, new_state_slot);
}
snprintf(msg, sizeof(msg), "%s: %d",
msg_hash_to_str(MSG_STATE_SLOT),