Skip to content

Commit

Permalink
Merge pull request #359 from LumpBloom7/dependabot/nuget/ppy.osu.Game…
Browse files Browse the repository at this point in the history
…-2022.810.0

Bump ppy.osu.Game from 2022.719.0 to 2022.810.0
  • Loading branch information
LumpBloom7 authored Aug 9, 2022
2 parents 06dc107 + 372810e commit 3673b89
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 19 deletions.
24 changes: 17 additions & 7 deletions osu.Game.Rulesets.Sentakki/Mods/SentakkiModHidden.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Batches;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Rendering.Vertices;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using osu.Game.Graphics.OpenGL.Vertices;
Expand Down Expand Up @@ -193,8 +193,8 @@ private class PlayfieldMaskDrawNode : DrawNode
private Vector2 maskPosition;
private Vector2 maskRadius;

private readonly VertexBatch<PositionAndColourVertex> quadBatch = new QuadBatch<PositionAndColourVertex>(1, 1);
private readonly Action<TexturedVertex2D> addAction;
private IVertexBatch<PositionAndColourVertex> quadBatch;
private Action<TexturedVertex2D> addAction;

public PlayfieldMaskDrawNode(PlayfieldMask source)
: base(source)
Expand All @@ -216,16 +216,26 @@ public override void ApplyState()
maskRadius = Source.MaskRadius * DrawInfo.Matrix.ExtractScale().Xy;
}

public override void Draw(Action<TexturedVertex2D> vertexAction)
public override void Draw(IRenderer renderer)
{
base.Draw(vertexAction);
base.Draw(renderer);

if (quadBatch == null)
{
quadBatch = renderer.CreateQuadBatch<PositionAndColourVertex>(1, 1);
addAction = v => quadBatch.Add(new PositionAndColourVertex
{
Position = v.Position,
Colour = v.Colour
});
}

shader.Bind();

shader.GetUniform<Vector2>("maskPosition").UpdateValue(ref maskPosition);
shader.GetUniform<Vector2>("maskRadius").UpdateValue(ref maskRadius);

DrawQuad(Texture.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: addAction);
renderer.DrawQuad(renderer.WhitePixel, screenSpaceDrawQuad, DrawColourInfo.Colour, vertexAction: addAction);

shader.Unbind();
}
Expand Down
2 changes: 1 addition & 1 deletion osu.Game.Rulesets.Sentakki/SentakkiRuleset.cs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public SentakkiIcon(Ruleset ruleset)
private void load(GameHost host)
{
if (textureStore is null)
textureStore = new LargeTextureStore(host.CreateTextureLoaderStore(ruleset.CreateResourceStore()));
textureStore = new LargeTextureStore(host.Renderer, host.CreateTextureLoaderStore(ruleset.CreateResourceStore()));

AddInternal(new Sprite
{
Expand Down
22 changes: 12 additions & 10 deletions osu.Game.Rulesets.Sentakki/UI/Components/PlayfieldVisualization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
using osu.Framework.Bindables;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Batches;
using osu.Framework.Graphics.Colour;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Rendering.Vertices;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using osu.Framework.Utils;
Expand Down Expand Up @@ -65,7 +65,7 @@ public class PlayfieldVisualisation : Drawable, IHasAccentColour
private readonly float[] frequencyAmplitudes = new float[256];

private IShader shader;
private readonly Texture texture;
private Texture texture;

public PlayfieldVisualisation()
{
Expand All @@ -75,16 +75,16 @@ public PlayfieldVisualisation()
Size = new Vector2(.99f);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
texture = Texture.WhitePixel;
Blending = BlendingParameters.Additive;
}

private readonly Bindable<bool> kiaiEffect = new Bindable<bool>(true);

[BackgroundDependencyLoader(true)]
private void load(ShaderManager shaders, IBindable<WorkingBeatmap> beatmap, SentakkiRulesetConfigManager settings)
private void load(IRenderer renderer, ShaderManager shaders, IBindable<WorkingBeatmap> beatmap, SentakkiRulesetConfigManager settings)
{
this.beatmap.BindTo(beatmap);
texture = renderer.WhitePixel;
shader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.TEXTURE_ROUNDED);

settings?.BindWith(SentakkiRulesetSettings.KiaiEffects, kiaiEffect);
Expand Down Expand Up @@ -181,7 +181,7 @@ private class VisualisationDrawNode : DrawNode
private Color4 colour;
private float[] audioData;

private readonly QuadBatch<TexturedVertex2D> vertexBatch = new QuadBatch<TexturedVertex2D>(100, 10);
private IVertexBatch<TexturedVertex2D> vertexBatch;

public VisualisationDrawNode(PlayfieldVisualisation source)
: base(source)
Expand All @@ -199,12 +199,14 @@ public override void ApplyState()
audioData = Source.frequencyAmplitudes;
}

public override void Draw(Action<TexturedVertex2D> vertexAction)
public override void Draw(IRenderer renderer)
{
if (!Source.ShouldDraw)
return;

base.Draw(vertexAction);
base.Draw(renderer);

vertexBatch ??= renderer.CreateQuadBatch<TexturedVertex2D>(100, 10);

shader.Bind();

Expand Down Expand Up @@ -241,7 +243,7 @@ public override void Draw(Action<TexturedVertex2D> vertexAction)
Vector2Extensions.Transform(barPosition + bottomOffset + amplitudeOffset, DrawInfo.Matrix)
);

DrawQuad(
renderer.DrawQuad(
texture,
rectangle,
colourInfo,
Expand All @@ -260,7 +262,7 @@ protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);

vertexBatch.Dispose();
vertexBatch?.Dispose();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AssemblyName>osu.Game.Rulesets.Sentakki</AssemblyName>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ppy.osu.Game" Version="2022.719.0"/>
<PackageReference Include="ppy.osu.Game" Version="2022.810.0"/>
</ItemGroup>

<!--Since we aren't changing the assembly name, we use the assembly title to indicate whether it is a dev build-->
Expand Down

0 comments on commit 3673b89

Please sign in to comment.