mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-24 17:39:42 +00:00
Simplify broken OpenAL workaround
This commit is contained in:
parent
33a63d88a5
commit
de102cd274
1 changed files with 5 additions and 25 deletions
|
@ -442,26 +442,7 @@ void OpenAL_Output::init(const std::string &devname)
|
||||||
{
|
{
|
||||||
ALCuint maxtotal = std::min<ALCuint>(maxmono+maxstereo, 256);
|
ALCuint maxtotal = std::min<ALCuint>(maxmono+maxstereo, 256);
|
||||||
if (maxtotal == 0) // workaround for broken implementations
|
if (maxtotal == 0) // workaround for broken implementations
|
||||||
{
|
|
||||||
maxtotal = 256;
|
maxtotal = 256;
|
||||||
bool stop = false;
|
|
||||||
for(size_t i = 0;i < maxtotal && !stop;i++) // generate source until error returned
|
|
||||||
{
|
|
||||||
ALuint src = 0;
|
|
||||||
alGenSources(1, &src);
|
|
||||||
ALenum err = alGetError();
|
|
||||||
if(err != AL_NO_ERROR)
|
|
||||||
{
|
|
||||||
stop = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
mFreeSources.push_back(src);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else // normal case
|
|
||||||
{
|
|
||||||
for(size_t i = 0;i < maxtotal;i++)
|
for(size_t i = 0;i < maxtotal;i++)
|
||||||
{
|
{
|
||||||
ALuint src = 0;
|
ALuint src = 0;
|
||||||
|
@ -470,7 +451,6 @@ void OpenAL_Output::init(const std::string &devname)
|
||||||
mFreeSources.push_back(src);
|
mFreeSources.push_back(src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch(std::exception &e)
|
catch(std::exception &e)
|
||||||
{
|
{
|
||||||
std::cout <<"Error: "<<e.what()<<", trying to continue"<< std::endl;
|
std::cout <<"Error: "<<e.what()<<", trying to continue"<< std::endl;
|
||||||
|
|
Loading…
Reference in a new issue