From ead2aed9651cff11d637057576c9859fed4cab10 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 22 Feb 2022 21:50:45 +1000 Subject: [PATCH] Improve mismatch of hudmsgRenderMissionTimer --- src/game/hudmsg.c | 69 ++++++++++++++++++++------------------- src/include/game/hudmsg.h | 2 +- 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/game/hudmsg.c b/src/game/hudmsg.c index 85fa42f85..d501f456f 100644 --- a/src/game/hudmsg.c +++ b/src/game/hudmsg.c @@ -351,39 +351,38 @@ glabel hudmsgRenderMissionTimer /* f0dd2a8: 00000000 */ nop ); -//Gfx *hudmsgRenderMissionTimer(Gfx *gdl, u32 arg1) +// Mismatch: Regalloc. Seems like something's optimised out before PLAYERCOUNT(). +//Gfx *hudmsgRenderMissionTimer(Gfx *gdl, u32 alpha) //{ -// s32 sp8c; -// s32 sp88; -// s32 sp84; -// s32 sp80; -// char buffer[24]; -// u32 textcolour; -// u32 alpha; -// s32 viewy; -// s32 playernum; -// s16 top; +// s32 x; // 8c +// s32 y; // 88 +// s32 viewleft; // 84 +// s32 timery; // 80 +// char buffer[24]; // 68 +// u32 textcolour; // 64 +// s32 viewheight; // s32 playercount; +// s32 playernum; // 58 +// s16 viewtop; // 56 // -// sp84 = viGetViewLeft() / g_ScaleX; -// top = viGetViewTop(); -// viewy = viGetViewHeight(); +// textcolour = alpha; +// +// viewleft = viGetViewLeft() / g_ScaleX; +// viewtop = viGetViewTop(); +// viewheight = viGetViewHeight(); // playercount = PLAYERCOUNT(); // playernum = g_Vars.currentplayernum; // -// sp80 = (top + viewy) - g_HudPaddingY; -// sp80 -= 8; +// timery = viewtop + viewheight - g_HudPaddingY - 8; // // // fe0 -// if ((IS4MB() || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) -// && countdownTimerIsVisible()) { -// sp80 -= 8; +// if ((IS4MB() || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL) && countdownTimerIsVisible()) { +// timery -= 8; // } // // // 054 -// if ((IS4MB() || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || playercount >= 3) -// && hudmsgIsZoomRangeVisible()) { -// sp80 -= 8; +// if ((IS4MB() || optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || playercount >= 3) && hudmsgIsZoomRangeVisible()) { +// timery -= 8; // } // // // 0d8 @@ -391,21 +390,21 @@ glabel hudmsgRenderMissionTimer // // 0e4 // if (IS4MB() || (optionsGetScreenSplit() != SCREENSPLIT_VERTICAL && playernum == 0)) { // // 118 -// sp80 += 10; +// timery += 10; // } else { // // 120 -// sp80 += 2; +// timery += 2; // } // } else /*128*/ if (playercount >= 3) { // if (playernum < 2) { -// sp80 += 10; +// timery += 10; // } else { -// sp80 += 2; +// timery += 2; // } // } else { // // 150 // if (optionsGetEffectiveScreenSize() != SCREENSIZE_FULL) { -// sp80 += 8; +// timery += 8; // } // } // @@ -414,21 +413,23 @@ glabel hudmsgRenderMissionTimer // // screen, move the timer left a bit as the safe zone doesn't need to be // // considered. // if (playercount == 2 && (optionsGetScreenSplit() == SCREENSPLIT_VERTICAL || IS4MB()) && playernum == 1) { -// sp84 -= 14; +// viewleft -= 14; // } else if (playercount >= 3 && (playernum & 1) == 1) { -// sp84 -= 14; +// viewleft -= 14; // } // // // 1e0 -// sp8c = sp84 + g_HudPaddingX + 3; -// -// alpha = (arg1 * 160) / 255; -// textcolour = alpha | 0x00ff0000; +// textcolour = (textcolour * 160 / 255) | 0x00ff0000; // // // 208 // formatTime(buffer, playerGetMissionTime(), TIMEPRECISION_HUNDREDTHS); // -// return textRender(gdl, &sp8c, &sp88, buffer, g_CharsNumeric, g_FontNumeric, textcolour, 0x000000a0, viGetWidth(), viGetHeight(), 0, 0); +// x = viewleft + g_HudPaddingX + 3; +// y = timery; +// +// gdl = textRender(gdl, &x, &y, buffer, g_CharsNumeric, g_FontNumeric, textcolour, 0x000000a0, viGetWidth(), viGetHeight(), 0, 0); +// +// return gdl; //} const char var7f1ade80[] = "%s%s%4.2fX"; diff --git a/src/include/game/hudmsg.h b/src/include/game/hudmsg.h index c7d310f2c..17236676e 100644 --- a/src/include/game/hudmsg.h +++ b/src/include/game/hudmsg.h @@ -6,7 +6,7 @@ u8 hudmsgsAreActive(void); s32 hudmsgIsZoomRangeVisible(void); -Gfx *hudmsgRenderMissionTimer(Gfx *gdl, u32 arg1); +Gfx *hudmsgRenderMissionTimer(Gfx *gdl, u32 alpha); Gfx *hudmsgRenderZoomRange(Gfx *gdl, s32 arg1); Gfx *hudmsgRenderBox(Gfx *gdl, s32 x1, s32 y1, s32 x2, s32 y2, f32 bgopacity, u32 bordercolour, f32 textopacity); s32 func0f0ddb1c(s32 *arg0, s32 arg1);