# HG changeset patch # User KoBeWi # Date 1476554802 -7200 # Node ID 7db5aef27e8d27acef42848c1ab4e9163d55c0be # Parent 992d7701cbd01e4da2f1b75f60ef59a9255cabb4 support for alternate sound paths [this is allowing themes to override certain sound files; reviewed and committed by sheepluva, fixes pending] diff -r 992d7701cbd0 -r 7db5aef27e8d hedgewars/uSound.pas --- a/hedgewars/uSound.pas Sat Oct 15 13:34:14 2016 +0200 +++ b/hedgewars/uSound.pas Sat Oct 15 20:06:42 2016 +0200 @@ -133,133 +133,132 @@ ( snd: sndNone; voicepack: nil)); Soundz: array[TSound] of record FileName: string[31]; - Path : TPathType; + Path, AltPath : TPathType; end = ( - (FileName: ''; Path: ptNone ),// sndNone - (FileName: 'grenadeimpact.ogg'; Path: ptSounds),// sndGrenadeImpact - (FileName: 'explosion.ogg'; Path: ptSounds),// sndExplosion - (FileName: 'throwpowerup.ogg'; Path: ptSounds),// sndThrowPowerUp - (FileName: 'throwrelease.ogg'; Path: ptSounds),// sndThrowRelease - (FileName: 'splash.ogg'; Path: ptSounds),// sndSplash - (FileName: 'shotgunreload.ogg'; Path: ptSounds),// sndShotgunReload - (FileName: 'shotgunfire.ogg'; Path: ptSounds),// sndShotgunFire - (FileName: 'graveimpact.ogg'; Path: ptSounds),// sndGraveImpact - (FileName: 'mineimpact.ogg'; Path: ptSounds),// sndMineImpact - (FileName: 'minetick.ogg'; Path: ptSounds),// sndMineTicks - (FileName: 'Droplet1.ogg'; Path: ptSounds),// sndMudballImpact - (FileName: 'pickhammer.ogg'; Path: ptSounds),// sndPickhammer - (FileName: 'gun.ogg'; Path: ptSounds),// sndGun - (FileName: 'bee.ogg'; Path: ptSounds),// sndBee - (FileName: 'Jump1.ogg'; Path: ptVoices),// sndJump1 - (FileName: 'Jump2.ogg'; Path: ptVoices),// sndJump2 - (FileName: 'Jump3.ogg'; Path: ptVoices),// sndJump3 - (FileName: 'Yessir.ogg'; Path: ptVoices),// sndYesSir - (FileName: 'Laugh.ogg'; Path: ptVoices),// sndLaugh - (FileName: 'Illgetyou.ogg'; Path: ptVoices),// sndIllGetYou - (FileName: 'Justyouwait.ogg'; Path: ptVoices),// sndJustyouwait - (FileName: 'Incoming.ogg'; Path: ptVoices),// sndIncoming - (FileName: 'Missed.ogg'; Path: ptVoices),// sndMissed - (FileName: 'Stupid.ogg'; Path: ptVoices),// sndStupid - (FileName: 'Firstblood.ogg'; Path: ptVoices),// sndFirstBlood - (FileName: 'Boring.ogg'; Path: ptVoices),// sndBoring - (FileName: 'Byebye.ogg'; Path: ptVoices),// sndByeBye - (FileName: 'Sameteam.ogg'; Path: ptVoices),// sndSameTeam - (FileName: 'Nutter.ogg'; Path: ptVoices),// sndNutter - (FileName: 'Reinforcements.ogg'; Path: ptVoices),// sndReinforce - (FileName: 'Traitor.ogg'; Path: ptVoices),// sndTraitor - (FileName: 'Youllregretthat.ogg'; Path: ptVoices),// sndRegret - (FileName: 'Enemydown.ogg'; Path: ptVoices),// sndEnemyDown - (FileName: 'Coward.ogg'; Path: ptVoices),// sndCoward - (FileName: 'Hurry.ogg'; Path: ptVoices),// sndHurry - (FileName: 'Watchit.ogg'; Path: ptVoices),// sndWatchIt - (FileName: 'Kamikaze.ogg'; Path: ptVoices),// sndKamikaze - (FileName: 'cake2.ogg'; Path: ptSounds),// sndCake - (FileName: 'Ow1.ogg'; Path: ptVoices),// sndOw1 - (FileName: 'Ow2.ogg'; Path: ptVoices),// sndOw2 - (FileName: 'Ow3.ogg'; Path: ptVoices),// sndOw3 - (FileName: 'Ow4.ogg'; Path: ptVoices),// sndOw4 - (FileName: 'Firepunch1.ogg'; Path: ptVoices),// sndFirepunch1 - (FileName: 'Firepunch2.ogg'; Path: ptVoices),// sndFirepunch2 - (FileName: 'Firepunch3.ogg'; Path: ptVoices),// sndFirepunch3 - (FileName: 'Firepunch4.ogg'; Path: ptVoices),// sndFirepunch4 - (FileName: 'Firepunch5.ogg'; Path: ptVoices),// sndFirepunch5 - (FileName: 'Firepunch6.ogg'; Path: ptVoices),// sndFirepunch6 - (FileName: 'Melon.ogg'; Path: ptVoices),// sndMelon - (FileName: 'Hellish.ogg'; Path: ptSounds),// sndHellish - (FileName: 'Yoohoo.ogg'; Path: ptSounds),// sndYoohoo - (FileName: 'rcplane.ogg'; Path: ptSounds),// sndRCPlane - (FileName: 'whipcrack.ogg'; Path: ptSounds),// sndWhipCrack - (FileName:'ride_of_the_valkyries.ogg'; Path: ptSounds),// sndRideOfTheValkyries - (FileName: 'denied.ogg'; Path: ptSounds),// sndDenied - (FileName: 'placed.ogg'; Path: ptSounds),// sndPlaced - (FileName: 'baseballbat.ogg'; Path: ptSounds),// sndBaseballBat - (FileName: 'steam.ogg'; Path: ptSounds),// sndVaporize - (FileName: 'warp.ogg'; Path: ptSounds),// sndWarp - (FileName: 'suddendeath.ogg'; Path: ptSounds),// sndSuddenDeath - (FileName: 'mortar.ogg'; Path: ptSounds),// sndMortar - (FileName: 'shutterclick.ogg'; Path: ptSounds),// sndShutter - (FileName: 'homerun.ogg'; Path: ptSounds),// sndHomerun - (FileName: 'molotov.ogg'; Path: ptSounds),// sndMolotov - (FileName: 'Takecover.ogg'; Path: ptVoices),// sndCover - (FileName: 'Uh-oh.ogg'; Path: ptVoices),// sndUhOh - (FileName: 'Oops.ogg'; Path: ptVoices),// sndOops - (FileName: 'Nooo.ogg'; Path: ptVoices),// sndNooo - (FileName: 'Hello.ogg'; Path: ptVoices),// sndHello - (FileName: 'ropeshot.ogg'; Path: ptSounds),// sndRopeShot - (FileName: 'ropeattach.ogg'; Path: ptSounds),// sndRopeAttach - (FileName: 'roperelease.ogg'; Path: ptSounds),// sndRopeRelease - (FileName: 'switchhog.ogg'; Path: ptSounds),// sndSwitchHog - (FileName: 'Victory.ogg'; Path: ptVoices),// sndVictory - (FileName: 'Flawless.ogg'; Path: ptVoices),// sndFlawless - (FileName: 'sniperreload.ogg'; Path: ptSounds),// sndSniperReload - (FileName: 'steps.ogg'; Path: ptSounds),// sndSteps - (FileName: 'lowgravity.ogg'; Path: ptSounds),// sndLowGravity - (FileName: 'hell_growl.ogg'; Path: ptSounds),// sndHellishImpact1 - (FileName: 'hell_ooff.ogg'; Path: ptSounds),// sndHellishImpact2 - (FileName: 'hell_ow.ogg'; Path: ptSounds),// sndHellishImpact3 - (FileName: 'hell_ugh.ogg'; Path: ptSounds),// sndHellishImpact4 - (FileName: 'melonimpact.ogg'; Path: ptSounds),// sndMelonImpact - (FileName: 'Droplet1.ogg'; Path: ptSounds),// sndDroplet1 - (FileName: 'Droplet2.ogg'; Path: ptSounds),// sndDroplet2 - (FileName: 'Droplet3.ogg'; Path: ptSounds),// sndDroplet3 - (FileName: 'egg.ogg'; Path: ptSounds),// sndEggBreak - (FileName: 'drillgun.ogg'; Path: ptSounds),// sndDrillRocket - (FileName: 'PoisonCough.ogg'; Path: ptVoices),// sndPoisonCough - (FileName: 'PoisonMoan.ogg'; Path: ptVoices),// sndPoisonMoan - (FileName: 'BirdyLay.ogg'; Path: ptSounds),// sndBirdyLay - (FileName: 'Whistle.ogg'; Path: ptSounds),// sndWhistle - (FileName: 'beewater.ogg'; Path: ptSounds),// sndBeeWater - (FileName: '1C.ogg'; Path: ptSounds),// sndPiano0 - (FileName: '2D.ogg'; Path: ptSounds),// sndPiano1 - (FileName: '3E.ogg'; Path: ptSounds),// sndPiano2 - (FileName: '4F.ogg'; Path: ptSounds),// sndPiano3 - (FileName: '5G.ogg'; Path: ptSounds),// sndPiano4 - (FileName: '6A.ogg'; Path: ptSounds),// sndPiano5 - (FileName: '7B.ogg'; Path: ptSounds),// sndPiano6 - (FileName: '8C.ogg'; Path: ptSounds),// sndPiano7 - (FileName: '9D.ogg'; Path: ptSounds),// sndPiano8 - (FileName: 'skip.ogg'; Path: ptSounds),// sndSkip - (FileName: 'sinegun.ogg'; Path: ptSounds),// sndSineGun - (FileName: 'Ooff1.ogg'; Path: ptVoices),// sndOoff1 - (FileName: 'Ooff2.ogg'; Path: ptVoices),// sndOoff2 - (FileName: 'Ooff3.ogg'; Path: ptVoices),// sndOoff3 - (FileName: 'hammer.ogg'; Path: ptSounds),// sndWhack - (FileName: 'Comeonthen.ogg'; Path: ptVoices),// sndComeonthen - (FileName: 'parachute.ogg'; Path: ptSounds),// sndParachute - (FileName: 'bump.ogg'; Path: ptSounds),// sndBump - (FileName: 'hogchant3.ogg'; Path: ptSounds),// sndResurrector - (FileName: 'plane.ogg'; Path: ptSounds),// sndPlane - (FileName: 'TARDIS.ogg'; Path: ptSounds),// sndTardis - (FileName: 'frozen_hog_impact.ogg'; Path: ptSounds),// sndFrozenHogImpact - (FileName: 'ice_beam.ogg'; Path: ptSounds),// sndIceBeam - (FileName: 'hog_freeze.ogg'; Path: ptSounds),// sndHogFreeze - (FileName: 'airmine_impact.ogg'; Path: ptSounds),// sndAirMineImpact - (FileName: 'knife_impact.ogg'; Path: ptSounds),// sndKnifeImpact - (FileName: 'extratime.ogg'; Path: ptSounds) // sndExtraTime + (FileName: ''; Path: ptNone; AltPath: ptNone),// sndNone + (FileName: 'grenadeimpact.ogg'; Path: ptSounds; AltPath: ptNone),// sndGrenadeImpact + (FileName: 'explosion.ogg'; Path: ptSounds; AltPath: ptNone),// sndExplosion + (FileName: 'throwpowerup.ogg'; Path: ptSounds; AltPath: ptNone),// sndThrowPowerUp + (FileName: 'throwrelease.ogg'; Path: ptSounds; AltPath: ptNone),// sndThrowRelease + (FileName: 'splash.ogg'; Path: ptCurrTheme; AltPath: ptSounds),// sndSplash + (FileName: 'shotgunreload.ogg'; Path: ptSounds; AltPath: ptNone),// sndShotgunReload + (FileName: 'shotgunfire.ogg'; Path: ptSounds; AltPath: ptNone),// sndShotgunFire + (FileName: 'graveimpact.ogg'; Path: ptSounds; AltPath: ptNone),// sndGraveImpact + (FileName: 'mineimpact.ogg'; Path: ptSounds; AltPath: ptNone),// sndMineImpact + (FileName: 'minetick.ogg'; Path: ptSounds; AltPath: ptNone),// sndMineTicks + (FileName: 'Droplet1.ogg'; Path: ptSounds; AltPath: ptNone),// sndMudballImpact + (FileName: 'pickhammer.ogg'; Path: ptSounds; AltPath: ptNone),// sndPickhammer + (FileName: 'gun.ogg'; Path: ptSounds; AltPath: ptNone),// sndGun + (FileName: 'bee.ogg'; Path: ptSounds; AltPath: ptNone),// sndBee + (FileName: 'Jump1.ogg'; Path: ptVoices; AltPath: ptNone),// sndJump1 + (FileName: 'Jump2.ogg'; Path: ptVoices; AltPath: ptNone),// sndJump2 + (FileName: 'Jump3.ogg'; Path: ptVoices; AltPath: ptNone),// sndJump3 + (FileName: 'Yessir.ogg'; Path: ptVoices; AltPath: ptNone),// sndYesSir + (FileName: 'Laugh.ogg'; Path: ptVoices; AltPath: ptNone),// sndLaugh + (FileName: 'Illgetyou.ogg'; Path: ptVoices; AltPath: ptNone),// sndIllGetYou + (FileName: 'Justyouwait.ogg'; Path: ptVoices; AltPath: ptNone),// sndJustyouwait + (FileName: 'Incoming.ogg'; Path: ptVoices; AltPath: ptNone),// sndIncoming + (FileName: 'Missed.ogg'; Path: ptVoices; AltPath: ptNone),// sndMissed + (FileName: 'Stupid.ogg'; Path: ptVoices; AltPath: ptNone),// sndStupid + (FileName: 'Firstblood.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirstBlood + (FileName: 'Boring.ogg'; Path: ptVoices; AltPath: ptNone),// sndBoring + (FileName: 'Byebye.ogg'; Path: ptVoices; AltPath: ptNone),// sndByeBye + (FileName: 'Sameteam.ogg'; Path: ptVoices; AltPath: ptNone),// sndSameTeam + (FileName: 'Nutter.ogg'; Path: ptVoices; AltPath: ptNone),// sndNutter + (FileName: 'Reinforcements.ogg'; Path: ptVoices; AltPath: ptNone),// sndReinforce + (FileName: 'Traitor.ogg'; Path: ptVoices; AltPath: ptNone),// sndTraitor + (FileName: 'Youllregretthat.ogg'; Path: ptVoices; AltPath: ptNone),// sndRegret + (FileName: 'Enemydown.ogg'; Path: ptVoices; AltPath: ptNone),// sndEnemyDown + (FileName: 'Coward.ogg'; Path: ptVoices; AltPath: ptNone),// sndCoward + (FileName: 'Hurry.ogg'; Path: ptVoices; AltPath: ptNone),// sndHurry + (FileName: 'Watchit.ogg'; Path: ptVoices; AltPath: ptNone),// sndWatchIt + (FileName: 'Kamikaze.ogg'; Path: ptVoices; AltPath: ptNone),// sndKamikaze + (FileName: 'cake2.ogg'; Path: ptSounds; AltPath: ptNone),// sndCake + (FileName: 'Ow1.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw1 + (FileName: 'Ow2.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw2 + (FileName: 'Ow3.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw3 + (FileName: 'Ow4.ogg'; Path: ptVoices; AltPath: ptNone),// sndOw4 + (FileName: 'Firepunch1.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch1 + (FileName: 'Firepunch2.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch2 + (FileName: 'Firepunch3.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch3 + (FileName: 'Firepunch4.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch4 + (FileName: 'Firepunch5.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch5 + (FileName: 'Firepunch6.ogg'; Path: ptVoices; AltPath: ptNone),// sndFirepunch6 + (FileName: 'Melon.ogg'; Path: ptVoices; AltPath: ptNone),// sndMelon + (FileName: 'Hellish.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellish + (FileName: 'Yoohoo.ogg'; Path: ptSounds; AltPath: ptNone),// sndYoohoo + (FileName: 'rcplane.ogg'; Path: ptSounds; AltPath: ptNone),// sndRCPlane + (FileName: 'whipcrack.ogg'; Path: ptSounds; AltPath: ptNone),// sndWhipCrack + (FileName:'ride_of_the_valkyries.ogg'; Path: ptSounds; AltPath: ptNone),// sndRideOfTheValkyries + (FileName: 'denied.ogg'; Path: ptSounds; AltPath: ptNone),// sndDenied + (FileName: 'placed.ogg'; Path: ptSounds; AltPath: ptNone),// sndPlaced + (FileName: 'baseballbat.ogg'; Path: ptSounds; AltPath: ptNone),// sndBaseballBat + (FileName: 'steam.ogg'; Path: ptSounds; AltPath: ptNone),// sndVaporize + (FileName: 'warp.ogg'; Path: ptSounds; AltPath: ptNone),// sndWarp + (FileName: 'suddendeath.ogg'; Path: ptSounds; AltPath: ptNone),// sndSuddenDeath + (FileName: 'mortar.ogg'; Path: ptSounds; AltPath: ptNone),// sndMortar + (FileName: 'shutterclick.ogg'; Path: ptSounds; AltPath: ptNone),// sndShutter + (FileName: 'homerun.ogg'; Path: ptSounds; AltPath: ptNone),// sndHomerun + (FileName: 'molotov.ogg'; Path: ptSounds; AltPath: ptNone),// sndMolotov + (FileName: 'Takecover.ogg'; Path: ptVoices; AltPath: ptNone),// sndCover + (FileName: 'Uh-oh.ogg'; Path: ptVoices; AltPath: ptNone),// sndUhOh + (FileName: 'Oops.ogg'; Path: ptVoices; AltPath: ptNone),// sndOops + (FileName: 'Nooo.ogg'; Path: ptVoices; AltPath: ptNone),// sndNooo + (FileName: 'Hello.ogg'; Path: ptVoices; AltPath: ptNone),// sndHello + (FileName: 'ropeshot.ogg'; Path: ptSounds; AltPath: ptNone),// sndRopeShot + (FileName: 'ropeattach.ogg'; Path: ptSounds; AltPath: ptNone),// sndRopeAttach + (FileName: 'roperelease.ogg'; Path: ptSounds; AltPath: ptNone),// sndRopeRelease + (FileName: 'switchhog.ogg'; Path: ptSounds; AltPath: ptNone),// sndSwitchHog + (FileName: 'Victory.ogg'; Path: ptVoices; AltPath: ptNone),// sndVictory + (FileName: 'Flawless.ogg'; Path: ptVoices; AltPath: ptNone),// sndFlawless + (FileName: 'sniperreload.ogg'; Path: ptSounds; AltPath: ptNone),// sndSniperReload + (FileName: 'steps.ogg'; Path: ptSounds; AltPath: ptNone),// sndSteps + (FileName: 'lowgravity.ogg'; Path: ptSounds; AltPath: ptNone),// sndLowGravity + (FileName: 'hell_growl.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellishImpact1 + (FileName: 'hell_ooff.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellishImpact2 + (FileName: 'hell_ow.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellishImpact3 + (FileName: 'hell_ugh.ogg'; Path: ptSounds; AltPath: ptNone),// sndHellishImpact4 + (FileName: 'melonimpact.ogg'; Path: ptSounds; AltPath: ptNone),// sndMelonImpact + (FileName: 'Droplet1.ogg'; Path: ptCurrTheme; AltPath: ptSounds),// sndDroplet1 + (FileName: 'Droplet2.ogg'; Path: ptCurrTheme; AltPath: ptSounds),// sndDroplet2 + (FileName: 'Droplet3.ogg'; Path: ptCurrTheme; AltPath: ptSounds),// sndDroplet3 + (FileName: 'egg.ogg'; Path: ptSounds; AltPath: ptNone),// sndEggBreak + (FileName: 'drillgun.ogg'; Path: ptSounds; AltPath: ptNone),// sndDrillRocket + (FileName: 'PoisonCough.ogg'; Path: ptVoices; AltPath: ptNone),// sndPoisonCough + (FileName: 'PoisonMoan.ogg'; Path: ptVoices; AltPath: ptNone),// sndPoisonMoan + (FileName: 'BirdyLay.ogg'; Path: ptSounds; AltPath: ptNone),// sndBirdyLay + (FileName: 'Whistle.ogg'; Path: ptSounds; AltPath: ptNone),// sndWhistle + (FileName: 'beewater.ogg'; Path: ptSounds; AltPath: ptNone),// sndBeeWater + (FileName: '1C.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano0 + (FileName: '2D.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano1 + (FileName: '3E.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano2 + (FileName: '4F.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano3 + (FileName: '5G.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano4 + (FileName: '6A.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano5 + (FileName: '7B.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano6 + (FileName: '8C.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano7 + (FileName: '9D.ogg'; Path: ptSounds; AltPath: ptNone),// sndPiano8 + (FileName: 'skip.ogg'; Path: ptCurrTheme; AltPath: ptSounds),// sndSkip + (FileName: 'sinegun.ogg'; Path: ptSounds; AltPath: ptNone),// sndSineGun + (FileName: 'Ooff1.ogg'; Path: ptVoices; AltPath: ptNone),// sndOoff1 + (FileName: 'Ooff2.ogg'; Path: ptVoices; AltPath: ptNone),// sndOoff2 + (FileName: 'Ooff3.ogg'; Path: ptVoices; AltPath: ptNone),// sndOoff3 + (FileName: 'hammer.ogg'; Path: ptSounds; AltPath: ptNone),// sndWhack + (FileName: 'Comeonthen.ogg'; Path: ptVoices; AltPath: ptNone),// sndComeonthen + (FileName: 'parachute.ogg'; Path: ptSounds; AltPath: ptNone),// sndParachute + (FileName: 'bump.ogg'; Path: ptSounds; AltPath: ptNone),// sndBump + (FileName: 'hogchant3.ogg'; Path: ptSounds; AltPath: ptNone),// sndResurrector + (FileName: 'plane.ogg'; Path: ptSounds; AltPath: ptNone),// sndPlane + (FileName: 'TARDIS.ogg'; Path: ptSounds; AltPath: ptNone),// sndTardis + (FileName: 'frozen_hog_impact.ogg'; Path: ptSounds; AltPath: ptNone),// sndFrozenHogImpact + (FileName: 'ice_beam.ogg'; Path: ptSounds; AltPath: ptNone),// sndIceBeam + (FileName: 'hog_freeze.ogg'; Path: ptSounds; AltPath: ptNone), // sndHogFreeze + (FileName: 'airmine_impact.ogg'; Path: ptSounds; AltPath: ptNone),// sndAirMineImpact + (FileName: 'knife_impact.ogg'; Path: ptSounds; AltPath: ptNone),// sndKnifeImpact + (FileName: 'extratime.ogg'; Path: ptSounds; AltPath: ptNone) // sndExtraTime ); - function AskForVoicepack(name: shortstring): Pointer; var i: Longword; locName, path: shortstring; @@ -398,6 +397,7 @@ procedure PlaySoundV(snd: TSound; voicepack: PVoicepack; keepPlaying: boolean); var s:shortstring; +rwops: PSDL_RWops; begin if (not isSoundEnabled) or fastUntilLag then exit; @@ -413,7 +413,16 @@ if (not pfsExists(s)) and (snd in [sndFirePunch2, sndFirePunch3, sndFirePunch4, sndFirePunch5, sndFirePunch6]) then s:= cPathz[Soundz[sndFirePunch1].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName; WriteToConsole(msgLoading + s + ' '); - voicepack^.chunks[snd]:= Mix_LoadWAV_RW(rwopsOpenRead(s), 1); + rwops := rwopsOpenRead(s); + + if rwops = nil then + begin + s:= cPathz[Soundz[snd].AltPath] + '/' + voicepack^.name + '/' + Soundz[snd].FileName; + WriteToConsole(msgLoading + s + ' ... '); + rwops := rwopsOpenRead(s); + end; + voicepack^.chunks[snd]:= Mix_LoadWAV_RW(rwops, 1); + if voicepack^.chunks[snd] = nil then WriteLnToConsole(msgFailed) else @@ -427,7 +436,16 @@ begin s:= cPathz[Soundz[snd].Path] + '/' + Soundz[snd].FileName; WriteToConsole(msgLoading + s + ' '); - defVoicepack^.chunks[snd]:= Mix_LoadWAV_RW(rwopsOpenRead(s), 1); + rwops := rwopsOpenRead(s); + + if rwops = nil then + begin + s:= cPathz[Soundz[snd].AltPath] + '/' + voicepack^.name + '/' + Soundz[snd].FileName; + WriteToConsole(msgLoading + s + ' ... '); + rwops := rwopsOpenRead(s); + end; + + defVoicepack^.chunks[snd]:= Mix_LoadWAV_RW(rwops, 1); if SDLCheck(defVoicepack^.chunks[snd] <> nil, 'Mix_LoadWAV_RW', true) then exit; WriteLnToConsole(msgOK); end; @@ -499,6 +517,7 @@ function LoopSoundV(snd: TSound; voicepack: PVoicepack; fadems: LongInt): LongInt; var s: shortstring; +rwops: PSDL_RWops; begin if (not isSoundEnabled) or fastUntilLag then begin @@ -512,7 +531,16 @@ begin s:= cPathz[Soundz[snd].Path] + '/' + voicepack^.name + '/' + Soundz[snd].FileName; WriteToConsole(msgLoading + s + ' '); - voicepack^.chunks[snd]:= Mix_LoadWAV_RW(rwopsOpenRead(s), 1); + rwops:=rwopsOpenRead(s); + + if rwops = nil then + begin + s:= cPathz[Soundz[snd].AltPath] + '/' + Soundz[snd].FileName; + WriteToConsole(msgLoading + s + ' ... '); + rwops:=rwopsOpenRead(s); + end; + + defVoicepack^.chunks[snd]:= Mix_LoadWAV_RW(rwops, 1); if voicepack^.chunks[snd] = nil then WriteLnToConsole(msgFailed) else