Skip to content

Commit

Permalink
Merge pull request #20025 from peppy/fix-results-sample-glitching
Browse files Browse the repository at this point in the history
Fix audio glitching when showing results screen with many scores
  • Loading branch information
smoogipoo authored Aug 31, 2022
2 parents cb4fd08 + 5d41fdf commit 1908a2e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions osu.Game/Screens/Ranking/ScorePanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class ScorePanel : CompositeDrawable, IStateful<PanelState>
[Resolved]
private OsuGameBase game { get; set; }

private DrawableAudioMixer mixer;
private AudioContainer audioContent;

private bool displayWithFlair;

Expand Down Expand Up @@ -130,7 +130,7 @@ private void load(AudioManager audio)
// Adding a manual offset here allows the expanded version to take on an "acceptable" vertical centre when at 100% UI scale.
const float vertical_fudge = 20;

InternalChild = mixer = new DrawableAudioMixer
InternalChild = audioContent = new AudioContainer
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
Expand Down Expand Up @@ -225,7 +225,7 @@ public PanelState State
protected override void Update()
{
base.Update();
mixer.Balance.Value = (ScreenSpaceDrawQuad.Centre.X / game.ScreenSpaceDrawQuad.Width) * 2 - 1;
audioContent.Balance.Value = (ScreenSpaceDrawQuad.Centre.X / game.ScreenSpaceDrawQuad.Width) * 2 - 1;
}

private void playAppearSample()
Expand Down Expand Up @@ -274,7 +274,7 @@ private void updateState()
break;
}

mixer.ResizeTo(Size, RESIZE_DURATION, Easing.OutQuint);
audioContent.ResizeTo(Size, RESIZE_DURATION, Easing.OutQuint);

bool topLayerExpanded = topLayerContainer.Y < 0;

Expand Down

0 comments on commit 1908a2e

Please sign in to comment.