mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 18:09:39 +00:00
add support for png and dds splashscreens to begin with.
This commit is contained in:
parent
bd667c3847
commit
b26887ef9b
1 changed files with 13 additions and 3 deletions
|
@ -65,16 +65,26 @@ namespace MWGui
|
||||||
const std::map<std::string, VFS::File*>& index = mVFS->getIndex();
|
const std::map<std::string, VFS::File*>& index = mVFS->getIndex();
|
||||||
std::string pattern = "Splash/";
|
std::string pattern = "Splash/";
|
||||||
mVFS->normalizeFilename(pattern);
|
mVFS->normalizeFilename(pattern);
|
||||||
|
std::list<std::string> supported_extensions = {".tga", ".png", ".dds"}; /* priority given to the left */
|
||||||
|
|
||||||
std::map<std::string, VFS::File*>::const_iterator found = index.lower_bound(pattern);
|
auto found = index.lower_bound(pattern);
|
||||||
while (found != index.end())
|
while (found != index.end())
|
||||||
{
|
{
|
||||||
const std::string& name = found->first;
|
const std::string& name = found->first;
|
||||||
if (name.size() >= pattern.size() && name.substr(0, pattern.size()) == pattern)
|
if (name.size() >= pattern.size() && name.substr(0, pattern.size()) == pattern)
|
||||||
{
|
{
|
||||||
size_t pos = name.find_last_of('.');
|
size_t pos = name.find_last_of('.');
|
||||||
if (pos != std::string::npos && name.compare(pos, name.size()-pos, ".tga") == 0)
|
if (pos != std::string::npos)
|
||||||
mSplashScreens.push_back(found->first);
|
{
|
||||||
|
for(auto const extension: supported_extensions)
|
||||||
|
{
|
||||||
|
if (name.compare(pos, name.size() - pos, extension) == 0)
|
||||||
|
{
|
||||||
|
mSplashScreens.push_back(found->first);
|
||||||
|
break; /* based on priority */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue