From 0bcf6082cc52cdf60964933d8d568b5759977e38 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 03:38:18 +0000 Subject: [PATCH] Decompile fn_19883 (CEffectPrim::RenderDoubleGumGang) Batch #11573 by SapitoSucio: 0 byte-identical, 1 confirmed by peer review. - fn_19883 CEffectPrim::RenderDoubleGumGang: logic confirmed by peer review Peer-reviewed-by: Yommy, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Effects/EffectPrimitiveRendering.cpp | 108 ++++++++++++++++-- 1 file changed, 101 insertions(+), 7 deletions(-) diff --git a/Source/Contents/Effects/EffectPrimitiveRendering.cpp b/Source/Contents/Effects/EffectPrimitiveRendering.cpp index 1c83536b..d65e181b 100644 --- a/Source/Contents/Effects/EffectPrimitiveRendering.cpp +++ b/Source/Contents/Effects/EffectPrimitiveRendering.cpp @@ -6135,18 +6135,15 @@ void CEffectPrim::RenderDoubleGumGang(matrix& wtm) { const vector3d vec6 = vec2; const vector3d vec7 = vec3; const vector3d vec8 = vec4; - const vector3d* const centers[4] = {&slot.vecBPre, &slot.vecBNow, &slot.vecTPre, &slot.vecTNow}; - for (int part = 0; part < 4; ++part) { - const float* const height = &slot.height[part * 4]; - const vector3d& center = *centers[part]; + { + const vector3d& center = slot.vecBPre; + const float* const height = &slot.height[0]; const int dif = static_cast(height[3] - this->state.slots[0].alphaT); - bool front = (dif < 70 && dif > -80) || dif < -270 || dif > 270; if (height[2] != 0.0f && height[2] != 2.0f) { front = !front; } - if (front) { vec1 = {vec5.x + center.x, vec5.y + center.y, vec5.z + center.z}; vec2 = {vec6.x + center.x, vec6.y + center.y, vec6.z + center.z}; @@ -6158,12 +6155,109 @@ void CEffectPrim::RenderDoubleGumGang(matrix& wtm) { vec3 = {vec8.x + center.x, vec8.y + center.y, vec8.z + center.z}; vec4 = {vec7.x + center.x, vec7.y + center.y, vec7.z + center.z}; } - vec1.y -= slot.height[20]; vec2.y -= slot.height[20]; vec3.y -= slot.height[20]; vec4.y -= slot.height[20]; + int count = static_cast(height[1]); + if (count > slot.process) { + count = slot.process; + } + this->RenderTeiRect( + &rpCnt, static_cast(count), vec1, vec2, vec3, vec4, wtm, 0, static_cast(height[2]), 0, red, green, blue, 0.0f, 1.0f, 0.0f, + 1.0f, 2 + ); + } + { + const vector3d& center = slot.vecBNow; + const float* const height = &slot.height[4]; + const int dif = static_cast(height[3] - this->state.slots[0].alphaT); + bool front = (dif < 70 && dif > -80) || dif < -270 || dif > 270; + if (height[2] != 0.0f && height[2] != 2.0f) { + front = !front; + } + if (front) { + vec1 = {vec5.x + center.x, vec5.y + center.y, vec5.z + center.z}; + vec2 = {vec6.x + center.x, vec6.y + center.y, vec6.z + center.z}; + vec3 = {vec7.x + center.x, vec7.y + center.y, vec7.z + center.z}; + vec4 = {vec8.x + center.x, vec8.y + center.y, vec8.z + center.z}; + } else { + vec1 = {vec6.x + center.x, vec6.y + center.y, vec6.z + center.z}; + vec2 = {vec5.x + center.x, vec5.y + center.y, vec5.z + center.z}; + vec3 = {vec8.x + center.x, vec8.y + center.y, vec8.z + center.z}; + vec4 = {vec7.x + center.x, vec7.y + center.y, vec7.z + center.z}; + } + vec1.y -= slot.height[20]; + vec2.y -= slot.height[20]; + vec3.y -= slot.height[20]; + vec4.y -= slot.height[20]; + int count = static_cast(height[1]); + if (count > slot.process) { + count = slot.process; + } + this->RenderTeiRect( + &rpCnt, static_cast(count), vec1, vec2, vec3, vec4, wtm, 0, static_cast(height[2]), 0, red, green, blue, 0.0f, 1.0f, 0.0f, + 1.0f, 2 + ); + } + + { + const vector3d& center = slot.vecTPre; + const float* const height = &slot.height[8]; + const int dif = static_cast(height[3] - this->state.slots[0].alphaT); + bool front = (dif < 70 && dif > -80) || dif < -270 || dif > 270; + if (height[2] != 0.0f && height[2] != 2.0f) { + front = !front; + } + if (front) { + vec1 = {vec5.x + center.x, vec5.y + center.y, vec5.z + center.z}; + vec2 = {vec6.x + center.x, vec6.y + center.y, vec6.z + center.z}; + vec3 = {vec7.x + center.x, vec7.y + center.y, vec7.z + center.z}; + vec4 = {vec8.x + center.x, vec8.y + center.y, vec8.z + center.z}; + } else { + vec1 = {vec6.x + center.x, vec6.y + center.y, vec6.z + center.z}; + vec2 = {vec5.x + center.x, vec5.y + center.y, vec5.z + center.z}; + vec3 = {vec8.x + center.x, vec8.y + center.y, vec8.z + center.z}; + vec4 = {vec7.x + center.x, vec7.y + center.y, vec7.z + center.z}; + } + vec1.y -= slot.height[20]; + vec2.y -= slot.height[20]; + vec3.y -= slot.height[20]; + vec4.y -= slot.height[20]; + int count = static_cast(height[1]); + if (count > slot.process) { + count = slot.process; + } + this->RenderTeiRect( + &rpCnt, static_cast(count), vec1, vec2, vec3, vec4, wtm, 0, static_cast(height[2]), 0, red, green, blue, 0.0f, 1.0f, 0.0f, + 1.0f, 2 + ); + } + + { + const vector3d& center = slot.vecTNow; + const float* const height = &slot.height[12]; + const int dif = static_cast(height[3] - this->state.slots[0].alphaT); + bool front = (dif < 70 && dif > -80) || dif < -270 || dif > 270; + if (height[2] != 0.0f && height[2] != 2.0f) { + front = !front; + } + if (front) { + vec1 = {vec5.x + center.x, vec5.y + center.y, vec5.z + center.z}; + vec2 = {vec6.x + center.x, vec6.y + center.y, vec6.z + center.z}; + vec3 = {vec7.x + center.x, vec7.y + center.y, vec7.z + center.z}; + vec4 = {vec8.x + center.x, vec8.y + center.y, vec8.z + center.z}; + } else { + vec1 = {vec6.x + center.x, vec6.y + center.y, vec6.z + center.z}; + vec2 = {vec5.x + center.x, vec5.y + center.y, vec5.z + center.z}; + vec3 = {vec8.x + center.x, vec8.y + center.y, vec8.z + center.z}; + vec4 = {vec7.x + center.x, vec7.y + center.y, vec7.z + center.z}; + } + vec1.y -= slot.height[20]; + vec2.y -= slot.height[20]; + vec3.y -= slot.height[20]; + vec4.y -= slot.height[20]; int count = static_cast(height[1]); if (count > slot.process) { count = slot.process;