Commit 12082ca6 authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Implement RETRO_ENVIRONMENT_GET_TARGET_REFRESH_RATE - by setting

framerate to auto it will use the specified refresh rate
parent 23c9f1ab
...@@ -210,7 +210,7 @@ gp_layout_t classic_alt = { ...@@ -210,7 +210,7 @@ gp_layout_t classic_alt = {
gp_layout_t *gp_layoutp = NULL; gp_layout_t *gp_layoutp = NULL;
unsigned framerate = 60; float framerate = 60.0f;
static bool initial_resolution_set = false; static bool initial_resolution_set = false;
static int invert_y_axis = 1; static int invert_y_axis = 1;
...@@ -716,9 +716,20 @@ static void update_variables(bool startup) ...@@ -716,9 +716,20 @@ static void update_variables(bool startup)
var.value = NULL; var.value = NULL;
if (startup && environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var)) if (startup && environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var))
framerate = atoi(var.value); {
if (!strcmp(var.value, "auto"))
{
float target_framerate = 0.0f;
if (!environ_cb(RETRO_ENVIRONMENT_GET_TARGET_REFRESH_RATE,
&target_framerate))
target_framerate = 60.0f;
framerate = target_framerate;
}
else
framerate = atof(var.value);
}
else else
framerate = 60; framerate = 60.0f;
var.key = "tyrquake_colored_lighting"; var.key = "tyrquake_colored_lighting";
var.value = NULL; var.value = NULL;
......
...@@ -72,6 +72,7 @@ struct retro_core_option_definition option_defs_us[] = { ...@@ -72,6 +72,7 @@ struct retro_core_option_definition option_defs_us[] = {
"Framerate (restart)", "Framerate (restart)",
"Modify framerate. Requires a restart.", "Modify framerate. Requires a restart.",
{ {
{ "auto", "Auto"},
{ "50", "50fps"}, { "50", "50fps"},
{ "60", "60fps"}, { "60", "60fps"},
{ "72", "72fps"}, { "72", "72fps"},
...@@ -85,7 +86,7 @@ struct retro_core_option_definition option_defs_us[] = { ...@@ -85,7 +86,7 @@ struct retro_core_option_definition option_defs_us[] = {
{ "244", "244fps"}, { "244", "244fps"},
{ NULL, NULL }, { NULL, NULL },
}, },
"60" "auto"
}, },
{ {
"tyrquake_colored_lighting", "tyrquake_colored_lighting",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment