Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
engine_resources.cpp File Reference
#include "engine_resources.h"
#include <Strings/components/utils/io/io.h>
#include "components/settings/config/config.h"

Functions

bool LoadNewResource (std::string file_path, BlamResourceType type, std::string id)
 Loads a new resource into the engine, with an optional ID. More...
 
bool LoadNewResource (std::string file_path, BlamResourceType type)
 Loads a new resource into the engine. More...
 
void ReleaseResource (std::string file_path)
 Releases a resource. More...
 

Variables

std::vector< BlamResourceengine_resources
 

Function Documentation

◆ LoadNewResource() [1/2]

bool LoadNewResource ( std::string  file_path,
BlamResourceType  type 
)

Loads a new resource into the engine.

If an ID is not supplied as a 3rd argument, the file_path is used as the ID instead.

This should ONLY be called from within the #LoadEngineResources function and nowhere else.

Parameters
file_path- The path to the file to load.
type- The type of resource to treat the file as.
Returns
true if the resource was loaded successfully, otherwise returns false.

◆ LoadNewResource() [2/2]

bool LoadNewResource ( std::string  file_path,
BlamResourceType  type,
std::string  id 
)

Loads a new resource into the engine, with an optional ID.

The ID may be used in place of the filename in the various functions used to retrieve or save an engine resource.

This should ONLY be called from within the #LoadEngineResources function and nowhere else.

Parameters
file_path- The path to the file to load.
type- The type of resource to treat the file as.
Returns
true if the resource was loaded successfully, otherwise returns false.

◆ ReleaseResource()

void ReleaseResource ( std::string  file_path)

Releases a resource.

Once a resource is released, it will no longer be usable within the engine. Resources should only be released within the Blam::EngineResources::ReleaseEngineResources() function.

Parameters
file_path- The file path or ID of the resource to release.

Variable Documentation

◆ engine_resources

std::vector<BlamResource> engine_resources