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

Apply NRT to new classes

This commit is contained in:
Dean Herbert 2024-01-16 14:17:21 +09:00
parent e75f113a06
commit 34905b2052
No known key found for this signature in database
2 changed files with 5 additions and 13 deletions

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System.Runtime.InteropServices;
using osu.Framework.Allocation;
using osu.Framework.Graphics;
@ -29,6 +27,8 @@ namespace osu.Game.Screens.Play.HUD.ArgonHealthDisplayParts
{
protected new ArgonHealthDisplayBackground Source => (ArgonHealthDisplayBackground)base.Source;
private IUniformBuffer<ArgonBarPathBackgroundParameters>? parametersBuffer;
public ArgonBarPathDrawNode(ArgonHealthDisplayBackground source)
: base(source)
{
@ -39,21 +39,15 @@ namespace osu.Game.Screens.Play.HUD.ArgonHealthDisplayParts
public override void ApplyState()
{
base.ApplyState();
size = Source.DrawSize;
}
private IUniformBuffer<ArgonBarPathBackgroundParameters> parametersBuffer;
protected override void BindUniformResources(IShader shader, IRenderer renderer)
{
base.BindUniformResources(shader, renderer);
parametersBuffer ??= renderer.CreateUniformBuffer<ArgonBarPathBackgroundParameters>();
parametersBuffer.Data = new ArgonBarPathBackgroundParameters
{
Size = size
};
parametersBuffer.Data = new ArgonBarPathBackgroundParameters { Size = size };
shader.BindUniformBlock("m_ArgonBarPathBackgroundParameters", parametersBuffer);
}

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
#nullable disable
using System;
using System.Runtime.InteropServices;
using osu.Framework.Allocation;
@ -107,6 +105,8 @@ namespace osu.Game.Screens.Play.HUD.ArgonHealthDisplayParts
{
protected new ArgonHealthDisplayBar Source => (ArgonHealthDisplayBar)base.Source;
private IUniformBuffer<ArgonBarPathParameters>? parametersBuffer;
public ArgonBarPathDrawNode(ArgonHealthDisplayBar source)
: base(source)
{
@ -139,8 +139,6 @@ namespace osu.Game.Screens.Play.HUD.ArgonHealthDisplayParts
base.Draw(renderer);
}
private IUniformBuffer<ArgonBarPathParameters> parametersBuffer;
protected override void BindUniformResources(IShader shader, IRenderer renderer)
{
base.BindUniformResources(shader, renderer);