1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-29 13:42:54 +08:00

Use TriangleBatch

This commit is contained in:
Dean Herbert 2019-07-19 23:47:48 +09:00
parent eebfdd8865
commit 5696d79423

View File

@ -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();