mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 07:53:51 +00:00
Merge remote-tracking branch 'scrawl/splashscreen_dirlisting'
Conflicts: apps/openmw/mwgui/loadingscreen.cpp
This commit is contained in:
commit
18686614db
3 changed files with 21 additions and 19 deletions
|
@ -163,9 +163,8 @@ void OMW::Engine::loadBSA()
|
||||||
std::cout << "Data dir " << dataDirectory << std::endl;
|
std::cout << "Data dir " << dataDirectory << std::endl;
|
||||||
Bsa::addDir(dataDirectory, mFSStrict);
|
Bsa::addDir(dataDirectory, mFSStrict);
|
||||||
|
|
||||||
// Workaround: Mygui does not find textures in non-BSA subfolders, _unless_ they are explicitely added like this
|
// Workaround until resource listing capabilities are added to DirArchive, we need those to list available splash screens
|
||||||
// For splash screens, this is OK to do, but eventually we will need an investigation why this is necessary
|
addResourcesDirectory (dataDirectory);
|
||||||
Bsa::addDir(dataDirectory + "/Splash", mFSStrict);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
#include <OgreCompositorChain.h>
|
#include <OgreCompositorChain.h>
|
||||||
#include <OgreMaterial.h>
|
#include <OgreMaterial.h>
|
||||||
|
|
||||||
#include <openengine/ogre/fader.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
|
#include <openengine/ogre/fader.hpp>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/inputmanager.hpp"
|
#include "../mwbase/inputmanager.hpp"
|
||||||
|
@ -212,20 +213,22 @@ namespace MWGui
|
||||||
|
|
||||||
void LoadingScreen::changeWallpaper ()
|
void LoadingScreen::changeWallpaper ()
|
||||||
{
|
{
|
||||||
/// \todo use a directory listing here
|
|
||||||
std::vector<std::string> splash;
|
std::vector<std::string> splash;
|
||||||
splash.push_back ("Splash_Bonelord.tga");
|
|
||||||
splash.push_back ("Splash_ClannDaddy.tga");
|
|
||||||
splash.push_back ("Splash_Clannfear.tga");
|
|
||||||
splash.push_back ("Splash_Daedroth.tga");
|
|
||||||
splash.push_back ("Splash_Hunger.tga");
|
|
||||||
splash.push_back ("Splash_KwamaWarrior.tga");
|
|
||||||
splash.push_back ("Splash_Netch.tga");
|
|
||||||
splash.push_back ("Splash_NixHound.tga");
|
|
||||||
splash.push_back ("Splash_Siltstriker.tga");
|
|
||||||
splash.push_back ("Splash_Skeleton.tga");
|
|
||||||
splash.push_back ("Splash_SphereCenturion.tga");
|
|
||||||
|
|
||||||
mBackgroundImage->setImageTexture (splash[rand() % splash.size()]);
|
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")
|
||||||
|
splash.push_back (*it);
|
||||||
|
}
|
||||||
|
std::string randomSplash = splash[rand() % splash.size()];
|
||||||
|
|
||||||
|
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, "General");
|
||||||
|
mBackgroundImage->setImageTexture (randomSplash);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -375,7 +375,7 @@ void addBSA(const std::string& name, const std::string& group)
|
||||||
{
|
{
|
||||||
insertBSAFactory();
|
insertBSAFactory();
|
||||||
ResourceGroupManager::getSingleton().
|
ResourceGroupManager::getSingleton().
|
||||||
addResourceLocation(name, "BSA", group);
|
addResourceLocation(name, "BSA", group, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addDir(const std::string& name, const bool& fs, const std::string& group)
|
void addDir(const std::string& name, const bool& fs, const std::string& group)
|
||||||
|
@ -384,7 +384,7 @@ void addDir(const std::string& name, const bool& fs, const std::string& group)
|
||||||
insertDirFactory();
|
insertDirFactory();
|
||||||
|
|
||||||
ResourceGroupManager::getSingleton().
|
ResourceGroupManager::getSingleton().
|
||||||
addResourceLocation(name, "Dir", group);
|
addResourceLocation(name, "Dir", group, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue