summaryrefslogtreecommitdiff
path: root/src/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/text.c b/src/text.c
index c2f78276b..dbf74ab61 100644
--- a/src/text.c
+++ b/src/text.c
@@ -2003,7 +2003,7 @@ void Text_InitWindow8002E4C(struct Window *win, const u8 *text, u16 tileDataStar
if (a6)
val = 255;
win->win_field_F = val;
- if (val)
+ if (win->win_field_F)
ClipLeft(win);
}
@@ -3394,7 +3394,7 @@ static u16 GetBlankTileNum(struct Window *win)
return retVal;
}
-static s32 sub_80048D8(struct Window *win, u8 x, u8 y)
+static s32 Window_MoveCursor(struct Window *win, u8 x, u8 y)
{
win->cursorX = x;
win->cursorY = y & 0xF8;
@@ -3672,25 +3672,26 @@ u8 Text_InitWindow8004D04(struct Window *win, const u8 *text, u16 tileDataStartO
return Text_PrintWindow8002F44(win);
}
-u8 Text_InitWindow8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top)
+u8 Text_InitWindow_RightAligned(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 right, u8 top)
{
u8 width = GetStringWidth(win, text);
- Text_InitWindow(win, text, tileDataStartOffset, left - ((u32)(width + 7) >> 3), top);
+ Text_InitWindow(win, text, tileDataStartOffset, right - ((u32)(width + 7) >> 3), top);
EraseAtCursor(win);
width &= 7;
if (width)
width = 8 - width;
- sub_80048D8(win, width, 0);
+ Window_MoveCursor(win, width, 0);
return Text_PrintWindow8002F44(win);
}
-u8 Text_InitWindow8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6)
+u8 Text_InitWindow_Centered(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 width)
{
- register u32 val asm("r5") = (u8)((a6 >> 1) - (GetStringWidth(win, text) >> 1));
- left += (val >> 3);
+ width = (u8)(width / 2 - GetStringWidth(win, text) / 2);
+ left += (u8)width / 8;
Text_InitWindow(win, text, tileDataStartOffset, left, top);
EraseAtCursor(win);
- sub_80048D8(win, val & 7, 0);
+ width &= 7;
+ Window_MoveCursor(win, width, 0);
return Text_PrintWindow8002F44(win);
}