Isle
Loading...
Searching...
No Matches
modeldb.cpp File Reference
#include "modeldb.h"
Include dependency graph for modeldb.cpp:

Go to the source code of this file.

Functions

MxResult ReadModelDbWorlds (FILE *p_file, ModelDbWorld *&p_worlds, MxS32 &p_numWorlds)
 [AI] Reads the collection of worlds (ModelDbWorld) from a model database file. More...
 
void FreeModelDbWorlds (ModelDbWorld *&p_worlds, MxS32 p_numWorlds)
 [AI] Frees all resources related to ModelDbWorlds previously allocated by ReadModelDbWorlds. More...
 

Function Documentation

◆ FreeModelDbWorlds()

void FreeModelDbWorlds ( ModelDbWorld *&  p_worlds,
MxS32  p_numWorlds 
)

[AI] Frees all resources related to ModelDbWorlds previously allocated by ReadModelDbWorlds.

[AI] Deallocates all world names, part lists/parts, model presenter/model names, and the worlds array itself.

Parameters
p_worldsReference to worlds array pointer, which is set to NULL after deletion. [AI]
p_numWorldsNumber of worlds in the array, needed for cleanup. [AI]

Definition at line 149 of file modeldb.cpp.

◆ ReadModelDbWorlds()

MxResult ReadModelDbWorlds ( FILE *  p_file,
ModelDbWorld *&  p_worlds,
MxS32 p_numWorlds 
)

[AI] Reads the collection of worlds (ModelDbWorld) from a model database file.

[AI] Allocates and loads the specified number of worlds, each containing their names, part lists, and models. Populates p_worlds and p_numWorlds accordingly. The caller is responsible for freeing with FreeModelDbWorlds.

Parameters
p_fileThe file pointer to read from. [AI]
p_worldsReference to pointer where the array of worlds will be stored. [AI]
p_numWorldsReference to int to store the number of worlds read. [AI]
Returns
SUCCESS on successful load, FAILURE on error. [AI]

Definition at line 90 of file modeldb.cpp.