]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
cl_main: Slight refactor
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 13 Apr 2021 16:31:44 +0000 (16:31 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 13 Apr 2021 16:31:44 +0000 (16:31 +0000)
Authored by bones_was_here and Cloudwalk
https://gitlab.com/xonotic/darkplaces/-/merge_requests/116

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13124 d7cf8633-e32d-0410-b094-e92efae38249

cl_main.c

index 7ecf1bf800c53e0d1beb286d4d84f3e038b28502..c55c543e3537e2d48470b840016e3148f56c5564 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -2753,7 +2753,6 @@ double CL_Frame (double time)
        static double clframetime;
        static double cl_timer = 0;
        static double time1 = 0, time2 = 0, time3 = 0;
-       static double wait;
        int pass1, pass2, pass3;
 
        CL_VM_PreventInformationLeaks();
@@ -2796,9 +2795,8 @@ double CL_Frame (double time)
                {
                        clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxfps.value);
                        // when running slow, we need to sleep to keep input responsive
-                       wait = bound(0, cl_maxfps_alwayssleep.value * 1000, 100000);
-                       if (wait > 0)
-                               Sys_Sleep((int)wait);
+                       if (cl_maxfps_alwayssleep.value > 0)
+                               Sys_Sleep((int)bound(0, cl_maxfps_alwayssleep.value * 1000, 100000));
                }
                else if (!vid_activewindow && cl_maxidlefps.value >= 1 && !cls.timedemo)
                        clframetime = cl.realframetime = max(cl_timer, 1.0 / cl_maxidlefps.value);