|
|
PixelBullet
0.0.1
A C++ game engine
|
Manages alias mappings for asset paths. This allows to use short “links” (e.g. @tex) that resolve to full directory paths. More...
#include <Link.hpp>
Public Member Functions | |
| std::string | ResolveAssetPath (const std::string &assetPath) const |
| Resolve an asset path that may begin with an alias (e.g. "@tex/icons/..."). | |
| void | RegisterAssetLink (const std::string &alias, const std::string &path) |
| Register or override an asset link mapping. | |
| void | LoadAssetLinksFromFile (const std::string &filename) |
| Load asset link mappings from a file. | |
Manages alias mappings for asset paths. This allows to use short “links” (e.g. @tex) that resolve to full directory paths.
| void PixelBullet::Link::LoadAssetLinksFromFile | ( | const std::string & | filename | ) |
Load asset link mappings from a file.
| void PixelBullet::Link::RegisterAssetLink | ( | const std::string & | alias, |
| const std::string & | path ) |
Register or override an asset link mapping.
| alias | The alias (without the '@') e.g. "tex" |
| path | The directory path that the alias should map to (e.g. "assets/textures"). |
| std::string PixelBullet::Link::ResolveAssetPath | ( | const std::string & | assetPath | ) | const |
Resolve an asset path that may begin with an alias (e.g. "@tex/icons/...").
If the path starts with '@', it is expected to be in the format: "@alias/some/path" The alias is looked up in the mapping table, and if found, replaced with the mapped path.
| assetPath | The asset path (may start with an alias). |