mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-14 00:21:34 +00:00
Remove an unnecessary function
This commit is contained in:
parent
5d1cd7b7fe
commit
99209c4a2a
1 changed files with 11 additions and 15 deletions
|
@ -137,18 +137,6 @@ static ALCenum checkALCError(ALCdevice *device, const char *fn, unsigned int ln)
|
|||
}
|
||||
#define getALCError(d) checkALCError((d), __FILE__, __LINE__)
|
||||
|
||||
static ALsizei GetBufferLength(ALuint buffer, const char *fn, unsigned int ln)
|
||||
{
|
||||
ALint bits, channels, size;
|
||||
alGetBufferi(buffer, AL_BITS, &bits);
|
||||
alGetBufferi(buffer, AL_CHANNELS, &channels);
|
||||
alGetBufferi(buffer, AL_SIZE, &size);
|
||||
if(checkALError(fn, ln) == AL_NO_ERROR)
|
||||
return (ALsizei)(size / (channels * bits / 8));
|
||||
return 0;
|
||||
}
|
||||
#define getBufferLength(b) GetBufferLength((b), __FILE__, __LINE__)
|
||||
|
||||
extern ReverbContainer *ForcedEnvironment;
|
||||
|
||||
#define PITCH_MULT (0.7937005f) /* Approx. 4 semitones lower; what Nash suggested */
|
||||
|
@ -575,9 +563,17 @@ unsigned int OpenALSoundRenderer::GetMSLength(SoundHandle sfx)
|
|||
|
||||
unsigned int OpenALSoundRenderer::GetSampleLength(SoundHandle sfx)
|
||||
{
|
||||
if(!sfx.data)
|
||||
if(sfx.data)
|
||||
{
|
||||
ALuint buffer = *((ALuint*)sfx.data);
|
||||
ALint bits, channels, size;
|
||||
alGetBufferi(buffer, AL_BITS, &bits);
|
||||
alGetBufferi(buffer, AL_CHANNELS, &channels);
|
||||
alGetBufferi(buffer, AL_SIZE, &size);
|
||||
if(getALError() == AL_NO_ERROR)
|
||||
return (ALsizei)(size / (channels * bits / 8));
|
||||
}
|
||||
return 0;
|
||||
return getBufferLength(*((ALuint*)sfx.data));
|
||||
}
|
||||
|
||||
float OpenALSoundRenderer::GetOutputRate()
|
||||
|
|
Loading…
Reference in a new issue