diff --git a/.gitignore b/.gitignore index c87845150..aa51d067b 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ tests/gltf/intel_sponza/ tests/gltf/glTF-Sample-Models/ tests/gltf/good-froge/ tests/gltf/deccer-cubes/ +tests/gltf/bistro/ tests/gltf_loaders/ # gltf Rust wrapper diff --git a/examples/gl_viewer/gl_viewer.cpp b/examples/gl_viewer/gl_viewer.cpp index 32af79033..d48918596 100644 --- a/examples/gl_viewer/gl_viewer.cpp +++ b/examples/gl_viewer/gl_viewer.cpp @@ -127,11 +127,11 @@ bool checkGlLinkErrors(GLuint target) { } struct IndirectDrawCommand { - uint32_t count; - uint32_t instanceCount; - uint32_t firstIndex; - int32_t baseVertex; - uint32_t baseInstance; + std::uint32_t count; + std::uint32_t instanceCount; + std::uint32_t firstIndex; + std::int32_t baseVertex; + std::uint32_t baseInstance; }; struct Primitive { @@ -153,7 +153,7 @@ struct Texture { GLuint texture; }; -enum MaterialUniformFlags : uint32_t { +enum MaterialUniformFlags : std::uint32_t { None = 0 << 0, HasBaseColorTexture = 1 << 0, }; @@ -161,7 +161,7 @@ enum MaterialUniformFlags : uint32_t { struct MaterialUniforms { glm::fvec4 baseColorFactor; float alphaCutoff; - uint32_t flags; + std::uint32_t flags; }; struct Viewer { @@ -434,10 +434,10 @@ bool loadMesh(Viewer* viewer, fastgltf::Mesh& mesh) { auto& indices = asset.accessors[it->indicesAccessor.value()]; if (!indices.bufferViewIndex.has_value()) return false; - draw.count = static_cast(indices.count); + draw.count = static_cast(indices.count); auto& indicesView = asset.bufferViews[indices.bufferViewIndex.value()]; - draw.firstIndex = static_cast(indices.byteOffset + indicesView.byteOffset) / fastgltf::getElementByteSize(indices.type, indices.componentType); + draw.firstIndex = static_cast(indices.byteOffset + indicesView.byteOffset) / fastgltf::getElementByteSize(indices.type, indices.componentType); primitive.indexType = getGLComponentType(indices.componentType); glVertexArrayElementBuffer(vao, viewer->buffers[indicesView.bufferIndex]); } diff --git a/include/fastgltf/parser.hpp b/include/fastgltf/parser.hpp index 6e84798f7..0be5d20ca 100644 --- a/include/fastgltf/parser.hpp +++ b/include/fastgltf/parser.hpp @@ -308,9 +308,9 @@ namespace fastgltf { // value used for enabling/disabling the loading of it. This also represents all extensions that // fastgltf supports and understands. #if FASTGLTF_ENABLE_DEPRECATED_EXT - static constexpr size_t SUPPORTED_EXTENSION_COUNT = 21; + static constexpr std::size_t SUPPORTED_EXTENSION_COUNT = 21; #else - static constexpr size_t SUPPORTED_EXTENSION_COUNT = 20; + static constexpr std::size_t SUPPORTED_EXTENSION_COUNT = 20; #endif static constexpr std::array, SUPPORTED_EXTENSION_COUNT> extensionStrings = {{ { extensions::EXT_mesh_gpu_instancing, Extensions::EXT_mesh_gpu_instancing }, diff --git a/include/fastgltf/types.hpp b/include/fastgltf/types.hpp index 606c84b35..704237149 100644 --- a/include/fastgltf/types.hpp +++ b/include/fastgltf/types.hpp @@ -240,7 +240,6 @@ namespace fastgltf { }; enum class MeshoptCompressionMode : std::uint8_t { - None = 0, Attributes, Triangles, Indices, diff --git a/src/base64.cpp b/src/base64.cpp index 0a8907399..77accec41 100644 --- a/src/base64.cpp +++ b/src/base64.cpp @@ -314,7 +314,7 @@ namespace fastgltf::base64 { } // clang-format off -[[gnu::aligned(16)]] static constexpr std::array shuffleData = { +[[gnu::aligned(16)]] static constexpr std::array shuffleData = { 2, 1, 0, 6, 5, 4, 10, 9, 8, diff --git a/src/fastgltf.cpp b/src/fastgltf.cpp index b12ff1c58..5ecba48f4 100644 --- a/src/fastgltf.cpp +++ b/src/fastgltf.cpp @@ -339,7 +339,7 @@ void fg::URIView::parse() { return; } - size_t idx = 0; + std::size_t idx = 0; auto firstColon = view.find(':'); if (firstColon != std::string::npos) { // URI has a scheme. @@ -838,8 +838,6 @@ fg::Error fg::validate(const fastgltf::Asset& asset) { if (compression->byteStride != 2 && compression->byteStride != 4) return Error::InvalidGltf; break; - case MeshoptCompressionMode::None: - break; } } } diff --git a/tests/gltf_path.hpp b/tests/gltf_path.hpp index 856d6e31a..c3b8b5937 100644 --- a/tests/gltf_path.hpp +++ b/tests/gltf_path.hpp @@ -6,4 +6,4 @@ inline auto path = std::filesystem::path { __FILE__ }.parent_path() / "gltf"; inline auto sampleModels = std::filesystem::path { __FILE__ }.parent_path() / "gltf" / "glTF-Sample-Models"; inline auto intelSponza = std::filesystem::path { __FILE__ }.parent_path() / "gltf" / "intel_sponza"; -inline auto bistroPath = std::filesystem::path {}; +inline auto bistroPath = std::filesystem::path { __FILE__ }.parent_path() / "gltf" / "bistro";