MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / sound_maintain

Function sound_maintain

TheForceEngine/TFE_DarkForces/sound.cpp:357–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355 }
356
357 SoundEffectId sound_maintain(SoundEffectId idInstance, SoundSourceId idSound, vec3_fixed pos)
358 {
359 if (idSound)
360 {
361 s32 vol, pan;
362 GameSound* sound = getSoundPtr(idSound);
363 soundCalculateCue(sound, pos.x, pos.y, pos.z, &vol, &pan);
364 s_lastMaintainVolume = vol;
365
366 if (vol)
367 {
368 // Check to see if the sound is still playing at specific intervals.
369 if (idInstance && !(s_curTick & 0x0f))
370 {
371 if (ImGetParam(idInstance, soundPlayCount) == 0)
372 {
373 sound_stop(idInstance);
374 idInstance = 0;
375 }
376 }
377
378 if (!idInstance)
379 {
380 idInstance = sound_play(idSound);
381 }
382 sound_setVolume(idInstance, vol);
383 sound_setPan(idInstance, pan);
384 }
385 else if (idInstance)
386 {
387 sound_stop(idInstance);
388 idInstance = 0;
389 }
390 return idInstance;
391 }
392 return 0;
393 }
394
395 ////////////////////////////////////////////////////////////////////
396 // Internal

Callers 4

inf_elevatorVolumeFunction · 0.85
ambientSoundTaskFuncFunction · 0.85
projectileTaskFuncFunction · 0.85
bobaFett_handleForcesFunction · 0.85

Calls 7

getSoundPtrFunction · 0.85
soundCalculateCueFunction · 0.85
ImGetParamFunction · 0.85
sound_stopFunction · 0.85
sound_playFunction · 0.85
sound_setVolumeFunction · 0.85
sound_setPanFunction · 0.85

Tested by

no test coverage detected