working on refactoring

This commit is contained in:
Vladislav Khorev committed 2026-10-24 22:37:20 +06:00
1 parent 9b71ee447a
commit d5ef126264
12 files changed
+309 -219

No files matched your search

+3 -4
View File
@@ -558,12 +558,11 @@ namespace FRG
for (const auto& [key, tex] : textureMap) residentKeys.insert(key);
}
void TextureManager::UnloadNonResident(const std::string& residentPrefix)
void TextureManager::UnloadUnused()
{
size_t unloaded = 0;
for (auto it = textureMap.begin(); it != textureMap.end(); ) {
const bool keep = residentKeys.count(it->first)
|| (!residentPrefix.empty() && it->first.compare(0, residentPrefix.size(), residentPrefix) == 0);
const bool keep = residentKeys.count(it->first) || it->second.use_count() > 1;
if (keep) {
++it;
}
@@ -572,7 +571,7 @@ namespace FRG
++unloaded;
}
}
logger() << "Unloaded " << unloaded << " non-resident textures" << std::endl;
logger() << "Unloaded " << unloaded << " unused textures" << std::endl;
}
}