mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
State whenever a zone is unloaded in unlinker
This commit is contained in:
parent
1a36912b44
commit
4a03efe636
@ -321,12 +321,20 @@ class Unlinker::Impl
|
||||
|
||||
void UnloadZones()
|
||||
{
|
||||
if (ShouldLoadObj())
|
||||
for (auto i = m_loaded_zones.rbegin(); i != m_loaded_zones.rend(); ++i)
|
||||
{
|
||||
for (auto& loadedZone : m_loaded_zones)
|
||||
auto& loadedZone = *i;
|
||||
std::string zoneName = loadedZone->m_name;
|
||||
|
||||
if (ShouldLoadObj())
|
||||
{
|
||||
ObjLoading::UnloadContainersOfZone(loadedZone.get());
|
||||
}
|
||||
|
||||
loadedZone.reset();
|
||||
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Unloaded zone \"" << zoneName << "\"\n";
|
||||
}
|
||||
m_loaded_zones.clear();
|
||||
}
|
||||
@ -346,6 +354,7 @@ class Unlinker::Impl
|
||||
auto searchPathsForZone = GetSearchPathsForZone(absoluteZoneDirectory);
|
||||
searchPathsForZone.IncludeSearchPath(&m_search_paths);
|
||||
|
||||
std::string zoneName;
|
||||
auto zone = ZoneLoading::LoadZone(zonePath);
|
||||
if (zone == nullptr)
|
||||
{
|
||||
@ -353,10 +362,9 @@ class Unlinker::Impl
|
||||
return false;
|
||||
}
|
||||
|
||||
zoneName = zone->m_name;
|
||||
if (m_args.m_verbose)
|
||||
{
|
||||
printf("Loaded zone \"%s\"\n", zone->m_name.c_str());
|
||||
}
|
||||
std::cout << "Loaded zone \"" << zoneName << "\"\n";
|
||||
|
||||
if (ShouldLoadObj())
|
||||
{
|
||||
@ -369,6 +377,10 @@ class Unlinker::Impl
|
||||
|
||||
if (ShouldLoadObj())
|
||||
ObjLoading::UnloadContainersOfZone(zone.get());
|
||||
|
||||
zone.reset();
|
||||
if (m_args.m_verbose)
|
||||
std::cout << "Unloaded zone \"" << zoneName << "\"\n";
|
||||
}
|
||||
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user