mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:53:53 +00:00
Merge remote-tracking branch 'blunted2night/loading_screen_fix'
This commit is contained in:
commit
fbb59302d9
2 changed files with 17 additions and 12 deletions
|
@ -213,7 +213,9 @@ namespace MWGui
|
|||
|
||||
void LoadingScreen::changeWallpaper ()
|
||||
{
|
||||
std::vector<std::string> splash;
|
||||
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)
|
||||
|
@ -224,11 +226,13 @@ namespace MWGui
|
|||
boost::to_lower(start);
|
||||
|
||||
if (start == "splash")
|
||||
splash.push_back (*it);
|
||||
mResources->push_back (*it);
|
||||
}
|
||||
if (splash.size())
|
||||
}
|
||||
|
||||
if (mResources->size())
|
||||
{
|
||||
std::string randomSplash = splash[rand() % splash.size()];
|
||||
std::string randomSplash = mResources->at (rand() % mResources->size());
|
||||
|
||||
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, "General");
|
||||
mBackgroundImage->setImageTexture (randomSplash);
|
||||
|
|
|
@ -42,6 +42,7 @@ namespace MWGui
|
|||
Ogre::Rectangle2D* mRectangle;
|
||||
Ogre::MaterialPtr mBackgroundMaterial;
|
||||
|
||||
Ogre::StringVectorPtr mResources;
|
||||
|
||||
bool mLoadingOn;
|
||||
|
||||
|
|
Loading…
Reference in a new issue