ZoneLoading: Properly link assets as dependencies instead of only saving the name of the dependency

This commit is contained in:
Jan
2020-02-18 13:16:39 +01:00
parent 246d74992c
commit 992e9cea30
16 changed files with 159 additions and 61 deletions

View File

@ -19,13 +19,15 @@ public:
{
for(auto assetInfo : *pool)
{
T* asset = assetInfo->Asset();
if(assetInfo->m_name[0] == ','
|| !ShouldDump(assetInfo->m_asset))
|| !ShouldDump(asset))
{
continue;
}
std::string assetFilePath = utils::Path::Combine(basePath, GetFileNameForAsset(zone, assetInfo->m_asset));
std::string assetFilePath = utils::Path::Combine(basePath, GetFileNameForAsset(zone, asset));
FileAPI::DirectoryCreate(utils::Path::GetDirectory(assetFilePath));
@ -33,7 +35,7 @@ public:
if(file.IsOpen())
{
DumpAsset(zone, assetInfo->m_asset, &file);
DumpAsset(zone, asset, &file);
file.Close();
}

View File

@ -61,7 +61,7 @@ std::string AssetDumperLocalizeEntry::GetNameOfLanguage(GameLanguage language)
void AssetDumperLocalizeEntry::DumpPool(Zone* zone, AssetPool<LocalizeEntry>* pool, const std::string& basePath)
{
if (pool->m_asset_lookup.size() == 0)
if (pool->m_asset_lookup.empty())
return;
const std::string language = GetNameOfLanguage(zone->m_language);
@ -84,7 +84,7 @@ void AssetDumperLocalizeEntry::DumpPool(Zone* zone, AssetPool<LocalizeEntry>* po
for(auto localizeEntry : *pool)
{
stringFileDumper.WriteLocalizeEntry(localizeEntry->m_asset->name, localizeEntry->m_asset->value);
stringFileDumper.WriteLocalizeEntry(localizeEntry->m_name, localizeEntry->Asset()->value);
}
stringFileDumper.Finalize();