stb_image (vendored with raylib) decodes referenced Picture() files at compile time; decoded RGBA8 goes in as kind 0 and renders through texture_rgba in every engine. KRAW stays for hand-made raw pixels; undecodable files (wav/ogg/fonts) remain opaque kind 2 blobs for host-side unpacking. Verified: png cartridge renders after the source file is deleted.
11 lines
285 B
C
11 lines
285 B
C
#ifndef K2B_STB_H
|
|
#define K2B_STB_H
|
|
|
|
/* Image decoding for cartridge embedding, on the stb_image vendored with
|
|
* raylib. Returns 0 and fills *rgba (malloc'd, top-down RGBA8 rows) on
|
|
* success. */
|
|
|
|
int k2b_decode_image(const char *file, unsigned char **rgba, int *w, int *h);
|
|
|
|
#endif
|