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

Method AdjustSound

sndlib/sdlsound.cpp:421–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void lnxsound::AdjustSound(int sound_uid, float f_volume, float f_pan, uint16_t frequency) {
422 int current_slot;
423
424 if (sound_device == 0)
425 return;
426
427 if ((current_slot = ValidateUniqueId(sound_uid)) == -1)
428 return;
429 if (sound_cache[current_slot].m_status == SSF_UNUSED)
430 return;
431
432 sound_buffer_info *sb = &sound_cache[current_slot];
433 play_information *play_info = sb->play_info;
434
435 play_info->left_volume = play_info->right_volume = f_volume;
436 if (f_pan < 0.0)
437 play_info->right_volume += f_volume * f_pan;
438 else
439 play_info->left_volume -= f_volume * f_pan;
440}
441
442void lnxsound::AdjustSound(int sound_uid, pos_state *cur_pos, float adjusted_volume, float reverb) {
443 if (sound_device == 0)

Callers 3

SetVolumeMethod · 0.80
BeginSoundFrameMethod · 0.80
Update2dSoundMethod · 0.80

Calls 1

vm_NormalizeVectorFunction · 0.85

Tested by

no test coverage detected