Functions for loading and saving nodes. More...
Functions | |
void | malloc_node (Node *node, int nodeType, FILE *file, Camera **c, Script *scripts, Node *editor) |
Allocates memory for a node and initializes it. | |
void | node_tree_to_file (FILE *file, Node *node, Node *editor) |
Writes the node tree to a file. | |
Functions for loading and saving nodes.
void malloc_node | ( | Node * | node, |
int | nodeType, | ||
FILE * | file, | ||
Camera ** | c, | ||
Script * | scripts, | ||
Node * | editor | ||
) |
Allocates memory for a node and initializes it.
This function allocates memory for a node and initializes it based on the provided node type. It also reads additional data from the given file and sets up the camera and scripts.
node | Pointer to the node to be allocated and initialized. |
nodeType | The type of the node to be created. |
file | Pointer to the file from which additional data is read. |
c | Pointer to the camera array to be set up. |
scripts | Array of scripts to be initialized. |
editor | Pointer to the editor node. |
Writes the node tree to a file.
This function traverses the node tree and writes its structure and data to the specified file. It includes the editor node in the output.
file | Pointer to the file where the node tree will be written. |
node | Pointer to the root node of the tree to be written. |
editor | Pointer to the editor node to be included in the output. |