From 8c9a5764ee2ac623b330c8fcb6bc92f5b61de152 Mon Sep 17 00:00:00 2001 From: JosiahWI Date: Wed, 17 May 2023 13:19:52 -0500 Subject: [PATCH] Convert snake_case variable names to camelCase --- source/Irrlicht/CGLTFMeshFileLoader.cpp | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source/Irrlicht/CGLTFMeshFileLoader.cpp b/source/Irrlicht/CGLTFMeshFileLoader.cpp index 5964d685..efcd2bf2 100644 --- a/source/Irrlicht/CGLTFMeshFileLoader.cpp +++ b/source/Irrlicht/CGLTFMeshFileLoader.cpp @@ -30,7 +30,7 @@ static bool dummyImageLoader(tinygltf::Image *a, int f, const unsigned char * g, int h, - void *user_pointer) + void *userPointer) { return false; }; @@ -83,25 +83,25 @@ IAnimatedMesh* CGLTFMeshFileLoader::createMesh(io::IReadFile* file) SMesh* mesh { new SMesh {} }; // Iterate models - for (std::size_t mesh_index = 0; - mesh_index < model.meshes.size(); mesh_index++) { + for (std::size_t meshIndex = 0; + meshIndex < model.meshes.size(); meshIndex++) { // Iterate primitives - for (std::size_t primitive_index = 0; primitive_index < model - .meshes[mesh_index].primitives.size(); primitive_index++) { + for (std::size_t primitiveIndex = 0; primitiveIndex < model + .meshes[meshIndex].primitives.size(); primitiveIndex++) { - const auto positionAccessorId = model.meshes[mesh_index] - .primitives[primitive_index].attributes["POSITION"]; - const auto indicesAccessorId = model.meshes[mesh_index] - .primitives[primitive_index].indices; + const auto positionAccessorId = model.meshes[meshIndex] + .primitives[primitiveIndex].attributes["POSITION"]; + const auto indicesAccessorId = model.meshes[meshIndex] + .primitives[primitiveIndex].indices; // Creates counts for preallocation - std::size_t vertices_count = model.accessors[positionAccessorId].count; + std::size_t vertexCount = model.accessors[positionAccessorId].count; // We must count to create containers for the data // Create new buffer for vertices, positions, and normals - auto* vertexBuffer = new video::S3DVertex[vertices_count](); + auto* vertexBuffer = new video::S3DVertex[vertexCount](); // This is used to copy data into the vertexBuffer - Span verticesBuffer{vertexBuffer,vertices_count}; + Span verticesBuffer{vertexBuffer,vertexCount}; // Create dynamic indices buffer so it's easier to work with. // Preallocate needed resources to boost game startup speed std::vector indicesBuffer(model.accessors[ @@ -112,8 +112,8 @@ IAnimatedMesh* CGLTFMeshFileLoader::createMesh(io::IReadFile* file) parser.getIndices(indicesAccessorId, indicesBuffer); parser.getVertices(positionAccessorId, verticesBuffer, - mesh_index, - primitive_index); + meshIndex, + primitiveIndex); // Inverse the order of indices due to the axis of the model being // inverted when going from left handed to right handed coordinates @@ -121,7 +121,7 @@ IAnimatedMesh* CGLTFMeshFileLoader::createMesh(io::IReadFile* file) // Create the mesh buffer SMeshBuffer* meshbuf { new SMeshBuffer {} }; - meshbuf->append(vertexBuffer, vertices_count, indicesBuffer.data(), + meshbuf->append(vertexBuffer, vertexCount, indicesBuffer.data(), indicesBuffer.size()); mesh->addMeshBuffer(meshbuf);