Working on loading screen
This commit is contained in:
1 parent
1c2c80f0ea
commit
44f5136f1d
8 files changed
+272
-187
No files matched your search
@@ -528,8 +528,20 @@ namespace ZL
|
||||
|
||||
void TextureManager::Unload(const std::string& fileName, const std::string& zipFile)
|
||||
{
|
||||
//For now, we should keep all textures in memory, to make game load faster after restart
|
||||
//textureMap.erase(MakeKey(fileName, zipFile));
|
||||
textureMap.erase(MakeKey(fileName, zipFile));
|
||||
}
|
||||
|
||||
void TextureManager::UnloadByPrefix(const std::string& prefix)
|
||||
{
|
||||
for (auto& it = textureMap.begin(); it != textureMap.end(); ) {
|
||||
if (it->first.substr(0, prefix.size()) == prefix) {
|
||||
std::cout << "Unloading texture with prefix: " << it->first << std::endl;
|
||||
it = textureMap.erase(it);
|
||||
}
|
||||
else {
|
||||
++it;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TextureManager::UnloadAll()
|
||||
|
||||
@@ -76,6 +76,7 @@ namespace ZL
|
||||
#endif
|
||||
|
||||
void Unload(const std::string& fileName, const std::string& zipFile = "");
|
||||
void UnloadByPrefix(const std::string& prefix);
|
||||
void UnloadAll();
|
||||
|
||||
private:
|
||||
|
||||
Reference in new issue
Block a user