mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 19:19:56 +00:00
Merge pull request #1674
This commit is contained in:
commit
ce1b2a612c
1 changed files with 5 additions and 17 deletions
|
@ -63,28 +63,16 @@ std::string Misc::ResourceHelpers::correctResourcePath(const std::string &topLev
|
||||||
|
|
||||||
std::string origExt = correctedPath;
|
std::string origExt = correctedPath;
|
||||||
|
|
||||||
// since we know all (GOTY edition or less) textures end
|
if (vfs->exists(origExt)
|
||||||
// in .dds, we change the extension
|
|| (changeExtensionToDds(correctedPath) && vfs->exists(correctedPath)))
|
||||||
bool changedToDds = changeExtensionToDds(correctedPath);
|
|
||||||
if (vfs->exists(correctedPath))
|
|
||||||
return correctedPath;
|
return correctedPath;
|
||||||
// if it turns out that the above wasn't true in all cases (not for vanilla, but maybe mods)
|
|
||||||
// verify, and revert if false (this call succeeds quickly, but fails slowly)
|
|
||||||
if (changedToDds && vfs->exists(origExt))
|
|
||||||
return origExt;
|
|
||||||
|
|
||||||
// fall back to a resource in the top level directory if it exists
|
// fall back to a resource in the top level directory if it exists
|
||||||
std::string fallback = topLevelDirectory + "\\" + getBasename(correctedPath);
|
std::string fallback = topLevelDirectory + "\\" + getBasename(origExt);
|
||||||
if (vfs->exists(fallback))
|
if (vfs->exists(fallback)
|
||||||
|
|| (changeExtensionToDds(fallback) && vfs->exists(fallback)))
|
||||||
return fallback;
|
return fallback;
|
||||||
|
|
||||||
if (changedToDds)
|
|
||||||
{
|
|
||||||
fallback = topLevelDirectory + "\\" + getBasename(origExt);
|
|
||||||
if (vfs->exists(fallback))
|
|
||||||
return fallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
return correctedPath;
|
return correctedPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue