hedgewars/hwengine.pas
changeset 6734 9709d15dabfa
parent 6700 e04da46ee43c
child 6863 4d1ce4b4f7c6
equal deleted inserted replaced
6733:5abbc345a82f 6734:9709d15dabfa
    49 
    49 
    50 ////////////////////////////////
    50 ////////////////////////////////
    51 procedure DoTimer(Lag: LongInt);
    51 procedure DoTimer(Lag: LongInt);
    52 var s: shortstring;
    52 var s: shortstring;
    53 begin
    53 begin
    54     if isPaused = false then
    54     inc(RealTicks, Lag);
    55         inc(RealTicks, Lag);
       
    56 
    55 
    57     case GameState of
    56     case GameState of
    58         gsLandGen:
    57         gsLandGen:
    59             begin
    58             begin
    60             GenMap;
    59             GenMap;
    86             end;
    85             end;
    87         gsConfirm, gsGame:
    86         gsConfirm, gsGame:
    88             begin
    87             begin
    89             DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible
    88             DrawWorld(Lag); // never place between ProcessKbd and DoGameTick - bugs due to /put cmd and isCursorVisible
    90             ProcessKbd;
    89             ProcessKbd;
    91             if not isPaused then
    90             DoGameTick(Lag);
    92                 begin
    91             ProcessVisualGears(Lag);
    93                 DoGameTick(Lag);
       
    94                 ProcessVisualGears(Lag);
       
    95                 end;
       
    96             end;
    92             end;
    97         gsChat:
    93         gsChat:
    98             begin
    94             begin
    99             DrawWorld(Lag);
    95             DrawWorld(Lag);
   100             if not isPaused then
    96             DoGameTick(Lag);
   101                 begin
    97             ProcessVisualGears(Lag);
   102                 DoGameTick(Lag);
       
   103                 ProcessVisualGears(Lag);
       
   104                 end;
       
   105             end;
    98             end;
   106         gsExit:
    99         gsExit:
   107             begin
   100             begin
   108             isTerminated:= true;
   101             isTerminated:= true;
   109             end;
   102             end;