mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-13 22:33:32 +00:00
Misc changes after Kart cherry-picks
This commit is contained in:
parent
c186d6402b
commit
a56a57b3d1
2 changed files with 30 additions and 12 deletions
10
src/m_menu.c
10
src/m_menu.c
|
@ -1381,13 +1381,13 @@ static menuitem_t OP_VideoOptionsMenu[] =
|
||||||
|
|
||||||
{IT_HEADER, NULL, "Diagnostic", NULL, 184},
|
{IT_HEADER, NULL, "Diagnostic", NULL, 184},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 190},
|
{IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 190},
|
||||||
{IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 195},
|
{IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 195},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Clear Before Redraw", &cv_homremoval, 200},
|
{IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 200},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 205},
|
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
{IT_HEADER, NULL, "Renderer", NULL, 213},
|
{IT_HEADER, NULL, "Renderer", NULL, 208},
|
||||||
{IT_CALL | IT_STRING, NULL, "OpenGL Options...", M_OpenGLOptionsMenu, 219},
|
{IT_CALL | IT_STRING, NULL, "OpenGL Options...", M_OpenGLOptionsMenu, 214},
|
||||||
|
{IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 219},
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
32
src/screen.c
32
src/screen.c
|
@ -451,7 +451,6 @@ boolean SCR_IsAspectCorrect(INT32 width, INT32 height)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static tic_t totaltics;
|
|
||||||
double averageFPS = 0.0f;
|
double averageFPS = 0.0f;
|
||||||
|
|
||||||
#define FPS_SAMPLE_RATE (50000) // How often to update FPS samples, in microseconds
|
#define FPS_SAMPLE_RATE (50000) // How often to update FPS samples, in microseconds
|
||||||
|
@ -515,18 +514,37 @@ void SCR_DisplayTicRate(void)
|
||||||
if (gamestate == GS_NULL)
|
if (gamestate == GS_NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (totaltics <= cap/2) ticcntcolor = V_REDMAP;
|
if (cap > 0)
|
||||||
else if (totaltics >= cap) ticcntcolor = V_GREENMAP;
|
{
|
||||||
|
if (fps <= cap / 2.0) ticcntcolor = V_REDMAP;
|
||||||
|
else if (fps <= cap * 0.90) ticcntcolor = V_YELLOWMAP;
|
||||||
|
else ticcntcolor = V_GREENMAP;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ticcntcolor = V_GREENMAP;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (cv_ticrate.value == 2) // compact counter
|
if (cv_ticrate.value == 2) // compact counter
|
||||||
V_DrawString(vid.width-(32*vid.dupx), h,
|
V_DrawString(vid.width-(32*vid.dupx), h,
|
||||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%04.0f", fps));
|
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%04.0f", fps));
|
||||||
else if (cv_ticrate.value == 1) // full counter
|
else if (cv_ticrate.value == 1) // full counter
|
||||||
{
|
{
|
||||||
V_DrawString(vid.width-(104*vid.dupx), h,
|
if (cap > 0)
|
||||||
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
{
|
||||||
V_DrawString(vid.width-(72*vid.dupx), h,
|
V_DrawString(vid.width-(104*vid.dupx), h,
|
||||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%4.0f/%4u", fps, cap));
|
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
||||||
|
V_DrawString(vid.width-(72*vid.dupx), h,
|
||||||
|
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%4.0f/%4u", fps, cap));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
V_DrawString(vid.width-(88*vid.dupx), h,
|
||||||
|
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
||||||
|
V_DrawString(vid.width-(56*vid.dupx), h,
|
||||||
|
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%4.0f", fps));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue