mirror of
https://github.com/osukey/osukey.git
synced 2025-06-18 01:37:57 +09: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 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.
|
// Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Menu.
|
||||||
if (UsingThemedIntro)
|
if (UsingThemedIntro)
|
||||||
|
@ -41,6 +41,8 @@ namespace osu.Game.Screens.Menu
|
|||||||
|
|
||||||
private Sample welcome;
|
private Sample welcome;
|
||||||
|
|
||||||
|
private DecoupleableInterpolatingFramedClock decoupledClock;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -56,10 +58,18 @@ namespace osu.Game.Screens.Menu
|
|||||||
{
|
{
|
||||||
PrepareMenuLoad();
|
PrepareMenuLoad();
|
||||||
|
|
||||||
|
decoupledClock = new DecoupleableInterpolatingFramedClock
|
||||||
|
{
|
||||||
|
IsCoupled = false
|
||||||
|
};
|
||||||
|
|
||||||
|
if (UsingThemedIntro)
|
||||||
|
decoupledClock.ChangeSource(Track);
|
||||||
|
|
||||||
LoadComponentAsync(new TrianglesIntroSequence(logo, background)
|
LoadComponentAsync(new TrianglesIntroSequence(logo, background)
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Clock = new FramedClock(UsingThemedIntro ? Track : null),
|
Clock = decoupledClock,
|
||||||
LoadMenu = LoadMenu
|
LoadMenu = LoadMenu
|
||||||
}, t =>
|
}, t =>
|
||||||
{
|
{
|
||||||
@ -78,6 +88,12 @@ namespace osu.Game.Screens.Menu
|
|||||||
background.FadeOut(100);
|
background.FadeOut(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void StartTrack()
|
||||||
|
{
|
||||||
|
if (UsingThemedIntro)
|
||||||
|
decoupledClock.Start();
|
||||||
|
}
|
||||||
|
|
||||||
private class TrianglesIntroSequence : CompositeDrawable
|
private class TrianglesIntroSequence : CompositeDrawable
|
||||||
{
|
{
|
||||||
private readonly OsuLogo logo;
|
private readonly OsuLogo logo;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user