diff --git a/src/sfmt/SFMT.h b/src/sfmt/SFMT.h index ddaabf246..b7d3c42f3 100644 --- a/src/sfmt/SFMT.h +++ b/src/sfmt/SFMT.h @@ -28,6 +28,8 @@ * unsigned int and 64-bit unsigned int in hexadecimal format. */ +#include + #ifndef SFMT_H #define SFMT_H diff --git a/src/sound/s_sound.cpp b/src/sound/s_sound.cpp index b94b9c5eb..ee3e63027 100644 --- a/src/sound/s_sound.cpp +++ b/src/sound/s_sound.cpp @@ -501,26 +501,9 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source, int seen = 0; if (source != NULL && channel == CHAN_AUTO) { - // Select a channel that isn't already playing something. - // Try channel 0 first, then travel from channel 7 down. - if (!IsChannelUsed(type, source, 0, &seen)) - { - 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; - } - } + // In the old sound system, 'AUTO' hijacked one of the other channels. + // Now, with CHANF_OVERLAP at our disposal that isn't needed anymore. Just set the flag and let all sounds play on channel 0. + chanflags |= CHANF_OVERLAP; } // If this actor is already playing something on the selected channel, stop it.