Move some code

This commit is contained in:
twinaphex 2016-01-27 19:45:54 +01:00
parent 3b38e2fe4c
commit 3728240162
2 changed files with 12 additions and 9 deletions

View File

@ -564,11 +564,18 @@ static bool event_init_content(void)
return true;
}
static bool event_init_core(void)
static bool event_init_core(void *data)
{
retro_ctx_environ_info_t info;
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
global_t *global = global_get_ptr();
settings_t *settings = config_get_ptr();
enum rarch_core_type *core_type = (enum rarch_core_type*)data;
if (!core_type)
return false;
init_libretro_sym(*core_type);
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_INIT, NULL);
/* auto overrides: apply overrides */
if(settings->auto_overrides_enable)
@ -1270,10 +1277,8 @@ bool event_cmd_ctl(enum event_command cmd, void *data)
break;
}
case EVENT_CMD_CORE_INIT:
if (!event_init_core())
{
if (!event_init_core(data))
return false;
}
break;
case EVENT_CMD_VIDEO_APPLY_STATE_CHANGES:
video_driver_ctl(RARCH_DISPLAY_CTL_APPLY_STATE_CHANGES, NULL);

View File

@ -1266,9 +1266,7 @@ int rarch_main_init(int argc, char *argv[])
}
driver_ctl(RARCH_DRIVER_CTL_INIT_PRE, NULL);
init_libretro_sym(current_core_type);
runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_INIT, NULL);
if (!event_cmd_ctl(EVENT_CMD_CORE_INIT, NULL))
if (!event_cmd_ctl(EVENT_CMD_CORE_INIT, &current_core_type))
goto error;
event_cmd_ctl(EVENT_CMD_DRIVERS_INIT, NULL);