diff options
| author | Mai <mai.iam2048@gmail.com> | 2023-12-12 18:38:20 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-12 18:38:20 -0500 |
| commit | ea3033731df0ec80b636485024992b5378870f42 (patch) | |
| tree | 14d2d302ef980dbf0d5740570acce045857822e5 /Source/Core/VideoCommon/GraphicsModSystem | |
| parent | 022b0a00a222235cc83b48ce1036fa6144c79704 (diff) | |
| parent | e204b3c8ee46653ca1c9d2aea6877ec3d11f7472 (diff) | |
Merge pull request #12240 from iwubcode/material_asset_additional_properties
VideoCommon: add additional data types to material asset
Diffstat (limited to 'Source/Core/VideoCommon/GraphicsModSystem')
| -rw-r--r-- | Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp index 267f88bb4c..0a51bb995e 100644 --- a/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp +++ b/Source/Core/VideoCommon/GraphicsModSystem/Runtime/Actions/CustomPipelineAction.cpp @@ -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); } } } |
