better?
authornemo
Sat, 21 Jul 2012 17:51:51 -0400
changeset 7418 f611ee4760c0
parent 7416 2f2f78fc65a3
child 7420 77567b03cc28
child 7421 76772043ba7f
better?
hedgewars/uCommandHandlers.pas
hedgewars/uGame.pas
--- a/hedgewars/uCommandHandlers.pas	Sun Jul 22 00:48:48 2012 +0400
+++ b/hedgewars/uCommandHandlers.pas	Sat Jul 21 17:51:51 2012 -0400
@@ -653,7 +653,7 @@
 procedure chSpeedup_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
-SpeedStart:= GameTicks;
+SpeedStart:= RealTicks;
 isSpeed:= true
 end;
 
--- a/hedgewars/uGame.pas	Sun Jul 22 00:48:48 2012 +0400
+++ b/hedgewars/uGame.pas	Sat Jul 21 17:51:51 2012 -0400
@@ -26,7 +26,7 @@
 ////////////////////
     implementation
 ////////////////////
-uses Math, uInputHandler, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables{$IFDEF SDL13}, uTouch{$ENDIF};
+uses uInputHandler, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables{$IFDEF SDL13}, uTouch{$ENDIF};
 
 procedure DoGameTick(Lag: LongInt);
 var i: LongInt;
@@ -46,7 +46,14 @@
 
 if (GameType = gmtDemo) then 
     if isSpeed then
-        Lag:= Lag * max(min(round(((GameTicks-SpeedStart)+100)/5000),100),5)
+        begin
+            i:= RealTicks-SpeedStart;
+            if i < 2000 then Lag:= Lag*5
+            else if i < 4000 then Lag:= Lag*10
+            else if i < 6000 then Lag:= Lag*20
+            else if i < 8000 then Lag:= Lag*40
+            else Lag:= Lag*80;
+        end
     else
         if cOnlyStats then
             Lag:= High(LongInt);