mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-31 01:11:15 +00:00
- Blood: don't play the same looped sound multiple times on the same actor.
This caused some strong echoing on E4M6.
This commit is contained in:
parent
1de9c63d45
commit
b54e52330c
3 changed files with 9 additions and 3 deletions
|
@ -1084,13 +1084,14 @@ void SoundEngine::SetPitch(FSoundChan *chan, float pitch)
|
||||||
// Is a sound being played by a specific emitter?
|
// Is a sound being played by a specific emitter?
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int SoundEngine::GetSoundPlayingInfo (int sourcetype, const void *source, int sound_id)
|
int SoundEngine::GetSoundPlayingInfo (int sourcetype, const void *source, int sound_id, int chann)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
if (sound_id > 0)
|
if (sound_id > 0)
|
||||||
{
|
{
|
||||||
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan)
|
||||||
{
|
{
|
||||||
|
if (chann != -1 && chann != chan->EntChannel) continue;
|
||||||
if (chan->OrgID == sound_id && (sourcetype == SOURCE_Any ||
|
if (chan->OrgID == sound_id && (sourcetype == SOURCE_Any ||
|
||||||
(chan->SourceType == sourcetype &&
|
(chan->SourceType == sourcetype &&
|
||||||
chan->Source == source)))
|
chan->Source == source)))
|
||||||
|
@ -1103,6 +1104,7 @@ int SoundEngine::GetSoundPlayingInfo (int sourcetype, const void *source, int so
|
||||||
{
|
{
|
||||||
for (FSoundChan* chan = Channels; chan != NULL; chan = chan->NextChan)
|
for (FSoundChan* chan = Channels; chan != NULL; chan = chan->NextChan)
|
||||||
{
|
{
|
||||||
|
if (chann != -1 && chann != chan->EntChannel) continue;
|
||||||
if ((sourcetype == SOURCE_Any || (chan->SourceType == sourcetype && chan->Source == source)))
|
if ((sourcetype == SOURCE_Any || (chan->SourceType == sourcetype && chan->Source == source)))
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
|
|
|
@ -303,7 +303,7 @@ public:
|
||||||
bool IsSourcePlayingSomething(int sourcetype, const void* actor, int channel, int sound_id = -1);
|
bool IsSourcePlayingSomething(int sourcetype, const void* actor, int channel, int sound_id = -1);
|
||||||
|
|
||||||
// Stop and resume music, during game PAUSE.
|
// Stop and resume music, during game PAUSE.
|
||||||
int GetSoundPlayingInfo(int sourcetype, const void* source, int sound_id);
|
int GetSoundPlayingInfo(int sourcetype, const void* source, int sound_id, int chan = -1);
|
||||||
void UnloadAllSounds();
|
void UnloadAllSounds();
|
||||||
void Reset();
|
void Reset();
|
||||||
void MarkUsed(int num);
|
void MarkUsed(int num);
|
||||||
|
|
|
@ -204,7 +204,11 @@ void sfxPlay3DSoundCP(spritetype* pSprite, int soundId, int playchannel, int pla
|
||||||
|
|
||||||
auto sfx = soundEngine->GetSfx(sid);
|
auto sfx = soundEngine->GetSfx(sid);
|
||||||
EChanFlags flags = playchannel == -1 ? CHANF_OVERLAP : CHANF_NONE;
|
EChanFlags flags = playchannel == -1 ? CHANF_OVERLAP : CHANF_NONE;
|
||||||
if (sfx && sfx->LoopStart >= 0) flags |= CHANF_LOOP;
|
if (sfx && sfx->LoopStart >= 0)
|
||||||
|
{
|
||||||
|
flags |= CHANF_LOOP;
|
||||||
|
flags &= ~CHANF_OVERLAP;
|
||||||
|
}
|
||||||
|
|
||||||
soundEngine->StartSound(SOURCE_Actor, pSprite, &svec, playchannel, flags, sid, volume * (0.8f / 80.f), attenuation, nullptr, pitch / 65536.f);
|
soundEngine->StartSound(SOURCE_Actor, pSprite, &svec, playchannel, flags, sid, volume * (0.8f / 80.f), attenuation, nullptr, pitch / 65536.f);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue