Fixed restoration of absolute time position for sounds

Loading of saved game no longer restarts sounds from beginning
This commit is contained in:
alexey.lysiuk 2017-05-07 13:00:06 +03:00
parent 2edae42822
commit e848abf4df

View file

@ -1585,7 +1585,7 @@ FISoundChannel *OpenALSoundRenderer::StartSound(SoundHandle sfx, float vol, int
else
{
if((chanflags&SNDF_ABSTIME))
alSourcef(source, AL_SEC_OFFSET, reuse_chan->StartTime.Lo/1000.f);
alSourcef(source, AL_SAMPLE_OFFSET, reuse_chan->StartTime.Lo);
else
{
float offset = std::chrono::duration_cast<std::chrono::duration<float>>(
@ -1793,7 +1793,7 @@ FISoundChannel *OpenALSoundRenderer::StartSound3D(SoundHandle sfx, SoundListener
else
{
if((chanflags&SNDF_ABSTIME))
alSourcef(source, AL_SEC_OFFSET, reuse_chan->StartTime.Lo/1000.f);
alSourcef(source, AL_SAMPLE_OFFSET, reuse_chan->StartTime.Lo);
else
{
float offset = std::chrono::duration_cast<std::chrono::duration<float>>(