small cleanup

This commit is contained in:
robojumper
2025-08-09 18:04:48 +02:00
parent 0847c40aa0
commit e08d120f0b
2 changed files with 10 additions and 14 deletions
-8
View File
@@ -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);
+10 -6
View File
@@ -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;