From faeb281905e3b233cd1b85e642d9cbad7c7488f0 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 18:09:08 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/Effects/EffectPrimitiveMotion.cpp, Source/Contents/Effects/EffectPrim.h Batch #2618 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review. - fn_19950 CEffectPrim::PrimFrameScroll: logic confirmed by peer review - fn_19962 CEffectPrim::PrimFramePhase: logic confirmed by peer review Peer-reviewed-by: youko Reviewed-by: ragnarok-clanker --- Source/Contents/Effects/EffectPrim.h | 2 + .../Effects/EffectPrimitiveMotion.cpp | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/Source/Contents/Effects/EffectPrim.h b/Source/Contents/Effects/EffectPrim.h index 16937996..e71c5c57 100644 --- a/Source/Contents/Effects/EffectPrim.h +++ b/Source/Contents/Effects/EffectPrim.h @@ -51,6 +51,8 @@ struct CEffectPrim : CRenderObject { bool PrimTwinSpin(); void PrimFlashFade(); bool PrimFadeAlpha(); + void PrimFrameScroll(); + void PrimFramePhase(); void Render2DCircle(); void RenderCrossPlanes(matrix& wtm); void RenderPyramid(matrix& wtm); diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.cpp b/Source/Contents/Effects/EffectPrimitiveMotion.cpp index 47fa4b7a..81811c8f 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.cpp +++ b/Source/Contents/Effects/EffectPrimitiveMotion.cpp @@ -4810,3 +4810,51 @@ bool CEffectPrim::PrimFadeAlpha() { this->ShiftSegment(); return this->AnimMotion(); } + +// OFFSET: 0x00BE92B0 +// FUNCTION: fn_19950 +void CEffectPrim::PrimFrameScroll() { + this->render.position = this->state.master->render.position; + + for (int index = 0; index < 4; ++index) { + EffectPrimitiveSlot& slot = this->state.slots[index]; + + if (slot.life != 1 || ++slot.process <= 0) { + continue; + } + + slot.height[1] += 1.0f; + if (slot.height[1] >= static_cast(this->state.totalTexture)) { + slot.height[1] = 0.0f; + } + + slot.distance -= 1.0f; + if (slot.distance < 0.0f) { + slot.distance += slot.maxHeight; + } + } +} + +// OFFSET: 0x00BEA310 +// FUNCTION: fn_19962 +void CEffectPrim::PrimFramePhase() { + this->render.position = this->state.master->render.position; + + for (int index = 0; index < 4; ++index) { + EffectPrimitiveSlot& slot = this->state.slots[index]; + + if (slot.life != 1 || ++slot.process <= 0) { + continue; + } + + slot.height[1] += 1.0f; + if (slot.height[1] >= static_cast(this->state.totalTexture)) { + slot.height[1] = 0.0f; + } + + slot.height[9] = slot.height[2] + slot.height[9]; + if (slot.height[9] >= 1.0f) { + slot.height[9] -= 1.0f; + } + } +}