summaryrefslogtreecommitdiff
path: root/src/doom/s_sound.c
diff options
context:
space:
mode:
authorSimon Howard2008-09-11 21:03:48 +0000
committerSimon Howard2008-09-11 21:03:48 +0000
commitb868352951acee0e556d702e5e90aa67d9a2b39e (patch)
treeb07b281ae6be155d2b80fdc09c2daa3c3132d238 /src/doom/s_sound.c
parentd863f019a2d19f1146d92c4db71883ab2ead87ec (diff)
downloadchocolate-doom-b868352951acee0e556d702e5e90aa67d9a2b39e.tar.gz
chocolate-doom-b868352951acee0e556d702e5e90aa67d9a2b39e.tar.bz2
chocolate-doom-b868352951acee0e556d702e5e90aa67d9a2b39e.zip
Refactor configuration file system to allow configuration file variables
to be bound in a distributed fashion around the program. Remove dependency of m_config.c on doom/. Subversion-branch: /branches/raven-branch Subversion-revision: 1222
Diffstat (limited to 'src/doom/s_sound.c')
-rw-r--r--src/doom/s_sound.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/doom/s_sound.c b/src/doom/s_sound.c
index fa236970..e78f763a 100644
--- a/src/doom/s_sound.c
+++ b/src/doom/s_sound.c
@@ -110,7 +110,7 @@ static musicinfo_t *mus_playing = NULL;
// Number of channels to use
-int numChannels = 8;
+int snd_channels = 8;
//
// Initializes sound stuff, including volume
@@ -131,10 +131,10 @@ void S_Init(int sfxVolume, int musicVolume)
// Allocating the internal channels for mixing
// (the maximum numer of sounds rendered
// simultaneously) within zone memory.
- channels = Z_Malloc(numChannels*sizeof(channel_t), PU_STATIC, 0);
+ channels = Z_Malloc(snd_channels*sizeof(channel_t), PU_STATIC, 0);
// Free all channels for use
- for (i=0 ; i<numChannels ; i++)
+ for (i=0 ; i<snd_channels ; i++)
{
channels[i].sfxinfo = 0;
}
@@ -175,7 +175,7 @@ static void S_StopChannel(int cnum)
// check to see if other channels are playing the sound
- for (i=0; i<numChannels; i++)
+ for (i=0; i<snd_channels; i++)
{
if (cnum != i && c->sfxinfo == channels[i].sfxinfo)
{
@@ -203,7 +203,7 @@ void S_Start(void)
// kill all playing sounds at start of level
// (trust me - a good idea)
- for (cnum=0 ; cnum<numChannels ; cnum++)
+ for (cnum=0 ; cnum<snd_channels ; cnum++)
{
if (channels[cnum].sfxinfo)
{
@@ -252,7 +252,7 @@ void S_StopSound(mobj_t *origin)
{
int cnum;
- for (cnum=0 ; cnum<numChannels ; cnum++)
+ for (cnum=0 ; cnum<snd_channels ; cnum++)
{
if (channels[cnum].sfxinfo && channels[cnum].origin == origin)
{
@@ -275,7 +275,7 @@ static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo)
channel_t* c;
// Find an open channel
- for (cnum=0 ; cnum<numChannels ; cnum++)
+ for (cnum=0 ; cnum<snd_channels ; cnum++)
{
if (!channels[cnum].sfxinfo)
{
@@ -289,10 +289,10 @@ static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo)
}
// None available
- if (cnum == numChannels)
+ if (cnum == snd_channels)
{
// Look for lower priority
- for (cnum=0 ; cnum<numChannels ; cnum++)
+ for (cnum=0 ; cnum<snd_channels ; cnum++)
{
if (channels[cnum].sfxinfo->priority >= sfxinfo->priority)
{
@@ -300,7 +300,7 @@ static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo)
}
}
- if (cnum == numChannels)
+ if (cnum == snd_channels)
{
// FUCK! No lower priority. Sorry, Charlie.
return -1;
@@ -524,7 +524,7 @@ void S_UpdateSounds(mobj_t *listener)
sfxinfo_t* sfx;
channel_t* c;
- for (cnum=0; cnum<numChannels; cnum++)
+ for (cnum=0; cnum<snd_channels; cnum++)
{
c = &channels[cnum];
sfx = c->sfxinfo;