From d0ec0d25ad82914bb679730434dae09196a669c0 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 17:31:30 +0000 Subject: [PATCH] Decompile fn_19889 (CEffectPrim::RenderRipple) Batch #18656 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_19889 CEffectPrim::RenderRipple: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, kyoshi, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Primitives/EffectPrimitiveRendering.cpp | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/Source/Contents/Effects/Primitives/EffectPrimitiveRendering.cpp b/Source/Contents/Effects/Primitives/EffectPrimitiveRendering.cpp index 0df3a81c5..99d89aa65 100644 --- a/Source/Contents/Effects/Primitives/EffectPrimitiveRendering.cpp +++ b/Source/Contents/Effects/Primitives/EffectPrimitiveRendering.cpp @@ -2095,30 +2095,28 @@ __declspec(safebuffers) void CEffectPrim::RenderRipple(matrix& wtm) { int rpCnt = 0; for (int ec = 0; ec < 4; ++ec) { - EffectPrimitiveSlot& slot = this->state.slots[ec]; - - if (slot.life != 1) { + if (this->state.slots[ec].life != 1) { continue; } for (int ring = 10; ring >= 1; --ring) { - const char kind = slot.flag1[4]; + const char kind = this->state.slots[ec].flag1[4]; int spread = 10 - ring; if (kind != 2) { spread *= 3; } - const float rx = static_cast(spread) + slot.distance; - slot.vecBPre = {rx * g_cosTable[45], 0.0f, rx * g_sinTable[45]}; - slot.vecBNow = {rx * g_cosTable[135], 0.0f, rx * g_sinTable[135]}; - slot.vecTNow = {rx * g_cosTable[225], 0.0f, rx * g_sinTable[225]}; - slot.vecTPre = {rx * g_cosTable[315], 0.0f, rx * g_sinTable[315]}; + const float rx = static_cast(spread) + this->state.slots[ec].distance; + this->state.slots[ec].vecBPre = {rx * g_cosTable[45], 0.0f, rx * g_sinTable[45]}; + this->state.slots[ec].vecBNow = {rx * g_cosTable[135], 0.0f, rx * g_sinTable[135]}; + this->state.slots[ec].vecTNow = {rx * g_cosTable[225], 0.0f, rx * g_sinTable[225]}; + this->state.slots[ec].vecTPre = {rx * g_cosTable[315], 0.0f, rx * g_sinTable[315]}; - const float base = slot.height[0]; - vec1.Set(slot.vecBPre.x + base, slot.vecBPre.y, slot.vecBPre.z); - vec2.Set(slot.vecBNow.x + base, slot.vecBNow.y, slot.vecBNow.z); - vec3.Set(slot.vecTNow.x + base, slot.vecTNow.y, slot.vecTNow.z); - vec4.Set(slot.vecTPre.x + base, slot.vecTPre.y, slot.vecTPre.z); + const float base = this->state.slots[ec].height[0]; + vec1.Set(this->state.slots[ec].vecBPre.x + base, this->state.slots[ec].vecBPre.y, this->state.slots[ec].vecBPre.z); + vec2.Set(this->state.slots[ec].vecBNow.x + base, this->state.slots[ec].vecBNow.y, this->state.slots[ec].vecBNow.z); + vec3.Set(this->state.slots[ec].vecTNow.x + base, this->state.slots[ec].vecTNow.y, this->state.slots[ec].vecTNow.z); + vec4.Set(this->state.slots[ec].vecTPre.x + base, this->state.slots[ec].vecTPre.y, this->state.slots[ec].vecTPre.z); this->Tei_TowardScreen(vec1, vec2, vec3, vec4, this->state.slots[0].alphaT, this->state.slots[1].alphaT); const float drop = kind == 2 ? 40.0f : 30.0f; @@ -2127,12 +2125,12 @@ __declspec(safebuffers) void CEffectPrim::RenderRipple(matrix& wtm) { vec3.y -= drop; vec4.y -= drop; - const int alpha = static_cast(slot.height[ring]); + const int alpha = static_cast(this->state.slots[ec].height[ring]); if (alpha > 0) { if (ring == 10) { - this->RenderTeiRect(&rpCnt, static_cast(alpha), vec2, vec1, vec4, vec3, wtm, 0, slot.flag1[0], 0, 55, 55, 255, 0.0f, 1.0f, 0.0f, 1.0f, 0); + this->RenderTeiRect(&rpCnt, static_cast(alpha), vec2, vec1, vec4, vec3, wtm, 0, this->state.slots[ec].flag1[0], 0, 55, 55, 255, 0.0f, 1.0f, 0.0f, 1.0f, 0); } else { - this->RenderTeiRect(&rpCnt, static_cast(alpha), vec2, vec1, vec4, vec3, wtm, 0, slot.flag1[0], 0, 5, 5, 255, 0.0f, 1.0f, 0.0f, 1.0f, 0); + this->RenderTeiRect(&rpCnt, static_cast(alpha), vec2, vec1, vec4, vec3, wtm, 0, this->state.slots[ec].flag1[0], 0, 5, 5, 255, 0.0f, 1.0f, 0.0f, 1.0f, 0); } } }