Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
fs_json.c File Reference

Macros

#define JSON_COMPRESSION
 

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.
 

Macro Definition Documentation

◆ JSON_COMPRESSION

#define JSON_COMPRESSION

Function Documentation

◆ loadJson()

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.

Parameters
nameThe filename of the JSON to load
spiRamtrue to load to SPI RAM, false to load to normal RAM. SPI RAM is more plentiful but slower to access than normal RAM
Returns
A pointer to a null terminated JSON string. May be NULL if the load fails. Must be freed after use

◆ freeJson()

void freeJson ( char * jsonStr)

Free an allocated JSON string.

Parameters
jsonStrthe JSON string to free