Commit 23c9f1ab authored by Libretro-Admin's avatar Libretro-Admin
Browse files

Add more framerate options

parent 8a229769
......@@ -62,7 +62,6 @@ extern qboolean noclip_anglehack;
//
extern quakeparms_t host_parms;
extern cvar_t sys_ticrate;
extern cvar_t sys_nostdout;
extern cvar_t developer;
......
......@@ -79,7 +79,6 @@ byte *host_colormap;
cvar_t host_framerate = { "host_framerate", "0" }; // set for slow motion
cvar_t host_speeds = { "host_speeds", "0" }; // set for running times
cvar_t sys_ticrate = { "sys_ticrate", "0.05" };
cvar_t serverprofile = { "serverprofile", "0" };
cvar_t fraglimit = { "fraglimit", "0", false, true };
......@@ -230,7 +229,6 @@ Host_InitLocal(void)
Cvar_RegisterVariable(&host_framerate);
Cvar_RegisterVariable(&host_speeds);
Cvar_RegisterVariable(&sys_ticrate);
Cvar_RegisterVariable(&serverprofile);
Cvar_RegisterVariable(&fraglimit);
......
......@@ -28,7 +28,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern quakeparms_t host_parms;
extern cvar_t sys_ticrate;
extern cvar_t sys_nostdout;
extern cvar_t developer;
......
......@@ -210,7 +210,7 @@ gp_layout_t classic_alt = {
gp_layout_t *gp_layoutp = NULL;
cvar_t framerate = { "framerate", "60", true };
unsigned framerate = 60;
static bool initial_resolution_set = false;
static int invert_y_axis = 1;
......@@ -495,7 +495,7 @@ void retro_get_system_info(struct retro_system_info *info)
void retro_get_system_av_info(struct retro_system_av_info *info)
{
info->timing.fps = framerate.value;
info->timing.fps = framerate;
info->timing.sample_rate = SAMPLERATE;
info->geometry.base_width = width;
......@@ -712,6 +712,14 @@ static void update_variables(bool startup)
{
struct retro_variable var;
var.key = "tyrquake_framerate";
var.value = NULL;
if (startup && environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var))
framerate = atoi(var.value);
else
framerate = 60;
var.key = "tyrquake_colored_lighting";
var.value = NULL;
......@@ -824,7 +832,7 @@ void retro_run(void)
if (!state_rumble)
retro_unset_rumble_strong();
Host_Frame(0.016667);
Host_Frame(1.0 / framerate);
if (shutdown_core)
return;
......@@ -1008,11 +1016,6 @@ bool retro_load_game(const struct retro_game_info *info)
return false;
}
Cvar_RegisterVariable(&framerate);
Cvar_Set("framerate", "60");
Cvar_Set("sys_ticrate", "0.016667");
/* Override some default binds with more modern ones if we are booting the
* game for the first time. */
snprintf(cfg_file, sizeof(cfg_file), "%s%cconfig.cfg", g_save_dir, slash);
......@@ -1276,7 +1279,7 @@ static void audio_process(void)
static void audio_callback(void)
{
unsigned read_first, read_second;
float samples_per_frame = (2 * SAMPLERATE) / framerate.value;
float samples_per_frame = (2 * SAMPLERATE) / framerate;
unsigned read_end = audio_buffer_ptr + samples_per_frame;
if (read_end > BUFFER_SIZE)
......
......@@ -67,6 +67,26 @@ struct retro_core_option_definition option_defs_us[] = {
},
"320x200"
},
{
"tyrquake_framerate",
"Framerate (restart)",
"Modify framerate. Requires a restart.",
{
{ "50", "50fps"},
{ "60", "60fps"},
{ "72", "72fps"},
{ "75", "75fps"},
{ "90", "90fps"},
{ "100", "100fps"},
{ "119", "119fps"},
{ "120", "120fps"},
{ "144", "144fps"},
{ "240", "240fps"},
{ "244", "244fps"},
{ NULL, NULL },
},
"60"
},
{
"tyrquake_colored_lighting",
"Colored lighting (restart)",
......
......@@ -1094,47 +1094,43 @@ M_OptionsVideo_AdjustSliders(int dir)
S_LocalSound("misc/menu3.wav");
switch (optionsvideo_cursor) {
case 0: // screen size
scr_viewsize.value += dir * 10;
if (scr_viewsize.value < 30)
scr_viewsize.value = 30;
if (scr_viewsize.value > 120)
scr_viewsize.value = 120;
Cvar_SetValue("viewsize", scr_viewsize.value);
break;
case 1: // gamma
v_gamma.value -= dir * 0.05;
if (v_gamma.value < 0.5)
v_gamma.value = 0.5;
if (v_gamma.value > 1)
v_gamma.value = 1;
Cvar_SetValue("gamma", v_gamma.value);
break;
case 3: // _windowed_mouse
Cvar_SetValue("_windowed_mouse", !_windowed_mouse.value);
break;
case 4:
cvar = Cvar_FindVar("dither_filter");
Cvar_SetValue("dither_filter", cvar->value ? 0.0f : 1.0f);
D_SetupFrame();
break;
case 5:
cvar = Cvar_FindVar("d_mipscale");
Cvar_SetValue("d_mipscale", cvar->value ? 0.0f : 1.0f);
break;
case 6:
cvar = Cvar_FindVar("r_lerpmodels");
Cvar_SetValue("r_lerpmodels", cvar->value ? 0.0f : 1.0f);
break;
case 7:
cvar = Cvar_FindVar("r_lerpmove");
Cvar_SetValue("r_lerpmove", cvar->value ? 0.0f : 1.0f);
break;
case 8:
cvar = Cvar_FindVar("framerate");
Cvar_SetValue("framerate", (cvar->value == 60) ? 50.0f : 60.0f);
break;
case 0: // screen size
scr_viewsize.value += dir * 10;
if (scr_viewsize.value < 30)
scr_viewsize.value = 30;
if (scr_viewsize.value > 120)
scr_viewsize.value = 120;
Cvar_SetValue("viewsize", scr_viewsize.value);
break;
case 1: // gamma
v_gamma.value -= dir * 0.05;
if (v_gamma.value < 0.5)
v_gamma.value = 0.5;
if (v_gamma.value > 1)
v_gamma.value = 1;
Cvar_SetValue("gamma", v_gamma.value);
break;
case 3: // _windowed_mouse
Cvar_SetValue("_windowed_mouse", !_windowed_mouse.value);
break;
case 4:
cvar = Cvar_FindVar("dither_filter");
Cvar_SetValue("dither_filter", cvar->value ? 0.0f : 1.0f);
D_SetupFrame();
break;
case 5:
cvar = Cvar_FindVar("d_mipscale");
Cvar_SetValue("d_mipscale", cvar->value ? 0.0f : 1.0f);
break;
case 6:
cvar = Cvar_FindVar("r_lerpmodels");
Cvar_SetValue("r_lerpmodels", cvar->value ? 0.0f : 1.0f);
break;
case 7:
cvar = Cvar_FindVar("r_lerpmove");
Cvar_SetValue("r_lerpmove", cvar->value ? 0.0f : 1.0f);
break;
}
}
......@@ -1182,13 +1178,6 @@ M_OptionsVideo_Draw(void)
M_Print(16, 88, " Smooth Movement");
M_DrawCheckbox(220, 88, cvar->value);
cvar = Cvar_FindVar("framerate");
M_Print(16,96, " Framerate");
if (cvar->value == 60)
M_Print(220,96, "60fps");
else
M_Print(220,96,"50fps");
// cursor
M_DrawCharacter(200, 32 + optionsvideo_cursor * 8,
12 + ((int)(realtime * 4) & 1));
......
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