From 653e9609e4b29116b410e443852bbbd5708bd510 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Perrier Date: Tue, 16 Feb 2021 10:14:42 +0100 Subject: [PATCH] Span + Naming --- Source/Engine/Render2D/Render2D.cpp | 4 ++-- Source/Engine/Render2D/Render2D.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Render2D/Render2D.cpp b/Source/Engine/Render2D/Render2D.cpp index 818265551..cd91430bf 100644 --- a/Source/Engine/Render2D/Render2D.cpp +++ b/Source/Engine/Render2D/Render2D.cpp @@ -1745,7 +1745,7 @@ void Render2D::DrawBlur(const Rectangle& rect, float blurStrength) WriteRect(rect, Color::White); } -void Render2D::DrawVertices(GPUTexture* t, const Array vertices, const Array uvs) +void Render2D::DrawTexturedTriangles(GPUTexture* t, const Span& vertices, const Span& uvs) { RENDER2D_CHECK_RENDERING_STATE; @@ -1759,7 +1759,7 @@ void Render2D::DrawVertices(GPUTexture* t, const Array vertices, const WriteTri(vertices[i], vertices[i + 1], vertices[i + 2], uvs[i], uvs[i + 1], uvs[i + 2]); } -void Render2D::DrawVertices(const Array vertices, const Array colors, bool useAlpha) +void Render2D::FillTriangles(const Span& vertices, const Span& colors, bool useAlpha) { RENDER2D_CHECK_RENDERING_STATE; diff --git a/Source/Engine/Render2D/Render2D.h b/Source/Engine/Render2D/Render2D.h index 1cf32a886..bd73fa137 100644 --- a/Source/Engine/Render2D/Render2D.h +++ b/Source/Engine/Render2D/Render2D.h @@ -5,6 +5,7 @@ #include "Engine/Core/Math/Color.h" #include "Engine/Scripting/ScriptingType.h" #include "Engine/Core/Collections/Array.h" +#include "Engine/Core/Types/Span.h" struct SpriteHandle; struct TextLayoutOptions; @@ -347,7 +348,7 @@ public: /// The texture. /// The vertices array. /// The uvs array. - API_FUNCTION() static void DrawVertices(GPUTexture* t, Array vertices, Array uvs); + API_FUNCTION() static void DrawTexturedTriangles(GPUTexture* t, const Span& vertices, const Span& uvs); /// /// Draws vertices array. @@ -355,7 +356,7 @@ public: /// The vertices array. /// The colors array. /// If true alpha blending will be enabled. - API_FUNCTION() static void DrawVertices(Array vertices, Array colors, bool useAlpha); + API_FUNCTION() static void FillTriangles(const Span& vertices, const Span& colors, bool useAlpha); /// /// Fills a triangular area.