mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 11:42:56 +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.Shapes;
|
||||
using osu.Framework.Graphics.Video;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Components
|
||||
@ -15,6 +16,8 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
private readonly VideoSprite video;
|
||||
|
||||
private readonly ManualClock manualClock;
|
||||
|
||||
public TourneyVideo(Stream stream)
|
||||
{
|
||||
if (stream == null)
|
||||
@ -30,6 +33,7 @@ namespace osu.Game.Tournament.Components
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
FillMode = FillMode.Fit,
|
||||
Clock = new FramedClock(manualClock = new ManualClock())
|
||||
};
|
||||
}
|
||||
|
||||
@ -41,5 +45,17 @@ namespace osu.Game.Tournament.Components
|
||||
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