From da913728047d9223576c6bee5601b72ae3800ccb Mon Sep 17 00:00:00 2001 From: Fireblade <72758695+Firebladedoge229@users.noreply.github.com> Date: Sat, 25 Apr 2026 12:09:30 -0400 Subject: [PATCH] chore: clean up paper doll code for redundancy --- Minecraft.Client/Gui.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Minecraft.Client/Gui.cpp b/Minecraft.Client/Gui.cpp index 8836a6b2..084a5472 100644 --- a/Minecraft.Client/Gui.cpp +++ b/Minecraft.Client/Gui.cpp @@ -710,23 +710,19 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) glTranslatef(static_cast(xo), static_cast(yo), 50); // correct paper doll aspect ratio - float ss = 12; + float ss = 12.0f; float aspectScaleX = 1.0f; float aspectScaleY = 1.0f; extern int g_rScreenWidth; extern int g_rScreenHeight; - float screenAspect = (float)g_rScreenWidth / (float)g_rScreenHeight; - float targetAspect = 16.0f / 9.0f; - - // apply correction if window is not already at a 16:9 aspect ratio - float correction = 1.0f; - - if (fabs(screenAspect - targetAspect) > 0.01f) { - if (g_rScreenHeight > 0) { - correction = 1080.0f / (float)g_rScreenHeight; - correction = std::clamp(correction, 0.5f, 2.0f); + if (g_rScreenWidth > 0 && g_rScreenHeight > 0) { + float screenAspect = (float)g_rScreenWidth / (float)g_rScreenHeight; + const float targetAspect = 16.0f / 9.0f; + + // apply correction if window is not already at a 16:9 aspect ratio + if (fabs(screenAspect - targetAspect) > 0.01f) { if (screenAspect > targetAspect) aspectScaleX = targetAspect / screenAspect; else @@ -734,8 +730,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse) } } - glTranslatef((float)xo, (float)yo, 50.0f); - glScalef(-ss * aspectScaleX, ss * aspectScaleY, ss); glRotatef(180, 0, 0, 1);