44 function ChangeVolume(voldelta: LongInt): LongInt; |
44 function ChangeVolume(voldelta: LongInt): LongInt; |
45 function AskForVoicepack(name: shortstring): Pointer; |
45 function AskForVoicepack(name: shortstring): Pointer; |
46 |
46 |
47 |
47 |
48 implementation |
48 implementation |
49 uses uVariables, uConsole, uUtils, uCommands, uDebug; |
49 uses uVariables, uConsole, uUtils, uCommands, uDebug, uMobile; |
50 |
50 |
51 const chanTPU = 32; |
51 const chanTPU = 32; |
52 var Volume: LongInt; |
52 var Volume: LongInt; |
53 lastChan: array [TSound] of LongInt; |
53 lastChan: array [TSound] of LongInt; |
54 voicepacks: array[0..cMaxTeams] of TVoicepack; |
54 voicepacks: array[0..cMaxTeams] of TVoicepack; |
145 |
145 |
146 for i:= Low(TSound) to High(TSound) do |
146 for i:= Low(TSound) to High(TSound) do |
147 begin |
147 begin |
148 defVoicepack^.chunks[i]:= nil; |
148 defVoicepack^.chunks[i]:= nil; |
149 // preload all the big sound files (>32k) that would otherwise lockup the game |
149 // preload all the big sound files (>32k) that would otherwise lockup the game |
150 if (i in [sndBeeWater, sndBee, sndCake, sndHellishImpact1, sndHellish, sndHomerun, sndMolotov, sndMortar, sndRideOfTheValkyries, sndYoohoo]) |
150 if (i in [sndBeeWater, sndBee, sndCake, sndHellishImpact1, sndHellish, sndHomerun, |
|
151 sndMolotov, sndMortar, sndRideOfTheValkyries, sndYoohoo]) |
151 and (Soundz[i].Path <> ptVoices) and (Soundz[i].FileName <> '') then |
152 and (Soundz[i].Path <> ptVoices) and (Soundz[i].FileName <> '') then |
152 begin |
153 begin |
153 s:= Pathz[Soundz[i].Path] + '/' + Soundz[i].FileName; |
154 s:= Pathz[Soundz[i].Path] + '/' + Soundz[i].FileName; |
154 WriteToConsole(msgLoading + s + ' '); |
155 WriteToConsole(msgLoading + s + ' '); |
155 defVoicepack^.chunks[i]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1); |
156 defVoicepack^.chunks[i]:= Mix_LoadWAV_RW(SDL_RWFromFile(Str2PChar(s), 'rb'), 1); |