diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/d/d_stage.cpp | 51 | ||||
| -rw-r--r-- | src/d/lyt/d_lyt_map_capture.cpp | 67 |
2 files changed, 83 insertions, 35 deletions
diff --git a/src/d/d_stage.cpp b/src/d/d_stage.cpp index 0e3a74b9..57089d1a 100644 --- a/src/d/d_stage.cpp +++ b/src/d/d_stage.cpp @@ -14,6 +14,7 @@ #include "d/flag/sceneflag_manager.h" #include "d/flag/storyflag_manager.h" #include "d/snd/d_snd_source_mgr.h" +#include "egg/gfx/eggCpuTexture.h" #include "f/f_base.h" #include "f/f_profile.h" #include "f/f_profile_name.h" @@ -23,6 +24,7 @@ #include "nw4r/g3d/res/g3d_resmat.h" #include "nw4r/g3d/res/g3d_resmdl.h" #include "nw4r/math/math_types.h" +#include "rvl/GX/GXTexture.h" #include "s/s_FPhase.h" #include "toBeSorted/arc_managers/current_stage_arc_manager.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" @@ -364,7 +366,7 @@ MapRelated::MapRelated() field_0x114(0.0f, 0.0f, 0.0f), field_0x120(0.0f, 0.0f, 0.0f), field_0x12C(0.0f), - field_0x1E0(0), + mpCpuTexture(NULL), field_0x1E6(0), field_0x1E8(0), field_0x1E9(4), @@ -394,3 +396,50 @@ extern "C" void fn_801B4AE0(); MapRelated::~MapRelated() { fn_801B4AE0(); } + +const mVec3_c &MapRelated::fn_801B4C90() const { + return mChildren[3 + field_0x1ED].a; +} + +const mVec3_c &MapRelated::fn_801B4CB0() const { + return mChildren[3 + field_0x1ED].b; +} + +extern "C" u32 lbl_805732F0; + +bool MapRelated::fn_801B50C0(s32 s) { + if (s < 0) { + if (s < -3) { + return false; + } + } else { + if (s > 4) { + return false; + } + } + + if (!getChildForFloor(s)->c) { + return false; + } + + field_0x1ED = s; + + if (getChildForFloor(field_0x1ED)->c) { + field_0x108 = getChildForFloor(field_0x1ED)->a; + field_0x114 = getChildForFloor(field_0x1ED)->b; + field_0x120 = field_0x108; + + field_0x1E6 = lbl_805732F0; + } + + return true; +} + +bool MapRelated::fn_801B5970(GXTexObj *tex) const { + if (mpCpuTexture == NULL) { + return false; + } + + mpCpuTexture->getTexObj(tex); + return true; +} diff --git a/src/d/lyt/d_lyt_map_capture.cpp b/src/d/lyt/d_lyt_map_capture.cpp index 20936865..657e40bd 100644 --- a/src/d/lyt/d_lyt_map_capture.cpp +++ b/src/d/lyt/d_lyt_map_capture.cpp @@ -1,4 +1,5 @@ #include "d/lyt/d_lyt_map_capture.h" + #include "common.h" #include "d/d_stage.h" #include "d/lyt/d_lyt_map_global.h" @@ -19,7 +20,8 @@ void dLytMapCapture_c::finalizeState_RenderingWait() {} void dLytMapCapture_c::initializeState_RenderingWaitStep2() {} void dLytMapCapture_c::executeState_RenderingWaitStep2() { - if (mIsBusyRendering && dStage_c::GetInstance() != nullptr && !dStage_c::GetInstance()->getMapRelated()->getField_0x1EE()) { + if (mIsBusyRendering && dStage_c::GetInstance() != nullptr && + !dStage_c::GetInstance()->getMapRelated()->getField_0x1EE()) { mIsBusyRendering = false; if (mRenderRequest) { fn_8012D6F0(); @@ -32,45 +34,25 @@ void dLytMapCapture_c::executeState_RenderingWaitStep2() { } void dLytMapCapture_c::finalizeState_RenderingWaitStep2() {} -bool dLytMapCapture_c::isBusyRendering() const{ - return mIsBusyRendering; -} - -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){ +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){ +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_8012D6D0(mVec3_c *out) { + *out = dStage_c::GetInstance()->getMapRelated()->field_0x0FC; } +void dLytMapCapture_c::fn_8012D6F0() { + dStage_c *pStage = dStage_c::GetInstance(); -void dLytMapCapture_c::fn_8012D6F0(){ - - dStage_c * pStage = dStage_c::GetInstance(); - if (pStage != nullptr) { - dLytMapGlobal_c* pLytMap = dLytMapGlobal_c::GetInstance(); + dLytMapGlobal_c *pLytMap = dLytMapGlobal_c::GetInstance(); f32 zoom = pLytMap->getZoomFrame(); f32 inv = 1.0f / pLytMap->getField_0x44(); @@ -79,16 +61,33 @@ void dLytMapCapture_c::fn_8012D6F0(){ 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_0x120 = pLytMap->getMapRotationCenter(); + pStage->getMapRelated()->field_0x1E6 = (u16)(-pLytMap->getMapRotation()); pStage->getMapRelated()->field_0x12C = zoom; pStage->getMapRelated()->field_0x1EE = 1; } return; -} +} + +void dLytMapCapture_c::execute() { + mStateMgr.executeState(); +} + +bool dLytMapCapture_c::isBusyRendering() const { + return mIsBusyRendering; +} + +void dLytMapCapture_c::fn_8012D800(nw4r::lyt::Pane *param_2, 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); + } +} |
