1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-05 03:22:59 +08:00

Update with framework-side front-to-back changes (#4577)

Update with framework-side front-to-back changes
This commit is contained in:
Dean Herbert 2019-06-06 21:00:11 +09:00 committed by GitHub
commit a228763cf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 33 deletions

View File

@ -2,13 +2,10 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic; using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Lines; using osu.Framework.Graphics.Lines;
using osu.Framework.Graphics.Primitives;
using osuTK; using osuTK;
using osuTK.Graphics; using osuTK.Graphics;
using osuTK.Graphics.ES30;
namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
{ {
@ -19,8 +16,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
private readonly SliderPath path; private readonly SliderPath path;
protected Path Path => path; protected Path Path => path;
private readonly BufferedContainer container;
public float PathRadius public float PathRadius
{ {
get => path.PathRadius; get => path.PathRadius;
@ -44,8 +39,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
return; return;
path.AccentColour = value; path.AccentColour = value;
container.ForceRedraw();
} }
} }
@ -61,8 +54,6 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
return; return;
path.BorderColour = value; path.BorderColour = value;
container.ForceRedraw();
} }
} }
@ -78,23 +69,12 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
return; return;
path.BorderSize = value; path.BorderSize = value;
container.ForceRedraw();
} }
} }
public Quad PathDrawQuad => container.ScreenSpaceDrawQuad;
protected SliderBody() protected SliderBody()
{ {
InternalChild = container = new BufferedContainer InternalChild = path = new SliderPath();
{
RelativeSizeAxes = Axes.Both,
CacheDrawnFrameBuffer = true,
Child = path = new SliderPath { Blending = BlendingMode.None }
};
container.Attach(RenderbufferInternalFormat.DepthComponent16);
} }
public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => path.ReceivePositionalInputAt(screenSpacePos); public override bool ReceivePositionalInputAt(Vector2 screenSpacePos) => path.ReceivePositionalInputAt(screenSpacePos);
@ -103,11 +83,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
/// Sets the vertices of the path which should be drawn by this <see cref="SliderBody"/>. /// Sets the vertices of the path which should be drawn by this <see cref="SliderBody"/>.
/// </summary> /// </summary>
/// <param name="vertices">The vertices</param> /// <param name="vertices">The vertices</param>
protected void SetVertices(IReadOnlyList<Vector2> vertices) protected void SetVertices(IReadOnlyList<Vector2> vertices) => path.Vertices = vertices;
{
path.Vertices = vertices;
container.ForceRedraw();
}
private class SliderPath : SmoothPath private class SliderPath : SmoothPath
{ {

View File

@ -210,7 +210,8 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
Vector2 pos = parts[i].Position; Vector2 pos = parts[i].Position;
float localTime = parts[i].Time; float localTime = parts[i].Time;
texture.DrawQuad( DrawQuad(
texture,
new Quad(pos.X - size.X / 2, pos.Y - size.Y / 2, size.X, size.Y), new Quad(pos.X - size.X / 2, pos.Y - size.Y / 2, size.X, size.Y),
DrawColourInfo.Colour, DrawColourInfo.Colour,
null, null,

View File

@ -214,7 +214,6 @@ namespace osu.Game.Graphics.Backgrounds
base.Draw(vertexAction); base.Draw(vertexAction);
shader.Bind(); shader.Bind();
texture.TextureGL.Bind();
Vector2 localInflationAmount = edge_smoothness * DrawInfo.MatrixInverse.ExtractScale().Xy; Vector2 localInflationAmount = edge_smoothness * DrawInfo.MatrixInverse.ExtractScale().Xy;
@ -231,7 +230,8 @@ namespace osu.Game.Graphics.Backgrounds
ColourInfo colourInfo = DrawColourInfo.Colour; ColourInfo colourInfo = DrawColourInfo.Colour;
colourInfo.ApplyChild(particle.Colour); colourInfo.ApplyChild(particle.Colour);
texture.DrawTriangle( DrawTriangle(
texture,
triangle, triangle,
colourInfo, colourInfo,
null, null,

View File

@ -31,6 +31,11 @@ namespace osu.Game.Overlays.Settings.Sections.Debug
LabelText = "Bypass caching (slow)", LabelText = "Bypass caching (slow)",
Bindable = config.GetBindable<bool>(DebugSetting.BypassCaching) Bindable = config.GetBindable<bool>(DebugSetting.BypassCaching)
}, },
new SettingsCheckbox
{
LabelText = "Bypass front-to-back render pass",
Bindable = config.GetBindable<bool>(DebugSetting.BypassFrontToBackPass)
}
}; };
} }
} }

View File

@ -179,7 +179,7 @@ namespace osu.Game.Rulesets.Mods
shader.GetUniform<Vector2>("flashlightSize").UpdateValue(ref flashlightSize); shader.GetUniform<Vector2>("flashlightSize").UpdateValue(ref flashlightSize);
shader.GetUniform<float>("flashlightDim").UpdateValue(ref flashlightDim); shader.GetUniform<float>("flashlightDim").UpdateValue(ref flashlightDim);
Texture.WhitePixel.DrawQuad(screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction); DrawQuad(Texture.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: vertexAction);
shader.Unbind(); shader.Unbind();
} }

View File

@ -189,7 +189,6 @@ namespace osu.Game.Screens.Menu
base.Draw(vertexAction); base.Draw(vertexAction);
shader.Bind(); shader.Bind();
texture.TextureGL.Bind();
Vector2 inflation = DrawInfo.MatrixInverse.ExtractScale().Xy; Vector2 inflation = DrawInfo.MatrixInverse.ExtractScale().Xy;
@ -224,7 +223,8 @@ namespace osu.Game.Screens.Menu
Vector2Extensions.Transform(barPosition + bottomOffset + amplitudeOffset, DrawInfo.Matrix) Vector2Extensions.Transform(barPosition + bottomOffset + amplitudeOffset, DrawInfo.Matrix)
); );
texture.DrawQuad( DrawQuad(
texture,
rectangle, rectangle,
colourInfo, colourInfo,
null, null,

View File

@ -15,7 +15,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="2.2.4" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="ppy.osu.Game.Resources" Version="2019.518.0" /> <PackageReference Include="ppy.osu.Game.Resources" Version="2019.518.0" />
<PackageReference Include="ppy.osu.Framework" Version="2019.604.1" /> <PackageReference Include="ppy.osu.Framework" Version="2019.606.1" />
<PackageReference Include="SharpCompress" Version="0.23.0" /> <PackageReference Include="SharpCompress" Version="0.23.0" />
<PackageReference Include="NUnit" Version="3.12.0" /> <PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="SharpRaven" Version="2.4.0" /> <PackageReference Include="SharpRaven" Version="2.4.0" />