From c96f8751cddf1a203bd5f310683ea35bf9cb8db2 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Thu, 21 Feb 2019 23:27:12 -0500 Subject: Improve window palette macros --- src/text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/text.c') diff --git a/src/text.c b/src/text.c index a439d3ced..c3ae315d0 100644 --- a/src/text.c +++ b/src/text.c @@ -1581,7 +1581,7 @@ u16 RenderText(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentChar++; return 2; case 15: - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, textPrinter->printerTemplate.bgColor | textPrinter->printerTemplate.bgColor << 4); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; return 2; @@ -1702,7 +1702,7 @@ u16 RenderText(struct TextPrinter *textPrinter) case 2: if (TextPrinterWaitWithDownArrow(textPrinter)) { - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, (textPrinter->printerTemplate.bgColor << 4) | textPrinter->printerTemplate.bgColor); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->state = 0; -- cgit v1.2.3 From 199863f21f41b3a51d9a6302ca7c3c2864ee1c17 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Thu, 21 Feb 2019 23:56:22 -0500 Subject: Replace more instances of fill values --- src/text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/text.c') diff --git a/src/text.c b/src/text.c index c3ae315d0..dc28d71c8 100644 --- a/src/text.c +++ b/src/text.c @@ -1724,12 +1724,12 @@ u16 RenderText(struct TextPrinter *textPrinter) int speed = gWindowVerticalScrollSpeeds[scrollSpeed]; 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; } 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; } CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); -- cgit v1.2.3 From 3716da5430a976d05afecdf82f43f14fc2584949 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 2 Mar 2019 17:25:39 -0500 Subject: Rename macro with correct name for pixel values --- src/text.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/text.c') diff --git a/src/text.c b/src/text.c index dc28d71c8..2d286992d 100644 --- a/src/text.c +++ b/src/text.c @@ -1581,7 +1581,7 @@ u16 RenderText(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentChar++; return 2; case 15: - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; return 2; @@ -1702,7 +1702,7 @@ u16 RenderText(struct TextPrinter *textPrinter) case 2: if (TextPrinterWaitWithDownArrow(textPrinter)) { - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->state = 0; @@ -1724,12 +1724,12 @@ u16 RenderText(struct TextPrinter *textPrinter) int speed = gWindowVerticalScrollSpeeds[scrollSpeed]; if (textPrinter->scrollDistance < speed) { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance = 0; } else { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance -= speed; } CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); -- cgit v1.2.3