diff --git a/Engine/Graphics/3DRenderer.cpp b/Engine/Graphics/3DRenderer.cpp index 3b3c175..ae504d9 100644 --- a/Engine/Graphics/3DRenderer.cpp +++ b/Engine/Graphics/3DRenderer.cpp @@ -120,7 +120,7 @@ void Graphic3DRenderer::Draw(sf::RenderTexture& context) { { size_t vCount = obj->GetObjectVerticesCount(); auto& oMesh = obj->GetObjectMesh(); - M3D_F4* projVertices = new M3D_F4[vCount]; + auto* projVertices = new M3D_F4[vCount]; // Vertices homogeneous clip space transformation M3D_V3Transform( @@ -131,7 +131,7 @@ void Graphic3DRenderer::Draw(sf::RenderTexture& context) { ); // Draw the object indice triangles if visible or partially clipped - sf::Vertex v_tri[4]; + auto* v_tri = new sf::Vertex[4]; for (auto& objPt : oMesh.parts) { auto indicePtr = static_cast(objPt.indices.data()); @@ -189,7 +189,8 @@ void Graphic3DRenderer::Draw(sf::RenderTexture& context) { } } - std::destroy_at(projVertices); + delete[] v_tri; + delete[] projVertices; } } }