Revert "Don't force DDS file usage (fixes #1392)"

This reverts commit 90f3ff2da4.
pull/443/head
Marc Zinnschlag 7 years ago
parent cd7268e9af
commit 13f7b53b1c

@ -63,16 +63,28 @@ std::string Misc::ResourceHelpers::correctResourcePath(const std::string &topLev
std::string origExt = correctedPath; std::string origExt = correctedPath;
if (vfs->exists(origExt) // since we know all (GOTY edition or less) textures end
|| (changeExtensionToDds(correctedPath) && vfs->exists(correctedPath))) // in .dds, we change the extension
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(origExt); std::string fallback = topLevelDirectory + "\\" + getBasename(correctedPath);
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…
Cancel
Save