Fix sound volume when using OpenAL

stable-5.3
Sven Eberhardt 2013-02-27 00:20:49 +01:00 committed by Armin Burgmeier
parent 59d8ef0bde
commit 4ced5be9c4
1 changed files with 4 additions and 1 deletions

View File

@ -386,7 +386,10 @@ void C4SoundInstance::Execute()
// start
if (!isStarted())
if (!CheckStart())
{
LogF("%s nostart", this->pEffect->Name);
return;
}
// set volume & panning
#ifdef HAVE_FMOD
FSOUND_SetVolume(iChannel, BoundBy(iVol / 100, 0, 255));
@ -399,7 +402,7 @@ void C4SoundInstance::Execute()
#endif
#ifdef USE_OPEN_AL
alSource3f(iChannel, AL_POSITION, 0, 0, 0); // FIXME
alSourcef(iChannel, AL_GAIN, iVol / 100);
alSourcef(iChannel, AL_GAIN, float(iVol) / (100.0f*256.0f));
#endif
}
}