MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / AllocSoundFile

Function AllocSoundFile

sndlib/soundload.cpp:305–318  ·  view source on GitHub ↗

Allocs a sound file for use, returns -1 if error, else index on success

Source from the content-addressed store, hash-verified

303
304// Allocs a sound file for use, returns -1 if error, else index on success
305int AllocSoundFile() {
306 for (int i = 0; i < MAX_SOUND_FILES; i++) {
307 if (SoundFiles[i].used == 0) {
308 memset(&SoundFiles[i], 0, sizeof(sound_file_info));
309 SoundFiles[i].used = 1;
310
311 Num_sound_files++;
312 return i;
313 }
314 }
315
316 Int3(); // No sound files free!
317 return -1;
318}
319
320// Frees sound index n
321void FreeSoundFile(int n) {

Callers 1

LoadSoundFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected