mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Merge pull request #868 from marauder2k9-torque/OpenalQuickFix
Mac OpenAL 1.1
This commit is contained in:
commit
ebbf0947b3
2 changed files with 34 additions and 0 deletions
|
|
@ -69,9 +69,40 @@ S32 SFXALDevice::getMaxSources()
|
||||||
ALCint nummono;
|
ALCint nummono;
|
||||||
mOpenAL.alcGetIntegerv(mDevice, ALC_MONO_SOURCES, 1, &nummono);
|
mOpenAL.alcGetIntegerv(mDevice, ALC_MONO_SOURCES, 1, &nummono);
|
||||||
|
|
||||||
|
if(nummono == 0)
|
||||||
|
nummono = getMaxSourcesOld();
|
||||||
|
|
||||||
return nummono;
|
return nummono;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
S32 SFXALDevice::getMaxSourcesOld()
|
||||||
|
{
|
||||||
|
ALuint uiSource[256];
|
||||||
|
S32 sourceCount = 0;
|
||||||
|
|
||||||
|
// clear errors.
|
||||||
|
mOpenAL.alGetError();
|
||||||
|
|
||||||
|
for(sourceCount = 0; sourceCount < 256; sourceCount++)
|
||||||
|
{
|
||||||
|
mOpenAL.alGenSources(1,&uiSource[sourceCount]);
|
||||||
|
if(mOpenAL.alGetError() != AL_NO_ERROR)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
mOpenAL.alDeleteSources(sourceCount, uiSource);
|
||||||
|
if(mOpenAL.alGetError() != AL_NO_ERROR)
|
||||||
|
{
|
||||||
|
for(U32 i = 0; i < 256; i++)
|
||||||
|
{
|
||||||
|
mOpenAL.alDeleteSources(1,&uiSource[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return sourceCount;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
SFXALDevice::SFXALDevice( SFXProvider *provider,
|
SFXALDevice::SFXALDevice( SFXProvider *provider,
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,9 @@ class SFXALDevice : public SFXDevice
|
||||||
void printHRTFInfo(ALCdevice* device);
|
void printHRTFInfo(ALCdevice* device);
|
||||||
void getEFXInfo(ALCdevice* device);
|
void getEFXInfo(ALCdevice* device);
|
||||||
S32 getMaxSources();
|
S32 getMaxSources();
|
||||||
|
|
||||||
|
// Compatibility with pre openal 1.2
|
||||||
|
S32 getMaxSourcesOld();
|
||||||
|
|
||||||
SFXALDevice( SFXProvider *provider,
|
SFXALDevice( SFXProvider *provider,
|
||||||
const OPENALFNTABLE &openal,
|
const OPENALFNTABLE &openal,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue