update HUD positions in updateOnWide instead of when drawing

this change makes it so positions will properly update when resizing the window, instead of only updating on room load
This commit is contained in:
CraftyBoss
2026-04-04 23:42:00 -07:00
parent 6e6f55f1e4
commit 6ca9017e12
4 changed files with 17 additions and 31 deletions
-27
View File
@@ -565,12 +565,7 @@ void dMeter2Draw_c::exec(u32 i_status) {
mButtonsPosX = g_drawHIO.mMainHUDButtonsPosX;
mButtonsPosY = g_drawHIO.mMainHUDButtonsPosY;
#if TARGET_PC
mpButtonParent->paneTrans(mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMainHUDButtonsPosX),
g_drawHIO.mMainHUDButtonsPosY);
#else
mpButtonParent->paneTrans(g_drawHIO.mMainHUDButtonsPosX, g_drawHIO.mMainHUDButtonsPosY);
#endif
}
if (mButtonsScale != g_drawHIO.mMainHUDButtonsScale) {
@@ -1482,11 +1477,7 @@ void dMeter2Draw_c::drawLife(s16 i_maxLife, s16 i_life, f32 i_posX, f32 i_posY)
mpBigHeart->scale(g_drawHIO.mBigHeartScale, g_drawHIO.mBigHeartScale);
}
#if TARGET_PC
mpLifeParent->paneTrans(mDoGph_gInf_c::ScaleHUDXLeft(i_posX), i_posY);
#else
mpLifeParent->paneTrans(i_posX, i_posY);
#endif
}
void dMeter2Draw_c::setAlphaLifeChange(bool param_0) {
@@ -1600,12 +1591,7 @@ void dMeter2Draw_c::drawKanteraScreen(u8 i_meterType) {
mpMagicBase->resize(field_0x5b4[i_meterType], field_0x5c0[i_meterType]);
mpMagicParent->scale(field_0x5cc[i_meterType], field_0x5d8[i_meterType]);
#if TARGET_PC
mpMagicParent->paneTrans(mDoGph_gInf_c::ScaleHUDXLeft(field_0x5e4[i_meterType]),
field_0x5f0[i_meterType]);
#else
mpMagicParent->paneTrans(field_0x5e4[i_meterType], field_0x5f0[i_meterType]);
#endif
mpKanteraScreen->draw(0.0f, 0.0f, graf_ctx);
}
@@ -1872,11 +1858,7 @@ void dMeter2Draw_c::drawLightDrop(u8 i_num, u8 i_needNum, f32 i_posX, f32 i_posY
mpLightDropParent->scale(mLightDropVesselScale * field_0x6f8,
mLightDropVesselScale * field_0x6f8);
#if TARGET_PC
mpLightDropParent->paneTrans(mDoGph_gInf_c::ScaleHUDXRight(i_posX), i_posY);
#else
mpLightDropParent->paneTrans(i_posX, i_posY);
#endif
}
void dMeter2Draw_c::setAlphaLightDropChange(bool unused) {}
@@ -2024,12 +2006,7 @@ void dMeter2Draw_c::drawRupee(s16 i_rupeeNum) {
mpRupeeKeyParent->scale(g_drawHIO.mRupeeKeyScale * field_0x718,
g_drawHIO.mRupeeKeyScale * field_0x718);
#if TARGET_PC
mpRupeeKeyParent->paneTrans(mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRupeeKeyPosX),
g_drawHIO.mRupeeKeyPosY);
#else
mpRupeeKeyParent->paneTrans(g_drawHIO.mRupeeKeyPosX, g_drawHIO.mRupeeKeyPosY);
#endif
mpRupeeParent[0]->scale(g_drawHIO.mRupeeScale, g_drawHIO.mRupeeScale);
mpRupeeParent[0]->paneTrans(g_drawHIO.mRupeePosX, g_drawHIO.mRupeePosY);
@@ -2611,11 +2588,7 @@ void dMeter2Draw_c::drawButtonCross(f32 i_posX, f32 i_posY) {
mpTextI->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale);
mpTextM->scale(g_drawHIO.mButtonCrossTextScale, g_drawHIO.mButtonCrossTextScale);
#if TARGET_PC
mpButtonCrossParent->paneTrans(mDoGph_gInf_c::ScaleHUDXLeft(i_posX), i_posY);
#else
mpButtonCrossParent->paneTrans(i_posX, i_posY);
#endif
}
void dMeter2Draw_c::setAlphaButtonCrossAnimeMin() {
+4
View File
@@ -1868,12 +1868,16 @@ f32 dMeter2Info_getWide2DPosX(f32* param_0) {
}
void dMeter2Info_onWide2D() {
#if !TARGET_PC
g_ringHIO.updateOnWide();
#endif
g_drawHIO.updateOnWide();
}
void dMeter2Info_offWide2D() {
#if !TARGET_PC
g_ringHIO.updateOffWide();
#endif
g_drawHIO.updateOffWide();
}
#endif
+12 -1
View File
@@ -2287,7 +2287,18 @@ dMeter_drawHIO_c::dMeter_drawHIO_c() {
}
#if WIDESCREEN_SUPPORT
void dMeter_drawHIO_c::updateOnWide() {}
void dMeter_drawHIO_c::updateOnWide() {
#if TARGET_PC
g_drawHIO = {}; // this might be a bad idea
g_drawHIO.mMainHUDButtonsPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mMainHUDButtonsPosX);
g_drawHIO.mRupeeKeyPosX = mDoGph_gInf_c::ScaleHUDXRight(g_drawHIO.mRupeeKeyPosX);
g_drawHIO.mButtonCrossOFFPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mButtonCrossOFFPosX);
g_drawHIO.mButtonCrossONPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mButtonCrossONPosX);
g_drawHIO.mLifeGaugePosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mLifeGaugePosX);
g_drawHIO.mLanternMeterPosX = mDoGph_gInf_c::ScaleHUDXLeft(g_drawHIO.mLanternMeterPosX);
#endif
}
void dMeter_drawHIO_c::updateOffWide() {}
#endif
+1 -3
View File
@@ -593,6 +593,7 @@ void mDoGph_gInf_c::onWide(f32 width, f32 height) {
pc_tvSize.width = width;
pc_tvSize.height = height;
setTvSize();
dMeter2Info_onWide2D();
}
#else
void mDoGph_gInf_c::onWide() {
@@ -605,10 +606,7 @@ void mDoGph_gInf_c::onWide() {
void mDoGph_gInf_c::offWide() {
mWide = FALSE;
setTvSize();
#if !TARGET_PC
dMeter2Info_offWide2D();
#endif
}
void mDoGph_gInf_c::onWideZoom() {