summaryrefslogtreecommitdiff
path: root/src/i_sound.c
diff options
context:
space:
mode:
authorSimon Howard2006-03-23 17:43:15 +0000
committerSimon Howard2006-03-23 17:43:15 +0000
commitd54a1ab430987fb6bda3c05ee2db2e9d012a6341 (patch)
tree46279b4dc9969641e9e99dc0dcddf58e642cc0c7 /src/i_sound.c
parente920b33fe51d5f129935ae7d8bfc85bf37263e3d (diff)
downloadchocolate-doom-d54a1ab430987fb6bda3c05ee2db2e9d012a6341.tar.gz
chocolate-doom-d54a1ab430987fb6bda3c05ee2db2e9d012a6341.tar.bz2
chocolate-doom-d54a1ab430987fb6bda3c05ee2db2e9d012a6341.zip
Separate variables for config file volume levels and sound API internal
volume levels (this is how the Vanilla code behaves). Fixes sound behavior on level 8! Subversion-branch: /trunk/chocolate-doom Subversion-revision: 429
Diffstat (limited to 'src/i_sound.c')
-rw-r--r--src/i_sound.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/i_sound.c b/src/i_sound.c
index 17f5e7d0..b0dfca71 100644
--- a/src/i_sound.c
+++ b/src/i_sound.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: i_sound.c 426 2006-03-18 23:24:04Z fraggle $
+// $Id: i_sound.c 429 2006-03-23 17:43:15Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -128,7 +128,7 @@
//-----------------------------------------------------------------------------
static const char
-rcsid[] = "$Id: i_sound.c 426 2006-03-18 23:24:04Z fraggle $";
+rcsid[] = "$Id: i_sound.c 429 2006-03-23 17:43:15Z fraggle $";
#include <stdio.h>
#include <stdlib.h>
@@ -348,12 +348,7 @@ void I_SetChannels()
void I_SetSfxVolume(int volume)
{
- // Identical to DOS.
- // Basically, this should propagate
- // the menu/config file setting
- // to the state variable used in
- // the mixing.
- snd_SfxVolume = volume;
+ // Unused
}
@@ -501,8 +496,8 @@ I_UpdateSoundParams
if (!sound_initialised)
return;
- left = ((254 - sep) * vol) / 15;
- right = ((sep) * vol) / 15;
+ left = ((254 - sep) * vol) / 127;
+ right = ((sep) * vol) / 127;
Mix_SetPanning(handle, left, right);
}
@@ -586,6 +581,7 @@ void I_ShutdownMusic(void)
}
static boolean musicpaused = false;
+static int currentMusicVolume;
//
// SDL_mixer's native MIDI music playing does not pause properly.
@@ -599,7 +595,7 @@ static void UpdateMusicVolume(void)
if (musicpaused)
vol = 0;
else
- vol = (snd_MusicVolume * MIX_MAX_VOLUME) / 15;
+ vol = (currentMusicVolume * MIX_MAX_VOLUME) / 127;
Mix_VolumeMusic(vol);
}
@@ -608,7 +604,7 @@ static void UpdateMusicVolume(void)
void I_SetMusicVolume(int volume)
{
// Internal state variable.
- snd_MusicVolume = volume;
+ currentMusicVolume = volume;
UpdateMusicVolume();
}