mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-25 13:21:36 +00:00
Try to fix up fps rates reported by ezhud.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5942 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
61b13c7b8e
commit
14dddfd63c
1 changed files with 25 additions and 23 deletions
|
@ -554,31 +554,8 @@ vrect_t scr_vrect;
|
||||||
|
|
||||||
void EZHud_Tick(double realtime, double gametime)
|
void EZHud_Tick(double realtime, double gametime)
|
||||||
{
|
{
|
||||||
static float lasttime, lasttime_min = 99999;
|
|
||||||
static int framecount;
|
|
||||||
|
|
||||||
//realtime(ms), realtime(secs), servertime
|
|
||||||
float oldtime = cls.realtime;
|
|
||||||
cls.realtime = realtime;
|
cls.realtime = realtime;
|
||||||
cls.frametime = cls.realtime - oldtime;
|
|
||||||
|
|
||||||
cl.time = gametime;
|
cl.time = gametime;
|
||||||
|
|
||||||
if (cls.realtime - lasttime > 1)
|
|
||||||
{
|
|
||||||
cls.fps = framecount/(cls.realtime - lasttime);
|
|
||||||
lasttime = cls.realtime;
|
|
||||||
framecount = 0;
|
|
||||||
|
|
||||||
if (cls.realtime - lasttime_min > 30)
|
|
||||||
{
|
|
||||||
cls.min_fps = cls.fps;
|
|
||||||
lasttime_min = cls.realtime;
|
|
||||||
}
|
|
||||||
else if (cls.min_fps > cls.fps)
|
|
||||||
cls.min_fps = cls.fps;
|
|
||||||
}
|
|
||||||
framecount++;
|
|
||||||
}
|
}
|
||||||
char *findinfo(char *info, char *findkey)
|
char *findinfo(char *info, char *findkey)
|
||||||
{
|
{
|
||||||
|
@ -630,6 +607,31 @@ int EZHud_Draw(int seat, float viewx, float viewy, float viewwidth, float viewhe
|
||||||
char serverinfo[4096];
|
char serverinfo[4096];
|
||||||
char val[64];
|
char val[64];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
static float lasttime, lasttime_min = 99999;
|
||||||
|
static int framecount;
|
||||||
|
static float oldtime;
|
||||||
|
if (cls.realtime - lasttime > 1)
|
||||||
|
{
|
||||||
|
cls.fps = framecount/(cls.realtime - lasttime);
|
||||||
|
lasttime = cls.realtime;
|
||||||
|
framecount = 0;
|
||||||
|
|
||||||
|
if (cls.realtime - lasttime_min > 30)
|
||||||
|
{
|
||||||
|
cls.min_fps = cls.fps;
|
||||||
|
lasttime_min = cls.realtime;
|
||||||
|
}
|
||||||
|
else if (cls.min_fps > cls.fps)
|
||||||
|
cls.min_fps = cls.fps;
|
||||||
|
}
|
||||||
|
if (!seat)
|
||||||
|
{
|
||||||
|
cls.frametime = cls.realtime - oldtime;
|
||||||
|
framecount++;
|
||||||
|
oldtime = cls.realtime;
|
||||||
|
}
|
||||||
|
|
||||||
cl.splitscreenview = seat;
|
cl.splitscreenview = seat;
|
||||||
scr_vrect.x = viewx;
|
scr_vrect.x = viewx;
|
||||||
scr_vrect.y = viewy;
|
scr_vrect.y = viewy;
|
||||||
|
|
Loading…
Reference in a new issue