Spellforce-Spell-framework
Loading...
Searching...
No Matches
SFSF Loading Screen Module

Core mod that maps custom maps to custom loading screen meshes. More...

Macros

#define MAX_SCREEN_ENTRIES   128

Functions

void initialize_screens_module ()
 Loads and validates sfsf\screens.json.
const char * find_screen_for_map (const char *map_name)
 Finds the loading screen mesh for a map, or NULL for the default.

Variables

SFModg_screens_mod = NULL
SFModg_screens_mod

Detailed Description

Core mod that maps custom maps to custom loading screen meshes.

Reads sfsf\screens.json, checks that every mesh it names is actually present under mesh\, and answers lookups from the loading screen hook. Owning its own SFMod means a mistyped mesh name shows up in the in-game mod list rather than silently falling back to the vanilla screen.

Macro Definition Documentation

◆ MAX_SCREEN_ENTRIES

#define MAX_SCREEN_ENTRIES   128

Upper bound on custom loading screens.

Definition at line 21 of file sf_screens_module.h.

Function Documentation

◆ find_screen_for_map()

const char * find_screen_for_map ( const char * map_name)

Finds the loading screen mesh for a map, or NULL for the default.

Parameters
map_nameMap path as the engine has it, e.g. "map\\Campaign\\000_Greyfell.map". Path, extension and any leading "NNN_" prefix are stripped before matching, so "000_Greyfell.map" matches "greyfell".

Definition at line 156 of file sf_screens_module.c.

Here is the caller graph for this function:

◆ initialize_screens_module()

void initialize_screens_module ( )

Loads and validates sfsf\screens.json.

Safe to call when the file is absent - custom loading screens are simply disabled. Must run before the first map load.

Definition at line 113 of file sf_screens_module.c.

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

Variable Documentation

◆ g_screens_mod [1/2]

SFMod* g_screens_mod = NULL

The core mod that owns every JSON-defined loading screen.

Definition at line 22 of file sf_screens_module.c.

◆ g_screens_mod [2/2]

SFMod* g_screens_mod
extern

The core mod that owns every JSON-defined loading screen.

Definition at line 22 of file sf_screens_module.c.