mirror of
https://github.com/osukey/osukey.git
synced 2025-05-11 16:47:19 +09:00
Fix FrameStabilityContainer performing frame-stable seeks
This commit is contained in:
parent
65f5318298
commit
80e1568e97
@ -68,6 +68,8 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
private const double sixty_frame_time = 1000.0 / 60;
|
private const double sixty_frame_time = 1000.0 / 60;
|
||||||
|
|
||||||
|
private bool firstConsumption = true;
|
||||||
|
|
||||||
public override bool UpdateSubTree()
|
public override bool UpdateSubTree()
|
||||||
{
|
{
|
||||||
requireMoreUpdateLoops = true;
|
requireMoreUpdateLoops = true;
|
||||||
@ -103,7 +105,14 @@ namespace osu.Game.Rulesets.UI
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (Math.Abs(manualClock.CurrentTime - newProposedTime) > sixty_frame_time * 1.2f)
|
if (firstConsumption)
|
||||||
|
{
|
||||||
|
// On the first update, frame-stability seeking would result in unexpected/unwanted behaviour.
|
||||||
|
// Instead we perform an initial seek to the proposed time.
|
||||||
|
manualClock.CurrentTime = newProposedTime;
|
||||||
|
firstConsumption = false;
|
||||||
|
}
|
||||||
|
else if (Math.Abs(manualClock.CurrentTime - newProposedTime) > sixty_frame_time * 1.2f)
|
||||||
{
|
{
|
||||||
newProposedTime = newProposedTime > manualClock.CurrentTime
|
newProposedTime = newProposedTime > manualClock.CurrentTime
|
||||||
? Math.Min(newProposedTime, manualClock.CurrentTime + sixty_frame_time)
|
? Math.Min(newProposedTime, manualClock.CurrentTime + sixty_frame_time)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user