From 403276ed70b46dede7beb44de78fbe77d01895ba Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 4 Nov 2026 16:07:16 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/Ground/GroundRendering.cpp Batch #10646 by dori: 0 byte-identical, 2 confirmed by peer review. - fn_17593 GroundGeometry::DrawSide: logic confirmed by peer review - fn_17590 GroundGeometry::Draw: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, cremane, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Ground/GroundRendering.cpp | 23 ++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Source/Contents/Ground/GroundRendering.cpp b/Source/Contents/Ground/GroundRendering.cpp index 1f523a42..f1f9a1ae 100644 --- a/Source/Contents/Ground/GroundRendering.cpp +++ b/Source/Contents/Ground/GroundRendering.cpp @@ -10,16 +10,16 @@ namespace { // INLINED - float Minimum4(float a, float b, float c, float d) { - const float first = !(a > b) ? a : b; - const float second = !(c > d) ? c : d; + const float& Minimum4(const float& a, const float& b, const float& c, const float& d) { + const float& first = !(a > b) ? a : b; + const float& second = !(c > d) ? c : d; return first > second ? second : first; } // INLINED - float Maximum4(float a, float b, float c, float d) { - const float first = !(b > a) ? a : b; - const float second = !(d > c) ? c : d; + const float& Maximum4(const float& a, const float& b, const float& c, const float& d) { + const float& first = !(b > a) ? a : b; + const float& second = !(d > c) ? c : d; return second > first ? second : first; } } @@ -61,11 +61,14 @@ bool GroundQuadVisible(const RenderVertex* vertices) { namespace { // INLINED - void Submit(const float* matrix, const GroundQuad& quad, bool clip) { + __forceinline void SubmitGroundQuad(const float* matrix, const GroundQuad& quad, bool clip) { RenderVertex vertices[4]{}; + for (auto& vertex : vertices) { + vertex.specular = 0xFF000000u; + } + for (unsigned corner = 0; corner < 4; ++corner) { - vertices[corner].specular = 0xFF000000u; g_renderer->viewport.Project(quad.vertices[corner], matrix, vertices[corner]); } @@ -89,7 +92,7 @@ namespace { // OFFSET: 0x00AC2530 // FUNCTION: fn_17593 void GroundGeometry::DrawSide(const float* matrix, const GroundQuad& quad, bool clip) { - Submit(matrix, quad, clip); + SubmitGroundQuad(matrix, quad, clip); } // OFFSET: 0x00AC19A0 @@ -108,7 +111,7 @@ void GroundGeometry::Draw(const float* matrix, const int* rectangle, bool clip) cell.frame = g_renderer->frame; if (cell.top) { - Submit(matrix, *cell.top, clip); + SubmitGroundQuad(matrix, *cell.top, clip); } if (cell.side2) {