Merge pull request #5434 from fr500/master

Clean remaps on deinit
This commit is contained in:
Andrés 2017-09-12 01:54:58 -05:00 committed by GitHub
commit 049d69f9cc
2 changed files with 18 additions and 8 deletions

View File

@ -1015,6 +1015,7 @@ static void command_event_init_controllers(void)
RARCH_LOG("%s %u.\n",
msg_hash_to_str(MSG_VALUE_DISCONNECTING_DEVICE_FROM_PORT),
i + 1);
set_controller = true;
break;
case RETRO_DEVICE_JOYPAD:
break;
@ -1023,14 +1024,18 @@ static void command_event_init_controllers(void)
* This is broken behavior of course, but avoid breaking
* cores needlessly. */
RARCH_LOG("%s %u: %s (ID: %u).\n",
msg_hash_to_str(MSG_CONNECTING_TO_PORT),
device, ident, i+1);
msg_hash_to_str(MSG_CONNECTING_TO_PORT),
device, ident, i+1);
set_controller = true;
break;
}
pad.device = device;
pad.port = i;
core_set_controller_port_device(&pad);
if (set_controller)
{
pad.device = device;
pad.port = i;
core_set_controller_port_device(&pad);
}
}
}

View File

@ -252,10 +252,15 @@ void input_remapping_set_defaults(bool deinit)
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
if (!global)
return;
if (!global)
return;
global->name.remapfile[0] = '\0';
if (deinit)
{
global->name.remapfile[0] = '\0';
rarch_ctl(RARCH_CTL_UNSET_REMAPS_CORE_ACTIVE, NULL);
rarch_ctl(RARCH_CTL_UNSET_REMAPS_GAME_ACTIVE, NULL);
}
for (i = 0; i < MAX_USERS; i++)
{