2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-01-25 09:23:03 +00:00

chore: adjust asset data when taking from global asset pools

This commit is contained in:
Jan Laupetin
2025-12-18 14:49:43 +00:00
parent 7bf7bf93de
commit 8eb79da8a2
14 changed files with 92 additions and 29 deletions

View File

@@ -10,7 +10,7 @@ class AssetVisitor
public:
virtual ~AssetVisitor() = default;
virtual std::optional<XAssetInfoGeneric> Visit_Dependency(asset_type_t assetType, const char* assetName)
virtual std::optional<XAssetInfoGeneric*> Visit_Dependency(asset_type_t assetType, const char* assetName)
{
// Do nothing by default
return std::nullopt;

View File

@@ -25,6 +25,9 @@ void BaseAssetMarker::MarkArray_ScriptString(scr_string_t* scriptStringArray, co
void BaseAssetMarker::Mark_IndirectAssetRef(const asset_type_t assetType, const char* assetName) const
{
if (!assetName)
return;
m_visitor.Visit_IndirectAssetRef(assetType, assetName);
}

View File

@@ -17,7 +17,7 @@ protected:
const auto result = m_visitor.Visit_Dependency(AssetType::EnumEntry, AssetName<AssetType>(*asset));
if (result.has_value())
asset = static_cast<std::add_pointer_t<typename AssetType::Type>>(result->m_ptr);
asset = static_cast<std::add_pointer_t<typename AssetType::Type>>((*result)->m_ptr);
}
void Mark_ScriptString(scr_string_t& scriptString) const;