Merge pull request #12240 from iwubcode/material_asset_additional_properties

VideoCommon: add additional data types to material asset
This commit is contained in:
Mai
2023-12-12 18:38:20 -05:00
committed by GitHub
3 changed files with 219 additions and 53 deletions

View File

@ -393,21 +393,15 @@ void CustomPipelineAction::OnTextureCreate(GraphicsModActionData::TextureCreate*
return;
}
if (property.m_type == VideoCommon::MaterialProperty::Type::Type_TextureAsset)
if (auto* value = std::get_if<std::string>(&property.m_value))
{
if (property.m_value)
auto asset = loader.LoadGameTexture(*value, m_library);
if (asset)
{
if (auto* value = std::get_if<std::string>(&*property.m_value))
{
auto asset = loader.LoadGameTexture(*value, m_library);
if (asset)
{
const auto loaded_time = asset->GetLastLoadedTime();
game_assets.push_back(VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>{
std::move(asset), loaded_time});
m_texture_code_names.push_back(property.m_code_name);
}
}
const auto loaded_time = asset->GetLastLoadedTime();
game_assets.push_back(
VideoCommon::CachedAsset<VideoCommon::GameTextureAsset>{std::move(asset), loaded_time});
m_texture_code_names.push_back(property.m_code_name);
}
}
}