Eliminate struct TextColor definition and use

This commit is contained in:
PikalaxALT
2019-08-26 14:54:33 -04:00
parent 634fe80e9d
commit 738dac67fc
23 changed files with 320 additions and 343 deletions
+12 -16
View File
@@ -41,12 +41,8 @@ static void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLef
static void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum);
static u8 MultichoiceGrid_MoveCursor(s8 deltaX, s8 deltaY);
static const struct TextColor gUnknown_8456618 =
{
.fgColor = 15,
.bgColor = 1,
.shadowColor = 2,
};
static const u8 gUnknown_8456618[3] =
{15, 1, 2};
void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum)
{
@@ -205,7 +201,7 @@ void TopBarWindowPrintString(const u8 *string, u8 unused, bool8 copyToVram)
PutWindowTilemap(sTopBarWindowId);
FillWindowPixelBuffer(sTopBarWindowId, PIXEL_FILL(15));
width = GetStringWidth(0, string, 0);
AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, &gUnknown_8456618, 0, string);
AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, gUnknown_8456618, 0, string);
if (copyToVram)
CopyWindowToVram(sTopBarWindowId, 3);
}
@@ -213,22 +209,22 @@ void TopBarWindowPrintString(const u8 *string, u8 unused, bool8 copyToVram)
void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgColorChooser, u8 unused, bool8 copyToVram)
{
struct TextColor color;
u8 color[3];
s32 fgColor, width;
if ( sTopBarWindowId != 0xFF )
{
if (fgColorChooser)
{
color.fgColor = 0;
color.bgColor = 1;
color.shadowColor = 2;
color[0] = 0;
color[1] = 1;
color[2] = 2;
}
else
{
color.fgColor = 15;
color.bgColor = 1;
color.shadowColor = 2;
color[0] = 15;
color[1] = 1;
color[2] = 2;
}
PutWindowTilemap(sTopBarWindowId);
@@ -236,9 +232,9 @@ void TopBarWindowPrintTwoStrings(const u8 *string, const u8 *string2, bool8 fgCo
if (string2)
{
width = GetStringWidth(0, string2, 0);
AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, &color, 0, string2);
AddTextPrinterParameterized3(sTopBarWindowId, 0, -20 - width, 1, color, 0, string2);
}
AddTextPrinterParameterized4(sTopBarWindowId, 1, 4, 1, 0, 0, &color, 0, string);
AddTextPrinterParameterized4(sTopBarWindowId, 1, 4, 1, 0, 0, color, 0, string);
if (copyToVram)
CopyWindowToVram(sTopBarWindowId, 3);
}