]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
made timing even more reliable (now sleeps only as little as possible, and only if...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 1 Nov 2005 09:57:40 +0000 (09:57 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 1 Nov 2005 09:57:40 +0000 (09:57 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5785 d7cf8633-e32d-0410-b094-e92efae38249

host.c

diff --git a/host.c b/host.c
index 05bcd3ed8f4afde90eac8aa65ff6110971fd7a1b..ae8f61bee8b61e84efa16cb1a7fb531fa4975cb4 100644 (file)
--- a/host.c
+++ b/host.c
@@ -586,12 +586,17 @@ qboolean Host_FilterTime (double time)
        timeleft = timecap - (realtime - oldrealtime);
        if (timeleft > 0)
        {
+#if 1
+               if (timeleft * 1000 >= 10)
+                       Sys_Sleep(1);
+#else
                int msleft;
                // don't totally hog the CPU
                // try to hit exactly a steady framerate by not sleeping the full amount
                msleft = (int)floor(timeleft * 1000);
                if (msleft >= 10)
                        Sys_Sleep(msleft);
+#endif
                return false;
        }