1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Rename Masking to ClampToDrawable

This commit is contained in:
Andrei Zavatski 2024-01-21 05:20:42 +03:00
parent e003ecb593
commit 1393f52b2b
8 changed files with 14 additions and 14 deletions

View File

@ -15,7 +15,7 @@ namespace osu.Game.Rulesets.Osu.Skinning.Default
{ {
TriangleScale = 1.2f; TriangleScale = 1.2f;
HideAlphaDiscrepancies = false; HideAlphaDiscrepancies = false;
Masking = false; ClampToDrawable = false;
} }
protected override void Update() protected override void Update()

View File

@ -40,7 +40,7 @@ namespace osu.Game.Tests.Visual.Background
AddSliderStep("Triangle scale", 0f, 10f, 1f, s => triangles.TriangleScale = s); AddSliderStep("Triangle scale", 0f, 10f, 1f, s => triangles.TriangleScale = s);
AddSliderStep("Seed", 0, 1000, 0, s => triangles.Reset(s)); AddSliderStep("Seed", 0, 1000, 0, s => triangles.Reset(s));
AddToggleStep("Masking", m => triangles.Masking = m); AddToggleStep("ClampToDrawable", c => triangles.ClampToDrawable = c);
} }
} }
} }

View File

@ -128,7 +128,7 @@ namespace osu.Game.Tests.Visual.Background
AddStep("White colour", () => box.Colour = triangles.Colour = maskedTriangles.Colour = Color4.White); AddStep("White colour", () => box.Colour = triangles.Colour = maskedTriangles.Colour = Color4.White);
AddStep("Vertical gradient", () => box.Colour = triangles.Colour = maskedTriangles.Colour = ColourInfo.GradientVertical(Color4.White, Color4.Red)); AddStep("Vertical gradient", () => box.Colour = triangles.Colour = maskedTriangles.Colour = ColourInfo.GradientVertical(Color4.White, Color4.Red));
AddStep("Horizontal gradient", () => box.Colour = triangles.Colour = maskedTriangles.Colour = ColourInfo.GradientHorizontal(Color4.White, Color4.Red)); AddStep("Horizontal gradient", () => box.Colour = triangles.Colour = maskedTriangles.Colour = ColourInfo.GradientHorizontal(Color4.White, Color4.Red));
AddToggleStep("Masking", m => maskedTriangles.Masking = m); AddToggleStep("ClampToDrawable", c => maskedTriangles.ClampToDrawable = c);
} }
} }
} }

View File

@ -80,7 +80,7 @@ namespace osu.Game.Graphics.Backgrounds
/// If enabled, only the portion of triangles that falls within this <see cref="Drawable"/>'s /// If enabled, only the portion of triangles that falls within this <see cref="Drawable"/>'s
/// shape is drawn to the screen. Default is true. /// shape is drawn to the screen. Default is true.
/// </summary> /// </summary>
public bool Masking { get; set; } = true; public bool ClampToDrawable { get; set; } = true;
/// <summary> /// <summary>
/// Whether we should drop-off alpha values of triangles more quickly to improve /// Whether we should drop-off alpha values of triangles more quickly to improve
@ -257,7 +257,7 @@ namespace osu.Game.Graphics.Backgrounds
private IShader shader; private IShader shader;
private Texture texture; private Texture texture;
private bool masking; private bool clamp;
private readonly List<TriangleParticle> parts = new List<TriangleParticle>(); private readonly List<TriangleParticle> parts = new List<TriangleParticle>();
private readonly Vector2 triangleSize = new Vector2(1f, equilateral_triangle_ratio) * triangle_size; private readonly Vector2 triangleSize = new Vector2(1f, equilateral_triangle_ratio) * triangle_size;
@ -276,7 +276,7 @@ namespace osu.Game.Graphics.Backgrounds
shader = Source.shader; shader = Source.shader;
texture = Source.texture; texture = Source.texture;
size = Source.DrawSize; size = Source.DrawSize;
masking = Source.Masking; clamp = Source.ClampToDrawable;
parts.Clear(); parts.Clear();
parts.AddRange(Source.parts); parts.AddRange(Source.parts);
@ -306,7 +306,7 @@ namespace osu.Game.Graphics.Backgrounds
Vector2 topLeft = particle.Position - new Vector2(relativeSize.X * 0.5f, 0f); Vector2 topLeft = particle.Position - new Vector2(relativeSize.X * 0.5f, 0f);
Quad triangleQuad = masking ? clampToDrawable(topLeft, relativeSize) : new Quad(topLeft.X, topLeft.Y, relativeSize.X, relativeSize.Y); Quad triangleQuad = clamp ? clampToDrawable(topLeft, relativeSize) : new Quad(topLeft.X, topLeft.Y, relativeSize.X, relativeSize.Y);
var drawQuad = new Quad( var drawQuad = new Quad(
Vector2Extensions.Transform(triangleQuad.TopLeft * size, DrawInfo.Matrix), Vector2Extensions.Transform(triangleQuad.TopLeft * size, DrawInfo.Matrix),

View File

@ -36,7 +36,7 @@ namespace osu.Game.Graphics.Backgrounds
/// If enabled, only the portion of triangles that falls within this <see cref="Drawable"/>'s /// If enabled, only the portion of triangles that falls within this <see cref="Drawable"/>'s
/// shape is drawn to the screen. Default is true. /// shape is drawn to the screen. Default is true.
/// </summary> /// </summary>
public bool Masking { get; set; } = true; public bool ClampToDrawable { get; set; } = true;
private readonly BindableFloat spawnRatio = new BindableFloat(1f); private readonly BindableFloat spawnRatio = new BindableFloat(1f);
@ -193,7 +193,7 @@ namespace osu.Game.Graphics.Backgrounds
private Vector2 size; private Vector2 size;
private float thickness; private float thickness;
private float texelSize; private float texelSize;
private bool masking; private bool clamp;
public TrianglesDrawNode(TrianglesV2 source) public TrianglesDrawNode(TrianglesV2 source)
: base(source) : base(source)
@ -208,7 +208,7 @@ namespace osu.Game.Graphics.Backgrounds
texture = Source.texture; texture = Source.texture;
size = Source.DrawSize; size = Source.DrawSize;
thickness = Source.Thickness; thickness = Source.Thickness;
masking = Source.Masking; clamp = Source.ClampToDrawable;
Quad triangleQuad = new Quad( Quad triangleQuad = new Quad(
Vector2Extensions.Transform(Vector2.Zero, DrawInfo.Matrix), Vector2Extensions.Transform(Vector2.Zero, DrawInfo.Matrix),
@ -248,7 +248,7 @@ namespace osu.Game.Graphics.Backgrounds
{ {
Vector2 topLeft = particle.Position - new Vector2(relativeSize.X * 0.5f, 0f); Vector2 topLeft = particle.Position - new Vector2(relativeSize.X * 0.5f, 0f);
Quad triangleQuad = masking ? clampToDrawable(topLeft, relativeSize) : new Quad(topLeft.X, topLeft.Y, relativeSize.X, relativeSize.Y); Quad triangleQuad = clamp ? clampToDrawable(topLeft, relativeSize) : new Quad(topLeft.X, topLeft.Y, relativeSize.X, relativeSize.Y);
var drawQuad = new Quad( var drawQuad = new Quad(
Vector2Extensions.Transform(triangleQuad.TopLeft * size, DrawInfo.Matrix), Vector2Extensions.Transform(triangleQuad.TopLeft * size, DrawInfo.Matrix),

View File

@ -150,7 +150,7 @@ namespace osu.Game.Graphics.UserInterface
TriangleScale = 4, TriangleScale = 4,
ColourDark = OsuColour.Gray(0.88f), ColourDark = OsuColour.Gray(0.88f),
Shear = new Vector2(-0.2f, 0), Shear = new Vector2(-0.2f, 0),
Masking = false ClampToDrawable = false
}, },
}, },
}, },

View File

@ -95,7 +95,7 @@ namespace osu.Game.Overlays.Mods
Height = header_height, Height = header_height,
Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0), Shear = new Vector2(-ShearedOverlayContainer.SHEAR, 0),
Velocity = 0.7f, Velocity = 0.7f,
Masking = false ClampToDrawable = false
}, },
headerText = new OsuTextFlowContainer(t => headerText = new OsuTextFlowContainer(t =>
{ {

View File

@ -109,7 +109,7 @@ namespace osu.Game.Screens.Select.Carousel
TriangleScale = 2, TriangleScale = 2,
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
ColourLight = Color4Extensions.FromHex(@"3a7285"), ColourLight = Color4Extensions.FromHex(@"3a7285"),
ColourDark = Color4Extensions.FromHex(@"123744"), ColourDark = Color4Extensions.FromHex(@"123744")
}, },
new FillFlowContainer new FillFlowContainer
{ {