hedgewars/uSound.pas
changeset 13287 29055da6a6cd
parent 13161 aa7915ceb69f
child 13288 ee8c6eb0ab47
equal deleted inserted replaced
13286:1fbf2ac1f13e 13287:29055da6a6cd
   184             (FileName:                'cake2.ogg'; Path: ptSounds; AltPath: ptNone),// sndCake
   184             (FileName:                'cake2.ogg'; Path: ptSounds; AltPath: ptNone),// sndCake
   185             (FileName:                  'Ow1.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw1
   185             (FileName:                  'Ow1.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw1
   186             (FileName:                  'Ow2.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw2
   186             (FileName:                  'Ow2.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw2
   187             (FileName:                  'Ow3.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw3
   187             (FileName:                  'Ow3.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw3
   188             (FileName:                  'Ow4.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw4
   188             (FileName:                  'Ow4.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw4
   189             (FileName:           'Firepunch1.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch1
   189             (FileName:           'Firepunch1.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch1
   190             (FileName:           'Firepunch2.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch2
   190             (FileName:           'Firepunch2.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch2
   191             (FileName:           'Firepunch3.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch3
   191             (FileName:           'Firepunch3.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch3
   192             (FileName:           'Firepunch4.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch4
   192             (FileName:           'Firepunch4.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch4
   193             (FileName:           'Firepunch5.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch5
   193             (FileName:           'Firepunch5.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch5
   194             (FileName:           'Firepunch6.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch6
   194             (FileName:           'Firepunch6.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirePunch6
   195             (FileName:                'Melon.ogg'; Path: ptVoices; AltPath: ptNone),// sndMelon
   195             (FileName:                'Melon.ogg'; Path: ptVoices; AltPath: ptNone),// sndMelon
   196             (FileName:              'Hellish.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellish
   196             (FileName:              'Hellish.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellish
   197             (FileName:               'Yoohoo.ogg'; Path: ptSounds; AltPath: ptNone),// sndYoohoo
   197             (FileName:               'Yoohoo.ogg'; Path: ptSounds; AltPath: ptNone),// sndYoohoo
   198             (FileName:              'rcplane.ogg'; Path: ptSounds; AltPath: ptNone),// sndRCPlane
   198             (FileName:              'rcplane.ogg'; Path: ptSounds; AltPath: ptNone),// sndRCPlane
   199             (FileName:            'whipcrack.ogg'; Path: ptSounds; AltPath: ptNone),// sndWhipCrack
   199             (FileName:            'whipcrack.ogg'; Path: ptSounds; AltPath: ptNone),// sndWhipCrack
   457     if (voicepack <> nil) then
   457     if (voicepack <> nil) then
   458         begin
   458         begin
   459         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
   459         if (voicepack^.chunks[snd] = nil) and (Soundz[snd].Path = ptVoices) and (Soundz[snd].FileName <> '') then
   460             begin
   460             begin
   461             s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   461             s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
       
   462             // Fallback to sndFirePunch1 if sndFirePunch{2,6} is missing
   462             if (not pfsExists(s)) and (snd in [sndFirePunch2, sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6]) then
   463             if (not pfsExists(s)) and (snd in [sndFirePunch2, sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6]) then
   463                 s:= cPathz[Soundz[sndFirePunch1].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
   464                 begin
       
   465                 snd := sndFirePunch1;
       
   466                 s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName;
       
   467                 end;
   464             WriteToConsole(msgLoading + s + ' ');
   468             WriteToConsole(msgLoading + s + ' ');
   465             rwops := rwopsOpenRead(s);
   469             rwops := rwopsOpenRead(s);
   466 
   470 
   467             if rwops = nil then
   471             if rwops = nil then
   468                 begin
   472                 begin