Renamed Decoder:getBits to Decoder:getBitDepth (see issue #636)

This commit is contained in:
Alex Szpakowski
2013-08-11 04:15:42 -03:00
parent daf50698b8
commit 66a773d2a7
20 changed files with 52 additions and 52 deletions
+6 -6
View File
@@ -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());
+2 -2
View File
@@ -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);