From 59196903defc49e02511cce88a07c0c14b38754e Mon Sep 17 00:00:00 2001 From: TheApadayo Date: Fri, 23 Dec 2016 13:00:14 -0500 Subject: [PATCH] [ZoneBuilder] Only mark assets once to speed up link step --- src/Components/Modules/ZoneBuilder.cpp | 8 ++++++++ src/Components/Modules/ZoneBuilder.hpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/ZoneBuilder.cpp b/src/Components/Modules/ZoneBuilder.cpp index f4e0c2aa..4b39de2f 100644 --- a/src/Components/Modules/ZoneBuilder.cpp +++ b/src/Components/Modules/ZoneBuilder.cpp @@ -283,7 +283,15 @@ namespace Components asset.header.data = ptr; asset.type = type; + const auto& cmp = asset.header.data; + + if(std::find_if(this->markedAssets.begin(), this->markedAssets.end(), [&cmp] (const Game::XAsset& s) { return cmp == s.header.data; } ) != this->markedAssets.end()) + { + return; // don't re-mark assets + } + AssetHandler::ZoneMark(asset, this); + this->markedAssets.push_back(asset); } void ZoneBuilder::Zone::writeZone() diff --git a/src/Components/Modules/ZoneBuilder.hpp b/src/Components/Modules/ZoneBuilder.hpp index b16b461c..63c0d308 100644 --- a/src/Components/Modules/ZoneBuilder.hpp +++ b/src/Components/Modules/ZoneBuilder.hpp @@ -75,11 +75,11 @@ namespace Components std::vector loadedAssets; std::vector savedAssets; + std::vector markedAssets; std::vector scriptStrings; std::map scriptStringMap; std::map renameMap[Game::XAssetType::ASSET_TYPE_COUNT]; std::map pointerMap; - std::vector aliasBaseStack; std::map aliasMap; Game::RawFile branding;