Remove LoadSoundBuffered since its no longer called

This commit is contained in:
Chris Robinson 2020-01-31 11:22:39 -08:00 committed by drfrag
parent 435a3885ca
commit c37caf4498
4 changed files with 0 additions and 63 deletions

View file

@ -487,10 +487,3 @@ SoundHandle SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int length)
if (data) delete[] data;
return retval;
}
SoundHandle SoundRenderer::LoadSoundBuffered(FSoundLoadBuffer *buffer)
{
SoundHandle retval = { NULL };
return retval;
}

View file

@ -110,7 +110,6 @@ public:
virtual SoundHandle LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *pBuffer = nullptr) = 0;
SoundHandle LoadSoundVoc(uint8_t *sfxdata, int length);
virtual SoundHandle LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1) = 0;
virtual SoundHandle LoadSoundBuffered(FSoundLoadBuffer *buffer);
virtual void UnloadSound (SoundHandle sfx) = 0; // unloads a sound from memory
virtual unsigned int GetMSLength(SoundHandle sfx) = 0; // Gets the length of a sound at its default frequency
virtual unsigned int GetSampleLength(SoundHandle sfx) = 0; // Gets the length of a sound at its default frequency

View file

@ -1134,60 +1134,6 @@ SoundHandle OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length, FSoundL
return retval;
}
SoundHandle OpenALSoundRenderer::LoadSoundBuffered(FSoundLoadBuffer *pBuffer)
{
SoundHandle retval = { NULL };
ALenum format = AL_NONE;
int srate = pBuffer->srate;
auto type = pBuffer->type;
auto chans = pBuffer->chans;
uint32_t loop_start = pBuffer->loop_start, loop_end = pBuffer->loop_end;
if (chans == ChannelConfig_Mono)
{
if (type == SampleType_UInt8) format = AL_FORMAT_MONO8;
if (type == SampleType_Int16) format = AL_FORMAT_MONO16;
}
else if (chans == ChannelConfig_Stereo)
{
if (type == SampleType_UInt8) format = AL_FORMAT_STEREO8;
if (type == SampleType_Int16) format = AL_FORMAT_STEREO16;
}
if (format == AL_NONE)
{
Printf("Unsupported audio format: %s, %s\n", GetChannelConfigName(chans),
GetSampleTypeName(type));
return retval;
}
auto &data = pBuffer->mBuffer;
ALenum err;
ALuint buffer = 0;
alGenBuffers(1, &buffer);
alBufferData(buffer, format, &data[0], (ALsizei)data.size(), srate);
if ((err = getALError()) != AL_NO_ERROR)
{
Printf("Failed to buffer data: %s\n", alGetString(err));
alDeleteBuffers(1, &buffer);
getALError();
return retval;
}
// the loop points were already validated by the previous load.
if ((loop_start > 0 || loop_end > 0) && loop_end > loop_start && AL.SOFT_loop_points)
{
ALint loops[2] = { static_cast<ALint>(loop_start), static_cast<ALint>(loop_end) };
DPrintf(DMSG_NOTIFY, "Setting loop points %d -> %d\n", loops[0], loops[1]);
alBufferiv(buffer, AL_LOOP_POINTS_SOFT, loops);
// no console messages here, please!
}
retval.data = MAKE_PTRID(buffer);
return retval;
}
void OpenALSoundRenderer::UnloadSound(SoundHandle sfx)
{
if(!sfx.data)

View file

@ -126,7 +126,6 @@ public:
virtual void SetSfxVolume(float volume);
virtual void SetMusicVolume(float volume);
virtual SoundHandle LoadSound(uint8_t *sfxdata, int length, FSoundLoadBuffer *buffer);
virtual SoundHandle LoadSoundBuffered(FSoundLoadBuffer *buffer);
virtual SoundHandle LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1);
virtual void UnloadSound(SoundHandle sfx);
virtual unsigned int GetMSLength(SoundHandle sfx);