mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 03:52:12 -04:00
rename max_instances back to parallel_sfx_limit and make configurable
This commit is contained in:
parent
4ea5788c90
commit
d2a411bd20
@ -2253,6 +2253,13 @@ default_t defaults[] = {
|
|||||||
"1 to play sounds in full length"
|
"1 to play sounds in full length"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"parallel_sfx_limit",
|
||||||
|
(config_t *) ¶llel_sfx_limit, NULL,
|
||||||
|
{3}, {1, MAX_CHANNELS}, number, ss_none, wad_no,
|
||||||
|
"parallel same-sound limit"
|
||||||
|
},
|
||||||
|
|
||||||
// [FG] music backend
|
// [FG] music backend
|
||||||
{
|
{
|
||||||
"midi_player",
|
"midi_player",
|
||||||
|
@ -250,7 +250,7 @@ static int S_CompareChannels(const void *arg_a, const void *arg_b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// How many instances of the same sfx can be playing concurrently
|
// How many instances of the same sfx can be playing concurrently
|
||||||
static const unsigned int max_instances = 3;
|
int parallel_sfx_limit = 3;
|
||||||
|
|
||||||
//
|
//
|
||||||
// S_getChannel :
|
// S_getChannel :
|
||||||
@ -299,7 +299,7 @@ static int S_getChannel(const mobj_t *origin, sfxinfo_t *sfxinfo,
|
|||||||
// Limit the number of identical sounds playing at once
|
// Limit the number of identical sounds playing at once
|
||||||
if (channels[cnum].sfxinfo == sfxinfo)
|
if (channels[cnum].sfxinfo == sfxinfo)
|
||||||
{
|
{
|
||||||
if (++instances >= max_instances)
|
if (++instances >= parallel_sfx_limit)
|
||||||
{
|
{
|
||||||
if (priority < channels[cnum].priority)
|
if (priority < channels[cnum].priority)
|
||||||
{
|
{
|
||||||
|
@ -80,6 +80,8 @@ typedef struct sfxinfo_struct {
|
|||||||
unsigned int alen; // length of converted sound pointed to by data
|
unsigned int alen; // length of converted sound pointed to by data
|
||||||
} sfxinfo_t;
|
} sfxinfo_t;
|
||||||
|
|
||||||
|
extern int parallel_sfx_limit;
|
||||||
|
|
||||||
//
|
//
|
||||||
// MusicInfo struct.
|
// MusicInfo struct.
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user