diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index 2803de4a..220671a5 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -7488,13 +7488,13 @@ finalizeState_RenderingWait__16dLytMapCapture_cFv = .text:0x8012D540; // type:fu initializeState_RenderingWaitStep2__16dLytMapCapture_cFv = .text:0x8012D550; // type:function size:0x4 executeState_RenderingWaitStep2__16dLytMapCapture_cFv = .text:0x8012D560; // type:function size:0x94 finalizeState_RenderingWaitStep2__16dLytMapCapture_cFv = .text:0x8012D600; // type:function size:0x4 -fn_8012D610 = .text:0x8012D610; // type:function size:0x5C -fn_8012D670 = .text:0x8012D670; // type:function size:0x5C -fn_8012D6D0 = .text:0x8012D6D0; // type:function size:0x20 -fn_8012D6F0 = .text:0x8012D6F0; // type:function size:0xE4 +fn_8012D610__16dLytMapCapture_cFP7mVec3_c = .text:0x8012D610; // type:function size:0x5C +fn_8012D670__16dLytMapCapture_cFP7mVec3_c = .text:0x8012D670; // type:function size:0x5C +fn_8012D6D0__16dLytMapCapture_cFP7mVec3_c = .text:0x8012D6D0; // type:function size:0x20 +fn_8012D6F0__16dLytMapCapture_cFv = .text:0x8012D6F0; // type:function size:0xE4 execute__16dLytMapCapture_cFv = .text:0x8012D7E0; // type:function size:0x10 isBusyRendering__16dLytMapCapture_cCFv = .text:0x8012D7F0; // type:function size:0x8 -fn_8012D800 = .text:0x8012D800; // type:function size:0xEC +fn_8012D800__16dLytMapCapture_cFPQ34nw4r3lyt4PanePC9_GXTexObj = .text:0x8012D800; // type:function size:0xEC finalizeState__31sFStateID_c<16dLytMapCapture_c>CFR16dLytMapCapture_c = .text:0x8012D8F0; // type:function size:0x30 executeState__31sFStateID_c<16dLytMapCapture_c>CFR16dLytMapCapture_c = .text:0x8012D920; // type:function size:0x30 initializeState__31sFStateID_c<16dLytMapCapture_c>CFR16dLytMapCapture_c = .text:0x8012D950; // type:function size:0x30 @@ -8709,10 +8709,10 @@ fn_80158290 = .text:0x80158290; // type:function size:0x4 fn_801582A0 = .text:0x801582A0; // type:function size:0x134 fn_801583E0 = .text:0x801583E0; // type:function size:0x4 fn_801583F0 = .text:0x801583F0; // type:function size:0x4 -fn_80158400 = .text:0x80158400; // type:function size:0x78 +fn_80158400__15dLytBossGauge_cFv = .text:0x80158400; // type:function size:0x78 fn_80158480 = .text:0x80158480; // type:function size:0x4 fn_80158490 = .text:0x80158490; // type:function size:0x4 -fn_801584A0 = .text:0x801584A0; // type:function size:0x78 +fn_801584A0__15dLytBossGauge_cFv = .text:0x801584A0; // type:function size:0x78 fn_80158520 = .text:0x80158520; // type:function size:0x4 fn_80158530 = .text:0x80158530; // type:function size:0x4 fn_80158540 = .text:0x80158540; // type:function size:0x80 diff --git a/include/d/d_stage.h b/include/d/d_stage.h index 3c3d2a93..60c79aa5 100644 --- a/include/d/d_stage.h +++ b/include/d/d_stage.h @@ -42,21 +42,18 @@ class MapRelated { bool c; }; + + public: MapRelated(); ~MapRelated(); + int fn_801B5970(const GXTexObj*); /* 0x000 */ mHeapAllocator_c mAllocator; /* 0x01C */ Child mChildren[8]; /* 0x0FC */ mVec3_c field_0x0FC; - /* 0x108 */ f32 field_0x108; - /* 0x10C */ f32 field_0x10C; - /* 0x110 */ f32 field_0x110; - /* 0x114 */ f32 field_0x114; - /* 0x118 */ f32 field_0x118; - /* 0x11C */ f32 field_0x11C; - /* 0x120 */ f32 field_0x120; - /* 0x124 */ f32 field_0x124; - /* 0x128 */ f32 field_0x128; + /* 0x108 */ mVec3_c field_0x108; + /* 0x114 */ mVec3_c field_0x114; + /* 0x120 */ mVec3_c field_0x120; /* 0x12C */ f32 field_0x12C; /* 0x130 */ EGG::ScreenEffectBlur mScreenEffect; /* 0x168 */ EGG::PostEffectBlur mPostEffect; @@ -95,6 +92,7 @@ public: void fn_801B4B80(u32 mapParams, const mVec3_c ¢er, const mVec3_c &size); void fn_801B4C70(const mVec3_c &); void fn_801B50C0(s32); + const mVec3_c &fn_801B4C90() const; const mVec3_c &fn_801B4CB0() const; s32 fn_801B4F10(s32 roomid, const mVec3_c &position) const; }; diff --git a/include/d/lyt/d_lyt_map_capture.h b/include/d/lyt/d_lyt_map_capture.h index a99fb335..4dec80a2 100644 --- a/include/d/lyt/d_lyt_map_capture.h +++ b/include/d/lyt/d_lyt_map_capture.h @@ -5,12 +5,11 @@ #include "nw4r/lyt/lyt_picture.h" #include "s/s_State.hpp" #include "s/s_StateID.hpp" +#include "m/m_vec.h" class dLytMapCapture_c { public: dLytMapCapture_c() :mStateMgr(*this), mpPicture(nullptr) { - field_0x070 = 0.0f; - field_0x074 = 0.0f; mRenderRequest = false; mIsBusyRendering = false; field_0x06C = 0.0f; @@ -33,9 +32,13 @@ public: void execute(); bool isBusyRendering() const; + void fn_8012D610(mVec3_c *out); + void fn_8012D670(mVec3_c *out); + void fn_8012D6D0(mVec3_c *out); private: void fn_8012D6F0(); + void fn_8012D800(nw4r::lyt::Pane *pane, const GXTexObj *texObj); /* 0x004 */ UI_STATE_MGR_DECLARE(dLytMapCapture_c); /* 0x040 */ nw4r::lyt::Picture *mpPicture; @@ -43,8 +46,7 @@ private: /* 0x064 */ f32 field_0x064; /* 0x068 */ f32 field_0x068; /* 0x06C */ f32 field_0x06C; - /* 0x070 */ f32 field_0x070; - /* 0x074 */ f32 field_0x074; + /* 0x070 */ nw4r::lyt::Size field_0x070; /* 0x078 */ bool mRenderRequest; /* 0x079 */ bool mIsBusyRendering; }; diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 9e8fde25..0e3a74b9 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -360,15 +360,9 @@ dRoomTable_c::dRoomTable_c() { MapRelated::MapRelated() : field_0x0FC(0.0f, 0.0f, 0.0f), - field_0x108(0.0f), - field_0x10C(0.0f), - field_0x110(0.0f), - field_0x114(0.0f), - field_0x118(0.0f), - field_0x11C(0.0f), - field_0x120(0.0f), - field_0x124(0.0f), - field_0x128(0.0f), + field_0x108(0.0f, 0.0f, 0.0f), + field_0x114(0.0f, 0.0f, 0.0f), + field_0x120(0.0f, 0.0f, 0.0f), field_0x12C(0.0f), field_0x1E0(0), field_0x1E6(0), diff --git a/src/d/lyt/d_lyt_map_capture.cpp b/src/d/lyt/d_lyt_map_capture.cpp index c8ead0c9..20936865 100644 --- a/src/d/lyt/d_lyt_map_capture.cpp +++ b/src/d/lyt/d_lyt_map_capture.cpp @@ -1,6 +1,7 @@ #include "d/lyt/d_lyt_map_capture.h" #include "common.h" #include "d/d_stage.h" +#include "d/lyt/d_lyt_map_global.h" STATE_DEFINE(dLytMapCapture_c, RenderingWait); STATE_DEFINE(dLytMapCapture_c, RenderingWaitStep2); @@ -38,3 +39,56 @@ bool dLytMapCapture_c::isBusyRendering() const{ void dLytMapCapture_c::execute() { mStateMgr.executeState(); } + +void dLytMapCapture_c::fn_8012D6D0(mVec3_c *out) { + *out = dStage_c::GetInstance()->getMapRelated()->field_0x0FC; +} + +void dLytMapCapture_c::fn_8012D610(mVec3_c *out){ + dStage_c::GetInstance()->getMapRelated()->fn_801B50C0(0); + *out = dStage_c::GetInstance()->getMapRelated()->fn_801B4CB0(); +} + +void dLytMapCapture_c::fn_8012D670(mVec3_c *out){ + dStage_c::GetInstance()->getMapRelated()->fn_801B50C0(0); + *out = dStage_c::GetInstance()->getMapRelated()->fn_801B4C90(); +} + + +void dLytMapCapture_c::fn_8012D800(nw4r::lyt::Pane *param_2, const GXTexObj *param_3) { + if (param_3 != nullptr && dStage_c::GetInstance() != nullptr && dStage_c::GetInstance()->getMapRelated()->fn_801B5970(param_3)) { + field_0x070.width = GXGetTexObjWidth(param_3); + field_0x070.height = GXGetTexObjHeight(param_3); + param_2->SetSize(field_0x070); + param_2->GetMaterial()->GetTexMapAry()->ReplaceImage(*param_3); + } +} + + +void dLytMapCapture_c::fn_8012D6F0(){ + + dStage_c * pStage = dStage_c::GetInstance(); + + if (pStage != nullptr) { + dLytMapGlobal_c* pLytMap = dLytMapGlobal_c::GetInstance(); + + f32 zoom = pLytMap->getZoomFrame(); + f32 inv = 1.0f / pLytMap->getField_0x44(); + s32 floor = pLytMap->getFloor(); + + mVec3_c v(field_0x064 * inv, 1, field_0x06C * inv); + + pStage->getMapRelated()->fn_801B50C0(floor); + + pStage->getMapRelated()->field_0x108 = pLytMap->getMapScroll(); + pStage->getMapRelated()->field_0x114 = v; + + pStage->getMapRelated()->field_0x120 = pLytMap->getMapRotationCenter(); + + + pStage->getMapRelated()->field_0x1E6 = (u16)(-pLytMap->getMapRotation()); + pStage->getMapRelated()->field_0x12C = zoom; + pStage->getMapRelated()->field_0x1EE = 1; + } + return; +}