1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 01:15:35 +00:00

Use std::string for ResourceManager cache key

Otherwise terrain textures cache has zero hits because it stores not normalized
paths. Due to implicit conversion it's possible to add entry with
addEntryToObjectCache passing a string that is converted into normalized path.
But then getRefFromObjectCache called with original value does not find this
entry because it's not converted and overloaded operators are used instead.
This commit is contained in:
elsid 2024-03-15 23:52:55 +01:00
parent 2a41811c83
commit 16410d0960
No known key found for this signature in database
GPG key ID: 4DE04C198CBA7625
2 changed files with 2 additions and 2 deletions

View file

@ -52,7 +52,7 @@ namespace Resource
Nif::Reader reader(*file, mEncoder);
reader.parse(mVFS->get(name));
obj = new NifFileHolder(file);
mCache->addEntryToObjectCache(name, obj);
mCache->addEntryToObjectCache(name.value(), obj);
return file;
}
}

View file

@ -72,7 +72,7 @@ namespace Resource
double mExpiryDelay;
};
class ResourceManager : public GenericResourceManager<VFS::Path::Normalized>
class ResourceManager : public GenericResourceManager<std::string>
{
public:
explicit ResourceManager(const VFS::Manager* vfs, double expiryDelay)