From: havoc Date: Wed, 2 Jul 2003 05:58:28 +0000 (+0000) Subject: added snd_staticvolume to snd_null.c X-Git-Tag: xonotic-v0.1.0preview~6572 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2903081de6c5335d7b64bc5e83db6b9d9aaf2f21;p=xonotic%2Fdarkplaces.git added snd_staticvolume to snd_null.c fixed prototype of SND_Spatialize in sound.h git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3137 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/snd_dma.c b/snd_dma.c index 337f1987..152a2147 100644 --- a/snd_dma.c +++ b/snd_dma.c @@ -477,7 +477,7 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f target_chan->master_vol = vol; target_chan->entnum = entnum; target_chan->entchannel = entchannel; - SND_Spatialize(target_chan); + SND_Spatialize(target_chan, false); if (!target_chan->leftvol && !target_chan->rightvol) return; // not audible at all @@ -660,7 +660,7 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) ss->dist_mult = (attenuation/64) / sound_nominal_clip_dist; ss->end = paintedtime + sc->length; - SND_Spatialize (ss); + SND_Spatialize (ss, true); } @@ -753,7 +753,7 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) { if (!ch->sfx) continue; - SND_Spatialize(ch, i > MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS); // respatialize channel + SND_Spatialize(ch, i >= MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS); // respatialize channel if (!ch->leftvol && !ch->rightvol) continue; diff --git a/snd_null.c b/snd_null.c index e699ac56..f1948f47 100755 --- a/snd_null.c +++ b/snd_null.c @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. cvar_t bgmvolume = {CVAR_SAVE, "bgmvolume", "1"}; cvar_t volume = {CVAR_SAVE, "volume", "0.7"}; +cvar_t snd_staticvolume = {CVAR_SAVE, "snd_staticvolume", "1"}; qboolean snd_initialized = false; @@ -31,6 +32,7 @@ void S_Init (void) { Cvar_RegisterVariable(&bgmvolume); Cvar_RegisterVariable(&volume); + Cvar_RegisterVariable(&snd_staticvolume); } void S_AmbientOff (void) diff --git a/sound.h b/sound.h index 4f44d240..b93f05d5 100644 --- a/sound.h +++ b/sound.h @@ -113,7 +113,7 @@ void S_InitPaintChannels (void); channel_t *SND_PickChannel(int entnum, int entchannel); // spatializes a channel -void SND_Spatialize(channel_t *ch); +void SND_Spatialize(channel_t *ch, int isstatic); // initializes cycling through a DMA buffer and returns information on it qboolean SNDDMA_Init(void);