From efc822d2d10a311bbfd638e9292360009d014150 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 15:42:13 +0000 Subject: [PATCH] Decompile fn_17926 (CameraState::Smooth) Batch #12472 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_17926 CameraState::Smooth: logic confirmed by peer review Peer-reviewed-by: Yommy, gordaoprogramas, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Camera/CameraSmoothing.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Contents/Camera/CameraSmoothing.cpp b/Source/Contents/Camera/CameraSmoothing.cpp index 273effc2..f111407e 100644 --- a/Source/Contents/Camera/CameraSmoothing.cpp +++ b/Source/Contents/Camera/CameraSmoothing.cpp @@ -70,16 +70,16 @@ void CameraState::Smooth() { this->target[2] = next[2]; this->target[1] = next[1]; this->target[0] = next[0]; - const int angle = TruncateToInt(-this->pitch); - const float sine = ClientSine(angle); - const float cosine = ClientCosine(angle); - const float tangent = static_cast(static_cast(sine) / cosine); - const float cotangent = static_cast(static_cast(cosine) / sine); + + const float tangent = ClientSine(static_cast(-this->pitch)) / ClientCosine(static_cast(-this->pitch)); + const float cotangent = ClientCosine(static_cast(-this->pitch)) / ClientSine(static_cast(-this->pitch)); + const float scaledTangent = tangent * g_projectionScale; - g_tangent = static_cast(static_cast(scaledTangent) / g_renderer->UiScaleY()); + g_tangent = scaledTangent / g_renderer->UiScaleY(); const float scaledCotangent = cotangent * g_projectionScale; - g_cotangent = static_cast(static_cast(scaledCotangent) / g_renderer->UiScaleY()); - const float relativeSine = static_cast((static_cast(sine) / ClientSine(45)) * 0.000009f); + g_cotangent = scaledCotangent / g_renderer->UiScaleY(); + + const float relativeSine = ClientSine(static_cast(-this->pitch)) / ClientSine(45) * 0.000009f; g_cameraScaleY = (g_cameraBaseDistance / this->distance) * relativeSine; g_cameraScaleX = (g_cameraBaseDistance / this->distance) * 0.000036f; }