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

SP3-13 Assets Management
Added function in asset manager to retrieve all dds images
This commit is contained in:
XiaoQiDigipen 2022-09-26 17:49:06 +08:00 committed by GitHub
commit 728d615425
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 4 deletions

View File

@ -21,9 +21,9 @@ namespace SHADE
std::string meshName;
std::vector<SHVec3> vertexPosition;
std::vector<SHVec2> texCoords;
std::vector<SHVec3> vertexTangent;
std::vector<SHVec3> vertexNormal;
std::vector<SHVec2> texCoords;
std::vector<uint32_t> indices;
};
}

View File

@ -70,7 +70,8 @@ enum class AssetType : uint8_t
#define PREFAB_EXTENSION ".SHPrefab"
#define MATERIAL_EXTENSION ".SHMat"
#define TEXTURE_EXTENSION ".dds"
#define MESH_EXTENSION ".fbx"
#define FBX_EXTENSION ".fbx"
#define MESH_EXTENSION ".shmesh"
std::string const EXTENSIONS[] = {
AUDIO_EXTENSION,
@ -82,7 +83,8 @@ std::string const EXTENSIONS[] = {
SCRIPT_EXTENSION,
SCENE_EXTENSION,
PREFAB_EXTENSION,
AUDIO_WAV_EXTENSION
AUDIO_WAV_EXTENSION,
FBX_EXTENSION
};
// Error flags

View File

@ -199,7 +199,7 @@ namespace SHADE
{
AssetPath path{ p };
if (path.extension().string() == MESH_EXTENSION)
if (path.extension().string() == FBX_EXTENSION)
{
LoadGLTF(
{
@ -236,6 +236,17 @@ namespace SHADE
return result;
}
std::vector<SHDDSAsset> SHAssetManager::GetAllDDS() noexcept
{
std::vector<SHDDSAsset> result;
for (auto const& dds : ddsCollection)
{
result.push_back(dds.second);
}
return result;
}
/****************************************************************************
* \param Path for meta data file
* \param Path for asset file

View File

@ -73,6 +73,7 @@ namespace SHADE
//TODO: TEMPORARY FOR TESTING GLTF & DDS
static void LoadDataTemp(std::string path) noexcept;
static std::vector<SHMeshAsset> GetAllMeshes() noexcept;
static std::vector<SHDDSAsset> GetAllDDS() noexcept;
private:
/****************************************************************************