- use the game timer, not the Build timer for the sound eviction delay.

This is supposed to wait for two game frames to be on the safe side.
This commit is contained in:
Christoph Oelckers 2020-08-26 03:50:07 +02:00
parent e1424d454f
commit de871c9ab9
5 changed files with 6 additions and 6 deletions

View file

@ -242,8 +242,8 @@ void S_SerializeSounds(FSerializer& arc)
}
arc.EndArray();
}
// Build runs at 120 fps, we need to allow a small delay here.
soundEngine->SetRestartTime(I_GetBuildTime() + 6);
// Add a small delay so that eviction only runs once the game is up and runnnig.
soundEngine->SetRestartTime(I_GetTime() + 2);
}
GSnd->Sync(false);
GSnd->UpdateSounds();

View file

@ -522,7 +522,7 @@ void UpdateSounds()
soundEngine->SetListener(listener);
soundEngine->UpdateSounds(gameclock);
soundEngine->UpdateSounds(I_GetTime());
soundEngine->EnumerateChannels([](FSoundChan* chan)
{
if (!(chan->ChanFlags & (CHANF_UI|CHANF_FORGETTABLE)))

View file

@ -353,7 +353,7 @@ void S_Update(void)
}
listener.ListenerObject = ud.camerasprite == -1 ? nullptr : &sprite[ud.camerasprite];
soundEngine->SetListener(listener);
soundEngine->UpdateSounds(I_GetBuildTime());
soundEngine->UpdateSounds(I_GetTime());
}

View file

@ -711,7 +711,7 @@ void EndOfLevel()
COVER_SetReverb(0); // Reset reverb
Player[myconnectindex].Reverb = 0;
StopSound();
soundEngine->UpdateSounds(I_GetBuildTime());
soundEngine->UpdateSounds(I_GetTime());
// NextLevel must be null while the intermission is running, but we still need the value for later
auto localNextLevel = NextLevel;
NextLevel = nullptr;

View file

@ -604,7 +604,7 @@ void DoUpdateSounds(void)
soundEngine->SetListener(listener);
UpdateAmbients();
soundEngine->UpdateSounds(I_GetBuildTime());
soundEngine->UpdateSounds(I_GetTime());
}
//==========================================================================