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 422ed7afc3
commit 3f8bbe7c57
20 changed files with 111 additions and 92 deletions
+8 -5
View File
@@ -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());
}