Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
Node Loader

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.
 

Detailed Description

Functions for loading and saving nodes.

Function Documentation

◆ malloc_node()

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.

Parameters
nodePointer to the node to be allocated and initialized.
nodeTypeThe type of the node to be created.
filePointer to the file from which additional data is read.
cPointer to the camera array to be set up.
scriptsArray of scripts to be initialized.
editorPointer to the editor node.

◆ node_tree_to_file()

void node_tree_to_file ( FILE *  file,
Node node,
Node editor 
)

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.

Parameters
filePointer to the file where the node tree will be written.
nodePointer to the root node of the tree to be written.
editorPointer to the editor node to be included in the output.