From: divverent Date: Mon, 23 Nov 2009 06:36:19 +0000 (+0000) Subject: fix sound spatialization of edited sounds X-Git-Tag: xonotic-v0.1.0preview~1134 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=75853fb8551fe78f89ec44c7914a867c096e04d7;p=xonotic%2Fdarkplaces.git fix sound spatialization of edited sounds git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9512 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/clvm_cmds.c b/clvm_cmds.c index e10ab54d..b2a4f3cd 100644 --- a/clvm_cmds.c +++ b/clvm_cmds.c @@ -162,6 +162,7 @@ static void VM_CL_sound (void) prvm_edict_t *entity; float volume; float attenuation; + vec3_t org; VM_SAFEPARMCOUNT(5, VM_CL_sound); @@ -189,7 +190,8 @@ static void VM_CL_sound (void) return; } - S_StartSound(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), entity->fields.client->origin, volume, attenuation); + CL_VM_GetEntitySoundOrigin(PRVM_NUM_FOR_EDICT(entity), org); + S_StartSound(MAX_EDICTS + PRVM_NUM_FOR_EDICT(entity), channel, S_FindName(sample), org, volume, attenuation); } // #483 void(vector origin, string sample, float volume, float attenuation) pointsound diff --git a/snd_main.c b/snd_main.c index 9be23f2b..fdb0c739 100644 --- a/snd_main.c +++ b/snd_main.c @@ -1466,7 +1466,8 @@ int S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f if (ch->entnum == entnum && (ch->entchannel == entchannel || entchannel == -1) ) { S_SetChannelVolume(ch_idx, fvol); - ch->dist_mult = attenuation / (64.0f * snd_soundradius.value); + ch->dist_mult = attenuation / snd_soundradius.value; + SND_Spatialize(ch_idx, false); return ch_idx; } }