Skip to content

Commit

Permalink
Fix editor performance dropping over time when hit markers are enabled
Browse files Browse the repository at this point in the history
There's probably a better solution but let's hotfix this for now.
  • Loading branch information
peppy committed Jun 25, 2024
1 parent aadb104 commit e84c8fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableHitCircle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,13 +325,16 @@ public ProxyableSkinnableDrawable(ISkinComponentLookup lookup, Func<ISkinCompone

internal void SuppressHitAnimations()
{
ClearTransforms(true);

UpdateState(ArmedState.Idle);
UpdateComboColour();

// This method is called every frame. If we need to, the following can likely be converted
// to code which doesn't use transforms at all.

// Matches stable (see https://github.com/peppy/osu-stable-reference/blob/bb57924c1552adbed11ee3d96cdcde47cf96f2b6/osu!/GameplayElements/HitObjects/Osu/HitCircleOsu.cs#L336-L338)

using (BeginAbsoluteSequence(StateUpdateTime - 5))
this.TransformBindableTo(AccentColour, Color4.White, Math.Max(0, HitStateUpdateTime - StateUpdateTime));

Expand Down
2 changes: 2 additions & 0 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSlider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ private partial class DefaultSliderBody : PlaySliderBody

internal void SuppressHitAnimations()
{
ClearTransforms(true);

UpdateState(ArmedState.Idle);
HeadCircle.SuppressHitAnimations();
TailCircle.SuppressHitAnimations();
Expand Down
4 changes: 4 additions & 0 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderTail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,13 @@ protected override void OnApply()

internal void SuppressHitAnimations()
{
ClearTransforms(true);

UpdateState(ArmedState.Idle);
UpdateComboColour();

ClearTransforms();

using (BeginAbsoluteSequence(StateUpdateTime - 5))
this.TransformBindableTo(AccentColour, Color4.White, Math.Max(0, HitStateUpdateTime - StateUpdateTime));

Expand Down

0 comments on commit e84c8fb

Please sign in to comment.