mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Renamed Decoder:getBits to Decoder:getBitDepth (see issue #636)
This commit is contained in:
@@ -544,15 +544,15 @@ void Source::setFloatv(float *dst, const float *src) const
|
||||
dst[2] = src[2];
|
||||
}
|
||||
|
||||
ALenum Source::getFormat(int channels, int bits) const
|
||||
ALenum Source::getFormat(int channels, int bitDepth) const
|
||||
{
|
||||
if (channels == 1 && bits == 8)
|
||||
if (channels == 1 && bitDepth == 8)
|
||||
return AL_FORMAT_MONO8;
|
||||
else if (channels == 1 && bits == 16)
|
||||
else if (channels == 1 && bitDepth == 16)
|
||||
return AL_FORMAT_MONO16;
|
||||
else if (channels == 2 && bits == 8)
|
||||
else if (channels == 2 && bitDepth == 8)
|
||||
return AL_FORMAT_STEREO8;
|
||||
else if (channels == 2 && bits == 16)
|
||||
else if (channels == 2 && bitDepth == 16)
|
||||
return AL_FORMAT_STEREO16;
|
||||
else
|
||||
return 0;
|
||||
@@ -563,7 +563,7 @@ int Source::streamAtomic(ALuint buffer, love::sound::Decoder *d)
|
||||
// Get more sound data.
|
||||
int decoded = d->decode();
|
||||
|
||||
int fmt = getFormat(d->getChannels(), d->getBits());
|
||||
int fmt = getFormat(d->getChannels(), d->getBitDepth());
|
||||
|
||||
if (fmt != 0)
|
||||
alBufferData(buffer, fmt, d->getBuffer(), decoded, d->getSampleRate());
|
||||
|
||||
@@ -108,10 +108,10 @@ private:
|
||||
* Gets the OpenAL format identifier based on number of
|
||||
* channels and bits.
|
||||
* @param channels Either 1 (mono) or 2 (stereo).
|
||||
* @param bits Either 8-bit samples, or 16-bit samples.
|
||||
* @param bitDepth Either 8-bit samples, or 16-bit samples.
|
||||
* @return One of AL_FORMAT_*, or 0 if unsupported format.
|
||||
**/
|
||||
ALenum getFormat(int channels, int bits) const;
|
||||
ALenum getFormat(int channels, int bitDepth) const;
|
||||
|
||||
int streamAtomic(ALuint buffer, love::sound::Decoder *d);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user