mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-21 07:11:33 +00:00
Merged pull request #1886
This commit is contained in:
commit
c1f38afca0
2 changed files with 27 additions and 8 deletions
|
@ -129,6 +129,7 @@
|
||||||
Feature #4581: Use proper logging system
|
Feature #4581: Use proper logging system
|
||||||
Task #2490: Don't open command prompt window on Release-mode builds automatically
|
Task #2490: Don't open command prompt window on Release-mode builds automatically
|
||||||
Task #4545: Enable is_pod string test
|
Task #4545: Enable is_pod string test
|
||||||
|
Task #4606: Support Rapture3D's OpenAL driver
|
||||||
|
|
||||||
0.44.0
|
0.44.0
|
||||||
------
|
------
|
||||||
|
|
|
@ -1145,14 +1145,24 @@ bool OpenAL_Output::playSound(Sound *sound, Sound_Handle data, float offset)
|
||||||
|
|
||||||
initCommon2D(source, sound->getPosition(), sound->getRealVolume(), sound->getPitch(),
|
initCommon2D(source, sound->getPosition(), sound->getRealVolume(), sound->getPitch(),
|
||||||
sound->getIsLooping(), sound->getUseEnv());
|
sound->getIsLooping(), sound->getUseEnv());
|
||||||
|
alSourcei(source, AL_BUFFER, GET_PTRID(data));
|
||||||
alSourcef(source, AL_SEC_OFFSET, offset);
|
alSourcef(source, AL_SEC_OFFSET, offset);
|
||||||
if(getALError() != AL_NO_ERROR)
|
if(getALError() != AL_NO_ERROR)
|
||||||
|
{
|
||||||
|
alSourceRewind(source);
|
||||||
|
alSourcei(source, AL_BUFFER, 0);
|
||||||
|
alGetError();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
alSourcei(source, AL_BUFFER, GET_PTRID(data));
|
|
||||||
alSourcePlay(source);
|
alSourcePlay(source);
|
||||||
if(getALError() != AL_NO_ERROR)
|
if(getALError() != AL_NO_ERROR)
|
||||||
|
{
|
||||||
|
alSourceRewind(source);
|
||||||
|
alSourcei(source, AL_BUFFER, 0);
|
||||||
|
alGetError();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
mFreeSources.pop_front();
|
mFreeSources.pop_front();
|
||||||
sound->mHandle = MAKE_PTRID(source);
|
sound->mHandle = MAKE_PTRID(source);
|
||||||
|
@ -1175,14 +1185,24 @@ bool OpenAL_Output::playSound3D(Sound *sound, Sound_Handle data, float offset)
|
||||||
initCommon3D(source, sound->getPosition(), sound->getMinDistance(), sound->getMaxDistance(),
|
initCommon3D(source, sound->getPosition(), sound->getMinDistance(), sound->getMaxDistance(),
|
||||||
sound->getRealVolume(), sound->getPitch(), sound->getIsLooping(),
|
sound->getRealVolume(), sound->getPitch(), sound->getIsLooping(),
|
||||||
sound->getUseEnv());
|
sound->getUseEnv());
|
||||||
|
alSourcei(source, AL_BUFFER, GET_PTRID(data));
|
||||||
alSourcef(source, AL_SEC_OFFSET, offset);
|
alSourcef(source, AL_SEC_OFFSET, offset);
|
||||||
if(getALError() != AL_NO_ERROR)
|
if(getALError() != AL_NO_ERROR)
|
||||||
|
{
|
||||||
|
alSourceRewind(source);
|
||||||
|
alSourcei(source, AL_BUFFER, 0);
|
||||||
|
alGetError();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
alSourcei(source, AL_BUFFER, GET_PTRID(data));
|
|
||||||
alSourcePlay(source);
|
alSourcePlay(source);
|
||||||
if(getALError() != AL_NO_ERROR)
|
if(getALError() != AL_NO_ERROR)
|
||||||
|
{
|
||||||
|
alSourceRewind(source);
|
||||||
|
alSourcei(source, AL_BUFFER, 0);
|
||||||
|
alGetError();
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
mFreeSources.pop_front();
|
mFreeSources.pop_front();
|
||||||
sound->mHandle = MAKE_PTRID(source);
|
sound->mHandle = MAKE_PTRID(source);
|
||||||
|
@ -1197,9 +1217,8 @@ void OpenAL_Output::finishSound(Sound *sound)
|
||||||
ALuint source = GET_PTRID(sound->mHandle);
|
ALuint source = GET_PTRID(sound->mHandle);
|
||||||
sound->mHandle = 0;
|
sound->mHandle = 0;
|
||||||
|
|
||||||
// Rewind the stream instead of stopping it, this puts the source into an AL_INITIAL state,
|
// Rewind the stream to put the source back into an AL_INITIAL state, for
|
||||||
// which works around a bug in the MacOS OpenAL implementation which would otherwise think
|
// the next time it's used.
|
||||||
// the initial queue already played when it hasn't.
|
|
||||||
alSourceRewind(source);
|
alSourceRewind(source);
|
||||||
alSourcei(source, AL_BUFFER, 0);
|
alSourcei(source, AL_BUFFER, 0);
|
||||||
getALError();
|
getALError();
|
||||||
|
@ -1302,9 +1321,8 @@ void OpenAL_Output::finishStream(Stream *sound)
|
||||||
sound->mHandle = 0;
|
sound->mHandle = 0;
|
||||||
mStreamThread->remove(stream);
|
mStreamThread->remove(stream);
|
||||||
|
|
||||||
// Rewind the stream instead of stopping it, this puts the source into an AL_INITIAL state,
|
// Rewind the stream to put the source back into an AL_INITIAL state, for
|
||||||
// which works around a bug in the MacOS OpenAL implementation which would otherwise think
|
// the next time it's used.
|
||||||
// the initial queue already played when it hasn't.
|
|
||||||
alSourceRewind(source);
|
alSourceRewind(source);
|
||||||
alSourcei(source, AL_BUFFER, 0);
|
alSourcei(source, AL_BUFFER, 0);
|
||||||
getALError();
|
getALError();
|
||||||
|
|
Loading…
Reference in a new issue