]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fixed two timing flaws where cl.realframetime was used instead of (cl.time - cl.oldti...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Apr 2007 04:27:17 +0000 (04:27 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 4 Apr 2007 04:27:17 +0000 (04:27 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7039 d7cf8633-e32d-0410-b094-e92efae38249

cl_screen.c
snd_main.c

index d53b012cfcb881159ac586729b02c13be8d97636..68c06cf97a4ea8a5cf61e95146c03e4b4285208c 100644 (file)
@@ -168,7 +168,8 @@ void SCR_CheckDrawCenterString (void)
        if (scr_center_lines > scr_erase_lines)
                scr_erase_lines = scr_center_lines;
 
-       scr_centertime_off -= cl.realframetime;
+       if (cl.time > cl.oldtime)
+               scr_centertime_off -= cl.time - cl.oldtime;
 
        // don't draw if this is a normal stats-screen intermission,
        // only if it is not an intermission, or a finale intermission
index de35456303da36b494bae541e712efdfc45eb72b..0462d38046de448489b1a4bd4a2970375f096e90 100644 (file)
@@ -1403,17 +1403,20 @@ void S_UpdateAmbientSounds (void)
 
                // Don't adjust volume too fast
                // FIXME: this rounds off to an int each frame, meaning there is little to no fade at extremely high framerates!
-               if (chan->master_vol < vol)
+               if (cl.time > cl.oldtime)
                {
-                       chan->master_vol += (int)(cl.realframetime * ambient_fade.value);
-                       if (chan->master_vol > vol)
-                               chan->master_vol = vol;
-               }
-               else if (chan->master_vol > vol)
-               {
-                       chan->master_vol -= (int)(cl.realframetime * ambient_fade.value);
                        if (chan->master_vol < vol)
-                               chan->master_vol = vol;
+                       {
+                               chan->master_vol += (int)((cl.time - cl.oldtime) * ambient_fade.value);
+                               if (chan->master_vol > vol)
+                                       chan->master_vol = vol;
+                       }
+                       else if (chan->master_vol > vol)
+                       {
+                               chan->master_vol -= (int)((cl.time - cl.oldtime) * ambient_fade.value);
+                               if (chan->master_vol < vol)
+                                       chan->master_vol = vol;
+                       }
                }
 
                for (i = 0;i < SND_LISTENERS;i++)