add_folder(char* name);
add_resource(char* name);
Adds a folder path or a .WRS resource file, like the PATH and RESOURCE statement.
Parameters:
name - char* or STRING*, folder path, resource file, or resource
buffer.
Remarks:
- Files for the media player, or DLL files can not be loaded from the
folder or resource path. However they can be contained in a resource and decompressed
at run time by file_cpy.
- A resource file does not consume memory. Only when a file is read out of
a resource, memory is allocated.
-
add_resource also accepts a buffer with the content of a resource
file as argument. This way, resource files can be read by user functions or
wrapped together with the executable. The engine detects automatically whether
a file name or a resource buffer is used. The user is responsible for freeing
the buffer at the end of the application.
-
A maximum of 32 folders and resources can be added. A7.08 Resources in the work folder are added automatically. All added folders, resources, and buffers are removed through the add_new function.
Speed:
medium
Example:
add_folder("c:\\test");
add_resource("test.wrs");
...
char* buffer = file_load("test2.wrs",NULL,NULL);
add_resource(buffer);
...
free(buffer);
sys_exit(NULL);
See also:
PATH, RESOURCE,
add_buffer, add_new
► latest
version online