From cce2b730f2113e7ab6ad3e07a6d92107bb33adf3 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Tue, 9 Jan 2024 13:26:18 +0300 Subject: [PATCH] Removed extras --- src/graphics/BlocksRenderer.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/graphics/BlocksRenderer.cpp b/src/graphics/BlocksRenderer.cpp index 6e79b045..7b8c09bb 100644 --- a/src/graphics/BlocksRenderer.cpp +++ b/src/graphics/BlocksRenderer.cpp @@ -156,17 +156,17 @@ void BlocksRenderer::tetragonicFace(const vec3& coord, const vec3& p1, bool lights) { glm::vec3 dir = glm::cross(p2 - p1, p3 - p1); glm::vec3 normal = glm::normalize(dir); - glm::vec4 tintx(1.0f); + glm::vec4 tint(1.0f); if (lights) { float d = glm::dot(normal, SUN_VECTOR); d = 0.7f + d * 0.3f; - tintx *= d; - tintx *= pickLight(coord); + tint *= d; + tint *= pickLight(coord); } - vertex(coord + (p1.x - 0.5f) * X + (p1.y - 0.5f) * Y + (p1.z - 0.5f) * Z, texreg.u1, texreg.v1, tintx); - vertex(coord + (p2.x - 0.5f) * X + (p2.y - 0.5f) * Y + (p2.z - 0.5f) * Z, texreg.u2, texreg.v1, tintx); - vertex(coord + (p3.x - 0.5f) * X + (p3.y - 0.5f) * Y + (p3.z - 0.5f) * Z, texreg.u2, texreg.v2, tintx); - vertex(coord + (p4.x - 0.5f) * X + (p4.y - 0.5f) * Y + (p4.z - 0.5f) * Z, texreg.u1, texreg.v2, tintx); + vertex(coord + (p1.x - 0.5f) * X + (p1.y - 0.5f) * Y + (p1.z - 0.5f) * Z, texreg.u1, texreg.v1, tint); + vertex(coord + (p2.x - 0.5f) * X + (p2.y - 0.5f) * Y + (p2.z - 0.5f) * Z, texreg.u2, texreg.v1, tint); + vertex(coord + (p3.x - 0.5f) * X + (p3.y - 0.5f) * Y + (p3.z - 0.5f) * Z, texreg.u2, texreg.v2, tint); + vertex(coord + (p4.x - 0.5f) * X + (p4.y - 0.5f) * Y + (p4.z - 0.5f) * Z, texreg.u1, texreg.v2, tint); index(0, 1, 3, 1, 2, 3); } @@ -241,7 +241,6 @@ void BlocksRenderer::blockAABB(const ivec3& icoord, void BlocksRenderer::blockCustomModel(const ivec3& icoord, const Block* block, ubyte rotation, bool lights) { - const float tint = 1.0f; vec3 X(1, 0, 0); vec3 Y(0, 1, 0); vec3 Z(0, 0, 1);