unc0rr, let me know what you think? Values were chosen semi-arbitrarily. But I was playing through a lot of large demos.
authornemo
Fri, 20 Jul 2012 21:30:53 -0400 (2012-07-21)
changeset 7414 a9f18c66ce34
parent 7412 9e5aa3c8dc62
child 7416 2f2f78fc65a3
unc0rr, let me know what you think? Values were chosen semi-arbitrarily. But I was playing through a lot of large demos.
hedgewars/uCommandHandlers.pas
hedgewars/uGame.pas
hedgewars/uVariables.pas
--- a/hedgewars/uCommandHandlers.pas	Fri Jul 20 21:15:38 2012 -0400
+++ b/hedgewars/uCommandHandlers.pas	Fri Jul 20 21:30:53 2012 -0400
@@ -653,6 +653,7 @@
 procedure chSpeedup_p(var s: shortstring);
 begin
 s:= s; // avoid compiler hint
+SpeedStart:= GameTicks;
 isSpeed:= true
 end;
 
--- a/hedgewars/uGame.pas	Fri Jul 20 21:15:38 2012 -0400
+++ b/hedgewars/uGame.pas	Fri Jul 20 21:30:53 2012 -0400
@@ -26,7 +26,7 @@
 ////////////////////
     implementation
 ////////////////////
-uses uInputHandler, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables{$IFDEF SDL13}, uTouch{$ENDIF};
+uses Math, uInputHandler, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables{$IFDEF SDL13}, uTouch{$ENDIF};
 
 procedure DoGameTick(Lag: LongInt);
 var i: LongInt;
@@ -46,7 +46,7 @@
 
 if (GameType = gmtDemo) then 
     if isSpeed then
-        Lag:= Lag * 10
+        Lag:= Lag * max(min(round(((GameTicks-SpeedStart)+100)/5000),100),5)
     else
         if cOnlyStats then
             Lag:= High(LongInt);
--- a/hedgewars/uVariables.pas	Fri Jul 20 21:15:38 2012 -0400
+++ b/hedgewars/uVariables.pas	Fri Jul 20 21:30:53 2012 -0400
@@ -60,6 +60,7 @@
     isPaused        : boolean;
     isInMultiShoot  : boolean;
     isSpeed         : boolean;
+    SpeedStart      : LongWord;
 
     fastUntilLag    : boolean;
     autoCameraOn    : boolean;
@@ -2583,6 +2584,7 @@
     isPaused        := false;
     isInMultiShoot  := false;
     isSpeed         := false;
+    SpeedStart      := 0;
     fastUntilLag    := false;
     autoCameraOn    := true;
     cScriptName     := '';