From 7062ef756474362793f7d267c9ef0944d726e411 Mon Sep 17 00:00:00 2001 From: orng Date: Sun, 29 Mar 2026 18:40:55 -0500 Subject: [PATCH] chore: fmt --- Minecraft.Client/Rendering/Cube.cpp | 13 ++++++------- Minecraft.Client/Rendering/Polygon.cpp | 7 +++---- Minecraft.Client/Rendering/Polygon.h | 3 ++- Minecraft.Client/Rendering/Vertex.h | 16 +++------------- 4 files changed, 14 insertions(+), 25 deletions(-) diff --git a/Minecraft.Client/Rendering/Cube.cpp b/Minecraft.Client/Rendering/Cube.cpp index 2291d0923..b091fa158 100644 --- a/Minecraft.Client/Rendering/Cube.cpp +++ b/Minecraft.Client/Rendering/Cube.cpp @@ -21,7 +21,7 @@ Cube::Cube(ModelPart* modelPart, int xTexOffs, int yTexOffs, float x0, float y0, Vertex{0, 0, 0, 0, 0}, Vertex{0, 0, 0, 0, 0}, Vertex{0, 0, 0, 0, 0}, Vertex{0, 0, 0, 0, 0}, Vertex{0, 0, 0, 0, 0}, Vertex{0, 0, 0, 0, 0}}), - polygons({}) { + polygons({}) { float x1 = x0 + w; float y1 = y0 + h; float z1 = z0 + d; @@ -89,10 +89,10 @@ Cube::Cube(ModelPart* modelPart, int xTexOffs, int yTexOffs, float x0, float y0, modelPart->xTexSize, modelPart->yTexSize); // Down } if (faceMask & 16) - polygons[faceCount++] = _Polygon( - std::array{u1, u0, u3, u2}, xTexOffs + d, - yTexOffs + d, xTexOffs + d + w, yTexOffs + d + h, - modelPart->xTexSize, modelPart->yTexSize); // Front + polygons[faceCount++] = + _Polygon(std::array{u1, u0, u3, u2}, xTexOffs + d, + yTexOffs + d, xTexOffs + d + w, yTexOffs + d + h, + modelPart->xTexSize, modelPart->yTexSize); // Front if (faceMask & 32) polygons[faceCount++] = _Polygon( std::array{l0, l1, l2, l3}, xTexOffs + d + w + d, @@ -101,8 +101,7 @@ Cube::Cube(ModelPart* modelPart, int xTexOffs, int yTexOffs, float x0, float y0, modelPart->yTexSize); // Back if (modelPart->bMirror) { - for (unsigned int i = 0; i < polygons.size(); i++) - polygons[i].mirror(); + for (unsigned int i = 0; i < polygons.size(); i++) polygons[i].mirror(); } } diff --git a/Minecraft.Client/Rendering/Polygon.cpp b/Minecraft.Client/Rendering/Polygon.cpp index bcfa26b37..d0de18504 100644 --- a/Minecraft.Client/Rendering/Polygon.cpp +++ b/Minecraft.Client/Rendering/Polygon.cpp @@ -5,7 +5,8 @@ #include _Polygon::_Polygon(const std::span vertices) - : vertexCount(vertices.size()), vertices(vertices.begin(), vertices.end()) {} + : vertexCount(vertices.size()), + vertices(vertices.begin(), vertices.end()) {} _Polygon::_Polygon(const std::span vertices, int u0, int v0, int u1, int v1, float xTexSize, float yTexSize) @@ -32,9 +33,7 @@ _Polygon::_Polygon(const std::span vertices, float u0, vertices[3].remap(u1, v1), }) {} -void _Polygon::mirror() { - std::reverse(vertices.begin(), vertices.end()); -} +void _Polygon::mirror() { std::reverse(vertices.begin(), vertices.end()); } void _Polygon::render(Tesselator* t, float scale) { Vec3 v0 = vertices[1].pos.vectorTo(vertices[0].pos); diff --git a/Minecraft.Client/Rendering/Polygon.h b/Minecraft.Client/Rendering/Polygon.h index a9ecf5638..c56306533 100644 --- a/Minecraft.Client/Rendering/Polygon.h +++ b/Minecraft.Client/Rendering/Polygon.h @@ -19,7 +19,8 @@ public: _Polygon(std::span vertices); _Polygon(std::span vertices, int u0, int v0, int u1, int v1, float xTexSize, float yTexSize); - _Polygon(std::span vertices, float u0, float v0, float u1, float v1); + _Polygon(std::span vertices, float u0, float v0, float u1, + float v1); void mirror(); void render(Tesselator* t, float scale); _Polygon* flipNormal(); diff --git a/Minecraft.Client/Rendering/Vertex.h b/Minecraft.Client/Rendering/Vertex.h index 7a175011f..b0437b9ba 100644 --- a/Minecraft.Client/Rendering/Vertex.h +++ b/Minecraft.Client/Rendering/Vertex.h @@ -8,22 +8,12 @@ public: public: constexpr Vertex(float x, float y, float z, float u, float v) - : pos({x, y, z}) - , u(u) - , v(v) - {} + : pos({x, y, z}), u(u), v(v) {} constexpr Vertex(Vertex* vertex, float u, float v) - : pos(vertex->pos) - , u(u) - , v(v) - {} + : pos(vertex->pos), u(u), v(v) {} - constexpr Vertex(Vec3* pos, float u, float v) - : pos(*pos) - , u(u) - , v(v) - {} + constexpr Vertex(Vec3* pos, float u, float v) : pos(*pos), u(u), v(v) {} Vertex remap(float u, float v) const; };