Replace magic constants derived from framebuffer size (#3144)

This commit is contained in:
Max Roncace
2026-04-11 02:43:37 -04:00
committed by GitHub
parent dabd6961a6
commit d7c34741e2
20 changed files with 111 additions and 92 deletions
+12 -12
View File
@@ -227,17 +227,17 @@ dMenu_Fmap_c::dMenu_Fmap_c(JKRExpHeap* i_heap, STControl* i_stick, CSTControl* i
}
if (i_panDirection == 1) {
mTransX = -608.0f;
mTransX = -FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (i_panDirection == 3) {
mTransX = 608.0f;
mTransX = FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (i_panDirection == 2) {
mTransX = 0.0f;
mTransY = -448.0f;
mTransY = -FB_HEIGHT_BASE;
} else if (i_panDirection == 0) {
mTransX = 0.0f;
mTransY = 448.0f;
mTransY = FB_HEIGHT_BASE;
} else {
mTransX = 0.0f;
mTransY = 0.0f;
@@ -1703,17 +1703,17 @@ bool dMenu_Fmap_c::isOpen() {
f32 ratio = (f32)mDisplayFrame / (f32)display_frame_num;
if (mPanDirection == 1) {
mTransX = (1.0f - ratio) * -608.0f;
mTransX = (1.0f - ratio) * -FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 3) {
mTransX = (1.0f - ratio) * 608.0f;
mTransX = (1.0f - ratio) * FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 2) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * -448.0f;
mTransY = (1.0f - ratio) * -FB_HEIGHT_BASE;
} else if (mPanDirection == 0) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * 448.0f;
mTransY = (1.0f - ratio) * FB_HEIGHT_BASE;
}
mAlphaRatio = ratio;
@@ -1753,17 +1753,17 @@ bool dMenu_Fmap_c::isClose() {
}
if (mPanDirection == 1) {
mTransX = (1.0f - ratio) * 608.0f;
mTransX = (1.0f - ratio) * FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 3) {
mTransX = (1.0f - ratio) * -608.0f;
mTransX = (1.0f - ratio) * -FB_WIDTH_BASE;
mTransY = 0.0f;
} else if (mPanDirection == 2) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * 448.0f;
mTransY = (1.0f - ratio) * FB_HEIGHT_BASE;
} else if (mPanDirection == 0) {
mTransX = 0.0f;
mTransY = (1.0f - ratio) * -448.0f;
mTransY = (1.0f - ratio) * -FB_HEIGHT_BASE;
}
mAlphaRatio = ratio;