diff --git a/src/graphics/core/Batch2D.cpp b/src/graphics/core/Batch2D.cpp index 13b48586..c4c67db2 100644 --- a/src/graphics/core/Batch2D.cpp +++ b/src/graphics/core/Batch2D.cpp @@ -11,7 +11,7 @@ inline constexpr uint B2D_VERTEX_SIZE = 8; Batch2D::Batch2D(size_t capacity) : capacity(capacity), color(1.0f){ - const vattr attrs[] = { + const VertexAttribute attrs[] = { {2}, {2}, {4}, {0} }; diff --git a/src/graphics/core/Batch3D.cpp b/src/graphics/core/Batch3D.cpp index 1770fc21..a81f4ffb 100644 --- a/src/graphics/core/Batch3D.cpp +++ b/src/graphics/core/Batch3D.cpp @@ -12,7 +12,7 @@ inline constexpr uint B3D_VERTEX_SIZE = 9; Batch3D::Batch3D(size_t capacity) : capacity(capacity) { - const vattr attrs[] = { + const VertexAttribute attrs[] = { {3}, {2}, {4}, {0} }; diff --git a/src/graphics/core/LineBatch.cpp b/src/graphics/core/LineBatch.cpp index dd3f8067..aed8a249 100644 --- a/src/graphics/core/LineBatch.cpp +++ b/src/graphics/core/LineBatch.cpp @@ -6,7 +6,7 @@ inline constexpr uint LB_VERTEX_SIZE = (3+4); LineBatch::LineBatch(size_t capacity) : capacity(capacity) { - const vattr attrs[] = { {3},{4}, {0} }; + const VertexAttribute attrs[] = { {3},{4}, {0} }; buffer = std::make_unique(capacity * LB_VERTEX_SIZE * 2); mesh = std::make_unique(buffer.get(), 0, attrs); index = 0; diff --git a/src/graphics/core/Mesh.cpp b/src/graphics/core/Mesh.cpp index e0cc5484..e8cffe6f 100644 --- a/src/graphics/core/Mesh.cpp +++ b/src/graphics/core/Mesh.cpp @@ -4,7 +4,7 @@ int Mesh::meshesCount = 0; int Mesh::drawCalls = 0; -inline size_t calc_vertex_size(const vattr* attrs) { +inline size_t calc_vertex_size(const VertexAttribute* attrs) { size_t vertexSize = 0; for (int i = 0; attrs[i].size; i++) { vertexSize += attrs[i].size; @@ -19,7 +19,7 @@ Mesh::Mesh(const MeshData& data) data.indices.size(), data.attrs.data()) {} -Mesh::Mesh(const float* vertexBuffer, size_t vertices, const int* indexBuffer, size_t indices, const vattr* attrs) : +Mesh::Mesh(const float* vertexBuffer, size_t vertices, const int* indexBuffer, size_t indices, const VertexAttribute* attrs) : ibo(0), vertices(0), indices(0) diff --git a/src/graphics/core/Mesh.hpp b/src/graphics/core/Mesh.hpp index b36b044d..482c82bf 100644 --- a/src/graphics/core/Mesh.hpp +++ b/src/graphics/core/Mesh.hpp @@ -14,8 +14,8 @@ class Mesh { size_t vertexSize; public: Mesh(const MeshData& data); - Mesh(const float* vertexBuffer, size_t vertices, const int* indexBuffer, size_t indices, const vattr* attrs); - Mesh(const float* vertexBuffer, size_t vertices, const vattr* attrs) : + Mesh(const float* vertexBuffer, size_t vertices, const int* indexBuffer, size_t indices, const VertexAttribute* attrs); + Mesh(const float* vertexBuffer, size_t vertices, const VertexAttribute* attrs) : Mesh(vertexBuffer, vertices, nullptr, 0, attrs) {}; ~Mesh(); diff --git a/src/graphics/core/MeshData.hpp b/src/graphics/core/MeshData.hpp index 62b32903..39220119 100644 --- a/src/graphics/core/MeshData.hpp +++ b/src/graphics/core/MeshData.hpp @@ -6,7 +6,7 @@ #include "util/Buffer.hpp" /// @brief Vertex attribute info -struct vattr { +struct VertexAttribute { ubyte size; }; @@ -14,7 +14,7 @@ struct vattr { struct MeshData { util::Buffer vertices; util::Buffer indices; - util::Buffer attrs; + util::Buffer attrs; MeshData() = default; @@ -24,7 +24,7 @@ struct MeshData { MeshData( util::Buffer vertices, util::Buffer indices, - util::Buffer attrs + util::Buffer attrs ) : vertices(std::move(vertices)), indices(std::move(indices)), attrs(std::move(attrs)) {} diff --git a/src/graphics/core/PostProcessing.cpp b/src/graphics/core/PostProcessing.cpp index 7352c3b5..3478ca08 100644 --- a/src/graphics/core/PostProcessing.cpp +++ b/src/graphics/core/PostProcessing.cpp @@ -14,7 +14,7 @@ PostProcessing::PostProcessing() { -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f }; - vattr attrs[] {{2}, {0}}; + VertexAttribute attrs[] {{2}, {0}}; quadMesh = std::make_unique(vertices, 6, attrs); } diff --git a/src/graphics/render/BlocksRenderer.cpp b/src/graphics/render/BlocksRenderer.cpp index 8b041b58..5570de4c 100644 --- a/src/graphics/render/BlocksRenderer.cpp +++ b/src/graphics/render/BlocksRenderer.cpp @@ -656,8 +656,8 @@ ChunkMeshData BlocksRenderer::createMesh() { MeshData( util::Buffer(vertexBuffer.get(), vertexOffset), util::Buffer(indexBuffer.get(), indexSize), - util::Buffer( - CHUNK_VATTRS, sizeof(CHUNK_VATTRS) / sizeof(vattr) + util::Buffer( + CHUNK_VATTRS, sizeof(CHUNK_VATTRS) / sizeof(VertexAttribute) ) ), std::move(sortingMesh)}; diff --git a/src/graphics/render/MainBatch.cpp b/src/graphics/render/MainBatch.cpp index 1cbb6c42..e3a87db7 100644 --- a/src/graphics/render/MainBatch.cpp +++ b/src/graphics/render/MainBatch.cpp @@ -6,7 +6,7 @@ #include "voxels/Chunks.hpp" #include "voxels/Chunk.hpp" -static const vattr attrs[] = { +static const VertexAttribute attrs[] = { {3}, {2}, {3}, {1}, {0} }; diff --git a/src/graphics/render/Skybox.cpp b/src/graphics/render/Skybox.cpp index e96e894a..af3a1587 100644 --- a/src/graphics/render/Skybox.cpp +++ b/src/graphics/render/Skybox.cpp @@ -39,7 +39,7 @@ Skybox::Skybox(uint size, Shader& shader) -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, 1.0f, -1.0f }; - vattr attrs[] {{2}, {0}}; + VertexAttribute attrs[] {{2}, {0}}; mesh = std::make_unique(vertices, 6, attrs); sprites.push_back(skysprite { diff --git a/src/graphics/render/commons.hpp b/src/graphics/render/commons.hpp index b6d18003..79b77393 100644 --- a/src/graphics/render/commons.hpp +++ b/src/graphics/render/commons.hpp @@ -8,7 +8,7 @@ #include "util/Buffer.hpp" /// @brief Chunk mesh vertex attributes -inline const vattr CHUNK_VATTRS[]{ {3}, {2}, {1}, {0} }; +inline const VertexAttribute CHUNK_VATTRS[]{ {3}, {2}, {1}, {0} }; /// @brief Chunk mesh vertex size divided by sizeof(float) inline constexpr int CHUNK_VERTEX_SIZE = 6;