Merge pull request #209 from dnlopez/master

In SDL version command line, don't look for depth in -resolution
This commit is contained in:
R. Belmont 2015-06-27 11:49:38 -04:00
commit 154cd29ec1
2 changed files with 13 additions and 2 deletions

View File

@ -756,6 +756,11 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con
data = defdata;
}
if (sscanf(data, "%dx%dx%d@%d", &config->width, &config->height, &config->depth, &config->refresh) < 2 && report_error)
if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error)
osd_printf_error("Illegal resolution value = %s\n", data);
const char * at_pos = strchr(data, '@');
if (at_pos)
if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error)
osd_printf_error("Illegal refresh rate in resolution value = %s\n", data);
}

View File

@ -508,6 +508,12 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con
return;
data = defdata;
}
if (sscanf(data, "%dx%d@%d", &config->width, &config->height, &config->refresh) < 2 && report_error)
if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error)
osd_printf_error("Illegal resolution value = %s\n", data);
const char * at_pos = strchr(data, '@');
if (at_pos)
if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error)
osd_printf_error("Illegal refresh rate in resolution value = %s\n", data);
}