diff options
| author | Max Roncace <me@caseif.net> | 2026-04-11 02:43:37 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-10 23:43:37 -0700 |
| commit | d7c34741e23297863254089125ed9ab56617dc5b (patch) | |
| tree | 6165df2b21a161a4349dd9c62440283a1909a9c1 /src/d/d_msg_scrn_explain.cpp | |
| parent | dabd6961a674f23ec0df8f2b4d16ba12e1e090e5 (diff) | |
Replace magic constants derived from framebuffer size (#3144)
Diffstat (limited to 'src/d/d_msg_scrn_explain.cpp')
| -rw-r--r-- | src/d/d_msg_scrn_explain.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/d/d_msg_scrn_explain.cpp b/src/d/d_msg_scrn_explain.cpp index 7387b36a6c..d14e193a40 100644 --- a/src/d/d_msg_scrn_explain.cpp +++ b/src/d/d_msg_scrn_explain.cpp @@ -70,7 +70,7 @@ dMsgScrnExplain_c::dMsgScrnExplain_c(STControl* i_stick, u8 param_1, bool i_isUs mpTxScreen = new J2DScreen(); JUT_ASSERT(102, mpTxScreen != NULL); - field_0x48 = 608.0f; + field_0x48 = FB_WIDTH_BASE; if (param_1 == 1 || param_1 == 3) { #if PLATFORM_GCN @@ -306,7 +306,7 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) { } if (mpBackTex != NULL) { - mpBackTex->draw(0.0f, 0.0f, 608.0f, 448.0f, false, false, false); + mpBackTex->draw(0.0f, 0.0f, FB_WIDTH_BASE, FB_HEIGHT_BASE, false, false, false); } if (field_0x66 != 2 && field_0x66 != 3) { @@ -327,6 +327,9 @@ void dMsgScrnExplain_c::draw(J2DOrthoGraph* i_graf) { strcpy(((J2DTextBox*)mpTm_c[0]->getPanePtr())->getStringPtr(), string_buf); if (mpSelect_c != NULL && (field_0x64 == 1 || field_0x64 == 2)) { + // the magic numbers here are relative to the framebuffer size, but were likely + // either chosen by hand or had multiple arithmetic operations applied which + // cannot easily be reverse engineered f32 y_offset = 0.0f; if (field_0x66 == 2) { y_offset = -100.0f; @@ -382,7 +385,7 @@ void dMsgScrnExplain_c::open_request_proc() { void dMsgScrnExplain_c::open_init() { field_0x5a = 0; - field_0x48 = 608.0f; + field_0x48 = FB_WIDTH_BASE; for (int i = 0; i < 2; i++) { mpRoot_c[i]->setAlphaRate(0.0f); } @@ -400,7 +403,7 @@ void dMsgScrnExplain_c::open_proc() { } } - field_0x48 = 608.0f * getAlphaRatio(); + field_0x48 = FB_WIDTH_BASE * getAlphaRatio(); for (int i = 0; i < 2; i++) { mpRoot_c[i]->setAlphaRate(1.0f - getAlphaRatio()); } @@ -580,7 +583,7 @@ void dMsgScrnExplain_c::close_proc() { } } - field_0x48 = 608.0f * getAlphaRatio(); + field_0x48 = FB_WIDTH_BASE * getAlphaRatio(); for (int i = 0; i < 2; i++) { mpRoot_c[i]->setAlphaRate(1.0f - getAlphaRatio()); } |
