1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

- fixed save games issues (#1044)

- hopefully some speedup for filesystem loading (#1048)
This commit is contained in:
Ivan Savenko
2012-08-07 11:28:52 +00:00
parent 708ad6ac7f
commit 8040a81eec
17 changed files with 268 additions and 283 deletions

View File

@ -13,22 +13,7 @@ ArchiveEntry::ArchiveEntry()
}
CLodArchiveLoader::CLodArchiveLoader()
{
}
CLodArchiveLoader::CLodArchiveLoader(const std::string & archive)
{
open(archive);
}
CLodArchiveLoader::CLodArchiveLoader(const CFileInfo & archive)
{
open(archive);
}
void CLodArchiveLoader::open(const std::string & archive)
{
// Open archive file(.snd, .vid, .lod)
this->archive = archive;
@ -58,11 +43,6 @@ void CLodArchiveLoader::open(const std::string & archive)
}
}
void CLodArchiveLoader::open(const CFileInfo & archive)
{
open(archive.getName());
}
void CLodArchiveLoader::initLODArchive(CFileInputStream & fileStream)
{
// Define LodEntryBlock struct
@ -204,14 +184,14 @@ std::unique_ptr<CInputStream> CLodArchiveLoader::load(const std::string & resour
}
}
std::list<std::string> CLodArchiveLoader::getEntries() const
std::unordered_map<ResourceID, std::string> CLodArchiveLoader::getEntries() const
{
std::list<std::string> retList;
std::unordered_map<ResourceID, std::string> retList;
for(auto it = entries.begin(); it != entries.end(); ++it)
{
const ArchiveEntry & entry = it->second;
retList.push_back(entry.name);
retList[ResourceID(entry.name)] = entry.name;
}
return std::move(retList);