aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/MobRenderer.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-07 21:56:03 -0500
committerGitHub <noreply@github.com>2026-03-08 09:56:03 +0700
commita9be52c41a02d207233199e98898fe7483d7e817 (patch)
tree71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.Client/MobRenderer.cpp
parent1be5faaea781402e7de06b263eeca4c688b7712c (diff)
Project modernization (#630)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
Diffstat (limited to 'Minecraft.Client/MobRenderer.cpp')
-rw-r--r--Minecraft.Client/MobRenderer.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.Client/MobRenderer.cpp b/Minecraft.Client/MobRenderer.cpp
index ee512530..92c89394 100644
--- a/Minecraft.Client/MobRenderer.cpp
+++ b/Minecraft.Client/MobRenderer.cpp
@@ -30,7 +30,7 @@ void MobRenderer::renderLeash(shared_ptr<Mob> entity, double x, double y, double
{
shared_ptr<Entity> roper = entity->getLeashHolder();
// roper = entityRenderDispatcher.cameraEntity;
- if (roper != NULL)
+ if (roper != nullptr)
{
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
@@ -61,9 +61,9 @@ void MobRenderer::renderLeash(shared_ptr<Mob> entity, double x, double y, double
x += rotOffCos;
z += rotOffSin;
- double dx = (float) (endX - startX);
- double dy = (float) (endY - startY);
- double dz = (float) (endZ - startZ);
+ double dx = static_cast<float>(endX - startX);
+ double dy = static_cast<float>(endY - startY);
+ double dz = static_cast<float>(endZ - startZ);
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
@@ -92,9 +92,9 @@ void MobRenderer::renderLeash(shared_ptr<Mob> entity, double x, double y, double
{
tessellator->color(rDarkCol, gDarkCol, bDarkCol, 1.0F);
}
- float aa = (float) k / (float) steps;
- tessellator->vertex(x + (dx * aa) + 0, y + (dy * ((aa * aa) + aa) * 0.5) + ((((float) steps - (float) k) / (steps * 0.75F)) + 0.125F), z + (dz * aa));
- tessellator->vertex(x + (dx * aa) + width, y + (dy * ((aa * aa) + aa) * 0.5) + ((((float) steps - (float) k) / (steps * 0.75F)) + 0.125F) + width, z + (dz * aa));
+ float aa = static_cast<float>(k) / static_cast<float>(steps);
+ tessellator->vertex(x + (dx * aa) + 0, y + (dy * ((aa * aa) + aa) * 0.5) + (((static_cast<float>(steps) - static_cast<float>(k)) / (steps * 0.75F)) + 0.125F), z + (dz * aa));
+ tessellator->vertex(x + (dx * aa) + width, y + (dy * ((aa * aa) + aa) * 0.5) + (((static_cast<float>(steps) - static_cast<float>(k)) / (steps * 0.75F)) + 0.125F) + width, z + (dz * aa));
}
tessellator->end();
@@ -109,9 +109,9 @@ void MobRenderer::renderLeash(shared_ptr<Mob> entity, double x, double y, double
{
tessellator->color(rDarkCol, gDarkCol, bDarkCol, 1.0F);
}
- float aa = (float) k / (float) steps;
- tessellator->vertex(x + (dx * aa) + 0, y + (dy * ((aa * aa) + aa) * 0.5) + ((((float) steps - (float) k) / (steps * 0.75F)) + 0.125F) + width, z + (dz * aa));
- tessellator->vertex(x + (dx * aa) + width, y + (dy * ((aa * aa) + aa) * 0.5) + ((((float) steps - (float) k) / (steps * 0.75F)) + 0.125F), z + (dz * aa) + width);
+ float aa = static_cast<float>(k) / static_cast<float>(steps);
+ tessellator->vertex(x + (dx * aa) + 0, y + (dy * ((aa * aa) + aa) * 0.5) + (((static_cast<float>(steps) - static_cast<float>(k)) / (steps * 0.75F)) + 0.125F) + width, z + (dz * aa));
+ tessellator->vertex(x + (dx * aa) + width, y + (dy * ((aa * aa) + aa) * 0.5) + (((static_cast<float>(steps) - static_cast<float>(k)) / (steps * 0.75F)) + 0.125F), z + (dz * aa) + width);
}
tessellator->end();