diff --git a/src/sound/s_sound.cpp b/src/sound/s_sound.cpp index b5e3840c9..13530f8bc 100644 --- a/src/sound/s_sound.cpp +++ b/src/sound/s_sound.cpp @@ -174,7 +174,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; } } @@ -575,7 +574,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 @@ -680,7 +678,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); @@ -780,51 +777,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);