From d70c3a94c58584a809dc90feb3b1a50cc5ca3f07 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Wed, 21 Nov 2018 23:30:04 +0100 Subject: [PATCH] match DecompressGlyphTile nicer --- include/text.h | 2 +- src/text.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/text.h b/include/text.h index 853e93e90..27a6364bb 100644 --- a/include/text.h +++ b/include/text.h @@ -229,7 +229,7 @@ u32 RenderFont(struct TextPrinter *textPrinter); void GenerateFontHalfRowLookupTable(u8 fgColor, u8 bgColor, u8 shadowColor); void SaveTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor); -void DecompressGlyphTile(const u16 *src, void *dest_); +void DecompressGlyphTile(const void *src_, void *dest_); u8 GetLastTextColor(u8 colorType); void CopyGlyphToWindow(struct TextPrinter *x); void ClearTextSpan(struct TextPrinter *textPrinter, u32 width); diff --git a/src/text.c b/src/text.c index 5f86d90d4..1966ffb2c 100644 --- a/src/text.c +++ b/src/text.c @@ -848,17 +848,17 @@ void RestoreTextColors(u8 *fgColor, u8 *bgColor, u8 *shadowColor) GenerateFontHalfRowLookupTable(*fgColor, *bgColor, *shadowColor); } -void DecompressGlyphTile(const u16 *src, void *dest_) +void DecompressGlyphTile(const u16 *src_, void *dest_) { u32 temp; + const u16 *src = src_; u32 *dest = dest_; - temp = *(src); + temp = *(src++); *(dest)++ = ((gFontHalfRowLookupTable[gFontHalfRowOffsets[temp & 0xFF]]) << 16) | (gFontHalfRowLookupTable[gFontHalfRowOffsets[temp >> 8]]); - temp = src[1]; - src += 2; - *(dest)++ = ((gFontHalfRowLookupTable[gFontHalfRowOffsets[temp & 0xFF]]) << 16) | (gFontHalfRowLookupTable[gFontHalfRowOffsets[temp >> 8]]); + temp = *(src++); + *(dest++) = ((gFontHalfRowLookupTable[gFontHalfRowOffsets[temp & 0xFF]]) << 16) | (gFontHalfRowLookupTable[gFontHalfRowOffsets[temp >> 8]]); temp = *(src++); *(dest++) = ((gFontHalfRowLookupTable[gFontHalfRowOffsets[temp & 0xFF]]) << 16) | (gFontHalfRowLookupTable[gFontHalfRowOffsets[temp >> 8]]);