From e9670aa9124522676bc0b1e714b85d504425033a Mon Sep 17 00:00:00 2001 From: eduardodoria Date: Thu, 9 Mar 2023 22:18:47 -0300 Subject: [PATCH] Fixed mesh load with no indices --- engine/core/subsystem/RenderSystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/core/subsystem/RenderSystem.cpp b/engine/core/subsystem/RenderSystem.cpp index 8f50fcb2..a8126d8d 100644 --- a/engine/core/subsystem/RenderSystem.cpp +++ b/engine/core/subsystem/RenderSystem.cpp @@ -495,7 +495,7 @@ bool RenderSystem::loadMesh(MeshComponent& mesh){ buffers["vertices"] = &mesh.buffer; allBuffersEmpty = false; } - if (mesh.buffer.getSize() > 0){ + if (mesh.indices.getSize() > 0){ buffers["indices"] = &mesh.indices; allBuffersEmpty = false; } @@ -505,7 +505,7 @@ bool RenderSystem::loadMesh(MeshComponent& mesh){ } if (mesh.vertexCount == 0){ - mesh.vertexCount = mesh.buffer.getSize(); + mesh.vertexCount = mesh.buffer.getCount(); } if (allBuffersEmpty)