Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
These functions load and free JSON assets which are compressed and compiled into the filesystem into RAM. Once decompressed and loaded into RAM, the JSON data is a string that may be parsed for whatever purpose.
For information on asset processing, see assets_preprocessor.
Load JSON files from the filesystem to RAM using loadJson(). JSON strings may be loaded to normal RAM, which is smaller and faster, or SPI RAM, which is larger and slower.
Free when done using freeJson(). If a json is not freed, the memory will leak.
Go to the source code of this file.
Functions | |
char * | loadJson (const char *name, bool spiRam) |
Load a JSON from ROM to RAM. JSONs placed in the assets_image folder before compilation will be automatically flashed to ROM. | |
void | freeJson (char *jsonStr) |
Free an allocated JSON string. | |
char * loadJson | ( | const char * | name, |
bool | spiRam ) |
Load a JSON from ROM to RAM. JSONs placed in the assets_image folder before compilation will be automatically flashed to ROM.
name | The filename of the JSON to load |
spiRam | true to load to SPI RAM, false to load to normal RAM. SPI RAM is more plentiful but slower to access than normal RAM |
void freeJson | ( | char * | jsonStr | ) |
Free an allocated JSON string.
jsonStr | the JSON string to free |