|
Polyphase Game Engine
|
#include <AssetManager.h>
Public Member Functions | |
| ~AssetManager () | |
| void | Initialize () |
| void | Update (float deltaTime) |
| void | DiscoverDirectory (AssetDir *directory, bool engineDir) |
| void | RefreshDirectory (AssetDir *directory) |
| void | Discover (const char *directoryName, const char *directoryPath) |
| void | DiscoverAssetRegistry (const char *registryPath) |
| void | DiscoverEmbeddedAssets (struct EmbeddedFile *assets, uint32_t numAssets) |
| void | Purge (bool purgeEngineAssets) |
| bool | PurgeAsset (const char *name) |
| void | RefSweep () |
| void | LoadAll () |
| POLYPHASE_API void | RegisterTransientAsset (Asset *asset) |
| Asset * | ImportEngineAsset (TypeId assetType, AssetDir *dir, const std::string &filename, ImportOptions *options=nullptr) |
| void | ImportEngineAssets () |
| AssetStub * | GetAssetStub (const std::string &name) |
| Asset * | GetAsset (const std::string &name) |
| AssetStub * | GetSceneAsset (const std::string &name) |
| Asset * | LoadAsset (const std::string &name) |
| Asset * | LoadAsset (AssetStub &stub) |
| void | AsyncLoadAsset (const std::string &name, AssetRef *targetRef) |
| AssetStub * | GetAssetStubByUuid (uint64_t uuid) |
| Asset * | GetAssetByUuid (uint64_t uuid) |
| Asset * | LoadAssetByUuid (uint64_t uuid) |
| void | AsyncLoadAssetByUuid (uint64_t uuid, AssetRef *targetRef) |
| AssetStub * | GetAssetStubByPath (const std::string &path) |
| Asset * | LoadAssetByPath (const std::string &path) |
| void | SaveAsset (const std::string &name) |
| void | SaveAsset (AssetStub &stub) |
| bool | UnloadAsset (const std::string &name) |
| bool | UnloadAsset (AssetStub &stub) |
| bool | DoesAssetExist (const std::string &name) |
| bool | RenameAsset (Asset *asset, const std::string &newName) |
| std::string | GetParentDirectory (const std::string &path) |
| bool | RenameDirectory (AssetDir *dir, const std::string &newName) |
| void | GatherScriptFilesRecursive (const std::string &dirPath, const std::string &relativePath, std::vector< std::string > &scriptFiles) |
| std::vector< std::string > | GetAvailableScriptFiles () |
| std::vector< std::string > | GetAvailableFontFiles () |
| AssetDir * | FindProjectDirectory () |
| AssetDir * | FindProjectRootDirectory () |
| AssetDir * | FindEngineDirectory () |
| AssetDir * | FindPackagesDirectory () |
| AssetDir * | GetRootDirectory () |
| void | DiscoverAddonPackages (const std::string &packagesDir) |
| std::string | GetPolyphaseDirectory () |
| void | GatherScriptFiles (const std::string &dir, std::vector< std::string > &outFiles) |
| void | GatherFontFiles (const std::string &dir, std::vector< std::string > &outFiles) |
| AssetStub * | FindDefaultScene () |
| std::string | FindDefaultScenePath () |
| void | UnloadProjectDirectory () |
| std::unordered_map< std::string, AssetStub * > & | GetAssetMap () |
| std::vector< AssetStub * > | GatherDirtyAssets () |
| AssetStub * | RegisterAsset (const std::string &filename, TypeId type, AssetDir *directory, EmbeddedFile *embeddedAsset, bool engineAsset, uint64_t uuid=0) |
| AssetStub * | CreateAndRegisterAsset (TypeId assetType, AssetDir *directory, const std::string &filename, bool engineAsset) |
| AssetDir * | GetAssetDirFromPath (const std::string &dirPath) |
| bool | IsPurging () const |
Static Public Member Functions | |
| static void | Create () |
| static void | Destroy () |
| static POLYPHASE_API AssetManager * | Get () |
Protected Member Functions | |
| AssetManager () | |
| void | UpdateEndLoadQueue () |
Static Protected Member Functions | |
| static ThreadFuncRet | AsyncLoadThreadFunc (void *in) |
Protected Attributes | |
| std::unordered_map< std::string, AssetStub * > | mAssetMap |
| std::unordered_map< std::string, AssetStub * > | mAssetPathMap |
| std::unordered_map< uint64_t, AssetStub * > | mUuidMap |
| std::vector< Asset * > | mTransientAssets |
| AssetDir * | mRootDirectory = nullptr |
| bool | mPurging = false |
| bool | mDestructing = false |
| std::deque< AsyncLoadRequest * > | mBeginLoadQueue |
| std::deque< AsyncLoadRequest * > | mEndLoadQueue |
| ThreadObject * | mAsyncLoadThread = {} |
| MutexObject * | mMutex = {} |
Static Protected Attributes | |
| static AssetManager * | sInstance = nullptr |
| AssetManager::~AssetManager | ( | ) |
|
protected |
| void AssetManager::AsyncLoadAsset | ( | const std::string & | name, |
| AssetRef * | targetRef | ||
| ) |
| void AssetManager::AsyncLoadAssetByUuid | ( | uint64_t | uuid, |
| AssetRef * | targetRef | ||
| ) |
|
staticprotected |
|
static |
| AssetStub * AssetManager::CreateAndRegisterAsset | ( | TypeId | assetType, |
| AssetDir * | directory, | ||
| const std::string & | filename, | ||
| bool | engineAsset | ||
| ) |
|
static |
| void AssetManager::Discover | ( | const char * | directoryName, |
| const char * | directoryPath | ||
| ) |
| void AssetManager::DiscoverAddonPackages | ( | const std::string & | packagesDir | ) |
| void AssetManager::DiscoverAssetRegistry | ( | const char * | registryPath | ) |
| void AssetManager::DiscoverDirectory | ( | AssetDir * | directory, |
| bool | engineDir | ||
| ) |
| void AssetManager::DiscoverEmbeddedAssets | ( | struct EmbeddedFile * | assets, |
| uint32_t | numAssets | ||
| ) |
| bool AssetManager::DoesAssetExist | ( | const std::string & | name | ) |
| AssetStub * AssetManager::FindDefaultScene | ( | ) |
| std::string AssetManager::FindDefaultScenePath | ( | ) |
| AssetDir * AssetManager::FindEngineDirectory | ( | ) |
| AssetDir * AssetManager::FindPackagesDirectory | ( | ) |
| AssetDir * AssetManager::FindProjectDirectory | ( | ) |
| AssetDir * AssetManager::FindProjectRootDirectory | ( | ) |
| std::vector< AssetStub * > AssetManager::GatherDirtyAssets | ( | ) |
| void AssetManager::GatherFontFiles | ( | const std::string & | dir, |
| std::vector< std::string > & | outFiles | ||
| ) |
| void AssetManager::GatherScriptFiles | ( | const std::string & | dir, |
| std::vector< std::string > & | outFiles | ||
| ) |
| void AssetManager::GatherScriptFilesRecursive | ( | const std::string & | dirPath, |
| const std::string & | relativePath, | ||
| std::vector< std::string > & | scriptFiles | ||
| ) |
|
static |
| Asset * AssetManager::GetAsset | ( | const std::string & | name | ) |
| Asset * AssetManager::GetAssetByUuid | ( | uint64_t | uuid | ) |
| AssetDir * AssetManager::GetAssetDirFromPath | ( | const std::string & | dirPath | ) |
| std::unordered_map< std::string, AssetStub * > & AssetManager::GetAssetMap | ( | ) |
| AssetStub * AssetManager::GetAssetStub | ( | const std::string & | name | ) |
| AssetStub * AssetManager::GetAssetStubByPath | ( | const std::string & | path | ) |
| AssetStub * AssetManager::GetAssetStubByUuid | ( | uint64_t | uuid | ) |
| std::vector< std::string > AssetManager::GetAvailableFontFiles | ( | ) |
| std::vector< std::string > AssetManager::GetAvailableScriptFiles | ( | ) |
| std::string AssetManager::GetParentDirectory | ( | const std::string & | path | ) |
| std::string AssetManager::GetPolyphaseDirectory | ( | ) |
| AssetDir * AssetManager::GetRootDirectory | ( | ) |
| AssetStub * AssetManager::GetSceneAsset | ( | const std::string & | name | ) |
| Asset * AssetManager::ImportEngineAsset | ( | TypeId | assetType, |
| AssetDir * | dir, | ||
| const std::string & | filename, | ||
| ImportOptions * | options = nullptr |
||
| ) |
| void AssetManager::ImportEngineAssets | ( | ) |
| void AssetManager::Initialize | ( | ) |
| bool AssetManager::IsPurging | ( | ) | const |
| void AssetManager::LoadAll | ( | ) |
| Asset * AssetManager::LoadAsset | ( | const std::string & | name | ) |
| Asset * AssetManager::LoadAssetByPath | ( | const std::string & | path | ) |
| Asset * AssetManager::LoadAssetByUuid | ( | uint64_t | uuid | ) |
| void AssetManager::Purge | ( | bool | purgeEngineAssets | ) |
| bool AssetManager::PurgeAsset | ( | const char * | name | ) |
| void AssetManager::RefreshDirectory | ( | AssetDir * | directory | ) |
| void AssetManager::RefSweep | ( | ) |
| AssetStub * AssetManager::RegisterAsset | ( | const std::string & | filename, |
| TypeId | type, | ||
| AssetDir * | directory, | ||
| EmbeddedFile * | embeddedAsset, | ||
| bool | engineAsset, | ||
| uint64_t | uuid = 0 |
||
| ) |
| void AssetManager::RegisterTransientAsset | ( | Asset * | asset | ) |
| bool AssetManager::RenameAsset | ( | Asset * | asset, |
| const std::string & | newName | ||
| ) |
| bool AssetManager::RenameDirectory | ( | AssetDir * | dir, |
| const std::string & | newName | ||
| ) |
| void AssetManager::SaveAsset | ( | AssetStub & | stub | ) |
| void AssetManager::SaveAsset | ( | const std::string & | name | ) |
| bool AssetManager::UnloadAsset | ( | AssetStub & | stub | ) |
| bool AssetManager::UnloadAsset | ( | const std::string & | name | ) |
| void AssetManager::UnloadProjectDirectory | ( | ) |
| void AssetManager::Update | ( | float | deltaTime | ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |