1
0
mirror of https://github.com/libretro/RetroArch synced 2025-03-03 04:14:00 +00:00

Fixups in libretro-test-gl.

This commit is contained in:
Themaister 2013-07-01 18:59:01 +02:00
parent 9af1bc3b3d
commit 22dd9e2894

@ -230,13 +230,15 @@ void retro_set_environment(retro_environment_t cb)
environ_cb = cb; environ_cb = cb;
struct retro_variable variables[] = { struct retro_variable variables[] = {
{ "resolution", {
"testgl_resolution",
#ifdef GLES #ifdef GLES
"Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768" }, "Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768",
#else #else
"Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768|1024x1024|1280x720|1280x960|1600x1200|1920x1080|1920x1440|1920x1600" }, "Internal resolution; 320x240|360x480|480x272|512x384|512x512|640x240|640x448|640x480|720x576|800x600|960x720|1024x768|1024x1024|1280x720|1280x960|1600x1200|1920x1080|1920x1440|1920x1600",
#endif #endif
{ NULL, NULL }, },
{ NULL, NULL },
}; };
bool no_rom = true; bool no_rom = true;
@ -273,24 +275,23 @@ static void update_variables(void)
{ {
struct retro_variable var; struct retro_variable var;
var.key = "resolution"; var.key = "testgl_resolution";
var.value = NULL; var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var)) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value)
{ {
char *pch; char *pch;
char str[100]; char str[100];
snprintf(str, sizeof(str), var.value); snprintf(str, sizeof(str), var.value);
pch = strtok(str, "x"); pch = strtok(str, "x");
if (pch)
width = strtoul(pch, NULL, 0);
pch = strtok(NULL, "x");
if (pch)
height = strtoul(pch, NULL, 0);
if (pch != NULL) fprintf(stderr, "[libretro-test]: Got size: %u x %u.\n", width, height);
width = atoi(pch);
pch = strtok(str, "x");
if (pch != NULL)
height = atoi(pch);
} }
} }