diff options
| author | robojumper <robojumper@gmail.com> | 2025-04-06 21:15:01 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-04-11 17:00:05 +0200 |
| commit | fe36b486bf28a220843194852506e7ad10b23a65 (patch) | |
| tree | eea64f6cfc8d4ced27a13da64b4aae1de5ba8884 /src/d | |
| parent | 6feb6a95c6e1b523a31fb1616207c02d63b10cbe (diff) | |
d_structd -> d_cursor_hit_check
Diffstat (limited to 'src/d')
| -rw-r--r-- | src/d/col/bg/d_bg_s.cpp | 2 | ||||
| -rw-r--r-- | src/d/col/cc/d_cc_s.cpp | 2 | ||||
| -rw-r--r-- | src/d/d_cs_base.cpp | 6 | ||||
| -rw-r--r-- | src/d/d_cs_game.cpp | 8 | ||||
| -rw-r--r-- | src/d/d_cursor_hit_check.cpp | 259 | ||||
| -rw-r--r-- | src/d/lyt/d_lyt_common_arrow.cpp | 20 | ||||
| -rw-r--r-- | src/d/lyt/d_lyt_common_icon_item.cpp | 14 | ||||
| -rw-r--r-- | src/d/lyt/d_lyt_common_icon_material.cpp | 8 | ||||
| -rw-r--r-- | src/d/lyt/d_lyt_map.cpp | 20 | ||||
| -rw-r--r-- | src/d/lyt/d_lyt_pause_disp_00.cpp | 2 | ||||
| -rw-r--r-- | src/d/lyt/d_structd.cpp | 35 |
11 files changed, 300 insertions, 76 deletions
diff --git a/src/d/col/bg/d_bg_s.cpp b/src/d/col/bg/d_bg_s.cpp index 43fd11dc..8409bc6a 100644 --- a/src/d/col/bg/d_bg_s.cpp +++ b/src/d/col/bg/d_bg_s.cpp @@ -1143,7 +1143,7 @@ void dBgS::InitMapParts() { } void dBgS::AppendMapSegment(MapLineSegment *pSeg) { - mList_0x388C.insert(pSeg); + mList_0x388C.append(pSeg); } void dBgS::RemoveMapSegment(MapLineSegment *pSeg) { diff --git a/src/d/col/cc/d_cc_s.cpp b/src/d/col/cc/d_cc_s.cpp index 120ee9f0..702042e4 100644 --- a/src/d/col/cc/d_cc_s.cpp +++ b/src/d/col/cc/d_cc_s.cpp @@ -106,7 +106,7 @@ bool dCcS::ChkCameraPoint( bool dCcS::ChkCo(const mVec3_c &, dAcObjBase_c *) {} -bool dCcS::fn_80357c90(const mVec3_c &, const mVec3_c &, u32, UNKTYPE **) {} +bool dCcS::fn_80357c90(const mVec3_c &, const mVec3_c &, u32, cCcD_ShapeAttr **, f32) {} void dCcS::Set(cCcD_Obj *) {} diff --git a/src/d/d_cs_base.cpp b/src/d/d_cs_base.cpp index 14aec0ee..fbd75427 100644 --- a/src/d/d_cs_base.cpp +++ b/src/d/d_cs_base.cpp @@ -43,8 +43,8 @@ int dCsBase_c::create() { mLyts[i].calc(); } setCurrentLyt(0); - mStructC.field_0x10 = 1; - d2d::dLytStructDList::GetInstance()->appendToList1(&mStructC); + mCursorIf.setCursorMask(1); + dCsMgr_c::GetInstance()->registCursor(&mCursorIf); fn_8016B2B0(); field_0x6F0 = 0.0f; field_0x6F4 = 0.0f; @@ -59,7 +59,7 @@ int dCsBase_c::create() { } int dCsBase_c::doDelete() { - d2d::dLytStructDList::GetInstance()->removeFromList1(&mStructC); + dCsMgr_c::GetInstance()->unregistCursor(&mCursorIf); fn_8016B2E0(); mResAcc.detach(); return SUCCEEDED; diff --git a/src/d/d_cs_game.cpp b/src/d/d_cs_game.cpp index bc153463..5ab406a5 100644 --- a/src/d/d_cs_game.cpp +++ b/src/d/d_cs_game.cpp @@ -1,8 +1,8 @@ #include "d/d_cs_game.h" #include "d/d_cs_base.h" +#include "d/d_cursor_hit_check.h" #include "d/lyt/d2d.h" -#include "d/lyt/d_structd.h" #include "f/f_base.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" #include "toBeSorted/small_sound_mgr.h" @@ -148,8 +148,8 @@ int dCsGame_c::create() { mCursorType = 0; mCursor.setField0x9A0(0); - mStructC.field_0x10 = 2; - d2d::dLytStructDList::GetInstance()->appendToList1(&mStructC); + mCursorIf.setCursorMask(2); + dCsMgr_c::GetInstance()->registCursor(&mCursorIf); dCsBase_c::GetInstance()->setField703(false); return SUCCEEDED; } @@ -158,7 +158,7 @@ int dCsGame_c::doDelete() { mCursor.remove(); mLyt2.dCsGameLytBase_0x14(); mLyt1.dCsGameLytBase_0x14(); - d2d::dLytStructDList::GetInstance()->removeFromList1(&mStructC); + dCsMgr_c::GetInstance()->unregistCursor(&mCursorIf); mCursorResAcc.detach(); mMain2DResAcc.detach(); return SUCCEEDED; diff --git a/src/d/d_cursor_hit_check.cpp b/src/d/d_cursor_hit_check.cpp new file mode 100644 index 00000000..9446db18 --- /dev/null +++ b/src/d/d_cursor_hit_check.cpp @@ -0,0 +1,259 @@ +#include "d/d_cursor_hit_check.h" + +#include "common.h" +#include "d/col/bg/d_bg_s.h" +#include "d/col/bg/d_bg_s_lin_chk.h" +#include "d/col/cc/d_cc_s.h" +#include "d/d_stage_mgr.h" +#include "m/m_mtx.h" +#include "m/m_vec.h" +#include "nw4r/g3d/g3d_camera.h" +#include "nw4r/lyt/lyt_bounding.h" +#include "nw4r/lyt/lyt_pane.h" +#include "nw4r/ut/ut_RuntimeTypeInfo.h" +#include "rvl/MTX/mtx.h" +#include "toBeSorted/d_d3d.h" +#include "toBeSorted/lyt_related_floats.h" + +dCsMgr_c::dCsMgr_c() { + // NONMATCHING - TList ctor issues + field_0x18 = true; + sInstance = this; +} + +extern "C" bool lbl_80572D10; +void dCsMgr_c::execute() { + // NONMATCHING - TList + if (field_0x18 == 0 && lbl_80572D10 == 0) { + for (CursorList::Iterator it = mList1.GetBeginIter(); it != mList1.GetEndIter(); ++it) { + it->mpHit = nullptr; + } + return; + } + + for (CursorList::Iterator it = mList1.GetBeginIter(); it != mList1.GetEndIter(); ++it) { + mVec2_c &pos = it->getCursorPos(); + s16 x = pos.x; + s16 y = pos.y; + it->mpHit = 0; + u32 mask = it->mCursorMask; + + if (mask) { + for (HitCheckList::Iterator chkIt = mList2.GetBeginIter(); chkIt != mList2.GetEndIter(); ++it) { + if ((chkIt->mMask & mask) != 0) { + bool hit = chkIt->checkHit(x, y); + if (chkIt->checkOverrideCallback(hit)) { + it->mpHit = &*chkIt; + break; + } + } + } + } + } +} + +void dCsMgr_c::registCursor(dCursorInterface_c *cursor) { + mList1.append(cursor); +} + +void dCsMgr_c::unregistCursor(dCursorInterface_c *cursor) { + // NONMATCHING - TList + mList1.remove(cursor); +} + +void dCsMgr_c::registCursorTarget(dCursorHitCheck_c *target) { + // NONMATCHING - TList + HitCheckList::Iterator it = mList2.GetBeginIter(); + HitCheckList::Iterator end = mList2.GetEndIter(); + while (it != end) { + if (target->mPriority < it->mPriority) { + if (it == end) { + mList2.prepend(target); + return; + } + + mList2.insertBefore(&*it, target); + return; + } + ++it; + } + mList2.append(target); +} + +void dCsMgr_c::unregistCursorTarget(dCursorHitCheck_c *target) { + // NONMATCHING - TList + for (CursorList::Iterator it = mList1.GetBeginIter(); it != mList1.GetEndIter(); ++it) { + if (target == it->mpHit) { + it->mpHit = 0; + } + } + mList2.remove(target); +} + +bool dCsMgr_c::isRegist(dCursorHitCheck_c *target) { + return mList2.GetPosition(target) != mList2.GetEndIter(); +} + +dCsMgr_c *dCsMgr_c::create(EGG::Heap *heap) { + return new (heap) dCsMgr_c(); +} + +bool dCursorHitCheck_c::init(u8 prio, u8 a, u16 mask) { + if (dCsMgr_c::GetInstance()->isRegist(this)) { + return false; + } + mPriority = prio; + field_0x017 = a; + mMask = mask; + return true; +} + +bool dCursorHitCheck_c::checkOverrideCallback(bool b) { + if (mOverrideHitCallback == nullptr) { + return b; + } + return mOverrideHitCallback(b, this, mCallbackData); +} + +bool dCursorHitCheckCC_c::checkHit(s32 x, s32 y) { + // NONMATCHING - TODO + mVec3_c pos(x, y, 10000.0f); + pos.x = (pos.x - get_8057515C()) / get_80575148() * -2.0f - 1.0f; + pos.y = (pos.y - get_8057519C()) / get_80575190() * 2.0f - 1.0f; + mVec3_c v; + d3d::fn_80016B60(v, pos); + nw4r::g3d::Camera cam = dStageMgr_c::GetInstance()->getCamera(0); + mMtx_c mtx; + cam.GetCameraMtx(mtx); + PSMTXInverse(mtx, mtx); + mVec3_c a; + a.x = mtx.m[0][3]; + a.y = mtx.m[1][3]; + a.z = mtx.m[2][3]; + dBgS_LinChk ck; + ck.Set(&a, &v, nullptr); + dBgS::GetInstance()->LineCross(&ck); + cCcD_ShapeAttr *attr = nullptr; + if (dCcS::GetInstance()->fn_80357c90(a, v, 0, &attr, 15.0f)) { + // TODO - this branches into unsplit code in col/ + return true; + } else { + return false; + } +} + +bool dCursorHitCheckCC_c::init(u16 mask, u8 prio, u8 a) { + return dCursorHitCheck_c::init(prio, a, mask); +} + +dCursorHitCheckLyt_c::~dCursorHitCheckLyt_c() { + delete[] mpBoundingData; + mpBoundingData = nullptr; +} + +bool dCursorHitCheckLyt_c::checkHit(s32 x, s32 y) { + dCsCheckLyt_BoundingData *p = &mpBoundingData[0]; + for (u16 i = 0; i < mNumBoundings; i++) { + if (p->mMinX <= x && x <= p->mMaxX && p->mMaxY >= y && y >= p->mMinY) { + mpHitPane = p->mpPane; + if (mpHitPane->GetAlpha() != 0 && mpHitPane->IsVisible()) { + return true; + } + } + p++; + } + + mpHitPane = nullptr; + return false; +} + +bool dCursorHitCheckLyt_c::init(nw4r::lyt::Pane *pPane, u16 mask, u8 prio, u8 a) { + if (!dCursorHitCheck_c::init(prio, a, mask)) { + return false; + } + + mpRootPane = pPane; + mNumBoundings = 0; + + countBoundings(pPane); + + dCsCheckLyt_BoundingData *pData = new dCsCheckLyt_BoundingData[mNumBoundings](); + mpBoundingData = pData; + dCsCheckLyt_BoundingData *pEnd = pData + mNumBoundings; + gatherBoundings(&pEnd, mpRootPane); + + return true; +} + +void dCursorHitCheckLyt_c::execute() { + if (!mHasCalculatedBoundingData) { + dCsCheckLyt_BoundingData *dat = &mpBoundingData[0]; + for (u16 i = 0; i < mNumBoundings; i++) { + nw4r::lyt::Pane *pane = dat->mpPane; + f32 xx = pane->GetGlobalMtx()._00; + switch (pane->GetPositionH()) { + case 0: + dat->mMinX = (s16)pane->GetGlobalMtx()._03; + dat->mMaxX = (s16)pane->GetGlobalMtx()._03 + xx * pane->GetSize().width; + break; + case 1: + dat->mMinX = (s16)pane->GetGlobalMtx()._03 - xx * pane->GetSize().width * 0.5f; + dat->mMaxX = (s16)pane->GetGlobalMtx()._03 + xx * pane->GetSize().width * 0.5f; + break; + case 2: + dat->mMinX = (s16)pane->GetGlobalMtx()._03 - xx * pane->GetSize().width; + dat->mMaxX = (s16)pane->GetGlobalMtx()._03; + break; + } + + switch (pane->GetPositionV()) { + case 0: + dat->mMaxY = (s16)pane->GetGlobalMtx()._13; + dat->mMinY = (s16)pane->GetGlobalMtx()._13 - pane->GetSize().height; + break; + case 1: + dat->mMaxY = (s16)pane->GetGlobalMtx()._13 + (pane->GetSize().height * 0.5f); + dat->mMinY = (s16)pane->GetGlobalMtx()._13 - (pane->GetSize().height * 0.5f); + break; + case 2: + dat->mMaxY = (s16)pane->GetGlobalMtx()._13 + pane->GetSize().height; + dat->mMinY = (s16)pane->GetGlobalMtx()._13; + break; + } + + dat++; + } + + mHasCalculatedBoundingData = true; + } +} + +void dCursorHitCheckLyt_c::countBoundings(nw4r::lyt::Pane *pane) { + nw4r::lyt::Bounding *b = nw4r::ut::DynamicCast<nw4r::lyt::Bounding *>(pane); + if (b != nullptr) { + mNumBoundings++; + } + + for (nw4r::lyt::Pane::ChildList::RevIterator it = pane->GetChildList()->GetEndReverseIter(); + it != pane->GetChildList()->GetBeginIter(); ++it) { + countBoundings(&*it); + } +} + +void dCursorHitCheckLyt_c::gatherBoundings(dCsCheckLyt_BoundingData **pEnd, nw4r::lyt::Pane *pane) { + nw4r::lyt::Bounding *b = nw4r::ut::DynamicCast<nw4r::lyt::Bounding *>(pane); + if (b != nullptr) { + (*pEnd)--; + (*pEnd)->mpPane = pane; + } + + for (nw4r::lyt::Pane::ChildList::RevIterator it = pane->GetChildList()->GetEndReverseIter(); + it != pane->GetChildList()->GetBeginIter(); ++it) { + gatherBoundings(pEnd, &*it); + } +} + +mVec2_c &dCursorInterface_c::getCursorPos() { + // NONMATCHING - Controller stuff + return *(mVec2_c *)nullptr; +} diff --git a/src/d/lyt/d_lyt_common_arrow.cpp b/src/d/lyt/d_lyt_common_arrow.cpp index 586604b3..1aeb988b 100644 --- a/src/d/lyt/d_lyt_common_arrow.cpp +++ b/src/d/lyt/d_lyt_common_arrow.cpp @@ -1,7 +1,7 @@ #include "d/lyt/d_lyt_common_arrow.h" #include "d/d_cs_base.h" -#include "d/lyt/d_structd.h" +#include "d/d_cursor_hit_check.h" #include "rvl/MTX/mtx.h" #include "toBeSorted/arc_managers/layout_arc_manager.h" #include "toBeSorted/small_sound_mgr.h" @@ -47,8 +47,8 @@ bool dLytCommonArrow_c::build() { for (int i = 0; i < 9; i++) { mAnmGroups[i].init(brlanMap[i].mFile, &mResAcc, mLytBase.getLayout(), brlanMap[i].mName); } - mStructD.fn_80065E70(mLytBase.getLayout()->GetRootPane(), 1, 0, 0); - d2d::dLytStructDList::GetInstance()->appendToList2(&mStructD); + mCsHitCheck.init(mLytBase.getLayout()->GetRootPane(), 1, 0, 0); + dCsMgr_c::GetInstance()->registCursorTarget(&mCsHitCheck); mBoundingL = mLytBase.findBounding("B_arrowL_00"); mBoundingR = mLytBase.findBounding("B_arrowR_00"); mStateMgr.changeState(StateID_None); @@ -57,7 +57,7 @@ bool dLytCommonArrow_c::build() { } bool dLytCommonArrow_c::remove() { - d2d::dLytStructDList::GetInstance()->removeFromList2(&mStructD); + dCsMgr_c::GetInstance()->unregistCursorTarget(&mCsHitCheck); mLytBase.unbindAnims(); for (int i = 0; i < 9; i++) { mAnmGroups[i].remove(); @@ -71,8 +71,8 @@ bool dLytCommonArrow_c::execute() { mAnmGroups[ANIM_LOOP].play(); } mLytBase.calc(); - mStructD.field_0x22 = 0; - mStructD.fn_80065F70(); + mCsHitCheck.resetCachedHitboxes(); + mCsHitCheck.execute(); field_0x6BC = field_0x6B8; return true; } @@ -153,11 +153,11 @@ void dLytCommonArrow_c::fn_80168880() { return; } - d2d::dLytStructD *thing = dCsBase_c::GetInstance()->getUnk(); - if (thing != nullptr && thing->getType() == 'lyt ') { - if (thing->field_0x24 == mBoundingL) { + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (d != nullptr && d->getType() == 'lyt ') { + if (static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mBoundingL) { i = 0; - } else if (thing->field_0x24 == mBoundingR) { + } else if (static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mBoundingR) { i = 1; } } diff --git a/src/d/lyt/d_lyt_common_icon_item.cpp b/src/d/lyt/d_lyt_common_icon_item.cpp index e4d67762..840c7db3 100644 --- a/src/d/lyt/d_lyt_common_icon_item.cpp +++ b/src/d/lyt/d_lyt_common_icon_item.cpp @@ -2,8 +2,8 @@ #include "common.h" #include "d/d_cs_base.h" +#include "d/d_cursor_hit_check.h" #include "d/lyt/d_lyt_common_icon_item_maps.h" -#include "d/lyt/d_structd.h" #include <cstring> @@ -223,8 +223,8 @@ bool dLytCommonIconItemPart1_c::isDoneDeciding() const { } bool dLytCommonIconItemPart1_c::isCursorOver() const { - d2d::dLytStructD *d = dCsBase_c::GetInstance()->getUnk(); - if (d != nullptr && d->getType() == 'lyt ' && d->field_0x24 == mpBounding) { + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (d != nullptr && d->getType() == 'lyt ' && static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mpBounding) { return true; } return false; @@ -556,8 +556,8 @@ bool dLytCommonIconItemPart2_c::isDoneDeciding() const { } bool dLytCommonIconItemPart2_c::isCursorOver() const { - d2d::dLytStructD *d = dCsBase_c::GetInstance()->getUnk(); - if (d != nullptr && d->getType() == 'lyt ' && d->field_0x24 == mpBounding) { + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (d != nullptr && d->getType() == 'lyt ' && static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mpBounding) { return true; } return false; @@ -688,8 +688,8 @@ void dLytCommonIconItemPart3_c::realizeItem(u8 item) { } bool dLytCommonIconItemPart3_c::isCursorOver() const { - d2d::dLytStructD *d = dCsBase_c::GetInstance()->getUnk(); - if (d != nullptr && d->getType() == 'lyt ' && d->field_0x24 == mpBounding) { + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (d != nullptr && d->getType() == 'lyt ' && static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mpBounding) { return true; } return false; diff --git a/src/d/lyt/d_lyt_common_icon_material.cpp b/src/d/lyt/d_lyt_common_icon_material.cpp index 2759bfeb..a8f99733 100644 --- a/src/d/lyt/d_lyt_common_icon_material.cpp +++ b/src/d/lyt/d_lyt_common_icon_material.cpp @@ -194,8 +194,8 @@ void dLytCommonIconMaterialPart1_c::setOff() { } bool dLytCommonIconMaterialPart1_c::isCursorOver() const { - d2d::dLytStructD *d = dCsBase_c::GetInstance()->getUnk(); - if (d != nullptr && d->getType() == 'lyt ' && d->field_0x24 == mpBounding) { + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (d != nullptr && d->getType() == 'lyt ' && static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mpBounding) { return true; } return false; @@ -393,8 +393,8 @@ void dLytCommonIconMaterialPart2_c::setOff() { } bool dLytCommonIconMaterialPart2_c::isCursorOver() const { - d2d::dLytStructD *d = dCsBase_c::GetInstance()->getUnk(); - if (d != nullptr && d->getType() == 'lyt ' && d->field_0x24 == mpBounding) { + dCursorHitCheck_c *d = dCsBase_c::GetInstance()->getHitCheck(); + if (d != nullptr && d->getType() == 'lyt ' && static_cast<dCursorHitCheckLyt_c *>(d)->getHitPane() == mpBounding) { return true; } return false; diff --git a/src/d/lyt/d_lyt_map.cpp b/src/d/lyt/d_lyt_map.cpp index d01e6942..8d63e48e 100644 --- a/src/d/lyt/d_lyt_map.cpp +++ b/src/d/lyt/d_lyt_map.cpp @@ -2,7 +2,7 @@ #include "common.h" #include "d/lyt/d2d.h" -#include "d/lyt/d_structd.h" +#include "d/d_cursor_hit_check.h" #include "egg/core/eggColorFader.h" #include "m/m_video.h" #include "sized_string.h" @@ -236,8 +236,8 @@ void dLytMapPinIcon_c::executeState_Remove() { void dLytMapPinIcon_c::finalizeState_Remove() {} dLytMapPinIcon_c::~dLytMapPinIcon_c() { - if (d2d::dLytStructDList::GetInstance()->fn_80065A30(&mStructD)) { - d2d::dLytStructDList::GetInstance()->removeFromList2(&mStructD); + if (dCsMgr_c::GetInstance()->isRegist(&mCsHitCheck)) { + dCsMgr_c::GetInstance()->unregistCursorTarget(&mCsHitCheck); } } @@ -266,8 +266,8 @@ bool dLytMapPinIcon_c::build(d2d::ResAccIf_c *resAcc) { } mpBounding = mLyt.findBounding("B_mark_00"); - mStructD.fn_80065E70(mpBounding, 2, 1, 0); - d2d::dLytStructDList::GetInstance()->appendToList2(&mStructD); + mCsHitCheck.init(mpBounding, 2, 1, 0); + dCsMgr_c::GetInstance()->registCursorTarget(&mCsHitCheck); mAnmGroups[LYT_MAP_PIN_ICON_ANIM_SCALE].bind(false); mAnmGroups[LYT_MAP_PIN_ICON_ANIM_LOOP].bind(false); @@ -282,7 +282,7 @@ bool dLytMapPinIcon_c::build(d2d::ResAccIf_c *resAcc) { } bool dLytMapPinIcon_c::remove() { - d2d::dLytStructDList::GetInstance()->removeFromList2(&mStructD); + dCsMgr_c::GetInstance()->unregistCursorTarget(&mCsHitCheck); for (int i = 0; i < 3; i++) { mAnmGroups[i].remove(); } @@ -296,8 +296,8 @@ bool dLytMapPinIcon_c::execute() { mAnmGroups[2].setFrame(field_0x1DC); // TODO something MapCapture mLyt.calc(); - mStructD.field_0x22 = 0; - mStructD.fn_80065F70(); + mCsHitCheck.resetCachedHitboxes(); + mCsHitCheck.execute(); return true; } @@ -398,8 +398,8 @@ void dLytMapFloorBtnMgr_c::finalizeState_Wait() {} extern "C" void fn_801942F0(int, int); dLytMapFloorBtnMgr_c::~dLytMapFloorBtnMgr_c() { for (int i = 0; i < 4; i++) { - if (d2d::dLytStructDList::GetInstance()->fn_80065A30(&mStructDs[i])) { - d2d::dLytStructDList::GetInstance()->removeFromList2(&mStructDs[i]); + if (dCsMgr_c::GetInstance()->isRegist(&mCsHitChecks[i])) { + dCsMgr_c::GetInstance()->unregistCursorTarget(&mCsHitChecks[i]); } } fn_801942F0(0, 0); diff --git a/src/d/lyt/d_lyt_pause_disp_00.cpp b/src/d/lyt/d_lyt_pause_disp_00.cpp index 36367537..9f88dca6 100644 --- a/src/d/lyt/d_lyt_pause_disp_00.cpp +++ b/src/d/lyt/d_lyt_pause_disp_00.cpp @@ -39,7 +39,7 @@ void dLytPauseDisp00_c::init() { } field_0xE29C.init(mLytBase.getLayout()->GetRootPane(), 1, 0, 0); - d2d::dLytStructDList::GetInstance()->appendToList2(&field_0xE29C); + dCsMgr_c::GetInstance()->registCursorTarget(&field_0xE29C); for (int i = 0; i < 0x25; i++) { if (i != 0x1F && i != 0x20) { nw4r::lyt::Bounding *b = mLytBase.findBounding(B_LIST[i]); diff --git a/src/d/lyt/d_structd.cpp b/src/d/lyt/d_structd.cpp deleted file mode 100644 index 40ee0a88..00000000 --- a/src/d/lyt/d_structd.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "d/lyt/d_structd.h" - -namespace d2d { - -dLytStructDList::dLytStructDList() { - field_0x18 = true; - sInstance = this; -} - -dLytStructDList *dLytStructDList::create(EGG::Heap *heap) { - return new (heap) dLytStructDList(); -} - -void dLytStructDList::appendToList1(dLytStructC *other) { - mList1.insert(other); -} - -void dLytStructDList::removeFromList1(dLytStructC *other) { - mList1.remove(other); -} - -void dLytStructDList::appendToList2(dLytStructD *other) { - mList2.insert(other); -} - -void dLytStructDList::removeFromList2(dLytStructD *other) { - mList2.remove(other); -} - -dLytStructD::~dLytStructD() { - delete[] field_0x1C; - field_0x1C = nullptr; -} - -} // namespace d2d |
