hedgewars/uSound.pas
changeset 2744 803d0142594e
parent 2716 b9ca1bfca24f
child 2745 11fce231f24a
equal deleted inserted replaced
2743:39d097ac2276 2744:803d0142594e
   154 
   154 
   155 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
   155 procedure PlaySound(snd: TSound; infinite: boolean; voicepack: PVoicepack);
   156 var loops: LongInt;
   156 var loops: LongInt;
   157 begin
   157 begin
   158 if (not isSoundEnabled) or fastUntilLag then exit;
   158 if (not isSoundEnabled) or fastUntilLag then exit;
       
   159 if infinite and (lastChan[snd] <> -1) then exit;
   159 if infinite then loops:= -1 else loops:= 0;
   160 if infinite then loops:= -1 else loops:= 0;
   160 
   161 
   161 if (voicepack <> nil) and (voicepack^.chunks[snd] <> nil) then
   162 if (voicepack <> nil) and (voicepack^.chunks[snd] <> nil) then
   162 	lastChan[snd]:= Mix_PlayChannelTimed(-1, voicepack^.chunks[snd], loops, -1)
   163 	lastChan[snd]:= Mix_PlayChannelTimed(-1, voicepack^.chunks[snd], loops, -1)
   163 else
   164 else