mirror of
https://github.com/ppy/osu.git
synced 2025-03-05 13:13:22 +08:00
Merge branch 'master' into fix-tourney-button-sounds
This commit is contained in:
commit
f68013059f
@ -7,6 +7,7 @@ using osu.Framework.Graphics.Colour;
|
|||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Graphics.Shapes;
|
using osu.Framework.Graphics.Shapes;
|
||||||
using osu.Framework.Graphics.Video;
|
using osu.Framework.Graphics.Video;
|
||||||
|
using osu.Framework.Timing;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Tournament.Components
|
namespace osu.Game.Tournament.Components
|
||||||
@ -15,6 +16,8 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
private readonly VideoSprite video;
|
private readonly VideoSprite video;
|
||||||
|
|
||||||
|
private readonly ManualClock manualClock;
|
||||||
|
|
||||||
public TourneyVideo(Stream stream)
|
public TourneyVideo(Stream stream)
|
||||||
{
|
{
|
||||||
if (stream == null)
|
if (stream == null)
|
||||||
@ -30,6 +33,7 @@ namespace osu.Game.Tournament.Components
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
FillMode = FillMode.Fit,
|
FillMode = FillMode.Fit,
|
||||||
|
Clock = new FramedClock(manualClock = new ManualClock())
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,5 +45,17 @@ namespace osu.Game.Tournament.Components
|
|||||||
video.Loop = value;
|
video.Loop = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Update()
|
||||||
|
{
|
||||||
|
base.Update();
|
||||||
|
|
||||||
|
if (manualClock != null && Clock.ElapsedFrameTime < 100)
|
||||||
|
{
|
||||||
|
// we want to avoid seeking as much as possible, because we care about performance, not sync.
|
||||||
|
// to avoid seeking completely, we only increment out local clock when in an updating state.
|
||||||
|
manualClock.CurrentTime += Clock.ElapsedFrameTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user