|
|
@ -9,6 +9,8 @@ extern sfx_t *known_sfx; |
|
|
extern int num_sfx; |
|
|
extern int num_sfx; |
|
|
|
|
|
|
|
|
FMOD_SYSTEM *fmod_system = NULL; |
|
|
FMOD_SYSTEM *fmod_system = NULL; |
|
|
|
|
|
int fmod_playernumber = 0; |
|
|
|
|
|
|
|
|
static qboolean fmod_ownership = false; |
|
|
static qboolean fmod_ownership = false; |
|
|
static int fmod_samplerate; |
|
|
static int fmod_samplerate; |
|
|
static float old_volume = -1.0f; |
|
|
static float old_volume = -1.0f; |
|
|
@ -334,7 +336,7 @@ static void S_UpdateAmbientSounds() |
|
|
mleaf_t *leaf; |
|
|
mleaf_t *leaf; |
|
|
float vol, channel_vol; |
|
|
float vol, channel_vol; |
|
|
|
|
|
|
|
|
if (cl.worldmodel && cl.worldmodel->nodes) |
|
|
|
|
|
|
|
|
if (cls.state == ca_connected && cl.worldmodel && cl.worldmodel->nodes) |
|
|
leaf = Mod_PointInLeaf(listener_origin, cl.worldmodel); |
|
|
leaf = Mod_PointInLeaf(listener_origin, cl.worldmodel); |
|
|
else |
|
|
else |
|
|
leaf = NULL; |
|
|
leaf = NULL; |
|
|
@ -566,8 +568,7 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) |
|
|
FMOD_VectorCopy(forward, fmod_forward); |
|
|
FMOD_VectorCopy(forward, fmod_forward); |
|
|
FMOD_VectorCopy(up, fmod_up); |
|
|
FMOD_VectorCopy(up, fmod_up); |
|
|
|
|
|
|
|
|
// TODO: set listener number based on player ID (for split-screen) |
|
|
|
|
|
FMOD_System_Set3DListenerAttributes(fmod_system, 0, &fmod_pos, NULL, &fmod_forward, &fmod_up); |
|
|
|
|
|
|
|
|
FMOD_System_Set3DListenerAttributes(fmod_system, fmod_playernumber, &fmod_pos, NULL, &fmod_forward, &fmod_up); |
|
|
|
|
|
|
|
|
FMOD_ChannelGroup_SetVolume(sfx_channelGroup, sfxvolume.value); |
|
|
FMOD_ChannelGroup_SetVolume(sfx_channelGroup, sfxvolume.value); |
|
|
|
|
|
|
|
|
|