1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

resource generation

This commit is contained in:
Laserlicht
2024-08-19 23:18:14 +02:00
parent 11ac768599
commit fff0159ef6
12 changed files with 162 additions and 66 deletions

View File

@ -66,11 +66,22 @@ CFilesystemList::~CFilesystemList()
std::unique_ptr<CInputStream> CFilesystemList::load(const ResourcePath & resourceName) const
{
// load resource from last loader that have it (last overridden version)
for(const auto & loader : boost::adaptors::reverse(loaders))
if(resourceName.getOriginalResource())
{
if (loader->existsResource(resourceName))
return loader->load(resourceName);
for(const auto & loader : loaders)
{
if (loader->existsResource(resourceName))
return loader->load(resourceName);
}
}
else
{
// load resource from last loader that have it (last overridden version)
for(const auto & loader : boost::adaptors::reverse(loaders))
{
if (loader->existsResource(resourceName))
return loader->load(resourceName);
}
}
throw std::runtime_error("Resource with name " + resourceName.getName() + " and type "