From 37bb2b5c116d27160a923ec432067a7f703d2e8a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 10:11:37 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/SpriteLayerDrawing.cpp, Source/Contents/SpriteLayerDrawing.h, ... Batch #5304 by youko: 0 byte-identical, 2 confirmed by peer review. - fn_04816 SpriteLayerRenderer::GetLayerSound: logic confirmed by peer review - fn_04818 SpriteLayerRenderer::LoadLayers: logic confirmed by peer review Peer-reviewed-by: eAthena, Yommy, alisonrag Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/SpriteLayerDrawing.cpp | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Source/Contents/SpriteLayerDrawing.cpp b/Source/Contents/SpriteLayerDrawing.cpp index 7b84387a..00405e98 100644 --- a/Source/Contents/SpriteLayerDrawing.cpp +++ b/Source/Contents/SpriteLayerDrawing.cpp @@ -105,5 +105,60 @@ std::pair SpriteLayerRenderer::FindLayer(int layer) } // OFFSET: 0x00641620 +// FUNCTION: fn_04816 +std::pair SpriteLayerRenderer::GetLayerSound(int layer, CActRes* action, int sound) { + if (layer != 6) { + return {false, ""}; + } + + if (sound == -1) { + return {false, ""}; + } + + std::string name = action->Sound(sound); + if (name.find(".wav") != std::string::npos) { + name.clear(); + } + + return {true, name}; +} // OFFSET: 0x00641E40 +// FUNCTION: fn_04818 +void SpriteLayerRenderer::LoadLayers() { + for (int layer = 0; layer < 9; ++layer) { + CRes* sprite = this->pc->GetEquipSprite(layer); + CRes* action = this->pc->GetEquipAction(layer); + if (!sprite || !action) { + continue; + } + + if (layer == 1) { + const ActionFrame& frame = static_cast(action)->Frame(this->pc->render.previousAnimation, this->pc->render.curMotion); + if (frame.Cell(GetSlotLayer(1)).image == -1) { + this->unknown_006D = true; + } + + if (StateFlag11(this->pc->stateFlags) == true) { + if (g_session.IsDoramJob(this->pc->unknown_025C) == true) { + sprite = ResourceMgr::Instance().Load("이팩트\\orcface_doram.spr"); + action = ResourceMgr::Instance().Load("이팩트\\orcface_doram.act"); + } else { + sprite = ResourceMgr::Instance().Load("이팩트\\orcface.spr"); + action = ResourceMgr::Instance().Load("이팩트\\orcface.act"); + } + } + } + + SpriteLayerResources& resources = this->layers[layer]; + resources.sprite = static_cast(sprite); + resources.action = static_cast(action); + } + + for (int layer = 2; layer <= 4; ++layer) { + if (g_session.IsSpecialMonsterJob(this->layerViews[layer]) == true) { + this->unknown_006C = true; + return; + } + } +}