102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
channels.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
10#include "pcdogs/game/globals.h"
15#include "pcdogs/math/types.h"
20#include "pcdogs/types/common.h"
21#include <math.h>
22#include <stdarg.h>
23#include <string.h>
24
25// Original pcdogs.exe: 0x4381a0
26// Clears the cached base rate and stops and ends playback for a populated sample slot without releasing its handle; the slot index is unchecked.
27void Audio_ReleaseSoundHandle(int32_t slot_index)
28{
29 if (!g_soundSlots[slot_index].base_playback_rate || !g_soundSlots[slot_index].sample_handle)
30 return;
31
32 g_soundSlots[slot_index].base_playback_rate = 0;
33 AIL_stop_sample(g_soundSlots[slot_index].sample_handle);
34 AIL_end_sample(g_soundSlots[slot_index].sample_handle);
35}
36
37// Original pcdogs.exe: 0x438220
38// Mutes the digital driver, ends all samples, and closes the active music stream.
40{
41 // Mute master volume (set to 0) for instant silence
42 // Mute digital master volume (set to 0) for instant silence via Miles AIL_set_digital_master_volume
44
45 /* tailcall */
46 return Audio_StopAllSamples();
47}
48
49// Original pcdogs.exe: 0x438250
50// Initializes RIFF sample playback with cached pitch, pan, volume, and optional looping. The RIFF tag is read before the null check, the slot index is unchecked, and a zero playback rate aborts startup.
51void Audio_StartSoundPlayback(int32_t slot_index, uint32_t const *riff_data, int32_t pitch_q12, int32_t volume, int32_t pan, char loop_flag)
52{
53 // Verify RIFF wave format signature
54 //
55 // Verify RIFF signature (0x46464952 = 'RIFF')
56 if (*(uint32_t *)riff_data != AUDIO_RIFF_SIGNATURE || !riff_data)
57 return;
58
59 AIL_HSAMPLE sample_handle = g_soundSlots[slot_index].sample_handle;
60
61 if (!sample_handle)
62 return;
63
64 Audio_ReleaseSoundHandle(slot_index);
65 AIL_init_sample(sample_handle);
66 AIL_set_sample_file(sample_handle, riff_data, 0);
67
68 int32_t base_playback_rate = AIL_sample_playback_rate(sample_handle);
69
70 g_soundSlots[slot_index].base_playback_rate = base_playback_rate;
71
72 if (!base_playback_rate)
73 return;
74
75 if (loop_flag)
76 AIL_set_sample_loop_count(sample_handle, 0);
77
78 g_soundSlots[slot_index].cached_volume = ((int32_t)AUDIO_INVALID_CACHE_VALUE);
79 g_soundSlots[slot_index].cached_pan = ((int32_t)AUDIO_INVALID_CACHE_VALUE);
80 g_soundSlots[slot_index].cached_playback_rate = ((int32_t)AUDIO_INVALID_CACHE_VALUE);
81 Audio_SetSamplePitch(slot_index, pitch_q12);
82 Audio_SetSamplePan(slot_index, pan);
83 Audio_SetSampleVolume(slot_index, volume);
84 AIL_start_sample(sample_handle);
85}
86
87// Original pcdogs.exe: 0x440e20
88// Removes the sound entry and stops its sample if playback had started; the slot index is unchecked.
89void Audio_StopSound(int32_t slot_index)
90{
91 if (Audio_FreeSoundSlot(slot_index, 1))
92 Audio_ReleaseSoundHandle(slot_index);
93}
94
95// Original pcdogs.exe: 0x440e40
96// Unlinks a sound entry, optionally clears its definition flag, and returns ordinary slots to the free list while reserving slot 8. Returns whether playback had started; the slot index is unchecked.
97uint8_t Audio_FreeSoundSlot(int32_t slot_index, BOOL clear_resource_flag)
98{
99 struct Audio_SoundDefinition *sound_def_ptr = g_soundEntries[slot_index].sound_def_ptr;
100
101 if (!sound_def_ptr)
102 {
103 return 0;
104 }
105
106 if (clear_resource_flag)
107 sound_def_ptr->flags &= (uint8_t)~AUDIO_SOUND_PROTECT_FROM_REPLACEMENT;
108
109 struct Audio_SoundEntry *prev = g_soundEntries[slot_index].prev;
110
111 if (prev)
112 prev->next = g_soundEntries[slot_index].next;
113 else
114 g_activeSoundList = g_soundEntries[slot_index].next;
115
116 struct Audio_SoundEntry *next = g_soundEntries[slot_index].next;
117
118 if (next)
119 next->prev = g_soundEntries[slot_index].prev;
120 else
121 g_soundSlotTail = g_soundEntries[slot_index].prev;
122
123 if (slot_index != AUDIO_RESERVED_CHANNEL_INDEX)
124 {
125 g_soundEntries[slot_index].next = g_soundSlotListPtr;
126 g_soundSlotListPtr = &g_soundEntries[slot_index];
127 }
128
129 uint8_t flags = g_soundEntries[slot_index].flags;
130
131 g_soundEntries[slot_index].sound_def_ptr = NULL;
132
134 {
135 return 0;
136 }
137
138 g_soundEntries[slot_index].flags = flags & (uint8_t)~AUDIO_CHANNEL_STARTED;
139
140 return 1;
141}
142
143// Original pcdogs.exe: 0x440f60
144// Allocates a free sound slot, reclaims an eligible active entry by playback state and priority, or reserves slot 8 for flagged definitions. Returns -1 when no replacement is available.
146{
147 struct Audio_SoundEntry *allocated_entry;
148
149 if (!(sound_def->flags & AUDIO_SOUND_RESERVED_CHANNEL))
150 {
151 allocated_entry = g_soundSlotListPtr;
152
153 if (!allocated_entry)
154 {
155 struct Audio_SoundEntry *active_entry = g_activeSoundList;
156 struct Audio_SoundEntry *replacement_entry = NULL;
157
158 for (; active_entry; active_entry = active_entry->next)
159 {
160 uint8_t flags = active_entry->sound_def_ptr->flags;
161
163 {
164 if (active_entry->flags & AUDIO_CHANNEL_STARTED && !(flags & AUDIO_SOUND_LOOP) && !Audio_IsSamplePlaying(((char *)active_entry - (char *)&g_soundEntries) / (int32_t)sizeof(struct Audio_SoundEntry)))
165 {
166 replacement_entry = active_entry;
167
168 break;
169 }
170
171 if (!replacement_entry)
172 {
173 struct Audio_SoundDefinition *sound_def_ptr = active_entry->sound_def_ptr;
174
175 if (!(sound_def_ptr->flags & AUDIO_SOUND_PROTECT_FROM_REPLACEMENT) && sound_def->replacement_priority <= sound_def_ptr->replacement_priority)
176 replacement_entry = active_entry;
177 }
178 }
179 }
180
181 allocated_entry = replacement_entry;
182
183 if (!replacement_entry)
185
186 Audio_FreeSoundSlot(((char *)replacement_entry - (char *)&g_soundEntries) / (int32_t)sizeof(struct Audio_SoundEntry), 0);
187 }
188
189 g_soundSlotListPtr = allocated_entry->next;
190 }
191 else
192 {
195 }
196
197 allocated_entry->next = NULL;
198 allocated_entry->prev = g_soundSlotTail;
199
200 struct Audio_SoundEntry *previous_tail = g_soundSlotTail;
201
202 if (!previous_tail)
203 g_activeSoundList = allocated_entry;
204 else
205 previous_tail->next = allocated_entry;
206
207 g_soundSlotTail = allocated_entry;
208
209 return ((char *)allocated_entry - (char *)&g_soundEntries) / (int32_t)sizeof(struct Audio_SoundEntry);
210}
211
212// Original pcdogs.exe: 0x4410d0
213// Searches by definition and emitter-pointer identity, or validates a supplied slot by definition and playback status. Removes completed matching entries during list searches and returns -1 if no usable match remains.
214int32_t Audio_FindSoundByType(int32_t slot_index, struct Audio_SoundDefinition *sound_def, struct Math_Vec3I32 *position)
215{
216 struct Audio_SoundDefinition *matched_definition = sound_def;
217 int32_t matched_slot_index = slot_index;
218
219 if (!(matched_slot_index >= 0 && matched_definition))
220 {
221 struct Audio_SoundEntry *active_entry = g_activeSoundList;
222
223 if (!active_entry)
225
226 while (true)
227 {
228 struct Audio_SoundEntry *next = active_entry->next;
229
230 if (active_entry->position_ptr == position && (!matched_definition || active_entry->sound_def_ptr == matched_definition))
231 {
232 matched_slot_index = ((char *)active_entry - (char *)&g_soundEntries) / (int32_t)sizeof(struct Audio_SoundEntry);
233
234 if (!(active_entry->flags & AUDIO_CHANNEL_STARTED))
235 break;
236
237 BOOL sample_still_playing = Audio_IsSamplePlaying(matched_slot_index);
238
239 if (sample_still_playing)
240 break;
241
242 Audio_FreeSoundSlot(matched_slot_index, sample_still_playing);
243 }
244
245 active_entry = next;
246
247 if (!next)
249 }
250
251 matched_definition = active_entry->sound_def_ptr;
252 }
253
254 if ((uint32_t)matched_slot_index >= AUDIO_CHANNEL_COUNT)
256
257 struct Audio_SoundDefinition *sound_def_ptr = g_soundEntries[matched_slot_index].sound_def_ptr;
258
259 if (sound_def_ptr != matched_definition)
261
262 int32_t sample_playing;
263
264 if (g_soundEntries[matched_slot_index].flags & AUDIO_CHANNEL_STARTED && !(sound_def_ptr->flags & AUDIO_SOUND_LOOP))
265 sample_playing = Audio_IsSamplePlaying(matched_slot_index);
266
267 if (!(g_soundEntries[matched_slot_index].flags & AUDIO_CHANNEL_STARTED) || sound_def_ptr->flags & AUDIO_SOUND_LOOP || sample_playing)
268 return matched_slot_index;
269
271}
272
273// Original pcdogs.exe: 0x441190
274// Stops all entries for a zero mask or removes nonlooping entries otherwise, initializing the free list when needed. A zero mask also reseeds sound timing and stops music.
275void Audio_UpdateSoundChannels(int32_t channel_mask)
276{
277 struct Audio_SoundEntry *active_entry = g_activeSoundList;
278
279 if (active_entry)
280 {
281 struct Audio_SoundEntry *next;
282
283 do
284 {
285 // Save the next entry before the current entry is unlinked.
286 next = active_entry->next;
287
288 int32_t slot_index = ((char *)active_entry - (char *)&g_soundEntries) / (int32_t)sizeof(struct Audio_SoundEntry);
289
290 if (!channel_mask)
291 Audio_StopSound(slot_index);
292 else if (!(active_entry->sound_def_ptr->flags & AUDIO_SOUND_LOOP) && Audio_FreeSoundSlot(slot_index, 0))
293 // Stop/end the sample when freeing the slot reports an active handle.
294 Audio_ReleaseSoundHandle(slot_index);
295
296 active_entry = next;
297 } while (next);
298 }
299 else if (!g_soundSlotListPtr)
300 {
301 for (int slot = 0; slot < AUDIO_RESERVED_CHANNEL_INDEX; ++slot)
302 {
303 g_soundEntries[slot].sound_def_ptr = NULL;
304 g_soundEntries[slot].next = &g_soundEntries[slot + 1];
305 }
308 }
309
310 if (channel_mask)
311 return;
312
314
315 /* tailcall */
317}
318
319// Original pcdogs.exe: 0x441240
320// Starts queued samples, updates randomized and spatial playback parameters, releases completed samples, and advances music fading. It swaps the sound random seed with the global seed so audio updates retain their own sequence.
322{
324 {
326
327 return;
328 }
329
330 uint32_t previous_random_seed = Math_SetRandomSeed(g_soundTimer);
331 struct Audio_SoundEntry *active_entry = g_activeSoundList;
332
333 g_soundTimer = previous_random_seed;
334
335 if (!active_entry)
336 {
339
340 return;
341 }
342
343 do
344 {
345 struct Audio_SoundEntry *next = active_entry->next;
346 uint8_t sample_started = active_entry->flags & AUDIO_CHANNEL_STARTED;
347
349 {
350 int32_t slot_index = ((char *)active_entry - (char *)&g_soundEntries) / (int32_t)sizeof(struct Audio_SoundEntry);
351 uint32_t volume_q12;
352
353 if (!sample_started)
354 {
355 struct Audio_SoundDefinition *volume_definition = active_entry->sound_def_ptr;
356 uint32_t volume_fp12 = volume_definition->volume_fp12;
357
358 if (volume_definition->flags & AUDIO_SOUND_RANDOM_VOLUME)
359 {
360 uint32_t range = volume_fp12 >> 1;
361
362 if (range)
363 {
364 uint32_t random_volume_offset = Math_GenerateRandom(range);
365
366 volume_fp12 += random_volume_offset - (range >> 1);
367 }
368 }
369
370 active_entry->volume = (uint16_t)volume_fp12;
371
372 struct Audio_SoundDefinition *pitch_definition = active_entry->sound_def_ptr;
373 uint32_t pitch_fp12 = pitch_definition->pitch_fp12;
374
375 if (pitch_definition->flags & AUDIO_SOUND_RANDOM_PITCH)
376 {
377 uint32_t pitch_random_range = pitch_fp12 >> AUDIO_RANDOM_PITCH_RANGE_SHIFT;
378
379 if (pitch_random_range)
380
381 pitch_fp12 += Math_GenerateRandom(pitch_random_range) - (pitch_random_range >> 1);
382 }
383
384 struct Audio_SoundDefinition *pan_definition = active_entry->sound_def_ptr;
385
386 active_entry->pitch = (uint16_t)pitch_fp12;
387
388 if (!(pan_definition->flags & AUDIO_SOUND_SPATIAL_PAN))
389 {
390 active_entry->pan = (int16_t)((uint16_t)pan_definition->pan << AUDIO_PACKED_PAN_SHIFT);
391 }
392 }
393
394 if (!sample_started || Audio_IsSamplePlaying(slot_index))
395 {
396 struct Audio_SoundDefinition *pitch_definition = active_entry->sound_def_ptr;
397 uint32_t pitch_q12 = (uint16_t)active_entry->pitch;
398 uint32_t adjusted_pitch_q12 = pitch_q12;
399
400 if (pitch_definition->flags & AUDIO_SOUND_DOPPLER_PITCH)
401 {
402 struct Math_Vec3I32 *position_ptr = active_entry->position_ptr;
403
404 if (position_ptr)
405 {
407 ? &g_cameraData.eye_pos
408 : &g_cameraData.target;
409 int32_t x = position_ptr->x;
410 int32_t relative_motion_x = active_entry->listener_pos.x - listener_position->x - active_entry->sound_pos.x + x;
411 int32_t emitter_z = position_ptr->z;
412 int32_t relative_motion_z = active_entry->listener_pos.z - listener_position->z - active_entry->sound_pos.z + emitter_z;
413
414 if (relative_motion_x || relative_motion_z)
415 {
416 int32_t listener_offset_x = listener_position->x - x;
417 int32_t listener_offset_z = listener_position->z - emitter_z;
418
419 if (listener_offset_x || listener_offset_z)
420 {
421 uint16_t listener_bearing = Math_CalculateAtan2FP12(listener_offset_z, listener_offset_x);
422 int32_t motion_bearing_difference = (Math_CalculateAtan2FP12(relative_motion_z, relative_motion_x) - listener_bearing) & AUDIO_PAN_WRAP_MASK;
423
424 if ((int16_t)motion_bearing_difference > AUDIO_PAN_HALF_TURN)
425
426 motion_bearing_difference = AUDIO_Q12_ONE - motion_bearing_difference;
427
428 uint32_t pitch_scale_q12 =
429 ((AUDIO_DOPPLER_BASE_SCALE_Q12 - (int32_t)(int16_t)motion_bearing_difference) * adjusted_pitch_q12) >> AUDIO_Q12_SHIFT;
430
431 adjusted_pitch_q12 = pitch_scale_q12;
432 g_soundVolumeArray[slot_index] = (uint16_t)pitch_scale_q12;
433 Audio_SetSamplePitch(slot_index, pitch_scale_q12);
434 }
435 }
436
437 struct Math_Vec3I32 *updated_emitter_position = active_entry->position_ptr;
438
439 active_entry->sound_pos.x = updated_emitter_position->x;
440 active_entry->sound_pos.y = updated_emitter_position->y;
441 active_entry->sound_pos.z = updated_emitter_position->z;
442
443 struct Math_Vec3I32 *updated_listener_position = &g_cameraData.eye_pos;
444
446 updated_listener_position = &g_cameraData.target;
447
448 pitch_q12 = adjusted_pitch_q12;
449
450 active_entry->listener_pos.x = updated_listener_position->x;
451 active_entry->listener_pos.y = updated_listener_position->y;
452 active_entry->listener_pos.z = updated_listener_position->z;
453 }
454 }
455
456 int16_t pan_angle = active_entry->pan;
457
458 volume_q12 = (uint16_t)active_entry->volume;
459
460 struct Audio_SoundDefinition *spatial_definition = active_entry->sound_def_ptr;
461 uint8_t flags = spatial_definition->flags;
462
464 {
465 int32_t distance_gain_q12 = (int32_t)volume_q12;
466 Audio_CalculateSpatialVolumeAndPan(active_entry->position_ptr, spatial_definition->spatial_range_fp12,
467 flags & AUDIO_SOUND_DISTANCE_VOLUME ? &distance_gain_q12 : NULL, &pan_angle);
468
470 {
471 volume_q12 = ((uint16_t)active_entry->volume * (uint32_t)distance_gain_q12) >> AUDIO_Q12_SHIFT;
472 Audio_SetSampleVolume(slot_index, (Settings_GetSfxVolume() * volume_q12) >> AUDIO_Q12_SHIFT);
473 }
474
475 if (active_entry->sound_def_ptr->flags & AUDIO_SOUND_SPATIAL_PAN)
476 Audio_SetSamplePan(slot_index, pan_angle);
477 else
478 pan_angle = active_entry->pan;
479 }
480
481 flags = active_entry->flags;
482
484 {
485 active_entry->flags = flags | AUDIO_CHANNEL_STARTED;
486
487 volume_q12 = (Settings_GetSfxVolume() * volume_q12) >> AUDIO_Q12_SHIFT;
488 g_soundVolumeArray[slot_index] = (uint16_t)pitch_q12;
489
490 int32_t game_complete = Save_IsGameComplete();
491 struct Audio_SoundDefinition *sample_definition;
492 uint32_t *riff_data;
493
494 if (game_complete == 1)
495 {
496 sample_definition = active_entry->sound_def_ptr;
497
498 riff_data = sample_definition->sample_table_ptr[1];
499 }
500
501 if (game_complete != 1 || !riff_data)
502 {
503 sample_definition = active_entry->sound_def_ptr;
504 riff_data = (uint32_t *)sample_definition->sample_table_ptr[0];
505 }
506
507 uint8_t loop_flag = sample_definition->flags & AUDIO_SOUND_LOOP;
508
509 Audio_StartSoundPlayback(slot_index, riff_data, pitch_q12, volume_q12, pan_angle, loop_flag);
510 }
511 }
512 else
513 Audio_FreeSoundSlot(slot_index, 0);
514 }
515
516 active_entry = next;
517 } while (active_entry);
518
521}
522
523// Original pcdogs.exe: 0x441740
524// Sets the pitch of playing samples to zero and clears saved pitch values for inactive slots.
526{
527 int32_t slot_index = 0;
528
529 for (uint16_t *paused_pitch_ptr = g_soundVolumeArray; paused_pitch_ptr < g_soundVolumeArray + AUDIO_CHANNEL_COUNT;)
530 {
531 int32_t sample_playing = Audio_IsSamplePlaying(slot_index);
532
533 // Check if this sound slot is currently playing
534 if (sample_playing)
535 Audio_SetSamplePitch(slot_index, 0);
536 else
537 *paused_pitch_ptr = (uint16_t)sample_playing;
538
539 paused_pitch_ptr = &paused_pitch_ptr[1];
540 slot_index += 1;
541 }
542}
543
544// Original pcdogs.exe: 0x441780
545// Restores each nonzero saved sample pitch across the nine sound slots.
547{
548 int32_t slot_index = 0;
549
550 for (uint16_t *paused_pitch_ptr = g_soundVolumeArray; paused_pitch_ptr < g_soundVolumeArray + AUDIO_CHANNEL_COUNT;)
551 {
552 uint16_t saved_pitch_q12 = *paused_pitch_ptr;
553
554 if (saved_pitch_q12) // Check if this slot has a stored pitch value (non-zero means it was paused)
555
556 // Restore the original pitch value to resume playback
557 Audio_SetSamplePitch(slot_index, (uint32_t)saved_pitch_q12);
558
559 paused_pitch_ptr = &paused_pitch_ptr[1];
560 slot_index += 1;
561 }
562}
#define AUDIO_INVALID_SOUND_INDEX
Definition constants.h:49
#define AUDIO_SOUND_LOOP
Definition constants.h:5
#define AUDIO_PAN_WRAP_MASK
Definition constants.h:28
#define AUDIO_FREE_CHANNEL_LAST_INDEX
Definition constants.h:42
#define AUDIO_RIFF_SIGNATURE
Definition constants.h:51
#define AUDIO_SOUND_RESERVED_CHANNEL
Definition constants.h:13
#define AUDIO_CHANNEL_STARTED
Definition constants.h:14
#define AUDIO_SOUND_DISTANCE_VOLUME
Definition constants.h:6
#define AUDIO_SOUND_RANDOM_VOLUME
Definition constants.h:9
#define AUDIO_Q12_ONE
Definition constants.h:24
#define AUDIO_DOPPLER_BASE_SCALE_Q12
Definition constants.h:56
#define AUDIO_RANDOM_PITCH_RANGE_SHIFT
Definition constants.h:47
#define AUDIO_PACKED_PAN_SHIFT
Definition constants.h:46
#define AUDIO_PAN_HALF_TURN
Definition constants.h:26
#define AUDIO_SOUND_DOPPLER_PITCH
Definition constants.h:11
#define AUDIO_INVALID_CACHE_VALUE
Definition constants.h:48
#define AUDIO_RESERVED_CHANNEL_INDEX
Definition constants.h:40
#define AUDIO_SOUND_SPATIAL_PAN
Definition constants.h:7
#define AUDIO_CHANNEL_COUNT
Definition constants.h:41
#define AUDIO_SOUND_PROTECT_FROM_REPLACEMENT
Definition constants.h:12
#define AUDIO_Q12_SHIFT
Definition constants.h:22
#define AUDIO_SOUND_RANDOM_PITCH
Definition constants.h:8
void Audio_SetSamplePan(int32_t slot_index, int32_t pan_fp12)
Definition samples.c:30
uint8_t Audio_CalculateSpatialVolumeAndPan(struct Math_Vec3I32 *sound_position, uint32_t audible_radius, int32_t *out_volume_q12, int16_t *out_pan_angle)
Definition spatial.c:240
void Audio_ProcessMusicFade(void)
Definition music.c:284
void Audio_SetSampleVolume(int32_t slot_index, int32_t volume_fp12)
Definition samples.c:54
void Audio_StopMusicAndPauseThunk(void)
Definition music.c:337
uint8_t Audio_FreeSoundSlot(int32_t slot_index, BOOL clear_resource_flag)
Definition channels.c:97
int32_t Audio_IsSamplePlaying(int32_t slot_index)
Definition samples.c:23
void Audio_SetSamplePitch(int32_t slot_index, int32_t pitch_scale_q12)
Definition samples.c:73
void Audio_StopAllSamples(void)
Definition samples.c:13
#define g_soundTimer
Definition globals.h:51
#define g_soundSlotListPtr
Definition globals.h:48
#define g_soundEntries
Definition globals.h:39
#define Audio_InitializeSystem_DigitalDriver
Definition globals.h:24
#define g_soundSlotTail
Definition globals.h:45
#define g_activeSoundList
Definition globals.h:42
#define g_soundSlots
Definition globals.h:27
#define g_soundVolumeArray
Definition globals.h:36
#define g_cameraData
Definition globals.h:63
void Audio_ResumeAllSounds()
Definition channels.c:546
uint8_t Audio_FreeSoundSlot(int32_t slot_index, BOOL clear_resource_flag)
Definition channels.c:97
void Audio_StopAllSounds()
Definition channels.c:39
void Audio_ProcessSoundQueue()
Definition channels.c:321
void Audio_StopSound(int32_t slot_index)
Definition channels.c:89
void Audio_UpdateSoundChannels(int32_t channel_mask)
Definition channels.c:275
void Audio_StartSoundPlayback(int32_t slot_index, uint32_t const *riff_data, int32_t pitch_q12, int32_t volume, int32_t pan, char loop_flag)
Definition channels.c:51
void Audio_ReleaseSoundHandle(int32_t slot_index)
Definition channels.c:27
void Audio_PauseAllSounds()
Definition channels.c:525
int32_t Audio_FindSoundByType(int32_t slot_index, struct Audio_SoundDefinition *sound_def, struct Math_Vec3I32 *position)
Definition channels.c:214
int32_t Audio_AllocateSoundSlot(struct Audio_SoundDefinition *sound_def)
Definition channels.c:145
void * AIL_HSAMPLE
Definition common.h:7
#define GAME_OVERLAY_SKIP_NODE_ANIMATION
Definition constants.h:34
#define GAME_TRANSITION_SCRIPT_PAUSED
Definition constants.h:20
#define GAME_OVERLAY_SKIP_OBJECT_RENDER
Definition constants.h:36
#define Game_FrameTransitionFlags
Definition globals.h:47
#define Game_FrameOverlayFlags
Definition globals.h:44
int32_t AIL_set_digital_master_volume(AIL_HDIGDRIVER driver, int32_t volume)
int32_t AIL_set_sample_file(AIL_HSAMPLE sample, void const *file_image, int32_t block)
int32_t AIL_start_sample(AIL_HSAMPLE sample)
int32_t AIL_set_sample_loop_count(AIL_HSAMPLE sample, int32_t loop_count)
int32_t AIL_end_sample(AIL_HSAMPLE sample)
int32_t AIL_init_sample(AIL_HSAMPLE sample)
int32_t AIL_sample_playback_rate(AIL_HSAMPLE sample)
int32_t AIL_stop_sample(AIL_HSAMPLE sample)
uint32_t Math_SetRandomSeed(uint32_t seed)
int16_t Math_CalculateAtan2FP12(int32_t y, int32_t x)
uint32_t Math_GenerateRandom(uint32_t range)
uint32_t Timer_GetElapsedTickCount()
Definition timer.c:24
int32_t Save_IsGameComplete(void)
Definition progress.c:27
uint16_t Settings_GetSfxVolume(void)
Definition preferences.c:13
void ** sample_table_ptr
Definition types.h:67
int32_t volume_fp12
Definition types.h:72
uint8_t replacement_priority
Definition types.h:70
int32_t spatial_range_fp12
Definition types.h:74
int32_t pitch_fp12
Definition types.h:73
int32_t z
Definition types.h:104
struct Audio_SoundEntry * prev
Definition types.h:95
struct Audio_SoundEntry * next
Definition types.h:96
uint8_t flags
Definition types.h:117
struct Audio_SoundDefinition * sound_def_ptr
Definition types.h:97
int16_t volume
Definition types.h:114
int16_t pitch
Definition types.h:115
struct Audio_SoundEntry::@100114371203023164022211357127366373354240353340 sound_pos
struct Audio_SoundEntry::@003200205222232126264271107277074317264256323153 listener_pos
struct Math_Vec3I32 * position_ptr
Definition types.h:98
int16_t pan
Definition types.h:116
int32_t x
Definition types.h:102
int32_t y
Definition types.h:103
int32_t y
Definition types.h:471
int32_t x
Definition types.h:470
int32_t z
Definition types.h:472