add_buffer(char* name,void* buffer,long size)

Adds a named buffer to the engine file system. If the engine afterwards attempts to open a file with the given name, it reads out of the buffer rather than loading the file from the hard disk. This allows to add a user defined file resource system in an external language.

Parameters:

name - file name (max. 31 characters).
buffer - pointer to the buffer with the file content, or NULL for removing the buffer from the file system.
size - size of the buffer in bytes

Remarks:

Speed:

medium

Example:

void* pTerrain = file_load("terrain.hmp",NULL,&size);
add_buffer("terrain1.hmp",pTerrain,size);

See also:

add_folder, add_new

► latest version online