Skip to content
Snippets Groups Projects
Commit 6e5e74b2 authored by Sal's avatar Sal Committed by Eidolon
Browse files

Allow FPS cap values

parent 0e1b01f2
Branches
No related tags found
No related merge requests found
...@@ -2076,9 +2076,10 @@ void CV_AddValue(consvar_t *var, INT32 increment) ...@@ -2076,9 +2076,10 @@ void CV_AddValue(consvar_t *var, INT32 increment)
{ {
increment = 0; increment = 0;
currentindice = max; currentindice = max;
break; // The value we definitely want, stop here.
} }
else if (var->PossibleValue[max].value == var->value) else if (var->PossibleValue[max].value == var->value)
currentindice = max; currentindice = max; // The value we maybe want.
} }
if (increment) if (increment)
......
...@@ -27,38 +27,33 @@ ...@@ -27,38 +27,33 @@
#endif #endif
static CV_PossibleValue_t fpscap_cons_t[] = { static CV_PossibleValue_t fpscap_cons_t[] = {
{-1, "Match refresh rate"},
{0, "Unlimited"},
#ifdef DEVELOP #ifdef DEVELOP
// Lower values are actually pretty useful for debugging interp problems! // Lower values are actually pretty useful for debugging interp problems!
{1, "One Singular Frame"}, {1, "MIN"},
{10, "10"}, #else
{20, "20"}, {TICRATE, "MIN"},
{25, "25"},
{30, "30"},
#endif #endif
{35, "35"}, {300, "MAX"},
{50, "50"}, {-1, "Unlimited"},
{60, "60"}, {0, "Match refresh rate"},
{70, "70"},
{75, "75"},
{90, "90"},
{100, "100"},
{120, "120"},
{144, "144"},
{200, "200"},
{240, "240"},
{0, NULL} {0, NULL}
}; };
consvar_t cv_fpscap = CVAR_INIT ("fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL); consvar_t cv_fpscap = CVAR_INIT ("fpscap", "Match refresh rate", CV_SAVE, fpscap_cons_t, NULL);
UINT32 R_GetFramerateCap(void) UINT32 R_GetFramerateCap(void)
{ {
if (cv_fpscap.value < 0) if (cv_fpscap.value == 0)
{ {
// 0: Match refresh rate
return I_GetRefreshRate(); return I_GetRefreshRate();
} }
if (cv_fpscap.value < 0)
{
// -1: Unlimited
return 0;
}
return cv_fpscap.value; return cv_fpscap.value;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment