mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-03 06:20:57 +00:00
renamed the global channels to snd_channels. removed the global variable
sound_nominal_clip_dist and made it into a macro in snd_dma.c. snd_dma.c: general whitespace and formatting cleanup. (S_StaticSound): Explicitly cast vol to int when assigning it to ss->master_vol. (S_UpdateAmbientSounds): changed the type of vol from float to int. used int casts in its calculations. added explicit int casts when assigning values to chan->master_vol. (S_Update_): added explicit unsigned int casts in endtime calculations. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@181 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
80a3a0df30
commit
5658a9e28d
3 changed files with 101 additions and 101 deletions
141
Quake/snd_dma.c
141
Quake/snd_dma.c
|
@ -34,20 +34,21 @@ void S_StopAllSoundsC(void);
|
||||||
// Internal sound data & structures
|
// Internal sound data & structures
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
|
||||||
channel_t channels[MAX_CHANNELS];
|
channel_t snd_channels[MAX_CHANNELS];
|
||||||
int total_channels;
|
int total_channels;
|
||||||
|
|
||||||
int snd_blocked = 0;
|
int snd_blocked = 0;
|
||||||
qboolean snd_initialized = false;
|
qboolean snd_initialized = false;
|
||||||
|
|
||||||
volatile dma_t *shm = NULL;
|
|
||||||
volatile dma_t sn;
|
volatile dma_t sn;
|
||||||
|
volatile dma_t *shm = NULL;
|
||||||
|
|
||||||
vec3_t listener_origin;
|
vec3_t listener_origin;
|
||||||
vec3_t listener_forward;
|
vec3_t listener_forward;
|
||||||
vec3_t listener_right;
|
vec3_t listener_right;
|
||||||
vec3_t listener_up;
|
vec3_t listener_up;
|
||||||
vec_t sound_nominal_clip_dist=1000.0;
|
|
||||||
|
#define sound_nominal_clip_dist 1000.0
|
||||||
|
|
||||||
int soundtime; // sample PAIRS
|
int soundtime; // sample PAIRS
|
||||||
int paintedtime; // sample PAIRS
|
int paintedtime; // sample PAIRS
|
||||||
|
@ -99,7 +100,6 @@ void S_SoundInfo_f(void)
|
||||||
S_Startup
|
S_Startup
|
||||||
================
|
================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void S_Startup (void)
|
void S_Startup (void)
|
||||||
{
|
{
|
||||||
if (!snd_initialized)
|
if (!snd_initialized)
|
||||||
|
@ -180,7 +180,7 @@ void S_Init (void)
|
||||||
if (sound_started == 0)
|
if (sound_started == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// provides a tick sound until washed clean
|
// provides a tick sound until washed clean
|
||||||
// if (shm->buffer)
|
// if (shm->buffer)
|
||||||
// shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging
|
// shm->buffer[4] = shm->buffer[5] = 0x7f; // force a pop for debugging
|
||||||
|
|
||||||
|
@ -194,8 +194,7 @@ void S_Init (void)
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
// Shutdown sound engine
|
// Shutdown sound engine
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
void S_Shutdown (void)
|
||||||
void S_Shutdown(void)
|
|
||||||
{
|
{
|
||||||
if (!sound_started)
|
if (!sound_started)
|
||||||
return;
|
return;
|
||||||
|
@ -232,7 +231,7 @@ sfx_t *S_FindName (char *name)
|
||||||
Sys_Error ("Sound name too long: %s", name);
|
Sys_Error ("Sound name too long: %s", name);
|
||||||
|
|
||||||
// see if already loaded
|
// see if already loaded
|
||||||
for (i=0 ; i < num_sfx ; i++)
|
for (i = 0; i < num_sfx; i++)
|
||||||
{
|
{
|
||||||
if (!Q_strcmp(known_sfx[i].name, name))
|
if (!Q_strcmp(known_sfx[i].name, name))
|
||||||
{
|
{
|
||||||
|
@ -297,9 +296,11 @@ sfx_t *S_PrecacheSound (char *name)
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
SND_PickChannel
|
SND_PickChannel
|
||||||
|
|
||||||
|
picks a channel based on priorities, empty slots, number of channels
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
channel_t *SND_PickChannel(int entnum, int entchannel)
|
channel_t *SND_PickChannel (int entnum, int entchannel)
|
||||||
{
|
{
|
||||||
int ch_idx;
|
int ch_idx;
|
||||||
int first_to_die;
|
int first_to_die;
|
||||||
|
@ -308,23 +309,23 @@ channel_t *SND_PickChannel(int entnum, int entchannel)
|
||||||
// Check for replacement sound, or find the best one to replace
|
// Check for replacement sound, or find the best one to replace
|
||||||
first_to_die = -1;
|
first_to_die = -1;
|
||||||
life_left = 0x7fffffff;
|
life_left = 0x7fffffff;
|
||||||
for (ch_idx=NUM_AMBIENTS ; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS ; ch_idx++)
|
for (ch_idx = NUM_AMBIENTS; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS; ch_idx++)
|
||||||
{
|
{
|
||||||
if (entchannel != 0 // channel 0 never overrides
|
if (entchannel != 0 // channel 0 never overrides
|
||||||
&& channels[ch_idx].entnum == entnum
|
&& snd_channels[ch_idx].entnum == entnum
|
||||||
&& (channels[ch_idx].entchannel == entchannel || entchannel == -1) )
|
&& (snd_channels[ch_idx].entchannel == entchannel || entchannel == -1) )
|
||||||
{ // allways override sound from same entity
|
{ // always override sound from same entity
|
||||||
first_to_die = ch_idx;
|
first_to_die = ch_idx;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't let monster sounds override player sounds
|
// don't let monster sounds override player sounds
|
||||||
if (channels[ch_idx].entnum == cl.viewentity && entnum != cl.viewentity && channels[ch_idx].sfx)
|
if (snd_channels[ch_idx].entnum == cl.viewentity && entnum != cl.viewentity && snd_channels[ch_idx].sfx)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (channels[ch_idx].end - paintedtime < life_left)
|
if (snd_channels[ch_idx].end - paintedtime < life_left)
|
||||||
{
|
{
|
||||||
life_left = channels[ch_idx].end - paintedtime;
|
life_left = snd_channels[ch_idx].end - paintedtime;
|
||||||
first_to_die = ch_idx;
|
first_to_die = ch_idx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,18 +333,20 @@ channel_t *SND_PickChannel(int entnum, int entchannel)
|
||||||
if (first_to_die == -1)
|
if (first_to_die == -1)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (channels[first_to_die].sfx)
|
if (snd_channels[first_to_die].sfx)
|
||||||
channels[first_to_die].sfx = NULL;
|
snd_channels[first_to_die].sfx = NULL;
|
||||||
|
|
||||||
return &channels[first_to_die];
|
return &snd_channels[first_to_die];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=================
|
=================
|
||||||
SND_Spatialize
|
SND_Spatialize
|
||||||
|
|
||||||
|
spatializes a channel
|
||||||
=================
|
=================
|
||||||
*/
|
*/
|
||||||
void SND_Spatialize(channel_t *ch)
|
void SND_Spatialize (channel_t *ch)
|
||||||
{
|
{
|
||||||
vec_t dot;
|
vec_t dot;
|
||||||
vec_t dist;
|
vec_t dist;
|
||||||
|
@ -391,7 +394,7 @@ void SND_Spatialize(channel_t *ch)
|
||||||
// Start a sound effect
|
// Start a sound effect
|
||||||
// =======================================================================
|
// =======================================================================
|
||||||
|
|
||||||
void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
|
void S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation)
|
||||||
{
|
{
|
||||||
channel_t *target_chan, *check;
|
channel_t *target_chan, *check;
|
||||||
sfxcache_t *sc;
|
sfxcache_t *sc;
|
||||||
|
@ -438,8 +441,8 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
|
||||||
|
|
||||||
// if an identical sound has also been started this frame, offset the pos
|
// if an identical sound has also been started this frame, offset the pos
|
||||||
// a bit to keep it from just making the first one louder
|
// a bit to keep it from just making the first one louder
|
||||||
check = &channels[NUM_AMBIENTS];
|
check = &snd_channels[NUM_AMBIENTS];
|
||||||
for (ch_idx=NUM_AMBIENTS ; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS ; ch_idx++, check++)
|
for (ch_idx = NUM_AMBIENTS; ch_idx < NUM_AMBIENTS + MAX_DYNAMIC_CHANNELS; ch_idx++, check++)
|
||||||
{
|
{
|
||||||
if (check == target_chan)
|
if (check == target_chan)
|
||||||
continue;
|
continue;
|
||||||
|
@ -455,23 +458,23 @@ void S_StartSound(int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float f
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_StopSound(int entnum, int entchannel)
|
void S_StopSound (int entnum, int entchannel)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0 ; i<MAX_DYNAMIC_CHANNELS ; i++)
|
for (i = 0; i < MAX_DYNAMIC_CHANNELS; i++)
|
||||||
{
|
{
|
||||||
if (channels[i].entnum == entnum
|
if (snd_channels[i].entnum == entnum
|
||||||
&& channels[i].entchannel == entchannel)
|
&& snd_channels[i].entchannel == entchannel)
|
||||||
{
|
{
|
||||||
channels[i].end = 0;
|
snd_channels[i].end = 0;
|
||||||
channels[i].sfx = NULL;
|
snd_channels[i].sfx = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_StopAllSounds(qboolean clear)
|
void S_StopAllSounds (qboolean clear)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -480,13 +483,13 @@ void S_StopAllSounds(qboolean clear)
|
||||||
|
|
||||||
total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; // no statics
|
total_channels = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; // no statics
|
||||||
|
|
||||||
for (i=0 ; i<MAX_CHANNELS ; i++)
|
for (i = 0; i < MAX_CHANNELS; i++)
|
||||||
{
|
{
|
||||||
if (channels[i].sfx)
|
if (snd_channels[i].sfx)
|
||||||
channels[i].sfx = NULL;
|
snd_channels[i].sfx = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(channels, 0, MAX_CHANNELS * sizeof(channel_t));
|
memset(snd_channels, 0, MAX_CHANNELS * sizeof(channel_t));
|
||||||
|
|
||||||
if (clear)
|
if (clear)
|
||||||
S_ClearBuffer ();
|
S_ClearBuffer ();
|
||||||
|
@ -538,7 +541,7 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ss = &channels[total_channels];
|
ss = &snd_channels[total_channels];
|
||||||
total_channels++;
|
total_channels++;
|
||||||
|
|
||||||
sc = S_LoadSound (sfx);
|
sc = S_LoadSound (sfx);
|
||||||
|
@ -553,8 +556,8 @@ void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation)
|
||||||
|
|
||||||
ss->sfx = sfx;
|
ss->sfx = sfx;
|
||||||
VectorCopy (origin, ss->origin);
|
VectorCopy (origin, ss->origin);
|
||||||
ss->master_vol = vol;
|
ss->master_vol = (int)vol;
|
||||||
ss->dist_mult = (attenuation/64) / sound_nominal_clip_dist;
|
ss->dist_mult = (attenuation / 64) / sound_nominal_clip_dist;
|
||||||
ss->end = paintedtime + sc->length;
|
ss->end = paintedtime + sc->length;
|
||||||
|
|
||||||
SND_Spatialize (ss);
|
SND_Spatialize (ss);
|
||||||
|
@ -571,8 +574,7 @@ S_UpdateAmbientSounds
|
||||||
void S_UpdateAmbientSounds (void)
|
void S_UpdateAmbientSounds (void)
|
||||||
{
|
{
|
||||||
mleaf_t *l;
|
mleaf_t *l;
|
||||||
float vol;
|
int vol, ambient_channel;
|
||||||
int ambient_channel;
|
|
||||||
channel_t *chan;
|
channel_t *chan;
|
||||||
|
|
||||||
//johnfitz -- no ambients when disconnected
|
//johnfitz -- no ambients when disconnected
|
||||||
|
@ -587,30 +589,30 @@ void S_UpdateAmbientSounds (void)
|
||||||
l = Mod_PointInLeaf (listener_origin, cl.worldmodel);
|
l = Mod_PointInLeaf (listener_origin, cl.worldmodel);
|
||||||
if (!l || !ambient_level.value)
|
if (!l || !ambient_level.value)
|
||||||
{
|
{
|
||||||
for (ambient_channel = 0 ; ambient_channel< NUM_AMBIENTS ; ambient_channel++)
|
for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++)
|
||||||
channels[ambient_channel].sfx = NULL;
|
snd_channels[ambient_channel].sfx = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ambient_channel = 0 ; ambient_channel< NUM_AMBIENTS ; ambient_channel++)
|
for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++)
|
||||||
{
|
{
|
||||||
chan = &channels[ambient_channel];
|
chan = &snd_channels[ambient_channel];
|
||||||
chan->sfx = ambient_sfx[ambient_channel];
|
chan->sfx = ambient_sfx[ambient_channel];
|
||||||
|
|
||||||
vol = ambient_level.value * l->ambient_sound_level[ambient_channel];
|
vol = (int) (ambient_level.value * l->ambient_sound_level[ambient_channel]);
|
||||||
if (vol < 8)
|
if (vol < 8)
|
||||||
vol = 0;
|
vol = 0;
|
||||||
|
|
||||||
// don't adjust volume too fast
|
// don't adjust volume too fast
|
||||||
if (chan->master_vol < vol)
|
if (chan->master_vol < vol)
|
||||||
{
|
{
|
||||||
chan->master_vol += host_frametime * ambient_fade.value;
|
chan->master_vol += (int) (host_frametime * ambient_fade.value);
|
||||||
if (chan->master_vol > vol)
|
if (chan->master_vol > vol)
|
||||||
chan->master_vol = vol;
|
chan->master_vol = vol;
|
||||||
}
|
}
|
||||||
else if (chan->master_vol > vol)
|
else if (chan->master_vol > vol)
|
||||||
{
|
{
|
||||||
chan->master_vol -= host_frametime * ambient_fade.value;
|
chan->master_vol -= (int) (host_frametime * ambient_fade.value);
|
||||||
if (chan->master_vol < vol)
|
if (chan->master_vol < vol)
|
||||||
chan->master_vol = vol;
|
chan->master_vol = vol;
|
||||||
}
|
}
|
||||||
|
@ -627,7 +629,7 @@ S_Update
|
||||||
Called once each time through the main loop
|
Called once each time through the main loop
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
|
void S_Update (vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
int total;
|
int total;
|
||||||
|
@ -648,8 +650,8 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
|
||||||
combine = NULL;
|
combine = NULL;
|
||||||
|
|
||||||
// update spatialization for static and dynamic sounds
|
// update spatialization for static and dynamic sounds
|
||||||
ch = channels+NUM_AMBIENTS;
|
ch = snd_channels + NUM_AMBIENTS;
|
||||||
for (i=NUM_AMBIENTS ; i<total_channels; i++, ch++)
|
for (i = NUM_AMBIENTS; i < total_channels; i++, ch++)
|
||||||
{
|
{
|
||||||
if (!ch->sfx)
|
if (!ch->sfx)
|
||||||
continue;
|
continue;
|
||||||
|
@ -671,8 +673,8 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// search for one
|
// search for one
|
||||||
combine = channels+MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS;
|
combine = snd_channels + MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS;
|
||||||
for (j=MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS ; j<i; j++, combine++)
|
for (j = MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS; j < i; j++, combine++)
|
||||||
{
|
{
|
||||||
if (combine->sfx == ch->sfx)
|
if (combine->sfx == ch->sfx)
|
||||||
break;
|
break;
|
||||||
|
@ -701,12 +703,12 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
|
||||||
if (snd_show.value)
|
if (snd_show.value)
|
||||||
{
|
{
|
||||||
total = 0;
|
total = 0;
|
||||||
ch = channels;
|
ch = snd_channels;
|
||||||
for (i=0 ; i<total_channels; i++, ch++)
|
for (i = 0; i < total_channels; i++, ch++)
|
||||||
{
|
{
|
||||||
if (ch->sfx && (ch->leftvol || ch->rightvol) )
|
if (ch->sfx && (ch->leftvol || ch->rightvol) )
|
||||||
{
|
{
|
||||||
//Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name);
|
// Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name);
|
||||||
total++;
|
total++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -718,7 +720,7 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up)
|
||||||
S_Update_();
|
S_Update_();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetSoundtime(void)
|
void GetSoundtime (void)
|
||||||
{
|
{
|
||||||
int samplepos;
|
int samplepos;
|
||||||
static int buffers;
|
static int buffers;
|
||||||
|
@ -779,15 +781,14 @@ void S_Update_(void)
|
||||||
// check to make sure that we haven't overshot
|
// check to make sure that we haven't overshot
|
||||||
if (paintedtime < soundtime)
|
if (paintedtime < soundtime)
|
||||||
{
|
{
|
||||||
//Con_Printf ("S_Update_ : overflow\n");
|
// Con_Printf ("S_Update_ : overflow\n");
|
||||||
paintedtime = soundtime;
|
paintedtime = soundtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
// mix ahead of current position
|
// mix ahead of current position
|
||||||
endtime = soundtime + _snd_mixahead.value * shm->speed;
|
endtime = soundtime + (unsigned int)(_snd_mixahead.value * shm->speed);
|
||||||
samps = shm->samples >> (shm->channels-1);
|
samps = shm->samples >> (shm->channels - 1);
|
||||||
if (endtime - soundtime > samps)
|
endtime = min(endtime, (unsigned int)(soundtime + samps));
|
||||||
endtime = soundtime + samps;
|
|
||||||
|
|
||||||
S_PaintChannels (endtime);
|
S_PaintChannels (endtime);
|
||||||
|
|
||||||
|
@ -827,15 +828,15 @@ console functions
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void S_Play(void)
|
void S_Play (void)
|
||||||
{
|
{
|
||||||
static int hash=345;
|
static int hash = 345;
|
||||||
int i;
|
int i;
|
||||||
char name[256];
|
char name[256];
|
||||||
sfx_t *sfx;
|
sfx_t *sfx;
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i<Cmd_Argc())
|
while (i < Cmd_Argc())
|
||||||
{
|
{
|
||||||
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
||||||
{
|
{
|
||||||
|
@ -850,16 +851,16 @@ void S_Play(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_PlayVol(void)
|
void S_PlayVol (void)
|
||||||
{
|
{
|
||||||
static int hash=543;
|
static int hash = 543;
|
||||||
int i;
|
int i;
|
||||||
float vol;
|
float vol;
|
||||||
char name[256];
|
char name[256];
|
||||||
sfx_t *sfx;
|
sfx_t *sfx;
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i<Cmd_Argc())
|
while (i < Cmd_Argc())
|
||||||
{
|
{
|
||||||
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
if (!Q_strrchr(Cmd_Argv(i), '.'))
|
||||||
{
|
{
|
||||||
|
@ -869,13 +870,13 @@ void S_PlayVol(void)
|
||||||
else
|
else
|
||||||
Q_strcpy(name, Cmd_Argv(i));
|
Q_strcpy(name, Cmd_Argv(i));
|
||||||
sfx = S_PrecacheSound(name);
|
sfx = S_PrecacheSound(name);
|
||||||
vol = Q_atof(Cmd_Argv(i+1));
|
vol = Q_atof(Cmd_Argv(i + 1));
|
||||||
S_StartSound(hash++, 0, sfx, listener_origin, vol, 1.0);
|
S_StartSound(hash++, 0, sfx, listener_origin, vol, 1.0);
|
||||||
i+=2;
|
i+=2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_SoundList(void)
|
void S_SoundList (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
sfx_t *sfx;
|
sfx_t *sfx;
|
||||||
|
@ -883,12 +884,12 @@ void S_SoundList(void)
|
||||||
int size, total;
|
int size, total;
|
||||||
|
|
||||||
total = 0;
|
total = 0;
|
||||||
for (sfx=known_sfx, i=0 ; i<num_sfx ; i++, sfx++)
|
for (sfx = known_sfx, i = 0; i < num_sfx; i++, sfx++)
|
||||||
{
|
{
|
||||||
sc = (sfxcache_t *) Cache_Check (&sfx->cache);
|
sc = (sfxcache_t *) Cache_Check (&sfx->cache);
|
||||||
if (!sc)
|
if (!sc)
|
||||||
continue;
|
continue;
|
||||||
size = sc->length*sc->width*(sc->stereo+1);
|
size = sc->length*sc->width*(sc->stereo + 1);
|
||||||
total += size;
|
total += size;
|
||||||
if (sc->loopstart >= 0)
|
if (sc->loopstart >= 0)
|
||||||
Con_SafePrintf ("L"); //johnfitz -- was Con_Printf
|
Con_SafePrintf ("L"); //johnfitz -- was Con_Printf
|
||||||
|
|
|
@ -168,7 +168,7 @@ void S_PaintChannels (int endtime)
|
||||||
memset(paintbuffer, 0, (end - paintedtime) * sizeof(portable_samplepair_t));
|
memset(paintbuffer, 0, (end - paintedtime) * sizeof(portable_samplepair_t));
|
||||||
|
|
||||||
// paint in the channels.
|
// paint in the channels.
|
||||||
ch = channels;
|
ch = snd_channels;
|
||||||
for (i = 0; i < total_channels; i++, ch++)
|
for (i = 0; i < total_channels; i++, ch++)
|
||||||
{
|
{
|
||||||
if (!ch->sfx)
|
if (!ch->sfx)
|
||||||
|
|
|
@ -148,7 +148,7 @@ void SNDDMA_UnblockSound(void);
|
||||||
#define MAX_DYNAMIC_CHANNELS 128 //johnfitz -- was 8
|
#define MAX_DYNAMIC_CHANNELS 128 //johnfitz -- was 8
|
||||||
|
|
||||||
|
|
||||||
extern channel_t channels[MAX_CHANNELS];
|
extern channel_t snd_channels[MAX_CHANNELS];
|
||||||
// 0 to MAX_DYNAMIC_CHANNELS-1 = normal entity sounds
|
// 0 to MAX_DYNAMIC_CHANNELS-1 = normal entity sounds
|
||||||
// MAX_DYNAMIC_CHANNELS to MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS -1 = water, etc
|
// MAX_DYNAMIC_CHANNELS to MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS -1 = water, etc
|
||||||
// MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS to total_channels = static sounds
|
// MAX_DYNAMIC_CHANNELS + NUM_AMBIENTS to total_channels = static sounds
|
||||||
|
@ -170,7 +170,6 @@ extern vec3_t listener_right;
|
||||||
extern vec3_t listener_up;
|
extern vec3_t listener_up;
|
||||||
extern volatile dma_t *shm;
|
extern volatile dma_t *shm;
|
||||||
extern volatile dma_t sn;
|
extern volatile dma_t sn;
|
||||||
extern vec_t sound_nominal_clip_dist;
|
|
||||||
|
|
||||||
extern cvar_t loadas8bit;
|
extern cvar_t loadas8bit;
|
||||||
extern cvar_t bgmvolume;
|
extern cvar_t bgmvolume;
|
||||||
|
|
Loading…
Reference in a new issue