From e5593f2132cb372bc8ea99086b3ffdc70023b9f2 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Wed, 20 Oct 2021 15:34:21 +0200 Subject: [PATCH] copy vertex data more efficiently --- MLEM/Misc/StaticSpriteBatch.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MLEM/Misc/StaticSpriteBatch.cs b/MLEM/Misc/StaticSpriteBatch.cs index ee79c81..1e48af2 100644 --- a/MLEM/Misc/StaticSpriteBatch.cs +++ b/MLEM/Misc/StaticSpriteBatch.cs @@ -77,8 +77,7 @@ namespace MLEM.Misc { var totalIndex = 0; while (totalIndex < this.vertices.Count) { var now = Math.Min(this.vertices.Count - totalIndex, Data.Length); - for (var i = 0; i < now; i++) - Data[i] = this.vertices[totalIndex + i]; + this.vertices.CopyTo(totalIndex, Data, 0, now); this.vertexBuffers[arrayIndex++].SetData(Data); totalIndex += now; }