From b26887ef9bd49cf2fc3dab700605e16aea0a0811 Mon Sep 17 00:00:00 2001 From: Bret Curtis Date: Wed, 13 Sep 2017 13:52:05 +0200 Subject: [PATCH] add support for png and dds splashscreens to begin with. --- apps/openmw/mwgui/loadingscreen.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index c5836b653..946751f68 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -65,16 +65,26 @@ namespace MWGui const std::map& index = mVFS->getIndex(); std::string pattern = "Splash/"; mVFS->normalizeFilename(pattern); + std::list supported_extensions = {".tga", ".png", ".dds"}; /* priority given to the left */ - std::map::const_iterator found = index.lower_bound(pattern); + auto found = index.lower_bound(pattern); while (found != index.end()) { const std::string& name = found->first; if (name.size() >= pattern.size() && name.substr(0, pattern.size()) == pattern) { size_t pos = name.find_last_of('.'); - if (pos != std::string::npos && name.compare(pos, name.size()-pos, ".tga") == 0) - mSplashScreens.push_back(found->first); + if (pos != std::string::npos) + { + 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 break;