mirror of
https://github.com/ppy/osu.git
synced 2025-01-29 13:42:54 +08:00
Use TriangleBatch
This commit is contained in:
parent
eebfdd8865
commit
5696d79423
@ -8,7 +8,6 @@ using osuTK.Graphics;
|
|||||||
using System;
|
using System;
|
||||||
using osu.Framework.Graphics.Shaders;
|
using osu.Framework.Graphics.Shaders;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osuTK.Graphics.ES30;
|
|
||||||
using osu.Framework.Graphics.Colour;
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Framework.Graphics.Primitives;
|
using osu.Framework.Graphics.Primitives;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -192,7 +191,7 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
private readonly List<TriangleParticle> parts = new List<TriangleParticle>();
|
private readonly List<TriangleParticle> parts = new List<TriangleParticle>();
|
||||||
private Vector2 size;
|
private Vector2 size;
|
||||||
|
|
||||||
private LinearBatch<TexturedVertex2D> vertexBatch;
|
private TriangleBatch<TexturedVertex2D> vertexBatch;
|
||||||
|
|
||||||
public TrianglesDrawNode(Triangles source)
|
public TrianglesDrawNode(Triangles source)
|
||||||
: base(source)
|
: base(source)
|
||||||
@ -215,10 +214,10 @@ namespace osu.Game.Graphics.Backgrounds
|
|||||||
{
|
{
|
||||||
base.Draw(vertexAction);
|
base.Draw(vertexAction);
|
||||||
|
|
||||||
if (vertexBatch == null || vertexBatch.Size != Source.AimCount * 6)
|
if (vertexBatch == null || vertexBatch.Size != Source.AimCount)
|
||||||
{
|
{
|
||||||
vertexBatch?.Dispose();
|
vertexBatch?.Dispose();
|
||||||
vertexBatch = new LinearBatch<TexturedVertex2D>(Source.AimCount * 6, 1, PrimitiveType.Triangles);
|
vertexBatch = new TriangleBatch<TexturedVertex2D>(Source.AimCount, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
shader.Bind();
|
shader.Bind();
|
||||||
|
Loading…
Reference in New Issue
Block a user