From a1581606ac83d3cec6aea65b71de20c4dd628344 Mon Sep 17 00:00:00 2001 From: AmyFoxie Date: Mon, 4 Dec 2023 18:59:03 +0100 Subject: [PATCH] model loading working --- src/engine/vk/test/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/vk/test/main.cpp b/src/engine/vk/test/main.cpp index 9176827..2bf589a 100644 --- a/src/engine/vk/test/main.cpp +++ b/src/engine/vk/test/main.cpp @@ -82,11 +82,11 @@ int main() { Assimp::Importer importer; const auto& scene = importer.ReadFile("../../src/engine/vk/test/vikingroom.glb", aiProcessPreset_TargetRealtime_Fast); - if (!scene) + if (nullptr == scene) throw std::runtime_error("Failed to load model from file"); const auto& mesh = scene->mMeshes[0]; - std::vector vertices{mesh->mNumVertices}; + std::vector vertices(mesh->mNumVertices); for (uint32_t i = 0; i < mesh->mNumVertices; i++) { const auto& vertex = mesh->mVertices[i]; const auto& color = mesh->HasVertexColors(i) ? *mesh->mColors[i] : aiColor4D{1.0f, 1.0f, 1.0f, 1.0f}; @@ -99,9 +99,9 @@ int main() { }; } - std::vector indices{mesh->mNumFaces * 3}; + std::vector indices(mesh->mNumFaces * 3); for (uint32_t i = 0; i < mesh->mNumFaces; i++) { - const auto& face = mesh->mFaces[i]; + const auto &face = mesh->mFaces[i]; if (face.mNumIndices != 3) { spdlog::warn("Skipping face with {} indices", face.mNumIndices); continue;