hedgewars/uGame.pas
changeset 13776 f26c9e931f5a
parent 13647 3d14950641a4
equal deleted inserted replaced
13775:baf15d31cd42 13776:f26c9e931f5a
    33 procedure DoGameTick(Lag: LongInt);
    33 procedure DoGameTick(Lag: LongInt);
    34 const maxCheckedGameDuration = 3*60*60*1000;
    34 const maxCheckedGameDuration = 3*60*60*1000;
    35 var i,j : LongInt;
    35 var i,j : LongInt;
    36     s: ansistring;
    36     s: ansistring;
    37 begin
    37 begin
       
    38 
       
    39 inc(SoundTimerTicks, Lag);
       
    40 if SoundTimerTicks >= 50 then
       
    41     begin
       
    42     SoundTimerTicks:= 0;
       
    43     if cVolumeDelta <> 0 then
       
    44         begin
       
    45         j:= Volume;
       
    46         i:= ChangeVolume(cVolumeDelta);
       
    47         if (not cIsSoundEnabled) or (isAudioMuted and (j<>i)) then
       
    48             AddCaption(trmsg[sidMute], capcolSetting, capgrpVolume)
       
    49         else if not isAudioMuted then
       
    50             begin
       
    51             s:= ansistring(inttostr(i));
       
    52             AddCaption(FormatA(trmsg[sidVolume], s), capcolSetting, capgrpVolume)
       
    53             end
       
    54         end
       
    55     else if cMuteToggle then
       
    56         begin
       
    57         MuteAudio;
       
    58         if isAudioMuted then
       
    59             AddCaption(trmsg[sidMute], capcolSetting, capgrpVolume)
       
    60         else
       
    61             begin
       
    62             s:= ansistring(inttostr(GetVolumePercent()));
       
    63             AddCaption(FormatA(trmsg[sidVolume], s), capcolSetting, capgrpVolume);
       
    64             end;
       
    65         cMuteToggle:= false;
       
    66         end;
       
    67     end;
       
    68 
    38 if isPaused then
    69 if isPaused then
    39     exit;
    70     exit;
    40 
    71 
    41 if (not CurrentTeam^.ExtDriven) then
    72 if (not CurrentTeam^.ExtDriven) then
    42     begin
    73     begin
    76     end;
   107     end;
    77 
   108 
    78 if cTestLua then
   109 if cTestLua then
    79     Lag:= High(LongInt);
   110     Lag:= High(LongInt);
    80 
   111 
    81 inc(SoundTimerTicks, Lag);
       
    82 if SoundTimerTicks >= 50 then
       
    83     begin
       
    84     SoundTimerTicks:= 0;
       
    85     if cVolumeDelta <> 0 then
       
    86         begin
       
    87         j:= Volume;
       
    88         i:= ChangeVolume(cVolumeDelta);
       
    89         if (not cIsSoundEnabled) or (isAudioMuted and (j<>i)) then
       
    90             AddCaption(trmsg[sidMute], capcolSetting, capgrpVolume)
       
    91         else if not isAudioMuted then
       
    92             begin
       
    93             s:= ansistring(inttostr(i));
       
    94             AddCaption(FormatA(trmsg[sidVolume], s), capcolSetting, capgrpVolume)
       
    95             end
       
    96         end
       
    97     else if cMuteToggle then
       
    98         begin
       
    99         MuteAudio;
       
   100         if isAudioMuted then
       
   101             AddCaption(trmsg[sidMute], capcolSetting, capgrpVolume)
       
   102         else
       
   103             begin
       
   104             s:= ansistring(inttostr(GetVolumePercent()));
       
   105             AddCaption(FormatA(trmsg[sidVolume], s), capcolSetting, capgrpVolume);
       
   106             end;
       
   107         cMuteToggle:= false;
       
   108         end;
       
   109     end;
       
   110 PlayNextVoice;
   112 PlayNextVoice;
   111 i:= 1;
   113 i:= 1;
   112 while (GameState <> gsExit) and (i <= Lag) and allOK do
   114 while (GameState <> gsExit) and (i <= Lag) and allOK do
   113     begin
   115     begin
   114     if not CurrentTeam^.ExtDriven then
   116     if not CurrentTeam^.ExtDriven then