Replace more instances of fill values

This commit is contained in:
Phlosioneer 2019-02-21 23:56:22 -05:00
parent c96f8751cd
commit 199863f21f
5 changed files with 13 additions and 11 deletions

View File

@ -698,7 +698,7 @@ static void ListMenuErasePrintedCursor(struct ListMenu *list, u16 selectedRow)
u8 width = GetMenuCursorDimensionByFont(list->template.fontId, 0); u8 width = GetMenuCursorDimensionByFont(list->template.fontId, 0);
u8 height = GetMenuCursorDimensionByFont(list->template.fontId, 1); u8 height = GetMenuCursorDimensionByFont(list->template.fontId, 1);
FillWindowPixelRect(list->template.windowId, FillWindowPixelRect(list->template.windowId,
(list->template.fillValue << 4) | (list->template.fillValue), PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue),
list->template.cursor_X, list->template.cursor_X,
selectedRow * yMultiplier + list->template.upText_Y, selectedRow * yMultiplier + list->template.upText_Y,
width, width,
@ -806,26 +806,26 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown)
{ {
u16 y, width, height; u16 y, width, height;
ScrollWindow(list->template.windowId, 1, count * yMultiplier, (list->template.fillValue << 4) | (list->template.fillValue)); ScrollWindow(list->template.windowId, 1, count * yMultiplier, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue));
ListMenuPrintEntries(list, list->scrollOffset, 0, count); ListMenuPrintEntries(list, list->scrollOffset, 0, count);
y = (list->template.maxShowed * yMultiplier) + list->template.upText_Y; y = (list->template.maxShowed * yMultiplier) + list->template.upText_Y;
width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8; width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8;
height = (GetWindowAttribute(list->template.windowId, WINDOW_HEIGHT) * 8) - y; height = (GetWindowAttribute(list->template.windowId, WINDOW_HEIGHT) * 8) - y;
FillWindowPixelRect(list->template.windowId, FillWindowPixelRect(list->template.windowId,
(list->template.fillValue << 4) | (list->template.fillValue), PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue),
0, y, width, height); 0, y, width, height);
} }
else else
{ {
u16 width; u16 width;
ScrollWindow(list->template.windowId, 0, count * yMultiplier, (list->template.fillValue << 4) | (list->template.fillValue)); ScrollWindow(list->template.windowId, 0, count * yMultiplier, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue));
ListMenuPrintEntries(list, list->scrollOffset + (list->template.maxShowed - count), list->template.maxShowed - count, count); ListMenuPrintEntries(list, list->scrollOffset + (list->template.maxShowed - count), list->template.maxShowed - count, count);
width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8; width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8;
FillWindowPixelRect(list->template.windowId, FillWindowPixelRect(list->template.windowId,
(list->template.fillValue << 4) | (list->template.fillValue), PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue),
0, 0, width, list->template.upText_Y); 0, 0, width, list->template.upText_Y);
} }
} }

View File

@ -1704,7 +1704,9 @@ static const struct TextColorThing sUnkColorStruct =
static const u8 sFillValues[3] = static const u8 sFillValues[3] =
{ {
0xEE, 0xDD, 0xFF PALETTE_NUM_TO_FILL_VALUE(0xE),
PALETTE_NUM_TO_FILL_VALUE(0xD),
PALETTE_NUM_TO_FILL_VALUE(0xF)
}; };
static const u8 *const sUnkColors[3] = static const u8 *const sUnkColors[3] =

View File

@ -9194,7 +9194,7 @@ static void sub_80D0834(u8 arg0, u8 arg1)
if (species != SPECIES_NONE) if (species != SPECIES_NONE)
{ {
FillWindowPixelRect8Bit(sPSSData->field_2200, FillWindowPixelRect8Bit(sPSSData->field_2200,
0, PALETTE_NUM_TO_FILL_VALUE(0),
24 * arg0, 24 * arg0,
24 * arg1, 24 * arg1,
32, 32,

View File

@ -1724,12 +1724,12 @@ u16 RenderText(struct TextPrinter *textPrinter)
int speed = gWindowVerticalScrollSpeeds[scrollSpeed]; int speed = gWindowVerticalScrollSpeeds[scrollSpeed];
if (textPrinter->scrollDistance < speed) if (textPrinter->scrollDistance < speed)
{ {
ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, textPrinter->printerTemplate.bgColor << 4 | textPrinter->printerTemplate.bgColor); ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance = 0; textPrinter->scrollDistance = 0;
} }
else else
{ {
ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, textPrinter->printerTemplate.bgColor << 4 | textPrinter->printerTemplate.bgColor); ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance -= speed; textPrinter->scrollDistance -= speed;
} }
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); CopyWindowToVram(textPrinter->printerTemplate.windowId, 2);

View File

@ -166,12 +166,12 @@ u16 Font6Func(struct TextPrinter *textPrinter)
{ {
if (textPrinter->scrollDistance < sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]) if (textPrinter->scrollDistance < sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed])
{ {
ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, textPrinter->printerTemplate.bgColor | (textPrinter->printerTemplate.bgColor << 4)); ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance = 0; textPrinter->scrollDistance = 0;
} }
else else
{ {
ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], textPrinter->printerTemplate.bgColor | (textPrinter->printerTemplate.bgColor << 4)); ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor));
textPrinter->scrollDistance -= sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]; textPrinter->scrollDistance -= sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed];
} }
CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); CopyWindowToVram(textPrinter->printerTemplate.windowId, 2);