From 435a3885cabdd4ab7dd730064962e352621a082f Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 31 Jan 2020 11:17:33 -0800 Subject: [PATCH] Get rid of the LoadSound3D method It no longer does anything since there's no separate buffer for 3D sfx. --- src/sound/s_sound.cpp | 48 ------------------------------------- src/sound/s_soundinternal.h | 1 - 2 files changed, 49 deletions(-) diff --git a/src/sound/s_sound.cpp b/src/sound/s_sound.cpp index c190cd6d2..3cea11e5a 100644 --- a/src/sound/s_sound.cpp +++ b/src/sound/s_sound.cpp @@ -175,7 +175,6 @@ void SoundEngine::CacheSound (sfxinfo_t *sfx) // Since we do not know in what format the sound will be used, we have to cache both. FSoundLoadBuffer SoundBuffer; LoadSound(sfx, &SoundBuffer); - LoadSound3D(sfx, &SoundBuffer); sfx->bUsed = true; } } @@ -576,7 +575,6 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source, if (attenuation > 0 && type != SOURCE_None) { - LoadSound3D(sfx, &SoundBuffer); chan = (FSoundChan*)GSnd->StartSound3D (sfx->data, &listener, float(volume), rolloff, float(attenuation), pitch, basepriority, pos, vel, channel, startflags, NULL); } else @@ -681,7 +679,6 @@ void SoundEngine::RestartChannel(FSoundChan *chan) return; } - LoadSound3D(sfx, &SoundBuffer); chan->ChanFlags &= ~(CHANF_EVICTED|CHANF_ABSTIME); ochan = (FSoundChan*)GSnd->StartSound3D(sfx->data, &listener, chan->Volume, &chan->Rolloff, chan->DistanceScale, chan->Pitch, chan->Priority, pos, vel, chan->EntChannel, startflags, chan); @@ -781,51 +778,6 @@ sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer) return sfx; } -void SoundEngine::LoadSound3D(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer) -{ - if (GSnd->IsNull()) return; - - if(sfx->data.isValid()) - return; - - //DPrintf(DMSG_NOTIFY, "Loading sound \"%s\" (%td)\n", sfx->name.GetChars(), sfx - &S_sfx[0]); - - if (pBuffer->mBuffer.size() > 0) - { - sfx->data = GSnd->LoadSoundBuffered(pBuffer); - } - else if (sfx->lumpnum >= 0) - { - auto sfxdata = ReadSound(sfx->lumpnum); - int size = sfxdata.Size(); - if (size <= 8) return; - int32_t dmxlen = LittleLong(((int32_t *)sfxdata.Data())[1]); - - // If the sound is voc, use the custom loader. - if (strncmp((const char *)sfxdata.Data(), "Creative Voice File", 19) == 0) - { - sfx->data = GSnd->LoadSoundVoc(sfxdata.Data(), size); - } - // If the sound is raw, just load it as such. - else if (sfx->bLoadRAW) - { - sfx->data = GSnd->LoadSoundRaw(sfxdata.Data(), size, sfx->RawRate, 1, 8, sfx->LoopStart); - } - // Otherwise, try the sound as DMX format. - else if (((uint8_t *)sfxdata.Data())[0] == 3 && ((uint8_t *)sfxdata.Data())[1] == 0 && dmxlen <= size - 8) - { - int frequency = LittleShort(((uint16_t *)sfxdata.Data())[1]); - if (frequency == 0) frequency = 11025; - sfx->data = GSnd->LoadSoundRaw(sfxdata.Data() + 8, dmxlen, frequency, 1, 8, sfx->LoopStart, -1); - } - // If that fails, let the sound system try and figure it out. - else - { - sfx->data = GSnd->LoadSound(sfxdata.Data(), size, pBuffer); - } - } -} - //========================================================================== // // S_CheckSingular diff --git a/src/sound/s_soundinternal.h b/src/sound/s_soundinternal.h index 44b01191a..c9041fdb4 100644 --- a/src/sound/s_soundinternal.h +++ b/src/sound/s_soundinternal.h @@ -248,7 +248,6 @@ protected: TArray S_rnd; private: - void LoadSound3D(sfxinfo_t* sfx, FSoundLoadBuffer* pBuffer); void LinkChannel(FSoundChan* chan, FSoundChan** head); void UnlinkChannel(FSoundChan* chan); void ReturnChannel(FSoundChan* chan);