From 250853a37b624299991fd0a1d99cb50a24b0e280 Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:25:07 +0100 Subject: [PATCH 1/2] consolidate down arrow tiles --- graphics/fonts/down_arrow.png | Bin 162 -> 0 bytes graphics/fonts/down_arrow_2.png | Bin 150 -> 0 bytes graphics/fonts/down_arrow_RS.png | Bin 163 -> 0 bytes graphics/fonts/down_arrow_RS_2.png | Bin 150 -> 0 bytes graphics/fonts/down_arrows.png | Bin 0 -> 237 bytes src/text.c | 11 +++++------ 6 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 graphics/fonts/down_arrow.png delete mode 100644 graphics/fonts/down_arrow_2.png delete mode 100644 graphics/fonts/down_arrow_RS.png delete mode 100644 graphics/fonts/down_arrow_RS_2.png create mode 100644 graphics/fonts/down_arrows.png diff --git a/graphics/fonts/down_arrow.png b/graphics/fonts/down_arrow.png deleted file mode 100644 index e74ed47efdbcb85cbb345ba89a678011020a147b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^4nWMo!VDyL`#gCAqznRlLR|lYK~hrE)vITpad7Ibngs4u(cyJ60_RR<9o-MvO;A rKWK$8c0Ue0!6J5ir2xkQ5x!Q2XY2V-*1IXifXwoA^>bP0l+XkK=*%;M diff --git a/graphics/fonts/down_arrow_2.png b/graphics/fonts/down_arrow_2.png deleted file mode 100644 index aefcf4f0845cf89ef07fbacbf1b4b5e9136dd81e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 150 zcmeAS@N?(olHy`uVBq!ia0vp^4nWMo!VDyL`#gCAqznRlLR|lYK~hrE)vITpad7IiZ1BmE-7>B@D|#W2Q)KU^Z#p e!KlZ~rpUn1Qq8!tabC`QkbX~BKbLh*2~7Z(OfP-_ diff --git a/graphics/fonts/down_arrow_RS.png b/graphics/fonts/down_arrow_RS.png deleted file mode 100644 index c0aae894f79ab93e51999d0d81b3dbf504f9e59a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 163 zcmeAS@N?(olHy`uVBq!ia0vp^4nWMo!VDyL`#gCAqznRlLR|lYK~hrE)vITpad7Ibnf>24ka|9qZ%IiaC>ra)J4G1H8BOH3v+S~~=H eNIx)25MW|pxyCYA^R43wkbX~BKbLh*2~7a3E-&2x diff --git a/graphics/fonts/down_arrows.png b/graphics/fonts/down_arrows.png new file mode 100644 index 0000000000000000000000000000000000000000..b89fa6bfe9bbb0eec03ff8bfc984610c004f8b7f GIT binary patch literal 237 zcmeAS@N?(olHy`uVBq!ia0vp^4L~fw!3-o{wzcm9QjEnx?oJHr&dIz4ats1|LR|lY zK~hrE)vITpad749h@rwT1``V3do(mj>UU(K?s4bo_aYy~jxBs%fW?J7>VtH$t RyyzClC7!N+F6*2UngEj^U!wp3 literal 0 HcmV?d00001 diff --git a/src/text.c b/src/text.c index b2dcff3b5a..6bc9e9f8e6 100644 --- a/src/text.c +++ b/src/text.c @@ -10,6 +10,8 @@ #define CURSOR_DELAY 8 +#define DARK_DOWN_ARROW_OFFSET 256 + extern const struct OamData gOamData_AffineOff_ObjNormal_16x16; static void DecompressGlyph_NormalCopy1(u16 glyphId, bool32 isJapanese); @@ -26,10 +28,7 @@ static void SpriteCB_TextCursor(struct Sprite *sprite); COMMON_DATA TextFlags gTextFlags = {0}; -static const u8 sDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow.4bpp"); -static const u8 sDarkDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow_RS.4bpp"); -static const u8 sTinyArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow_2.4bpp"); -static const u8 sTinyDarkDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrow_RS_2.4bpp"); +static const u8 sDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrows.4bpp"); static const u8 sDoubleArrowTiles1[] = INCBIN_U8("graphics/fonts/down_arrow_3.4bpp"); static const u8 sDoubleArrowTiles2[] = INCBIN_U8("graphics/fonts/down_arrow_4.4bpp"); @@ -497,7 +496,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter) arrowTiles = sDownArrowTiles; break; case 1: - arrowTiles = sDarkDownArrowTiles; + arrowTiles = &sDownArrowTiles[DARK_DOWN_ARROW_OFFSET]; break; } @@ -605,7 +604,7 @@ void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *c arrowTiles = sDownArrowTiles; break; case 1: - arrowTiles = sDarkDownArrowTiles; + arrowTiles = &sDownArrowTiles[DARK_DOWN_ARROW_OFFSET]; break; } From 4ca46860f42a682914172e65e262fb4dc682ea93 Mon Sep 17 00:00:00 2001 From: cawtds <38510667+cawtds@users.noreply.github.com> Date: Tue, 7 Jan 2025 18:27:11 +0100 Subject: [PATCH 2/2] formatting --- src/text.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/text.c b/src/text.c index 6bc9e9f8e6..baaefe2e6a 100644 --- a/src/text.c +++ b/src/text.c @@ -28,9 +28,9 @@ static void SpriteCB_TextCursor(struct Sprite *sprite); COMMON_DATA TextFlags gTextFlags = {0}; -static const u8 sDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrows.4bpp"); -static const u8 sDoubleArrowTiles1[] = INCBIN_U8("graphics/fonts/down_arrow_3.4bpp"); -static const u8 sDoubleArrowTiles2[] = INCBIN_U8("graphics/fonts/down_arrow_4.4bpp"); +static const u8 sDownArrowTiles[] = INCBIN_U8("graphics/fonts/down_arrows.4bpp"); +static const u8 sDoubleArrowTiles1[] = INCBIN_U8("graphics/fonts/down_arrow_3.4bpp"); +static const u8 sDoubleArrowTiles2[] = INCBIN_U8("graphics/fonts/down_arrow_4.4bpp"); static const u8 sDownArrowYCoords[] = { 0, 16, 32, 16 }; static const u8 sWindowVerticalScrollSpeeds[] = {