]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - snd_dma.c
Fixed partially the sound code for DP video captures. It still can't sync with the...
[xonotic/darkplaces.git] / snd_dma.c
index 11fb8c326a991da7f51e052e97b0bcd1d0b581c4..1c6957e30c804ebb02bf9a6f538b0ff3c8239ddc 100644 (file)
--- a/snd_dma.c
+++ b/snd_dma.c
@@ -40,6 +40,9 @@ void S_Update_();
 void S_StopAllSounds(qboolean clear);
 void S_StopAllSoundsC(void);
 
+void S_ClearBuffer (void);
+
+
 // =======================================================================
 // Internal sound data & structures
 // =======================================================================
@@ -48,7 +51,6 @@ channel_t channels[MAX_CHANNELS];
 unsigned int total_channels;
 
 int snd_blocked = 0;
-static qboolean snd_ambient = 1;
 cvar_t snd_initialized = { CVAR_READONLY, "snd_initialized", "0"};
 cvar_t snd_streaming = { CVAR_SAVE, "snd_streaming", "1"};
 
@@ -107,18 +109,6 @@ qboolean fakedma = false;
 int fakedma_updates = 15;
 
 
-void S_AmbientOff (void)
-{
-       snd_ambient = false;
-}
-
-
-void S_AmbientOn (void)
-{
-       snd_ambient = true;
-}
-
-
 void S_SoundInfo_f(void)
 {
        if (!sound_started || !shm)
@@ -132,7 +122,7 @@ void S_SoundInfo_f(void)
        Con_Printf("%5d samplepos\n", shm->samplepos);
        Con_Printf("%5d samplebits\n", shm->format.width * 8);
        Con_Printf("%5d speed\n", shm->format.speed);
-       Con_Printf("0x%x dma buffer\n", shm->buffer);
+       Con_Printf("%p dma buffer\n", shm->buffer);
        Con_Printf("%5u total_channels\n", total_channels);
 }
 
@@ -690,6 +680,12 @@ void S_ResumeGameSounds (void)
        }
 }
 
+void S_SetChannelVolume (unsigned int ch_ind, float fvol)
+{
+       channels[ch_ind].master_vol = fvol * 255;
+}
+
+
 void S_ClearBuffer(void)
 {
        int             clear;
@@ -808,7 +804,7 @@ void S_UpdateAmbientSounds (void)
        for (ambient_channel = 0 ; ambient_channel < NUM_AMBIENTS;ambient_channel++)
                channels[ambient_channel].sfx = NULL;
 
-       if (!snd_ambient || ambient_level.value <= 0 || !cl.worldmodel || !cl.worldmodel->brush.AmbientSoundLevelsForPoint)
+       if (ambient_level.value <= 0 || !cl.worldmodel || !cl.worldmodel->brush.AmbientSoundLevelsForPoint)
                return;
 
        cl.worldmodel->brush.AmbientSoundLevelsForPoint(cl.worldmodel, listener_vieworigin, ambientlevels, sizeof(ambientlevels));