mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-12-13 13:50:59 +00:00
Get rid of the LoadSound3D method
It no longer does anything since there's no separate buffer for 3D sfx.
This commit is contained in:
parent
1065d18bc4
commit
435a3885ca
2 changed files with 0 additions and 49 deletions
|
@ -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.
|
// Since we do not know in what format the sound will be used, we have to cache both.
|
||||||
FSoundLoadBuffer SoundBuffer;
|
FSoundLoadBuffer SoundBuffer;
|
||||||
LoadSound(sfx, &SoundBuffer);
|
LoadSound(sfx, &SoundBuffer);
|
||||||
LoadSound3D(sfx, &SoundBuffer);
|
|
||||||
sfx->bUsed = true;
|
sfx->bUsed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -576,7 +575,6 @@ FSoundChan *SoundEngine::StartSound(int type, const void *source,
|
||||||
|
|
||||||
if (attenuation > 0 && type != SOURCE_None)
|
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);
|
chan = (FSoundChan*)GSnd->StartSound3D (sfx->data, &listener, float(volume), rolloff, float(attenuation), pitch, basepriority, pos, vel, channel, startflags, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -681,7 +679,6 @@ void SoundEngine::RestartChannel(FSoundChan *chan)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadSound3D(sfx, &SoundBuffer);
|
|
||||||
chan->ChanFlags &= ~(CHANF_EVICTED|CHANF_ABSTIME);
|
chan->ChanFlags &= ~(CHANF_EVICTED|CHANF_ABSTIME);
|
||||||
ochan = (FSoundChan*)GSnd->StartSound3D(sfx->data, &listener, chan->Volume, &chan->Rolloff, chan->DistanceScale, chan->Pitch,
|
ochan = (FSoundChan*)GSnd->StartSound3D(sfx->data, &listener, chan->Volume, &chan->Rolloff, chan->DistanceScale, chan->Pitch,
|
||||||
chan->Priority, pos, vel, chan->EntChannel, startflags, chan);
|
chan->Priority, pos, vel, chan->EntChannel, startflags, chan);
|
||||||
|
@ -781,51 +778,6 @@ sfxinfo_t *SoundEngine::LoadSound(sfxinfo_t *sfx, FSoundLoadBuffer *pBuffer)
|
||||||
return sfx;
|
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
|
// S_CheckSingular
|
||||||
|
|
|
@ -248,7 +248,6 @@ protected:
|
||||||
TArray<FRandomSoundList> S_rnd;
|
TArray<FRandomSoundList> S_rnd;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void LoadSound3D(sfxinfo_t* sfx, FSoundLoadBuffer* pBuffer);
|
|
||||||
void LinkChannel(FSoundChan* chan, FSoundChan** head);
|
void LinkChannel(FSoundChan* chan, FSoundChan** head);
|
||||||
void UnlinkChannel(FSoundChan* chan);
|
void UnlinkChannel(FSoundChan* chan);
|
||||||
void ReturnChannel(FSoundChan* chan);
|
void ReturnChannel(FSoundChan* chan);
|
||||||
|
|
Loading…
Reference in a new issue