103 |
103 |
104 // Returns a pointer to the voicepack with the given name. |
104 // Returns a pointer to the voicepack with the given name. |
105 function AskForVoicepack(name: shortstring): Pointer; |
105 function AskForVoicepack(name: shortstring): Pointer; |
106 |
106 |
107 |
107 |
|
108 var Volume: LongInt; |
|
109 SoundTimerTicks: Longword; |
108 implementation |
110 implementation |
109 uses uVariables, uConsole, uUtils, uCommands, uDebug, uPhysFSLayer; |
111 uses uVariables, uConsole, uCommands, uDebug, uPhysFSLayer; |
110 |
112 |
111 const chanTPU = 32; |
113 const chanTPU = 32; |
112 var Volume: LongInt; |
114 var cInitVolume: LongInt; |
113 cInitVolume: LongInt; |
|
114 previousVolume: LongInt; // cached volume value |
115 previousVolume: LongInt; // cached volume value |
115 lastChan: array [TSound] of LongInt; |
116 lastChan: array [TSound] of LongInt; |
116 voicepacks: array[0..cMaxTeams] of TVoicepack; |
117 voicepacks: array[0..cMaxTeams] of TVoicepack; |
117 defVoicepack: PVoicepack; |
118 defVoicepack: PVoicepack; |
118 Mus: PMixMusic; // music pointer |
119 Mus: PMixMusic; // music pointer |
119 MusicFN: shortstring; // music file name |
120 MusicFN: shortstring; // music file name |
120 isMusicEnabled: boolean; |
121 isMusicEnabled: boolean; |
121 isSoundEnabled: boolean; |
122 isSoundEnabled: boolean; |
122 isSEBackup: boolean; |
123 isSEBackup: boolean; |
|
124 VoiceList : array[0..7] of TVoice = ( |
|
125 ( snd: sndNone; voicepack: nil), |
|
126 ( snd: sndNone; voicepack: nil), |
|
127 ( snd: sndNone; voicepack: nil), |
|
128 ( snd: sndNone; voicepack: nil), |
|
129 ( snd: sndNone; voicepack: nil), |
|
130 ( snd: sndNone; voicepack: nil), |
|
131 ( snd: sndNone; voicepack: nil), |
|
132 ( snd: sndNone; voicepack: nil)); |
|
133 Soundz: array[TSound] of record |
|
134 FileName: string[31]; |
|
135 Path : TPathType; |
|
136 end = ( |
|
137 (FileName: ''; Path: ptNone ),// sndNone |
|
138 (FileName: 'grenadeimpact.ogg'; Path: ptSounds),// sndGrenadeImpact |
|
139 (FileName: 'explosion.ogg'; Path: ptSounds),// sndExplosion |
|
140 (FileName: 'throwpowerup.ogg'; Path: ptSounds),// sndThrowPowerUp |
|
141 (FileName: 'throwrelease.ogg'; Path: ptSounds),// sndThrowRelease |
|
142 (FileName: 'splash.ogg'; Path: ptSounds),// sndSplash |
|
143 (FileName: 'shotgunreload.ogg'; Path: ptSounds),// sndShotgunReload |
|
144 (FileName: 'shotgunfire.ogg'; Path: ptSounds),// sndShotgunFire |
|
145 (FileName: 'graveimpact.ogg'; Path: ptSounds),// sndGraveImpact |
|
146 (FileName: 'mineimpact.ogg'; Path: ptSounds),// sndMineImpact |
|
147 (FileName: 'minetick.ogg'; Path: ptSounds),// sndMineTicks |
|
148 (FileName: 'Droplet1.ogg'; Path: ptSounds),// sndMudballImpact |
|
149 (FileName: 'pickhammer.ogg'; Path: ptSounds),// sndPickhammer |
|
150 (FileName: 'gun.ogg'; Path: ptSounds),// sndGun |
|
151 (FileName: 'bee.ogg'; Path: ptSounds),// sndBee |
|
152 (FileName: 'Jump1.ogg'; Path: ptVoices),// sndJump1 |
|
153 (FileName: 'Jump2.ogg'; Path: ptVoices),// sndJump2 |
|
154 (FileName: 'Jump3.ogg'; Path: ptVoices),// sndJump3 |
|
155 (FileName: 'Yessir.ogg'; Path: ptVoices),// sndYesSir |
|
156 (FileName: 'Laugh.ogg'; Path: ptVoices),// sndLaugh |
|
157 (FileName: 'Illgetyou.ogg'; Path: ptVoices),// sndIllGetYou |
|
158 (FileName: 'JustYouWait.ogg'; Path: ptVoices),// sndJustYouWait |
|
159 (FileName: 'Incoming.ogg'; Path: ptVoices),// sndIncoming |
|
160 (FileName: 'Missed.ogg'; Path: ptVoices),// sndMissed |
|
161 (FileName: 'Stupid.ogg'; Path: ptVoices),// sndStupid |
|
162 (FileName: 'Firstblood.ogg'; Path: ptVoices),// sndFirstBlood |
|
163 (FileName: 'Boring.ogg'; Path: ptVoices),// sndBoring |
|
164 (FileName: 'Byebye.ogg'; Path: ptVoices),// sndByeBye |
|
165 (FileName: 'Sameteam.ogg'; Path: ptVoices),// sndSameTeam |
|
166 (FileName: 'Nutter.ogg'; Path: ptVoices),// sndNutter |
|
167 (FileName: 'Reinforcements.ogg'; Path: ptVoices),// sndReinforce |
|
168 (FileName: 'Traitor.ogg'; Path: ptVoices),// sndTraitor |
|
169 (FileName: 'Youllregretthat.ogg'; Path: ptVoices),// sndRegret |
|
170 (FileName: 'Enemydown.ogg'; Path: ptVoices),// sndEnemyDown |
|
171 (FileName: 'Coward.ogg'; Path: ptVoices),// sndCoward |
|
172 (FileName: 'Hurry.ogg'; Path: ptVoices),// sndHurry |
|
173 (FileName: 'Watchit.ogg'; Path: ptVoices),// sndWatchIt |
|
174 (FileName: 'Kamikaze.ogg'; Path: ptVoices),// sndKamikaze |
|
175 (FileName: 'cake2.ogg'; Path: ptSounds),// sndCake |
|
176 (FileName: 'Ow1.ogg'; Path: ptVoices),// sndOw1 |
|
177 (FileName: 'Ow2.ogg'; Path: ptVoices),// sndOw2 |
|
178 (FileName: 'Ow3.ogg'; Path: ptVoices),// sndOw3 |
|
179 (FileName: 'Ow4.ogg'; Path: ptVoices),// sndOw4 |
|
180 (FileName: 'Firepunch1.ogg'; Path: ptVoices),// sndFirepunch1 |
|
181 (FileName: 'Firepunch2.ogg'; Path: ptVoices),// sndFirepunch2 |
|
182 (FileName: 'Firepunch3.ogg'; Path: ptVoices),// sndFirepunch3 |
|
183 (FileName: 'Firepunch4.ogg'; Path: ptVoices),// sndFirepunch4 |
|
184 (FileName: 'Firepunch5.ogg'; Path: ptVoices),// sndFirepunch5 |
|
185 (FileName: 'Firepunch6.ogg'; Path: ptVoices),// sndFirepunch6 |
|
186 (FileName: 'Melon.ogg'; Path: ptVoices),// sndMelon |
|
187 (FileName: 'Hellish.ogg'; Path: ptSounds),// sndHellish |
|
188 (FileName: 'Yoohoo.ogg'; Path: ptSounds),// sndYoohoo |
|
189 (FileName: 'rcplane.ogg'; Path: ptSounds),// sndRCPlane |
|
190 (FileName: 'whipcrack.ogg'; Path: ptSounds),// sndWhipCrack |
|
191 (FileName:'ride_of_the_valkyries.ogg'; Path: ptSounds),// sndRideOfTheValkyries |
|
192 (FileName: 'denied.ogg'; Path: ptSounds),// sndDenied |
|
193 (FileName: 'placed.ogg'; Path: ptSounds),// sndPlaced |
|
194 (FileName: 'baseballbat.ogg'; Path: ptSounds),// sndBaseballBat |
|
195 (FileName: 'steam.ogg'; Path: ptSounds),// sndVaporize |
|
196 (FileName: 'warp.ogg'; Path: ptSounds),// sndWarp |
|
197 (FileName: 'suddendeath.ogg'; Path: ptSounds),// sndSuddenDeath |
|
198 (FileName: 'mortar.ogg'; Path: ptSounds),// sndMortar |
|
199 (FileName: 'shutterclick.ogg'; Path: ptSounds),// sndShutter |
|
200 (FileName: 'homerun.ogg'; Path: ptSounds),// sndHomerun |
|
201 (FileName: 'molotov.ogg'; Path: ptSounds),// sndMolotov |
|
202 (FileName: 'Takecover.ogg'; Path: ptVoices),// sndCover |
|
203 (FileName: 'Uh-oh.ogg'; Path: ptVoices),// sndUhOh |
|
204 (FileName: 'Oops.ogg'; Path: ptVoices),// sndOops |
|
205 (FileName: 'Nooo.ogg'; Path: ptVoices),// sndNooo |
|
206 (FileName: 'Hello.ogg'; Path: ptVoices),// sndHello |
|
207 (FileName: 'ropeshot.ogg'; Path: ptSounds),// sndRopeShot |
|
208 (FileName: 'ropeattach.ogg'; Path: ptSounds),// sndRopeAttach |
|
209 (FileName: 'roperelease.ogg'; Path: ptSounds),// sndRopeRelease |
|
210 (FileName: 'switchhog.ogg'; Path: ptSounds),// sndSwitchHog |
|
211 (FileName: 'Victory.ogg'; Path: ptVoices),// sndVictory |
|
212 (FileName: 'Flawless.ogg'; Path: ptVoices),// sndFlawless |
|
213 (FileName: 'sniperreload.ogg'; Path: ptSounds),// sndSniperReload |
|
214 (FileName: 'steps.ogg'; Path: ptSounds),// sndSteps |
|
215 (FileName: 'lowgravity.ogg'; Path: ptSounds),// sndLowGravity |
|
216 (FileName: 'hell_growl.ogg'; Path: ptSounds),// sndHellishImpact1 |
|
217 (FileName: 'hell_ooff.ogg'; Path: ptSounds),// sndHellishImpact2 |
|
218 (FileName: 'hell_ow.ogg'; Path: ptSounds),// sndHellishImpact3 |
|
219 (FileName: 'hell_ugh.ogg'; Path: ptSounds),// sndHellishImpact4 |
|
220 (FileName: 'melonimpact.ogg'; Path: ptSounds),// sndMelonImpact |
|
221 (FileName: 'Droplet1.ogg'; Path: ptSounds),// sndDroplet1 |
|
222 (FileName: 'Droplet2.ogg'; Path: ptSounds),// sndDroplet2 |
|
223 (FileName: 'Droplet3.ogg'; Path: ptSounds),// sndDroplet3 |
|
224 (FileName: 'egg.ogg'; Path: ptSounds),// sndEggBreak |
|
225 (FileName: 'drillgun.ogg'; Path: ptSounds),// sndDrillRocket |
|
226 (FileName: 'PoisonCough.ogg'; Path: ptVoices),// sndPoisonCough |
|
227 (FileName: 'PoisonMoan.ogg'; Path: ptVoices),// sndPoisonMoan |
|
228 (FileName: 'BirdyLay.ogg'; Path: ptSounds),// sndBirdyLay |
|
229 (FileName: 'Whistle.ogg'; Path: ptSounds),// sndWhistle |
|
230 (FileName: 'beewater.ogg'; Path: ptSounds),// sndBeeWater |
|
231 (FileName: '1C.ogg'; Path: ptSounds),// sndPiano0 |
|
232 (FileName: '2D.ogg'; Path: ptSounds),// sndPiano1 |
|
233 (FileName: '3E.ogg'; Path: ptSounds),// sndPiano2 |
|
234 (FileName: '4F.ogg'; Path: ptSounds),// sndPiano3 |
|
235 (FileName: '5G.ogg'; Path: ptSounds),// sndPiano4 |
|
236 (FileName: '6A.ogg'; Path: ptSounds),// sndPiano5 |
|
237 (FileName: '7B.ogg'; Path: ptSounds),// sndPiano6 |
|
238 (FileName: '8C.ogg'; Path: ptSounds),// sndPiano7 |
|
239 (FileName: '9D.ogg'; Path: ptSounds),// sndPiano8 |
|
240 (FileName: 'skip.ogg'; Path: ptSounds),// sndSkip |
|
241 (FileName: 'sinegun.ogg'; Path: ptSounds),// sndSineGun |
|
242 (FileName: 'Ooff1.ogg'; Path: ptVoices),// sndOoff1 |
|
243 (FileName: 'Ooff2.ogg'; Path: ptVoices),// sndOoff2 |
|
244 (FileName: 'Ooff3.ogg'; Path: ptVoices),// sndOoff3 |
|
245 (FileName: 'hammer.ogg'; Path: ptSounds),// sndWhack |
|
246 (FileName: 'Comeonthen.ogg'; Path: ptVoices),// sndComeonthen |
|
247 (FileName: 'parachute.ogg'; Path: ptSounds),// sndParachute |
|
248 (FileName: 'bump.ogg'; Path: ptSounds),// sndBump |
|
249 (FileName: 'hogchant3.ogg'; Path: ptSounds),// sndResurrector |
|
250 (FileName: 'plane.ogg'; Path: ptSounds),// sndPlane |
|
251 (FileName: 'TARDIS.ogg'; Path: ptSounds) // sndTardis |
|
252 ); |
|
253 |
123 |
254 |
124 |
255 |
125 function AskForVoicepack(name: shortstring): Pointer; |
256 function AskForVoicepack(name: shortstring): Pointer; |
126 var i: Longword; |
257 var i: Longword; |
127 locName, path: shortstring; |
258 locName, path: shortstring; |