Fix -L arg when default libretro is set.

This commit is contained in:
Themaister 2013-12-28 23:29:34 +01:00
parent 520589ed15
commit 7bd6599634
3 changed files with 5 additions and 2 deletions

View File

@ -356,6 +356,7 @@ struct global
bool has_set_save_path;
bool has_set_state_path;
bool has_set_libretro_device[MAX_PLAYERS];
bool has_set_libretro;
#ifdef HAVE_RMENU
char menu_texture_path[PATH_MAX];

View File

@ -793,6 +793,7 @@ static void parse_input(int argc, char *argv[])
g_extern.libretro_dummy = false;
g_extern.has_set_save_path = false;
g_extern.has_set_state_path = false;
g_extern.has_set_libretro = false;
if (argc < 2)
{
@ -1015,6 +1016,7 @@ static void parse_input(int argc, char *argv[])
#ifdef HAVE_DYNAMIC
case 'L':
strlcpy(g_settings.libretro, optarg, sizeof(g_settings.libretro));
g_extern.has_set_libretro = true;
break;
#endif

View File

@ -417,7 +417,7 @@ void config_set_defaults(void)
if (default_shader_dir)
fill_pathname_expand_special(g_settings.video.shader_dir, default_shader_dir, sizeof(g_settings.video.shader_dir));
if (default_libretro_path)
if (default_libretro_path && !g_extern.has_set_libretro)
fill_pathname_expand_special(g_settings.libretro, default_libretro_path, sizeof(g_settings.libretro));
if (default_libretro_info_path)
@ -800,7 +800,7 @@ bool config_load_file(const char *path)
CONFIG_GET_STRING(input.joypad_driver, "input_joypad_driver");
CONFIG_GET_STRING(input.keyboard_layout, "input_keyboard_layout");
if (!*g_settings.libretro)
if (!g_extern.has_set_libretro)
CONFIG_GET_PATH(libretro, "libretro_path");
CONFIG_GET_BOOL(fps_show, "fps_show");