Kart v1.0/srb2 styled fps counter option

this was so much pain for whatever reason lmao
This commit is contained in:
Alug committed 2023-12-21 13:41:13 +01:00
1 parent bccc79fe4b
commit ea3fc8f526
4 files changed
+52 -29

No files matched your search

-1
View File
@@ -488,7 +488,6 @@ consvar_t cv_pingicon = {"pingicon", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL,
static CV_PossibleValue_t cv_pingstyle_cons_t[] = {{0, "New"}, {1, "Old"}, {0, NULL}};
consvar_t cv_pingstyle = {"pingstyle", "New", CV_SAVE, cv_pingstyle_cons_t, 0, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_luaimmersion = {"luaimmersion", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_minihead = {"smallminimapplayers", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+1 -1
View File
@@ -1392,7 +1392,7 @@ static const char* OP_VideoTooltips[] =
"How far away weather is drawn.",
"Toggle being able to see the sky.",
"Player field of view.",
"Show current game framerate.",
"Show current game framerate and select the style.",
"Sync game framerate to refresh rate of monitor.",
"Set manual framerate cap.",
"Size of drift spark pulse.",
+50 -26
View File
@@ -429,41 +429,65 @@ void SCR_DisplayTicRate(void)
INT32 x = 318;
double fps = round(averageFPS);
INT32 fpsflags = SCR_FPSflags();
const char *fps_string;
INT32 ticcntcolor2 = 0;
if (gamestate == GS_NULL)
return;
// draw "FPS"
if (cv_ticrate.value == 1)
V_DrawFixedPatch(306<<FRACBITS, 183<<FRACBITS, FRACUNIT, fpsflags, framecounter, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE));
if (fps > (benchmark - 5))
ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE);
else if (fps < 20)
ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
if (cap != 0)
// new kart counter
if ((cv_ticrate.value == 1) || (cv_ticrate.value == 2))
{
UINT32 digits = 1;
UINT32 c2 = cap;
// draw "FPS"
if (cv_ticrate.value == 1)
V_DrawFixedPatch(306<<FRACBITS, 183<<FRACBITS, FRACUNIT, fpsflags, framecounter, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_YELLOW, GTC_CACHE));
if (fps > (benchmark - 5))
ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_MINT, GTC_CACHE);
else if (fps < 20)
ticcntcolor = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
while (c2 > 0)
if (cap != 0)
{
c2 = c2 / 10;
digits++;
UINT32 digits = 1;
UINT32 c2 = cap;
while (c2 > 0)
{
c2 = c2 / 10;
digits++;
}
// draw total frame:
V_DrawPingNum(x, 190, fpsflags, cap, ticcntcolor);
x -= digits * 4;
// draw "/"
V_DrawFixedPatch(x<<FRACBITS, 190<<FRACBITS, FRACUNIT, fpsflags, frameslash, ticcntcolor);
}
// draw total frame:
V_DrawPingNum(x, 190, fpsflags, cap, ticcntcolor);
x -= digits * 4;
// draw "/"
V_DrawFixedPatch(x<<FRACBITS, 190<<FRACBITS, FRACUNIT, fpsflags, frameslash, ticcntcolor);
// draw our actual framerate
V_DrawPingNum(x, 190, fpsflags, fps, ticcntcolor);
}
else if ((cv_ticrate.value == 3)||(cv_ticrate.value == 4)) // kart v1.0/srb2 counter
{
if (fps > (benchmark - 5))
ticcntcolor2 = V_GREENMAP;
else if (fps < 20)
ticcntcolor2 = V_REDMAP;
// draw our actual framerate
V_DrawPingNum(x, 190, fpsflags, fps, ticcntcolor);
if (cap != 0)
fps_string = va("%d/%d\x82", (INT32)fps, cap);
else
fps_string = va("%d\x82", (INT32)fps);
if (cv_ticrate.value == 3)
V_DrawRightAlignedString(319, 181, V_YELLOWMAP|fpsflags, "FPS");
V_DrawRightAlignedString(319, 190, ticcntcolor2|fpsflags, fps_string);
}
}
// SCR_DisplayLocalPing
@@ -476,8 +500,8 @@ void SCR_DisplayLocalPing(void)
if (cv_showping.value == 1 || (cv_showping.value == 2 && ping > servermaxping)) // only show 2 (warning) if our ping is at a bad level
{
INT32 dispy = (cv_ticrate.value == 1) ? 165 : ((cv_ticrate.value == 2) ? 172 : 181);
INT32 dispy = (cv_ticrate.value == 1) ? 165 : ((cv_ticrate.value == 2 || cv_ticrate.value == 4) ? 172 : ((cv_ticrate.value == 3) ? 163 : 181)); // absolute buttpain
HU_drawPing(308, dispy, ping, fpsflags);
}
}
+1 -1
View File
@@ -42,7 +42,7 @@ UINT8 *screens[5];
static CV_PossibleValue_t gamma_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NULL}};
static void CV_usegamma_OnChange(void);
static CV_PossibleValue_t fps_cons_t[] = {{0, "No"}, {1, "Normal"}, {2, "Compact"}, {0, NULL}};
static CV_PossibleValue_t fps_cons_t[] = {{0, "No"}, {1, "Normal"}, {2, "Compact"}, {3, "Old"}, {4, "Old Compact"}, {0, NULL}};
consvar_t cv_ticrate = {"showfps", "No", CV_SAVE, fps_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usegamma = {"gamma", "0", CV_SAVE|CV_CALL, gamma_cons_t, CV_usegamma_OnChange, 0, NULL, NULL, 0, 0, NULL};