mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 23:12:24 +00:00
Remove LoadSoundBuffered since its no longer called
This commit is contained in:
parent
30bdd0c2d4
commit
3c975f18bc
4 changed files with 0 additions and 63 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue