From e08d120f0bd0e5df3d3c173130d485dcdddb22d4 Mon Sep 17 00:00:00 2001 From: robojumper Date: Sat, 9 Aug 2025 18:04:48 +0200 Subject: [PATCH] small cleanup --- include/d/lyt/d_lyt_pause_disp_00.h | 8 -------- src/d/lyt/d_lyt_pause_disp_00.cpp | 16 ++++++++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/include/d/lyt/d_lyt_pause_disp_00.h b/include/d/lyt/d_lyt_pause_disp_00.h index 38a07923..aa77d651 100644 --- a/include/d/lyt/d_lyt_pause_disp_00.h +++ b/include/d/lyt/d_lyt_pause_disp_00.h @@ -36,14 +36,6 @@ public: STATE_FUNC_DECLARE(dLytPauseDisp00_c, Out); private: - static s32 navTargetToBounding(s32 target) { - return target - 1; - } - - static s32 boundingToNavTarget(s32 target) { - return target + 1; - } - void setAnm(int idx, f32 value); void stopAnm(int idx); void playBackwards(d2d::AnmGroup_c &anm); diff --git a/src/d/lyt/d_lyt_pause_disp_00.cpp b/src/d/lyt/d_lyt_pause_disp_00.cpp index c2ab10bf..153cb74b 100644 --- a/src/d/lyt/d_lyt_pause_disp_00.cpp +++ b/src/d/lyt/d_lyt_pause_disp_00.cpp @@ -329,6 +329,9 @@ static const d2d::LytBrlanMapping brlanMap[] = { #define PAUSE_DISP_00_NUM_SUBPANES 24 +#define navTargetToBounding(n) (s32)(n - 1) +#define boundingToNavTarget(n) (s32)(n + 1) + // clang-format off static const u8 iconVariants[] = { // Wheel @@ -1621,8 +1624,7 @@ s32 dLytPauseDisp00_c::updateSelection() { } if (mCurrentNavTarget != 0) { - s32 paneIdx = navTargetToBounding(mCurrentNavTarget); - dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundings[paneIdx]); + dCsBase_c::GetInstance()->setCursorStickTargetPane(mpBoundings[navTargetToBounding(mCurrentNavTarget)]); } target = mCurrentNavTarget; @@ -1666,8 +1668,7 @@ s32 dLytPauseDisp00_c::updateSelection() { } anyTab: { pause->setCurrentSelectionTab(tab); - s32 bounding = navTargetToBounding(target); - if (mpBoundings[bounding]->IsVisible()) { + if (mpBoundings[navTargetToBounding(target)]->IsVisible()) { pause->setSelection(dLytPauseMgr_c::SELECT_CATEGORY, tab, false); } else { pause->setSelection(dLytPauseMgr_c::SELECT_NONE, 0, false); @@ -1739,8 +1740,7 @@ s32 dLytPauseDisp00_c::updateSelection() { } } if (!dPadNav::isPrevPointerVisible()) { - s32 bounding = navTargetToBounding(target); - if (!mpBoundings[bounding]->IsVisible()) { + if (!mpBoundings[navTargetToBounding(target)]->IsVisible()) { selectionType = dLytPauseMgr_c::SELECT_NONE; id = 0; } @@ -1750,6 +1750,10 @@ s32 dLytPauseDisp00_c::updateSelection() { } } + // TODO: this part needs to be fixed before we can deal with the regswaps. + // Part of the `mpBoundings[navTargetToBounding(target)]->IsVisible()` here is kept around + // until the end of the function where the same call appears. + pAnm = &mAnm[PAUSE_DISP_00_ANIM_ONOFF_TABLET]; for (int i = PAUSE_DISP_00_BOUNDING_TABLETS; i < PAUSE_DISP_00_BOUNDING_HARP; i++) { s32 anim = PAUSE_DISP_00_ANIM_ONOFF_TABLET + i;