1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 03:22: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]
private void load()
{
InternalChild = foregroundBuffer = new BufferedContainer
InternalChild = foregroundBuffer = new BufferedContainer(cachedFrameBuffer: true)
{
Blending = BlendingParameters.Additive,
RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
Children = new Drawable[]
{
new Box { RelativeSizeAxes = Axes.Both },
subtractionBuffer = new BufferedContainer
subtractionBuffer = new BufferedContainer(cachedFrameBuffer: true)
{
RelativeSizeAxes = Axes.Both,
// This is needed because we're blending with another object
BackgroundColour = Color4.White.Opacity(0),
CacheDrawnFrameBuffer = true,
// The 'hole' is achieved by subtracting the result of this container with the parent
Blending = new BlendingParameters { AlphaEquation = BlendingEquation.ReverseSubtract },
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,
CacheDrawnFrameBuffer = true,
BackgroundColour = Color4Extensions.FromHex("#202624").Opacity(0),
Child = pointGrid = new GridContainer
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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