hedgewars/uSound.pas
changeset 14074 38eb5937169e
parent 14063 006f97a6f6a7
child 14089 859a41b137d4
equal deleted inserted replaced
14073:9c817b2eedae 14074:38eb5937169e
   548 begin
   548 begin
   549     PlaySoundV:= PlaySoundV(snd, voicepack, keepPlaying, ignoreMask, false);
   549     PlaySoundV:= PlaySoundV(snd, voicepack, keepPlaying, ignoreMask, false);
   550 end;
   550 end;
   551 
   551 
   552 function PlaySoundV(snd: TSound; voicepack: PVoicepack; keepPlaying, ignoreMask, soundAsMusic: boolean): boolean;
   552 function PlaySoundV(snd: TSound; voicepack: PVoicepack; keepPlaying, ignoreMask, soundAsMusic: boolean): boolean;
   553 var s:shortstring;
   553 var s: shortstring;
       
   554 tempSnd: TSound;
   554 rwops: PSDL_RWops;
   555 rwops: PSDL_RWops;
   555 begin
   556 begin
   556     s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   557     s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   557     PlaySoundV:= false;
   558     PlaySoundV:= false;
   558     if ((not isSoundEnabled) and (not (soundAsMusic and isMusicEnabled))) or fastUntilLag then
   559     if ((not isSoundEnabled) and (not (soundAsMusic and isMusicEnabled))) or fastUntilLag then
   570             begin
   571             begin
   571             s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   572             s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   572             // Fallback taunts
   573             // Fallback taunts
   573             if (not pfsExists(s)) then
   574             if (not pfsExists(s)) then
   574                 begin
   575                 begin
   575                 snd := GetFallbackV(snd);
   576                 tempSnd := GetFallbackV(snd);
   576                 if snd = sndNone then
   577                 if tempSnd <> sndNone then
   577                     exit;
   578                     snd := tempSnd;
   578                 s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   579                 s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   579                 end;
   580                 end;
   580             WriteToConsole(msgLoading + s + ' ');
   581             WriteToConsole(msgLoading + s + ' ');
   581             rwops := rwopsOpenRead(s);
   582             rwops := rwopsOpenRead(s);
   582 
   583