134 s:shortstring; |
134 s:shortstring; |
135 begin |
135 begin |
136 if not isSoundEnabled then exit; |
136 if not isSoundEnabled then exit; |
137 |
137 |
138 defVoicepack:= AskForVoicepack('Default'); |
138 defVoicepack:= AskForVoicepack('Default'); |
139 |
139 |
140 for t:= 0 to cMaxTeams do |
140 for t:= 0 to cMaxTeams do |
141 if voicepacks[t].name <> '' then |
141 if voicepacks[t].name <> '' then |
142 for i:= Low(TSound) to High(TSound) do |
142 for i:= Low(TSound) to High(TSound) do |
143 voicepacks[t].chunks[i]:= nil; |
143 voicepacks[t].chunks[i]:= nil; |
144 |
144 |
145 for i:= Low(TSound) to High(TSound) do |
145 for i:= Low(TSound) to High(TSound) do |
146 begin |
146 begin |
147 defVoicepack^.chunks[i]:= nil; |
147 defVoicepack^.chunks[i]:= nil; |
148 // preload all the big sound files (>32k) that would otherwise lockup the game |
148 // preload all the big sound files (>32k) that would otherwise lockup the game |
149 if (i in [sndBeeWater, sndBee, sndCake, sndHellishImpact1, sndHellish, sndHomerun, sndMolotov, sndMortar, sndRideOfTheValkyries, sndYoohoo]) |
149 if (i in [sndBeeWater, sndBee, sndCake, sndHellishImpact1, sndHellish, sndHomerun, sndMolotov, sndMortar, sndRideOfTheValkyries, sndYoohoo]) |
150 and (Soundz[i].Path <> ptVoices) and (Soundz[i].FileName <> '') then |
150 and (Soundz[i].Path <> ptVoices) and (Soundz[i].FileName <> '') then |
151 begin |
151 begin |
152 s:= Pathz[Soundz[i].Path] + '/' + Soundz[i].FileName; |
152 s:= Pathz[Soundz[i].Path] + '/' + Soundz[i].FileName; |
153 WriteToConsole(msgLoading + s + ' '); |
153 WriteToConsole(msgLoading + s + ' '); |
154 defVoicepack^.chunks[i]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1); |
154 defVoicepack^.chunks[i]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1); |