commit
583a74c0e4
|
@ -1305,7 +1305,7 @@ static void command_event_restore_default_shader_preset(void)
|
||||||
static void command_event_restore_remaps(void)
|
static void command_event_restore_remaps(void)
|
||||||
{
|
{
|
||||||
if (rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL))
|
if (rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL))
|
||||||
input_remapping_set_defaults();
|
input_remapping_set_defaults(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool command_event_save_auto_state(void)
|
static bool command_event_save_auto_state(void)
|
||||||
|
|
|
@ -1586,7 +1586,7 @@ static void config_set_defaults(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
input_config_reset();
|
input_config_reset();
|
||||||
input_remapping_set_defaults();
|
input_remapping_set_defaults(true);
|
||||||
input_autoconfigure_reset();
|
input_autoconfigure_reset();
|
||||||
|
|
||||||
/* Verify that binds are in proper order. */
|
/* Verify that binds are in proper order. */
|
||||||
|
@ -3009,7 +3009,7 @@ bool config_load_remap(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RARCH_LOG("Remaps: no game-specific remap found at %s.\n", game_path);
|
RARCH_LOG("Remaps: no game-specific remap found at %s.\n", game_path);
|
||||||
input_remapping_set_defaults();
|
input_remapping_set_defaults(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new config file from core_path */
|
/* Create a new config file from core_path */
|
||||||
|
@ -3029,7 +3029,7 @@ bool config_load_remap(void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RARCH_LOG("Remaps: no core-specific remap found at %s.\n", core_path);
|
RARCH_LOG("Remaps: no core-specific remap found at %s.\n", core_path);
|
||||||
input_remapping_set_defaults();
|
input_remapping_set_defaults(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
new_conf = NULL;
|
new_conf = NULL;
|
||||||
|
|
|
@ -246,10 +246,16 @@ bool input_remapping_remove_file(const char *path)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void input_remapping_set_defaults(void)
|
void input_remapping_set_defaults(bool deinit)
|
||||||
{
|
{
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
global_t *global = global_get_ptr();
|
||||||
|
|
||||||
|
if (!global)
|
||||||
|
return;
|
||||||
|
|
||||||
|
global->name.remapfile[0] = '\0';
|
||||||
|
|
||||||
for (i = 0; i < MAX_USERS; i++)
|
for (i = 0; i < MAX_USERS; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,7 +47,7 @@ bool input_remapping_save_file(const char *path);
|
||||||
|
|
||||||
bool input_remapping_remove_file(const char *path);
|
bool input_remapping_remove_file(const char *path);
|
||||||
|
|
||||||
void input_remapping_set_defaults(void);
|
void input_remapping_set_defaults(bool deinit);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
|
|
|
@ -2151,7 +2151,7 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||||
{
|
{
|
||||||
if (action_type == ACTION_OK_REMAP_FILE_SAVE_CORE)
|
if (action_type == ACTION_OK_REMAP_FILE_SAVE_CORE)
|
||||||
rarch_ctl(RARCH_CTL_SET_REMAPS_CORE_ACTIVE, NULL);
|
rarch_ctl(RARCH_CTL_SET_REMAPS_CORE_ACTIVE, NULL);
|
||||||
else
|
else if (action_type == ACTION_OK_REMAP_FILE_SAVE_GAME)
|
||||||
rarch_ctl(RARCH_CTL_SET_REMAPS_GAME_ACTIVE, NULL);
|
rarch_ctl(RARCH_CTL_SET_REMAPS_GAME_ACTIVE, NULL);
|
||||||
|
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
|
@ -2167,10 +2167,19 @@ static int generic_action_ok_remap_file_operation(const char *path,
|
||||||
{
|
{
|
||||||
if(input_remapping_remove_file(file))
|
if(input_remapping_remove_file(file))
|
||||||
{
|
{
|
||||||
if (action_type == ACTION_OK_REMAP_FILE_REMOVE_CORE)
|
if (action_type == ACTION_OK_REMAP_FILE_REMOVE_CORE &&
|
||||||
|
rarch_ctl(RARCH_CTL_IS_REMAPS_CORE_ACTIVE, NULL))
|
||||||
|
{
|
||||||
rarch_ctl(RARCH_CTL_UNSET_REMAPS_CORE_ACTIVE, NULL);
|
rarch_ctl(RARCH_CTL_UNSET_REMAPS_CORE_ACTIVE, NULL);
|
||||||
else
|
input_remapping_set_defaults(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (action_type == ACTION_OK_REMAP_FILE_REMOVE_GAME &&
|
||||||
|
rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL))
|
||||||
|
{
|
||||||
rarch_ctl(RARCH_CTL_UNSET_REMAPS_GAME_ACTIVE, NULL);
|
rarch_ctl(RARCH_CTL_UNSET_REMAPS_GAME_ACTIVE, NULL);
|
||||||
|
input_remapping_set_defaults(true);
|
||||||
|
}
|
||||||
|
|
||||||
runloop_msg_queue_push(
|
runloop_msg_queue_push(
|
||||||
msg_hash_to_str(MSG_REMAP_FILE_REMOVED_SUCCESSFULLY),
|
msg_hash_to_str(MSG_REMAP_FILE_REMOVED_SUCCESSFULLY),
|
||||||
|
|
|
@ -48,13 +48,7 @@
|
||||||
|
|
||||||
static int action_start_remap_file_load(unsigned type, const char *label)
|
static int action_start_remap_file_load(unsigned type, const char *label)
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
input_remapping_set_defaults(true);
|
||||||
|
|
||||||
if (!global)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
global->name.remapfile[0] = '\0';
|
|
||||||
input_remapping_set_defaults();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue