Merge pull request #92 from SHADE-DP/SP3-13-Assets-Manager

SP3-13 Assets Management
Pushed functions to retrieve mesh and texture asset data
This commit is contained in:
XiaoQiDigipen 2022-10-17 15:05:14 +08:00 committed by GitHub
commit 86f4125100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -255,6 +255,26 @@ namespace SHADE
return result; return result;
} }
SHMeshAsset const* SHAssetManager::GetMesh(AssetID id) noexcept
{
if (meshCollection.find(id) == meshCollection.end())
{
return nullptr;
}
return &meshCollection[id];
}
SHTextureAsset const* SHAssetManager::GetTexture(AssetID id) noexcept
{
if (textureCollection.find(id) == textureCollection.end())
{
return nullptr;
}
return &textureCollection[id];
}
/**************************************************************************** /****************************************************************************
* \param Path for meta data file * \param Path for meta data file
* \param Path for asset file * \param Path for asset file

View File

@ -75,6 +75,8 @@ namespace SHADE
static std::vector<SHMeshAsset> GetAllMeshes() noexcept; static std::vector<SHMeshAsset> GetAllMeshes() noexcept;
static std::vector<SHTextureAsset> GetAllTextures() noexcept; static std::vector<SHTextureAsset> GetAllTextures() noexcept;
static SHMeshAsset const* GetMesh(AssetID id) noexcept;
static SHTextureAsset const* GetTexture(AssetID id) noexcept;
private: private:
/**************************************************************************** /****************************************************************************
* \brief Load resource data into memory * \brief Load resource data into memory