diff --git a/osu-framework b/osu-framework index 976d7833e8..c7e33572ce 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 976d7833e85ff880e9b00e8c121747f59becb2d8 +Subproject commit c7e33572ceb96df9f0345dc63f689f7d433bf7b0 diff --git a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs index 94aa185772..3ef13792de 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/Pieces/Triangles.cs @@ -8,29 +8,24 @@ using OpenTK; namespace osu.Game.Modes.Osu.Objects.Drawables.Pieces { - public class Triangles : Container + public class Triangles : Container { - private Texture triangle; - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - triangle = textures.Get(@"Play/osu/triangle@2x"); - } - protected override void LoadComplete() { base.LoadComplete(); + + const float size = 100; for (int i = 0; i < 10; i++) { - Add(new Sprite + Add(new Triangle { - Texture = triangle, Origin = Anchor.Centre, RelativePositionAxes = Axes.Both, Position = new Vector2(RNG.NextSingle(), RNG.NextSingle()), Scale = new Vector2(RNG.NextSingle() * 0.4f + 0.2f), - Alpha = RNG.NextSingle() * 0.3f + // Scaling height by 0.866 results in equiangular triangles (== 60° and equal side length) + Size = new Vector2(size, 0.866f * size), + Alpha = RNG.NextSingle() * 0.3f, }); } } diff --git a/osu.Game/Graphics/Backgrounds/Triangles.cs b/osu.Game/Graphics/Backgrounds/Triangles.cs index 514ffb9497..34e65f0b2a 100644 --- a/osu.Game/Graphics/Backgrounds/Triangles.cs +++ b/osu.Game/Graphics/Backgrounds/Triangles.cs @@ -13,10 +13,8 @@ using OpenTK; namespace osu.Game.Graphics.Backgrounds { - public class Triangles : Container + public class Triangles : Container { - private Texture triangle; - public Triangles() { Alpha = 0.3f; @@ -35,12 +33,6 @@ namespace osu.Game.Graphics.Backgrounds } } - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - triangle = textures.Get(@"Play/osu/triangle@2x"); - } - private int aimTriangleCount => (int)((DrawWidth * DrawHeight) / 800 / triangleScale); protected override void Update() @@ -60,16 +52,18 @@ namespace osu.Game.Graphics.Backgrounds } - protected virtual Sprite CreateTriangle() + protected virtual Triangle CreateTriangle() { var scale = triangleScale * RNG.NextSingle() * 0.4f + 0.2f; + const float size = 100; - return new Sprite + return new Triangle { - Texture = triangle, Origin = Anchor.TopCentre, RelativePositionAxes = Axes.Both, Scale = new Vector2(scale), + // Scaling height by 0.866 results in equiangular triangles (== 60° and equal side length) + Size = new Vector2(size, 0.866f * size), Alpha = RNG.NextSingle(), Depth = scale, }; diff --git a/osu.Game/Graphics/Cursor/CursorTrail.cs b/osu.Game/Graphics/Cursor/CursorTrail.cs index b724f71c13..f2060bf8a3 100644 --- a/osu.Game/Graphics/Cursor/CursorTrail.cs +++ b/osu.Game/Graphics/Cursor/CursorTrail.cs @@ -195,7 +195,7 @@ namespace osu.Game.Graphics.Cursor colour.BottomLeft.Linear.A = Parts[i].Time + colour.BottomLeft.Linear.A; colour.BottomRight.Linear.A = Parts[i].Time + colour.BottomRight.Linear.A; - Texture.Draw( + Texture.DrawQuad( new Quad(pos.X - Size.X / 2, pos.Y - Size.Y / 2, Size.X, Size.Y), colour, null, diff --git a/osu.Game/Screens/Menu/OsuLogo.cs b/osu.Game/Screens/Menu/OsuLogo.cs index c0d3b94737..323b23b920 100644 --- a/osu.Game/Screens/Menu/OsuLogo.cs +++ b/osu.Game/Screens/Menu/OsuLogo.cs @@ -213,7 +213,7 @@ namespace osu.Game.Screens.Menu Alpha = 1; } - protected override Sprite CreateTriangle() + protected override Triangle CreateTriangle() { var triangle = base.CreateTriangle(); triangle.Alpha = 1;