libdragon
Loading...
Searching...
No Matches
Functions
asset.c File Reference

Functions

void __asset_init_compression_lvl2 (void)
 Initialize compression level 2 (APLIB)
 
void __asset_init_compression_lvl3 (void)
 Initialize compression level 3 (SHRINKLER)
 
int must_open (const char *fn)
 Open a file and assert on error.
 
FILE * must_fopen (const char *fn)
 Open a file as FILE* and assert on error.
 
void * asset_load (const char *fn, int *sz)
 Load an asset file (possibly uncompressing it)
 

Detailed Description

Author
Giovanni Bajo giova.nosp@m.nnib.nosp@m.ajo@g.nosp@m.mail.nosp@m..com

Function Documentation

◆ asset_load()

void * asset_load ( const char *  fn,
int *  sz 
)

Load an asset file (possibly uncompressing it)

This function loads a file from a file system (eg: from ROM or SD). If the file was compressed using the mkasset tool, it will be automatically uncompressed.

Parameters
fnFilename to load (including filesystem prefix, eg: "rom:/foo.dat")
szIf not NULL, this will be filed with the uncompressed size of the loaded file
Returns
void* Pointer to the loaded file (must be freed with free() when done)