P4.3: render seeded board with real gem sprites (sx, iOS sim)
Adopt the modules/ui UIPipeline framework (as the chess reference app does) and replace the P0 placeholder quad with a BoardView (View protocol, modeled on chess/board_view.sx): - background.png fills the screen; an 8x8 cell.png grid is centered in the safe area; each cell's gem is sampled from gems.png by UV column = gem index (0=red .. 5=purple). - Drive it from board.sx seeded with 1337 (the board_init golden's seed), so the on-screen layout matches that snapshot gem-for-gem. main.sx now hosts the view via UIPipeline (Metal on iOS, GL on desktop) and heap-allocates the board/asset state behind pointers (UFCS method calls on a value-typed global mutate a copy, so mutable state must live behind a pointer as the reference app does). Vendor the C deps the UI module's image/font path needs (stb_image, stb_truetype, kb_text_shape, file_utils); their #include "vendors/..." paths resolve relative to the project root. Evidence: ios-sim build links clean; tools/run_tests.sh 11/11 pass; running app captured at goldens/p4_board.png.
This commit is contained in:
13
vendors/file_utils/file_utils.h
vendored
Normal file
13
vendors/file_utils/file_utils.h
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
#ifndef FILE_UTILS_H
|
||||
#define FILE_UTILS_H
|
||||
|
||||
unsigned char* read_file_bytes(const char* path, int* out_size);
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// Install the AAssetManager that `read_file_bytes` consults for paths
|
||||
// rooted inside the APK. Caller is responsible for passing the manager
|
||||
// from `ANativeActivity->assetManager` before any read_file_bytes call.
|
||||
void sx_android_set_asset_manager(void* m);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user