Overlay-Next: Fix glitches with the grid

The vertex array was allocating uninitialized memory.
This fixes the API usage mistake and do the
intended reserve call.
This commit is contained in:
Clément Foucault
2024-09-30 13:04:49 +02:00
parent 5c42dd3ae7
commit a39a966328

View File

@@ -1376,7 +1376,8 @@ ShapeCache::ShapeCache()
steps[i] = -1.0f + float(i * 2) / resolution;
}
Vector<Vertex> verts(resolution * resolution * 6);
Vector<Vertex> verts;
verts.reserve(resolution * resolution * 6);
for (const int x : IndexRange(resolution)) {
for (const int y : IndexRange(resolution)) {
verts.append(Vertex{{steps[x], steps[y], 0.0f}});