Embed the arrow cursor bitmap from a PNG source

This commit is contained in:
Rachel 2025-09-07 00:13:28 -07:00
parent 79277693f1
commit 726124a94c
5 changed files with 13 additions and 69 deletions

View File

@ -177,6 +177,7 @@ main = executable('main',
c_consts_generators,
naix_headers,
h_headers,
embed_headers,
],
c_args: [
pokeplatinum_args,

BIN
res/fonts/arrow_cursor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

View File

@ -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]

View File

@ -1,6 +1,7 @@
nitrofs_files = []
naix_headers = []
h_headers = []
embed_headers = []
### PREBUILT FILES ###
subdir('prebuilt')

View File

@ -1,8 +1,5 @@
#include "menu.h"
#include <nitro.h>
#include <string.h>
#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)
{