mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 20:06:43 +00:00
Better handle bad OpenAL source counts
This commit is contained in:
parent
089c340935
commit
c072babd17
1 changed files with 2 additions and 2 deletions
|
@ -415,12 +415,12 @@ void OpenAL_Output::init(const std::string &devname)
|
||||||
alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
|
alDistanceModel(AL_LINEAR_DISTANCE_CLAMPED);
|
||||||
throwALerror();
|
throwALerror();
|
||||||
|
|
||||||
ALCint maxmono, maxstereo;
|
ALCint maxmono=0, maxstereo=0;
|
||||||
alcGetIntegerv(mDevice, ALC_MONO_SOURCES, 1, &maxmono);
|
alcGetIntegerv(mDevice, ALC_MONO_SOURCES, 1, &maxmono);
|
||||||
alcGetIntegerv(mDevice, ALC_STEREO_SOURCES, 1, &maxstereo);
|
alcGetIntegerv(mDevice, ALC_STEREO_SOURCES, 1, &maxstereo);
|
||||||
throwALCerror(mDevice);
|
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++)
|
for(size_t i = 0;i < mFreeSources.size();i++)
|
||||||
{
|
{
|
||||||
ALuint src;
|
ALuint src;
|
||||||
|
|
Loading…
Reference in a new issue