summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2010-05-09 18:13:04 +0000
committerAndrey Nazarov <skuller@skuller.net>2010-05-09 18:13:04 +0000
commitc877967be5689e19ae50ef7e241535d0e7b83a59 (patch)
tree2fde7c255d05d94538413110a48c3120cf7395d7
parent633c832e43c42bce0a685a93acfc3937c84ed6bb (diff)
Put S_StopAllSounds back into S_Init to prevent crash due to uninitialized playsound list.
Enable setting AL_MIN_GAIN for listener entity.
-rw-r--r--source/snd_al.c2
-rw-r--r--source/snd_main.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/source/snd_al.c b/source/snd_al.c
index 30b5143..78be0d1 100644
--- a/source/snd_al.c
+++ b/source/snd_al.c
@@ -134,7 +134,7 @@ void AL_PlayChannel( channel_t *ch ) {
//qalSourcei( ch->srcnum, AL_LOOPING, sc->loopstart == -1 ? AL_FALSE : AL_TRUE );
qalSourcei( ch->srcnum, AL_LOOPING, ch->autosound ? AL_TRUE : AL_FALSE );
qalSourcef( ch->srcnum, AL_GAIN, ch->master_vol );
-#if 0
+#if 1
// anything coming from the view entity will always be full volume
if( ch->entnum == -1 || ch->entnum == listener_entnum ) {
qalSourcef( ch->srcnum, AL_MIN_GAIN, 1 );
diff --git a/source/snd_main.c b/source/snd_main.c
index 1c60fc4..9c38b13 100644
--- a/source/snd_main.c
+++ b/source/snd_main.c
@@ -204,8 +204,6 @@ void S_Init( void ) {
}
}
- S_ClearBuffer();
-
Com_Printf( "sound sampling rate: %i\n", dma.speed );
s_started = SS_DMA;
}
@@ -218,6 +216,9 @@ void S_Init( void ) {
Cmd_Register( c_sound );
+ // init playsound list
+ S_StopAllSounds();
+
S_InitScaletable();
num_sfx = 0;