From 94afe49718247f5d2e239094f5cde1d8d6121f2b Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 01:04:46 +0000 Subject: [PATCH] Decompile fn_17491 (C3dNode::Find) Batch #15456 by youko: 1 byte-identical, 0 confirmed by peer review. - fn_17491 C3dNode::Find: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Contents/Models/ModelLighting.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Source/Contents/Models/ModelLighting.cpp b/Source/Contents/Models/ModelLighting.cpp index 691000281..e661ccd9e 100644 --- a/Source/Contents/Models/ModelLighting.cpp +++ b/Source/Contents/Models/ModelLighting.cpp @@ -11,6 +11,8 @@ #include #include +extern template int std::_Traits_compare>(const char*, std::size_t, const char*, std::size_t) noexcept; + union ModelColor { std::uint32_t value; struct { @@ -62,12 +64,26 @@ namespace { color.b = Scale(factor, light[2], color.b); return color; } + + // INLINED + __forceinline void GroundColor(const C3dNode* node, const GroundGeometry& ground, const float* matrix, const std::array& vertex, std::uint32_t* output) { + const float x = (((vertex[0] * matrix[0] + vertex[1] * matrix[3]) + vertex[2] * matrix[6]) + matrix[9]) + node->model->position[0]; + const float y = (((vertex[0] * matrix[1] + vertex[1] * matrix[4]) + vertex[2] * matrix[7]) + matrix[10]) + node->model->position[1]; + const float z = (((vertex[0] * matrix[2] + vertex[1] * matrix[5]) + vertex[2] * matrix[8]) + matrix[11]) + node->model->position[2]; + ground.WorldColor(x, y, z, output); + } + + // INLINED + int AddChannel(std::uint32_t sampled, std::uint32_t channel) { + const int value = static_cast(sampled) + channel; + return value > 255 ? 255 : value; + } } // OFFSET: 0x00AB78B0 // FUNCTION: fn_17491 C3dNode* C3dNode::Find(const char* selected) { - if (this->name == selected) { + if (this->name.compare(selected) == 0) { return this; }