From ff3b252e499e6403025e212835cb3a3325e78862 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Mon, 18 Apr 2022 14:53:17 +1000 Subject: [PATCH] jpn-final: Attempt to decompile frRenderHudElement --- src/game/training.c | 48 ++++++++++++++++++++++++++++++++++ src/include/game/game_1531a0.h | 2 ++ src/include/game/training.h | 3 ++- 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/game/training.c b/src/game/training.c index 059bf54e8..f5dca0861 100644 --- a/src/game/training.c +++ b/src/game/training.c @@ -10977,6 +10977,54 @@ glabel frRenderHudElement /* f1a3a24: 03e00008 */ jr $ra /* f1a3a28: 27bd0078 */ addiu $sp,$sp,0x78 ); + +//Gfx *frRenderHudElement(Gfx *gdl, s32 x, s32 y, char *string1, char *string2, char *string3, u32 colour, u8 alpha) +//{ +// s32 textheight; // 74 +// s32 textwidth; // 70 +// s32 x2; // 6c +// s32 y2; // 68 +// +// u32 halfalpha = alpha >> 1; +// u32 fullcolour = (colour & 0xffffff00) | alpha; +// +// textMeasure(&textheight, &textwidth, string1, g_CharsHandelGothicMd, g_FontHandelGothicMd, 0); +// +// x2 = x - (textwidth >> 1); +// y2 = y; +// gdl = func0f153858(gdl, &x2, &y2, &textwidth, &textheight); +// +// gdl = textRender(gdl, &x2, &y2, string1, +// g_CharsHandelGothicMd, g_FontHandelGothicMd, fullcolour, halfalpha, viGetWidth(), viGetHeight(), 0, 0); +// +// if (string2) { +// s32 textheight2; // 5c +// s32 textwidth2; // 58 +// s32 textheight3; // 54 +// s32 textwidth3; // 50 +// +// textMeasure(&textheight2, &textwidth2, string2, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); +// textMeasure(&textheight3, &textwidth3, string3, g_CharsHandelGothicXs, g_FontHandelGothicXs, 0); +// +// textwidth = textwidth2 + textwidth3; +// textheight = textheight3; +// x2 = x - (textwidth >> 1); +// y2 = y + 17; +// +// gdl = func0f153858(gdl, &x2, &y2, &textwidth, &textheight); +// +// gdl = func0f1574d0jf(gdl, &x2, &y2, string2, +// g_CharsHandelGothicXs, g_FontHandelGothicXs, fullcolour, halfalpha, viGetWidth(), viGetHeight(), 0, 0); +// +// x2 -= 4; +// y2 = y + 18; +// +// gdl = func0f1574d0jf(gdl, &x2, &y2, string3, +// g_CharsHandelGothicXs, g_FontHandelGothicXs, fullcolour, halfalpha, viGetWidth(), viGetHeight(), 0, 0); +// } +// +// return gdl; +//} #else Gfx *frRenderHudElement(Gfx *gdl, s32 x, s32 y, char *string1, char *string2, u32 colour, u8 alpha) { diff --git a/src/include/game/game_1531a0.h b/src/include/game/game_1531a0.h index 7ba784f7f..5adac3e2e 100644 --- a/src/include/game/game_1531a0.h +++ b/src/include/game/game_1531a0.h @@ -49,4 +49,6 @@ Gfx *textRender(Gfx *gdl, s32 *x, s32 *y, char *text, struct fontchar *font1, st void textMeasure(s32 *textheight, s32 *textwidth, char *text, struct fontchar *font1, struct font *font2, s32 lineheight); void textWrap(s32 width, char *in, char *out, struct fontchar *font1, struct font *font2); +Gfx *func0f1574d0jf(Gfx *gdl, s32 *x, s32 *y, char *text, struct fontchar *font1, struct font *font2, s32 colour, u32 colour2, s32 width, s32 height, s32 arg9, u32 arg10); + #endif diff --git a/src/include/game/training.h b/src/include/game/training.h index ad5b55703..ca28d070a 100644 --- a/src/include/game/training.h +++ b/src/include/game/training.h @@ -118,19 +118,20 @@ void frGetGoalScoreText(char *buffer1, char *buffer2); bool frGetMinAccuracy(char *buffer1, f32 accuracy, char *buffer2); bool frGetHudMiddleSubtext(char *buffer1, char *buffer2); bool frGetFeedback(char *score, char *zone, char *extrabuffer); +Gfx *frRenderHudElement(Gfx *gdl, s32 x, s32 y, char *string1, char *string2, char *string3, u32 colour, u8 alpha); #else void frGetGoalTargetsText(char *buffer); void frGetGoalScoreText(char *buffer); bool frGetMinAccuracy(char *buffer, f32 accuracy); bool frGetHudMiddleSubtext(char *buffer); bool frGetFeedback(char *score, char *zone); +Gfx *frRenderHudElement(Gfx *gdl, s32 x, s32 y, char *string1, char *string2, u32 colour, u8 alpha); #endif void frGetTargetsDestroyedValue(char *buffer); void frGetScoreValue(char *buffer); f32 frGetAccuracy(char *buffer); bool frFormatTime(char *buffer); -Gfx *frRenderHudElement(Gfx *gdl, s32 x, s32 y, char *string1, char *string2, u32 colour, u8 alpha); Gfx *frRenderHud(Gfx *gdl); #endif