From 726124a94c0b6cc3540afe590ff2e0a7d1de3c2f Mon Sep 17 00:00:00 2001 From: Rachel Date: Sun, 7 Sep 2025 00:13:28 -0700 Subject: [PATCH] Embed the arrow cursor bitmap from a PNG source --- meson.build | 1 + res/fonts/arrow_cursor.png | Bin 0 -> 162 bytes res/fonts/meson.build | 10 ++++++ res/meson.build | 1 + src/menu.c | 70 +------------------------------------ 5 files changed, 13 insertions(+), 69 deletions(-) create mode 100644 res/fonts/arrow_cursor.png diff --git a/meson.build b/meson.build index 3444446073..a82c67297c 100644 --- a/meson.build +++ b/meson.build @@ -177,6 +177,7 @@ main = executable('main', c_consts_generators, naix_headers, h_headers, + embed_headers, ], c_args: [ pokeplatinum_args, diff --git a/res/fonts/arrow_cursor.png b/res/fonts/arrow_cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..dbad8ea37426e1072026c1984ca6426f6a1ef6a2 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^96&6ZRaQU(D&A+B?dW<^B>t=YTxor1vs zHG4I$O3ZoJ%~1TmdhfgcQ}+J9_Y9~I4*viDe_e-l1(2`n>Eal|F*Etc|Nr*P%rgX- z1e<;-IB~deylUo96j;b2#9TPl;gy5e6o;;j3=HjO1td)`uBrkV=CL BHH`oO literal 0 HcmV?d00001 diff --git a/res/fonts/meson.build b/res/fonts/meson.build index 9f91f1b0ba..65e4df4845 100644 --- a/res/fonts/meson.build +++ b/res/fonts/meson.build @@ -109,5 +109,15 @@ pl_font_narc = custom_target('pl_font.narc', ], ) +arrow_cursor_embed = custom_target('arrow_cursor.4bpp.h', + output: [ + 'arrow_cursor.4bpp', + 'arrow_cursor.4bpp.h', + ], + input: files('arrow_cursor.png'), + command: [ nitrogfx_exe, '@INPUT@', '@OUTPUT0@', '-embed', 'sArrowCursorBitmap' ], +) + nitrofs_files += pl_font_narc naix_headers += pl_font_narc[1] +embed_headers += arrow_cursor_embed[1] diff --git a/res/meson.build b/res/meson.build index 504393fc54..e420cc0f70 100644 --- a/res/meson.build +++ b/res/meson.build @@ -1,6 +1,7 @@ nitrofs_files = [] naix_headers = [] h_headers = [] +embed_headers = [] ### PREBUILT FILES ### subdir('prebuilt') diff --git a/src/menu.c b/src/menu.c index d3fdd26667..c48128dfa7 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1,8 +1,5 @@ #include "menu.h" -#include -#include - #include "bg_window.h" #include "colored_arrow.h" #include "font.h" @@ -410,72 +407,7 @@ void Menu_DestroyForExit(Menu *menu, u32 heapID) Menu_Free(menu, NULL); } -static const u8 sArrowCursorBitmap[] = { - 0xff, - 0xff, - 0xff, - 0x0, - 0xff, - 0xff, - 0xff, - 0x0, - 0x21, - 0xff, - 0xff, - 0x0, - 0x11, - 0xf2, - 0xff, - 0x0, - 0x11, - 0x21, - 0xff, - 0x0, - 0x11, - 0x11, - 0xf2, - 0x0, - 0x11, - 0x11, - 0x21, - 0x0, - 0x11, - 0x11, - 0x22, - 0x0, - 0x11, - 0x21, - 0xf2, - 0x0, - 0x11, - 0x22, - 0xff, - 0x0, - 0x21, - 0xf2, - 0xff, - 0x0, - 0x22, - 0xff, - 0xff, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0, - 0x0 -}; +#include "res/fonts/arrow_cursor.4bpp.h" void Window_DrawMenuCursor(Window *window, u32 x, u32 y) {