Fix sound volume when using OpenAL

scancodes-fix
Sven Eberhardt 2013-02-27 00:20:49 +01:00
parent cc44b71756
commit f5647d05fe
1 changed files with 4 additions and 1 deletions

View File

@ -387,7 +387,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));
@ -400,7 +403,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
}
}