Apply DrawNode parameter changes

This commit is contained in:
Dan Balasescu 2022-07-29 22:33:34 +09:00
parent 6703b8df02
commit 155dac55d0
7 changed files with 25 additions and 22 deletions

View File

@ -12,6 +12,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Batches;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Textures;
using osu.Framework.Input;
@ -254,9 +255,9 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor
Source.parts.CopyTo(parts, 0);
}
public override void Draw(Action<TexturedVertex2D> vertexAction)
public override void Draw(IRenderer renderer)
{
base.Draw(vertexAction);
base.Draw(renderer);
shader.Bind();
shader.GetUniform<float>("g_FadeClock").UpdateValue(ref time);

View File

@ -17,6 +17,7 @@ using System.Collections.Generic;
using osu.Framework.Graphics.Batches;
using osu.Framework.Graphics.OpenGL.Buffers;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Lists;
namespace osu.Game.Graphics.Backgrounds
@ -270,9 +271,9 @@ namespace osu.Game.Graphics.Backgrounds
parts.AddRange(Source.parts);
}
public override void Draw(Action<TexturedVertex2D> vertexAction)
public override void Draw(IRenderer renderer)
{
base.Draw(vertexAction);
base.Draw(renderer);
if (Source.AimCount > 0 && (vertexBatch == null || vertexBatch.Size != Source.AimCount))
{

View File

@ -6,8 +6,8 @@
using System;
using System.Collections.Generic;
using osu.Framework.Graphics;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Utils;
@ -89,7 +89,7 @@ namespace osu.Game.Graphics
currentTime = source.Time.Current;
}
protected override void Blit(Action<TexturedVertex2D> vertexAction)
protected override void Blit(IRenderer renderer)
{
double time = currentTime - startTime;
@ -112,9 +112,9 @@ namespace osu.Game.Graphics
Vector2Extensions.Transform(rect.BottomRight, DrawInfo.Matrix)
);
DrawQuad(Texture, quad, DrawColourInfo.Colour.MultiplyAlpha(alpha), null, vertexAction,
new Vector2(InflationAmount.X / DrawRectangle.Width, InflationAmount.Y / DrawRectangle.Height),
null, TextureCoords);
DrawQuad(Texture, quad, DrawColourInfo.Colour.MultiplyAlpha(alpha),
inflationPercentage: new Vector2(InflationAmount.X / DrawRectangle.Width, InflationAmount.Y / DrawRectangle.Height),
textureCoords: TextureCoords);
}
}

View File

@ -7,8 +7,8 @@ using System;
using osu.Framework.Bindables;
using osu.Framework.Extensions.EnumExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Utils;
@ -107,7 +107,7 @@ namespace osu.Game.Graphics
sourceSize = Source.DrawSize;
}
protected override void Blit(Action<TexturedVertex2D> vertexAction)
protected override void Blit(IRenderer renderer)
{
foreach (var p in particles)
{
@ -136,9 +136,9 @@ namespace osu.Game.Graphics
transformPosition(rect.BottomRight, rect.Centre, angle)
);
DrawQuad(Texture, quad, DrawColourInfo.Colour.MultiplyAlpha(alpha), null, vertexAction,
new Vector2(InflationAmount.X / DrawRectangle.Width, InflationAmount.Y / DrawRectangle.Height),
null, TextureCoords);
DrawQuad(Texture, quad, DrawColourInfo.Colour.MultiplyAlpha(alpha),
inflationPercentage: new Vector2(InflationAmount.X / DrawRectangle.Width, InflationAmount.Y / DrawRectangle.Height),
textureCoords: TextureCoords);
}
}

View File

@ -3,10 +3,9 @@
#nullable disable
using System;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Sprites;
@ -57,11 +56,11 @@ namespace osu.Game.Graphics.Sprites
progress = source.animationProgress;
}
protected override void Blit(Action<TexturedVertex2D> vertexAction)
protected override void Blit(IRenderer renderer)
{
Shader.GetUniform<float>("progress").UpdateValue(ref progress);
base.Blit(vertexAction);
base.Blit(renderer);
}
protected override bool CanDrawOpaqueInterior => false;

View File

@ -9,6 +9,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Batches;
using osu.Framework.Graphics.OpenGL.Vertices;
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Rendering;
using osu.Framework.Graphics.Shaders;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
@ -235,9 +236,9 @@ namespace osu.Game.Rulesets.Mods
flashlightDim = Source.FlashlightDim;
}
public override void Draw(Action<TexturedVertex2D> vertexAction)
public override void Draw(IRenderer renderer)
{
base.Draw(vertexAction);
base.Draw(renderer);
shader.Bind();

View File

@ -22,6 +22,7 @@ using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Utils;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics.Rendering;
namespace osu.Game.Screens.Menu
{
@ -198,9 +199,9 @@ namespace osu.Game.Screens.Menu
Source.frequencyAmplitudes.AsSpan().CopyTo(audioData);
}
public override void Draw(Action<TexturedVertex2D> vertexAction)
public override void Draw(IRenderer renderer)
{
base.Draw(vertexAction);
base.Draw(renderer);
shader.Bind();