mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 04:43:22 +08:00
Fix judgement disposals causing huge LOH pressure
This commit is contained in:
parent
1a19cf0739
commit
9f6ff63634
@ -12,6 +12,7 @@ using osu.Game.Rulesets.UI;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using osu.Game.Rulesets.Judgements;
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Osu.UI.Cursor;
|
using osu.Game.Rulesets.Osu.UI.Cursor;
|
||||||
|
using osu.Game.Skinning;
|
||||||
|
|
||||||
namespace osu.Game.Rulesets.Osu.UI
|
namespace osu.Game.Rulesets.Osu.UI
|
||||||
{
|
{
|
||||||
@ -39,7 +40,13 @@ namespace osu.Game.Rulesets.Osu.UI
|
|||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Depth = 1,
|
Depth = 1,
|
||||||
},
|
},
|
||||||
HitObjectContainer,
|
// Todo: This should not exist, but currently helps to reduce LOH allocations due to unbinding skin source events on judgement disposal
|
||||||
|
// Todo: Remove when hitobjects are properly pooled
|
||||||
|
new LocalSkinOverrideContainer(null)
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
Child = HitObjectContainer,
|
||||||
|
},
|
||||||
approachCircles = new ApproachCircleProxyContainer
|
approachCircles = new ApproachCircleProxyContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
|
@ -34,7 +34,7 @@ namespace osu.Game.Skinning
|
|||||||
public Drawable GetDrawableComponent(string componentName)
|
public Drawable GetDrawableComponent(string componentName)
|
||||||
{
|
{
|
||||||
Drawable sourceDrawable;
|
Drawable sourceDrawable;
|
||||||
if (beatmapSkins.Value && (sourceDrawable = skin.GetDrawableComponent(componentName)) != null)
|
if (beatmapSkins.Value && (sourceDrawable = skin?.GetDrawableComponent(componentName)) != null)
|
||||||
return sourceDrawable;
|
return sourceDrawable;
|
||||||
|
|
||||||
return fallbackSource?.GetDrawableComponent(componentName);
|
return fallbackSource?.GetDrawableComponent(componentName);
|
||||||
@ -43,7 +43,7 @@ namespace osu.Game.Skinning
|
|||||||
public Texture GetTexture(string componentName)
|
public Texture GetTexture(string componentName)
|
||||||
{
|
{
|
||||||
Texture sourceTexture;
|
Texture sourceTexture;
|
||||||
if (beatmapSkins.Value && (sourceTexture = skin.GetTexture(componentName)) != null)
|
if (beatmapSkins.Value && (sourceTexture = skin?.GetTexture(componentName)) != null)
|
||||||
return sourceTexture;
|
return sourceTexture;
|
||||||
|
|
||||||
return fallbackSource.GetTexture(componentName);
|
return fallbackSource.GetTexture(componentName);
|
||||||
@ -52,7 +52,7 @@ namespace osu.Game.Skinning
|
|||||||
public SampleChannel GetSample(string sampleName)
|
public SampleChannel GetSample(string sampleName)
|
||||||
{
|
{
|
||||||
SampleChannel sourceChannel;
|
SampleChannel sourceChannel;
|
||||||
if (beatmapHitsounds.Value && (sourceChannel = skin.GetSample(sampleName)) != null)
|
if (beatmapHitsounds.Value && (sourceChannel = skin?.GetSample(sampleName)) != null)
|
||||||
return sourceChannel;
|
return sourceChannel;
|
||||||
|
|
||||||
return fallbackSource?.GetSample(sampleName);
|
return fallbackSource?.GetSample(sampleName);
|
||||||
|
Loading…
Reference in New Issue
Block a user