mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 15:35:23 +00:00
updated loading screen to use the resource managers pattern matching when finding files
This commit is contained in:
parent
44031ec3d7
commit
6ca87e108f
@ -214,27 +214,14 @@ namespace MWGui
|
||||
void LoadingScreen::changeWallpaper ()
|
||||
{
|
||||
if (mResources.isNull ())
|
||||
{
|
||||
mResources = Ogre::StringVectorPtr (new Ogre::StringVector);
|
||||
|
||||
Ogre::StringVectorPtr resources = Ogre::ResourceGroupManager::getSingleton ().listResourceNames ("General", false);
|
||||
for (Ogre::StringVector::const_iterator it = resources->begin(); it != resources->end(); ++it)
|
||||
{
|
||||
if (it->size() < 6)
|
||||
continue;
|
||||
std::string start = it->substr(0, 6);
|
||||
boost::to_lower(start);
|
||||
|
||||
if (start == "splash")
|
||||
mResources->push_back (*it);
|
||||
}
|
||||
}
|
||||
mResources = Ogre::ResourceGroupManager::getSingleton ().findResourceNames ("General", "Splash_*.tga");
|
||||
|
||||
if (mResources->size())
|
||||
{
|
||||
std::string randomSplash = mResources->at (rand() % mResources->size());
|
||||
std::string const & randomSplash = mResources->at (rand() % mResources->size());
|
||||
|
||||
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, "General");
|
||||
|
||||
mBackgroundImage->setImageTexture (randomSplash);
|
||||
}
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user