![]() |
Blamite Game Engine - blam!
00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
|
Namespace for things related to game engine resources. More...
Functions | |
BLAM bool | LoadEngineResources () |
Loads all required engine resources. More... | |
BLAM void | ReleaseEngineResources () |
Releases all engine resources. More... | |
BLAM BlamResource | GetResource (std::string file_path) |
Retrieves a resource. More... | |
BLAM BlamResource * | GetResourcePointer (std::string file_path) |
Retrieves a pointer to a resource. More... | |
BLAM bool | SaveResource (std::string file_path) |
Saves a resource back to the disk. More... | |
Namespace for things related to game engine resources.
Engine resources are, in a sense, a form of content - although not entirely. They refer to any sort of data used for the engine itself, rather than for any specific game - for instance, default engine globals, the colormap, UI schemes, engine strings, and engine configuration files.
BlamResource Blam::EngineResources::GetResource | ( | std::string | file_path | ) |
Retrieves a resource.
file_path | - The file path of the resource. This MUST be identical to the path used to load the resource originally. Alternatively, the resource ID can be used instead. |
BlamResource * Blam::EngineResources::GetResourcePointer | ( | std::string | file_path | ) |
Retrieves a pointer to a resource.
The resource actually stores a pointer in the first place, so you generally won't need to use this except for cases where you plan to alter a resource (and do so in such a way that requires changing the resource's size).
file_path | - The file path of the resource. This MUST be identical to the path used to load the resource originally. Alternatively, the resource ID can be used instead. |
nullptr
if no matching resource was found. bool Blam::EngineResources::LoadEngineResources | ( | ) |
Loads all required engine resources.
This function will load any and all engine resources. This should be run before starting up any other engine components, as those components may depend on one or more of these resources. In the past, resources were loaded as part of each component's initialization process. Going forward all data files that the engine needs to utilize should be loaded here - nowhere else.
true
if all resources were loaded without error, otherwise returns false
. Engine initialization should be aborted if this function fails. void Blam::EngineResources::ReleaseEngineResources | ( | ) |
Releases all engine resources.
Just as how LoadEngineResources() is called earliest, this function should be called last. It will release and, thus, invalidate all loaded engine resources.
bool Blam::EngineResources::SaveResource | ( | std::string | file_path | ) |
Saves a resource back to the disk.
If a resource has been modified, this can be used to save the file back to local storage. Otherwise, any changes will be lost at engine shutdown.
file_path | - The file path of the resource. This MUST be identical to the path used to load the resource originally. Alternatively, the resource ID can be used instead. |
true
if the resource was saved successfully, otherwise returns false
.