remove parallel sfx limit (#972)

This commit is contained in:
Fabian Greffrath 2023-04-05 20:49:51 +02:00 committed by GitHub
parent b09678d980
commit 0ff8bdb36b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 0 additions and 52 deletions

View File

@ -406,13 +406,6 @@ default_t defaults[] = {
"number of sound effects handled simultaneously"
},
{
"parallel_sfx_limit",
(config_t *) &parallel_sfx_limit, NULL,
{4}, {1, MAX_CHANNELS}, number, ss_none, wad_no,
"parallel same-sound limit (MAX_CHANNELS = disable)"
},
// [FG] music backend
{
"midi_player",

View File

@ -212,28 +212,6 @@ static int S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source,
return *vol > 0;
}
//
// S_CompareChannels
//
// A comparison function that determines which sound channel should
// take priority. Can be used with std::sort.
//
// Returns true if the first channel should precede the second.
//
static int S_CompareChannels(const void *arg_a, const void *arg_b)
{
const channel_t *a = (const channel_t *) arg_a;
const channel_t *b = (const channel_t *) arg_b;
// Note that a higher priority number means lower priority!
const int ret = a->priority - b->priority;
return ret ? ret : (b->idnum - a->idnum);
}
// How many instances of the same sfx can be playing concurrently
int parallel_sfx_limit;
//
// S_getChannel :
//
@ -247,10 +225,6 @@ static int S_getChannel(const mobj_t *origin, sfxinfo_t *sfxinfo,
{
// channel number to use
int cnum;
int instances = 0;
// Sort the sound channels by descending priority levels
qsort(channels, numChannels, sizeof(channel_t), S_CompareChannels);
// haleyjd 09/28/06: moved this here. If we kill a sound already
// being played, we can use that channel. There is no need to
@ -279,23 +253,6 @@ static int S_getChannel(const mobj_t *origin, sfxinfo_t *sfxinfo,
S_StopChannel(cnum);
return cnum;
}
// Limit the number of identical sounds playing at once
if (channels[cnum].sfxinfo == sfxinfo)
{
if (++instances >= parallel_sfx_limit)
{
if (priority < channels[cnum].priority)
{
S_StopChannel(cnum);
return cnum;
}
else
{
return -1;
}
}
}
}
// Find an open channel

View File

@ -66,8 +66,6 @@ typedef struct sfxinfo_struct {
} sfxinfo_t;
extern int parallel_sfx_limit;
//
// MusicInfo struct.
//