]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
changed now showfps calculates the fps - hopefully an improvement
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Feb 2008 14:09:14 +0000 (14:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 14 Feb 2008 14:09:14 +0000 (14:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8086 d7cf8633-e32d-0410-b094-e92efae38249

sbar.c

diff --git a/sbar.c b/sbar.c
index ef7a0bcbe692ccb4f8b18ea1ee8e3dfd4542f865..e493b6ddcb708bfdb73dd0982bbd4cef77b24337 100644 (file)
--- 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++;