2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-09-04 07:47:25 +00:00

refactor: make LoadDependency and LoadIndirectAssetReference functions work with Asset template types

This commit is contained in:
Jan
2024-04-22 23:36:21 +02:00
parent 0b61fc6e81
commit eb0cec1d81
16 changed files with 106 additions and 90 deletions

View File

@@ -99,7 +99,7 @@ namespace
textureDef.semantic = jTexture.semantic;
textureDef.isMatureContent = jTexture.isMatureContent;
auto* image = static_cast<XAssetInfo<GfxImage>*>(m_manager.LoadDependency(ASSET_TYPE_IMAGE, jTexture.image));
auto* image = m_manager.LoadDependency<AssetImage>(jTexture.image);
if (!image)
{
PrintError(material, std::format("Could not find textureDef image: {}", jTexture.image));
@@ -275,7 +275,7 @@ namespace
material.cameraRegion = jMaterial.cameraRegion;
material.probeMipBits = jMaterial.probeMipBits;
auto* techniqueSet = static_cast<XAssetInfo<MaterialTechniqueSet>*>(m_manager.LoadDependency(ASSET_TYPE_TECHNIQUE_SET, jMaterial.techniqueSet));
auto* techniqueSet = m_manager.LoadDependency<AssetTechniqueSet>(jMaterial.techniqueSet);
if (!techniqueSet)
{
PrintError(material, "Could not find technique set");
@@ -337,7 +337,7 @@ namespace
if (jMaterial.thermalMaterial)
{
auto* thermalMaterial = static_cast<XAssetInfo<Material>*>(m_manager.LoadDependency(ASSET_TYPE_MATERIAL, jMaterial.thermalMaterial.value()));
auto* thermalMaterial = m_manager.LoadDependency<AssetMaterial>(jMaterial.thermalMaterial.value());
if (!thermalMaterial)
{
PrintError(material, "Could not find thermal material");