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

Method Update2dSound

sndlib/hlsoundlib.cpp:830–850  ·  view source on GitHub ↗

Allows for changes in a currently playing sound

Source from the content-addressed store, hash-verified

828}
829// Allows for changes in a currently playing sound
830int hlsSystem::Update2dSound(int hlsound_uid, float volume, float pan) {
831 int sound_obj_index;
832
833 if (!m_f_hls_system_init)
834 return -1;
835 if (volume < 0.0f)
836 volume = 0.0f;
837 else if (volume > 1.0f)
838 volume = 1.0f;
839 if (pan < -1.0f)
840 pan = -1.0f;
841 else if (pan > 1.0f)
842 pan = 1.0f;
843 if (!m_f_hls_system_init)
844 return -1;
845 sound_obj_index = ValidateUniqueId(hlsound_uid);
846 if (sound_obj_index == -1)
847 return -1;
848 m_ll_sound_ptr->AdjustSound(m_sound_objects[sound_obj_index].m_sound_uid, volume, pan, 22050);
849 return hlsound_uid;
850}
851bool hlsSystem::ComputePlayInfo(int sound_obj_index, vector *virtual_pos, vector *virtual_vel, float *adjusted_volume) {
852 int sound_index;
853

Callers 1

UpdateTerrainSoundFunction · 0.80

Calls 1

AdjustSoundMethod · 0.80

Tested by

no test coverage detected