hedgewars/uGame.pas
changeset 7418 f611ee4760c0
parent 7414 a9f18c66ce34
child 7442 9bb6abdb5675
equal deleted inserted replaced
7416:2f2f78fc65a3 7418:f611ee4760c0
    24 procedure DoGameTick(Lag: LongInt);
    24 procedure DoGameTick(Lag: LongInt);
    25 
    25 
    26 ////////////////////
    26 ////////////////////
    27     implementation
    27     implementation
    28 ////////////////////
    28 ////////////////////
    29 uses Math, uInputHandler, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables{$IFDEF SDL13}, uTouch{$ENDIF};
    29 uses uInputHandler, uTeams, uIO, uAI, uGears, uSound, uMobile, uVisualGears, uTypes, uVariables{$IFDEF SDL13}, uTouch{$ENDIF};
    30 
    30 
    31 procedure DoGameTick(Lag: LongInt);
    31 procedure DoGameTick(Lag: LongInt);
    32 var i: LongInt;
    32 var i: LongInt;
    33 begin
    33 begin
    34 if isPaused then
    34 if isPaused then
    44 else if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then
    44 else if (GameType = gmtSave) or (fastUntilLag and (GameType = gmtNet)) then
    45     Lag:= 2500;
    45     Lag:= 2500;
    46 
    46 
    47 if (GameType = gmtDemo) then 
    47 if (GameType = gmtDemo) then 
    48     if isSpeed then
    48     if isSpeed then
    49         Lag:= Lag * max(min(round(((GameTicks-SpeedStart)+100)/5000),100),5)
    49         begin
       
    50             i:= RealTicks-SpeedStart;
       
    51             if i < 2000 then Lag:= Lag*5
       
    52             else if i < 4000 then Lag:= Lag*10
       
    53             else if i < 6000 then Lag:= Lag*20
       
    54             else if i < 8000 then Lag:= Lag*40
       
    55             else Lag:= Lag*80;
       
    56         end
    50     else
    57     else
    51         if cOnlyStats then
    58         if cOnlyStats then
    52             Lag:= High(LongInt);
    59             Lag:= High(LongInt);
    53 PlayNextVoice;
    60 PlayNextVoice;
    54 i:= 1;
    61 i:= 1;