]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
added snd_staticvolume to snd_null.c
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 2 Jul 2003 05:58:28 +0000 (05:58 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 2 Jul 2003 05:58:28 +0000 (05:58 +0000)
fixed prototype of SND_Spatialize in sound.h

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3137 d7cf8633-e32d-0410-b094-e92efae38249

snd_dma.c
snd_null.c
sound.h

index 337f1987c80c1bb3afc7c378e6b90e20b38832f0..152a2147ba69f8baa0f78cdee28f6029ce728cc5 100644 (file)
--- 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;
 
index e699ac565313fec746773e8e85a0ae1bb1f1cec2..f1948f476d045976969e11030094870b9ca4e592 100755 (executable)
@@ -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 4f44d24049fe947b220659ce6d2ceb1a6c02b532..b93f05d59cd08d00c2fa588798173d03825b94e6 100644 (file)
--- 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);