mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-15 19:19:58 -04:00
runtime/menu_assets.c reads them from the user's RomFS at runtime (nothing is shipped): .zs files with the dictionaries of Pack/ZsDic.pack.zs (streamed when a frame does not say its size), the fonts of Font2/Scalable behind their 8-byte header and per-word XOR key, and BNTX textures (Switch 2 archives say "Ounc" where Switch ones say "NX ") through the runtime's block-linear copy and BC4 and ASTC decoders. ui/menu_art.cpp decodes the shared interface archive on a worker at the first present and uploads each texture for Dear ImGui at its first use. The menu now uses ClarimoUDPE for its text (with a sixth more line height) and CetraDisplayPro for its title and tabs, Roboto merged behind both; umber, brown and gold colours; the game's ornamented frame along the window's edge (the art holds two sides and is drawn again turned for the other two); its cursor glow and line around the selected row (edges only, so the label stays readable); and its control-guide bar under Continue and Quit. Without the files it keeps Roboto and plain shapes. The window's pointer is an original gold arrowhead drawn at start for the system DPI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
20 lines
785 B
C
20 lines
785 B
C
// The game's own interface fonts and textures for the settings menu, read from the user's RomFS (menu_assets.c).
|
|
#pragma once
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// A RomFS file, a .zs one decompressed with the game's dictionaries; malloc'd, NULL when absent or unreadable.
|
|
uint8_t *menu_asset_load(const char *rel, size_t *n);
|
|
// A .bfotf / .bfttf font as plain OpenType / TrueType bytes; malloc'd, NULL when absent or not a font.
|
|
uint8_t *menu_asset_font(const char *rel, size_t *n);
|
|
// Texture `name` of a BNTX archive as RGBA8 (BC4 masks: white, the mask in alpha); 1 with a malloc'd *rgba.
|
|
int menu_asset_texture(const uint8_t *bntx, size_t n, const char *name, uint8_t **rgba, uint32_t *w, uint32_t *h);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|