hedgewars/uSound.pas
branchwebgl
changeset 8018 091293bc974f
parent 7977 4987f6f83cdf
parent 8015 e7869e70db35
child 8026 4a4f21070479
equal deleted inserted replaced
8008:2ed42786aca7 8018:091293bc974f
   137         else
   137         else
   138             begin
   138             begin
   139             path:= Pathz[ptVoices] + '/' + locName;
   139             path:= Pathz[ptVoices] + '/' + locName;
   140             if DirectoryExists(path) then
   140             if DirectoryExists(path) then
   141                 name:= locName
   141                 name:= locName
   142             else if Length(cLocale) > 2
   142             else if Length(cLocale) > 3
   143                 then
   143                 then
   144                 begin
   144                 begin
   145                 locName:= name+'_'+Copy(cLocale,1,2);
   145                 locName:= name+'_'+Copy(cLocale,1,2);
   146                 path:= UserPathz[ptVoices] + '/' + locName;
   146                 path:= UserPathz[ptVoices] + '/' + locName;
   147                 if DirectoryExists(path) then
   147                 if DirectoryExists(path) then
   268         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
   268         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
   269             begin
   269             begin
   270             s:= UserPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   270             s:= UserPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   271             if (not FileExists(s)) then
   271             if (not FileExists(s)) then
   272                 s:= Pathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   272                 s:= Pathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
       
   273             if (not FileExists(s)) and (snd in [sndFirePunch2, sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6]) then
       
   274                 s:= Pathz[Soundz[sndFirePunch1].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   273             WriteToConsole(msgLoading + s + ' ');
   275             WriteToConsole(msgLoading + s + ' ');
   274             voicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), _P'rb'), 1);
   276             voicepack^.chunks[snd]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), _P'rb'), 1);
   275             if voicepack^.chunks[snd] = nil then
   277             if voicepack^.chunks[snd] = nil then
   276                 WriteLnToConsole(msgFailed)
   278                 WriteLnToConsole(msgFailed)
   277             else
   279             else
   492     ChangeVolume(previousVolume - Volume);
   494     ChangeVolume(previousVolume - Volume);
   493 end;
   495 end;
   494 
   496 
   495 procedure MuteAudio;
   497 procedure MuteAudio;
   496 begin
   498 begin
   497     if (not isSoundEnabled) then
   499     if not isSoundEnabled then
   498         exit;
   500         exit;
   499 
   501 
   500     if (isAudioMuted) then
   502     if (isAudioMuted) then
   501     begin
   503     begin
   502         ResumeMusic;
   504         ResumeMusic;