mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-07 09:50:45 +00:00
- don't let CHANF_AUTO hijack other channels.
With CHANF_OVERLAP this isn't needed anymore - any sound started on CHAN_AUTO can actually play on this channel with overlap implicitly allowed. This has the added advantage that these sounds can be reliably accessed with other function by using CHAN_AUTO. # Conflicts: # src/v_2ddrawer.cpp
This commit is contained in:
parent
af10281799
commit
17add7f47f
2 changed files with 5 additions and 20 deletions
|
@ -28,6 +28,8 @@
|
||||||
* unsigned int and 64-bit unsigned int in hexadecimal format.
|
* unsigned int and 64-bit unsigned int in hexadecimal format.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <inttypes.h>
|
||||||
|
|
||||||
#ifndef SFMT_H
|
#ifndef SFMT_H
|
||||||
#define SFMT_H
|
#define SFMT_H
|
||||||
|
|
||||||
|
|
|
@ -501,26 +501,9 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
|
||||||
int seen = 0;
|
int seen = 0;
|
||||||
if (source != NULL && channel == CHAN_AUTO)
|
if (source != NULL && channel == CHAN_AUTO)
|
||||||
{
|
{
|
||||||
// Select a channel that isn't already playing something.
|
// In the old sound system, 'AUTO' hijacked one of the other channels.
|
||||||
// Try channel 0 first, then travel from channel 7 down.
|
// Now, with CHANF_OVERLAP at our disposal that isn't needed anymore. Just set the flag and let all sounds play on channel 0.
|
||||||
if (!IsChannelUsed(type, source, 0, &seen))
|
chanflags |= CHANF_OVERLAP;
|
||||||
{
|
|
||||||
channel = 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (channel = 7; channel > 0; --channel)
|
|
||||||
{
|
|
||||||
if (!IsChannelUsed(type, source, channel, &seen))
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (channel == 0)
|
|
||||||
{ // Crap. No free channels.
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this actor is already playing something on the selected channel, stop it.
|
// If this actor is already playing something on the selected channel, stop it.
|
||||||
|
|
Loading…
Reference in a new issue