1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 04:52:57 +08:00

Update usages of BufferedContainer in line with framework changes

This commit is contained in:
Dean Herbert 2021-11-05 15:54:27 +09:00
parent 9b5ed791b5
commit 6399c695e8
11 changed files with 13 additions and 23 deletions

View File

@ -86,20 +86,18 @@ namespace osu.Game.Rulesets.Mania.Skinning.Default
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
InternalChild = foregroundBuffer = new BufferedContainer InternalChild = foregroundBuffer = new BufferedContainer(cachedFrameBuffer: true)
{ {
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
Children = new Drawable[] Children = new Drawable[]
{ {
new Box { RelativeSizeAxes = Axes.Both }, new Box { RelativeSizeAxes = Axes.Both },
subtractionBuffer = new BufferedContainer subtractionBuffer = new BufferedContainer(cachedFrameBuffer: true)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
// This is needed because we're blending with another object // This is needed because we're blending with another object
BackgroundColour = Color4.White.Opacity(0), BackgroundColour = Color4.White.Opacity(0),
CacheDrawnFrameBuffer = true,
// The 'hole' is achieved by subtracting the result of this container with the parent // The 'hole' is achieved by subtracting the result of this container with the parent
Blending = new BlendingParameters { AlphaEquation = BlendingEquation.ReverseSubtract }, Blending = new BlendingParameters { AlphaEquation = BlendingEquation.ReverseSubtract },
Child = subtractionLayer = new CircularContainer Child = subtractionLayer = new CircularContainer

View File

@ -136,10 +136,9 @@ namespace osu.Game.Rulesets.Osu.Statistics
} }
} }
}, },
bufferedGrid = new BufferedContainer bufferedGrid = new BufferedContainer(cachedFrameBuffer: true)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
BackgroundColour = Color4Extensions.FromHex("#202624").Opacity(0), BackgroundColour = Color4Extensions.FromHex("#202624").Opacity(0),
Child = pointGrid = new GridContainer Child = pointGrid = new GridContainer
{ {

View File

@ -58,10 +58,9 @@ namespace osu.Game.Graphics.Backgrounds
{ {
RemoveInternal(Sprite); RemoveInternal(Sprite);
AddInternal(bufferedContainer = new BufferedContainer AddInternal(bufferedContainer = new BufferedContainer(cachedFrameBuffer: true)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
RedrawOnScale = false, RedrawOnScale = false,
Child = Sprite Child = Sprite
}); });

View File

@ -69,12 +69,11 @@ namespace osu.Game.Graphics.Sprites
Children = new Drawable[] Children = new Drawable[]
{ {
new BufferedContainer new BufferedContainer(cachedFrameBuffer: true)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
BlurSigma = new Vector2(4), BlurSigma = new Vector2(4),
CacheDrawnFrameBuffer = true,
RedrawOnScale = false, RedrawOnScale = false,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,

View File

@ -366,14 +366,13 @@ namespace osu.Game.Overlays
private readonly WorkingBeatmap beatmap; private readonly WorkingBeatmap beatmap;
public Background(WorkingBeatmap beatmap = null) public Background(WorkingBeatmap beatmap = null)
: base(cachedFrameBuffer: true)
{ {
this.beatmap = beatmap; this.beatmap = beatmap;
Depth = float.MaxValue; Depth = float.MaxValue;
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
CacheDrawnFrameBuffer = true;
Children = new Drawable[] Children = new Drawable[]
{ {
sprite = new Sprite sprite = new Sprite

View File

@ -393,6 +393,7 @@ namespace osu.Game.Screens.Menu
public class OutlineTriangle : BufferedContainer public class OutlineTriangle : BufferedContainer
{ {
public OutlineTriangle(bool outlineOnly, float size) public OutlineTriangle(bool outlineOnly, float size)
: base(cachedFrameBuffer: true)
{ {
Size = new Vector2(size); Size = new Vector2(size);
@ -414,7 +415,6 @@ namespace osu.Game.Screens.Menu
} }
Blending = BlendingParameters.Additive; Blending = BlendingParameters.Additive;
CacheDrawnFrameBuffer = true;
} }
} }
} }

View File

@ -32,9 +32,9 @@ namespace osu.Game.Screens.Play.Break
} }
public BlurredIcon() public BlurredIcon()
: base(cachedFrameBuffer: true)
{ {
RelativePositionAxes = Axes.X; RelativePositionAxes = Axes.X;
CacheDrawnFrameBuffer = true;
Child = icon = new SpriteIcon Child = icon = new SpriteIcon
{ {
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -98,9 +98,8 @@ namespace osu.Game.Screens.Play
/// </summary> /// </summary>
protected virtual void RecreateGraph() protected virtual void RecreateGraph()
{ {
var newColumns = new BufferedContainer<Column> var newColumns = new BufferedContainer<Column>(cachedFrameBuffer: true)
{ {
CacheDrawnFrameBuffer = true,
RedrawOnScale = false, RedrawOnScale = false,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
}; };

View File

@ -51,13 +51,12 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
Font = OsuFont.Numeric.With(size: 76), Font = OsuFont.Numeric.With(size: 76),
UseFullGlyphHeight = false UseFullGlyphHeight = false
}, },
superFlash = new BufferedContainer superFlash = new BufferedContainer(cachedFrameBuffer: true)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
BlurSigma = new Vector2(85), BlurSigma = new Vector2(85),
Size = new Vector2(600), Size = new Vector2(600),
CacheDrawnFrameBuffer = true,
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
Alpha = 0, Alpha = 0,
Children = new[] Children = new[]
@ -71,14 +70,13 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
}, },
}, },
}, },
flash = new BufferedContainer flash = new BufferedContainer(cachedFrameBuffer: true)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
BlurSigma = new Vector2(35), BlurSigma = new Vector2(35),
BypassAutoSizeAxes = Axes.Both, BypassAutoSizeAxes = Axes.Both,
Size = new Vector2(200), Size = new Vector2(200),
CacheDrawnFrameBuffer = true,
Blending = BlendingParameters.Additive, Blending = BlendingParameters.Additive,
Alpha = 0, Alpha = 0,
Scale = new Vector2(1.8f), Scale = new Vector2(1.8f),

View File

@ -27,9 +27,8 @@ namespace osu.Game.Screens.Select
{ {
RelativeSizeAxes = Axes.Both; RelativeSizeAxes = Axes.Both;
InternalChild = new BufferedContainer InternalChild = new BufferedContainer(cachedFrameBuffer: true)
{ {
CacheDrawnFrameBuffer = true,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Children = new Drawable[] Children = new Drawable[]
{ {

View File

@ -15,8 +15,8 @@ namespace osu.Game.Screens.Select.Carousel
public class SetPanelBackground : BufferedContainer public class SetPanelBackground : BufferedContainer
{ {
public SetPanelBackground(WorkingBeatmap working) public SetPanelBackground(WorkingBeatmap working)
: base(cachedFrameBuffer: true)
{ {
CacheDrawnFrameBuffer = true;
RedrawOnScale = false; RedrawOnScale = false;
Children = new Drawable[] Children = new Drawable[]