diff --git a/Headers/System/Mesh.hpp b/Headers/System/Mesh.hpp index e28d989..fb5c960 100644 --- a/Headers/System/Mesh.hpp +++ b/Headers/System/Mesh.hpp @@ -48,8 +48,8 @@ namespace System { Points }; struct SubMeshDescriptor { - int indexStart; - int indexCount; + unsigned int indexStart; + unsigned int indexCount; int baseVertex; MeshTopology topology; }; @@ -58,7 +58,7 @@ namespace System { std::vector vertices; std::vector normals; - std::vector indices; + std::vector indices; System::Bounds bounds; std::vector submeshes; std::vector tangents; @@ -251,10 +251,10 @@ namespace System { m_bitFlags |= bitFlags::Modified; } - void SetTriangles(const std::vector& triangles, int submesh, bool calculateBounds = true, int baseVertex = 0) { + void SetTriangles(const std::vector& triangles, int submesh, bool calculateBounds = true, int baseVertex = 0) { SetIndices(triangles, MeshTopology::Triangles, submesh, calculateBounds, baseVertex); } - void SetIndices(const std::vector& newIndices, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0) { + void SetIndices(const std::vector& newIndices, MeshTopology topology, int submesh, bool calculateBounds = true, int baseVertex = 0) { m_bitFlags |= bitFlags::Modified; if (submesh < 0) { throw std::out_of_range("Submesh index is out of range."); @@ -271,8 +271,8 @@ namespace System { } else { // It's an existing submesh that we are replacing SubMeshDescriptor& desc = submeshes[submesh]; - int oldIndexCount = desc.indexCount; - int newIndexCount = newIndices.size(); + unsigned int oldIndexCount = desc.indexCount; + unsigned int newIndexCount = newIndices.size(); int diff = newIndexCount - oldIndexCount; // Replace the indices @@ -298,13 +298,13 @@ namespace System { if (index < 0 || index >= submeshes.size()) throw std::out_of_range("Submesh index is out of range."); return submeshes[index]; } - std::vector GetIndices(int submesh) const { + std::vector GetIndices(int submesh) const { if (submesh < 0 || submesh >= submeshes.size()) { throw std::out_of_range("Submesh index is out of range."); } const auto& desc = submeshes[submesh]; - return std::vector(indices.begin() + desc.indexStart, indices.begin() + desc.indexStart + desc.indexCount); + return std::vector(indices.begin() + desc.indexStart, indices.begin() + desc.indexStart + desc.indexCount); } void Clear(bool keepVertexLayout = true) { vertices.clear(); diff --git a/Sources/System/GameObject.cpp b/Sources/System/GameObject.cpp index 41780e0..f737ba7 100644 --- a/Sources/System/GameObject.cpp +++ b/Sources/System/GameObject.cpp @@ -71,7 +71,7 @@ namespace System { Vector3(-0.5f, 0.5f, 0.5f) }; - std::vector triangles = { + std::vector triangles = { // Front face 0, 1, 2, 2, 3, 0, diff --git a/Tests/scene_render/scene_render_debug b/Tests/scene_render/scene_render_debug new file mode 100755 index 0000000..6021fb2 Binary files /dev/null and b/Tests/scene_render/scene_render_debug differ