mirror of
https://github.com/ppy/osu
synced 2025-02-19 03:47:01 +00:00
Use a decoupled clock for triangles intro to avoid startup freezes on broken audio device
This commit is contained in:
parent
2c6ee0ebf7
commit
ba99a808af
@ -165,7 +165,7 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
protected override BackgroundScreen CreateBackground() => new BackgroundScreenBlack();
|
||||
|
||||
protected void StartTrack()
|
||||
protected virtual void StartTrack()
|
||||
{
|
||||
// Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Menu.
|
||||
if (UsingThemedIntro)
|
||||
|
@ -41,6 +41,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
private Sample welcome;
|
||||
|
||||
private DecoupleableInterpolatingFramedClock decoupledClock;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -56,10 +58,18 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
PrepareMenuLoad();
|
||||
|
||||
decoupledClock = new DecoupleableInterpolatingFramedClock
|
||||
{
|
||||
IsCoupled = false
|
||||
};
|
||||
|
||||
if (UsingThemedIntro)
|
||||
decoupledClock.ChangeSource(Track);
|
||||
|
||||
LoadComponentAsync(new TrianglesIntroSequence(logo, background)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Clock = new FramedClock(UsingThemedIntro ? Track : null),
|
||||
Clock = decoupledClock,
|
||||
LoadMenu = LoadMenu
|
||||
}, t =>
|
||||
{
|
||||
@ -78,6 +88,12 @@ namespace osu.Game.Screens.Menu
|
||||
background.FadeOut(100);
|
||||
}
|
||||
|
||||
protected override void StartTrack()
|
||||
{
|
||||
if (UsingThemedIntro)
|
||||
decoupledClock.Start();
|
||||
}
|
||||
|
||||
private class TrianglesIntroSequence : CompositeDrawable
|
||||
{
|
||||
private readonly OsuLogo logo;
|
||||
|
Loading…
Reference in New Issue
Block a user