1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 21:45:33 +00:00

Better handle bad OpenAL source counts

This commit is contained in:
Chris Robinson 2012-03-28 04:56:40 -07:00
parent 089c340935
commit c072babd17

View file

@ -415,12 +415,12 @@ void OpenAL_Output::init(const std::string &devname)
alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
throwALerror();
ALCint maxmono, maxstereo;
ALCint maxmono=0, maxstereo=0;
alcGetIntegerv(mDevice, ALC_MONO_SOURCES, 1, &maxmono);
alcGetIntegerv(mDevice, ALC_STEREO_SOURCES, 1, &maxstereo);
throwALCerror(mDevice);
mFreeSources.resize(std::min(maxmono+maxstereo, 256));
mFreeSources.resize(std::min<ALCuint>(maxmono+maxstereo, 256));
for(size_t i = 0;i < mFreeSources.size();i++)
{
ALuint src;