mirror of
https://git.code.sf.net/p/quake/nuq
synced 2024-11-24 21:12:07 +00:00
Apply fps patch from Timothy C. McGrath that brings sw show_fps from newtree to
nuq.
This commit is contained in:
parent
0808c65d17
commit
20854c0f2f
1 changed files with 28 additions and 0 deletions
|
@ -422,6 +422,33 @@ void SCR_DrawNet (void)
|
|||
Draw_Pic (scr_vrect.x+64, scr_vrect.y, scr_net);
|
||||
}
|
||||
|
||||
void SCR_DrawFPS (void)
|
||||
{
|
||||
extern cvar_t *show_fps;
|
||||
static double lastframetime;
|
||||
double t;
|
||||
extern int fps_count;
|
||||
static int lastfps;
|
||||
int x, y;
|
||||
char st[80];
|
||||
|
||||
if (!show_fps->value)
|
||||
return;
|
||||
|
||||
t = Sys_DoubleTime();
|
||||
if ((t - lastframetime) >= 1.0) {
|
||||
lastfps = fps_count;
|
||||
fps_count = 0;
|
||||
lastframetime = t;
|
||||
}
|
||||
|
||||
sprintf(st, "%3d FPS", lastfps);
|
||||
x = vid.width - strlen(st) * 8 - 8;
|
||||
y = vid.height - sb_lines - 8;
|
||||
Draw_String8 (x, y, st);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============
|
||||
DrawPause
|
||||
|
@ -962,6 +989,7 @@ void SCR_UpdateScreen (void)
|
|||
SCR_DrawNet ();
|
||||
SCR_DrawTurtle ();
|
||||
SCR_DrawPause ();
|
||||
SCR_DrawFPS ();
|
||||
SCR_CheckDrawCenterString ();
|
||||
Sbar_Draw ();
|
||||
SCR_DrawConsole ();
|
||||
|
|
Loading…
Reference in a new issue