Spellforce-Spell-framework
Loading...
Searching...
No Matches
Loading Screen JSON Loader

Parses screens.json into ScreenEntry records. More...

Classes

struct  ScreenEntry
 One "map name -> loading screen mesh" pair. More...

Macros

#define JSMN_STATIC
#define JSMN_PARENT_LINKS
#define SCREEN_MAP_NAME_LEN   128
#define SCREEN_MSB_NAME_LEN   128

Functions

bool parse_screens_json_file (const char *path, ScreenEntry *out_entries, int max_entries, int *out_count)
 Reads a screens.json: a single object of map_name : msb_file pairs.

Detailed Description

Parses screens.json into ScreenEntry records.

Parsing only - discovery, validation and lookup belong to the Loading Screen Module (sf_screens_module.h), which owns the entries this fills in.

Macro Definition Documentation

◆ JSMN_PARENT_LINKS

#define JSMN_PARENT_LINKS

Definition at line 16 of file sf_screens_loader.c.

◆ JSMN_STATIC

#define JSMN_STATIC

Definition at line 15 of file sf_screens_loader.c.

◆ SCREEN_MAP_NAME_LEN

#define SCREEN_MAP_NAME_LEN   128

Definition at line 19 of file sf_screens_loader.h.

◆ SCREEN_MSB_NAME_LEN

#define SCREEN_MSB_NAME_LEN   128

Definition at line 20 of file sf_screens_loader.h.

Function Documentation

◆ parse_screens_json_file()

bool parse_screens_json_file ( const char * path,
ScreenEntry * out_entries,
int max_entries,
int * out_count )

Reads a screens.json: a single object of map_name : msb_file pairs.

Parameters
pathFull path to the file.
out_entriesCaller owned array, filled up to max_entries.
max_entriesCapacity of out_entries.
out_countNumber of entries written.
Returns
false when the file is unreadable or is not a flat JSON object.

Definition at line 73 of file sf_screens_loader.c.

Here is the call graph for this function:
Here is the caller graph for this function: