From 6658817fbe236cec63fbd07f3ff5d18ff2b324f6 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 14 Feb 2008 14:09:14 +0000 Subject: [PATCH] changed now showfps calculates the fps - hopefully an improvement git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8086 d7cf8633-e32d-0410-b094-e92efae38249 --- sbar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbar.c b/sbar.c index ef7a0bcb..e493b6dd 100644 --- a/sbar.c +++ b/sbar.c @@ -1057,13 +1057,16 @@ void Sbar_ShowFPS(void) static double nexttime = 0, lasttime = 0; static double framerate = 0; static int framecount = 0; + double interval = 0.25; double newtime; newtime = realtime; if (newtime >= nexttime) { framerate = framecount / (newtime - lasttime); + if (nexttime < newtime - interval * 1.5) + nexttime = newtime; lasttime = newtime; - nexttime = max(nexttime + 1, lasttime - 1); + nexttime += interval; framecount = 0; } framecount++; -- 2.39.2