forked from teamnwah/openmw-tes3coop
fixed the disappearing
This commit is contained in:
parent
2f0b47fc38
commit
7ad80e306b
3 changed files with 40 additions and 24 deletions
|
@ -162,6 +162,10 @@ void OMW::Engine::loadBSA()
|
|||
dataDirectory = iter->string();
|
||||
std::cout << "Data dir " << dataDirectory << std::endl;
|
||||
Bsa::addDir(dataDirectory, mFSStrict);
|
||||
|
||||
// Workaround: Mygui does not find textures in non-BSA subfolders, _unless_ they are explicitely added like this
|
||||
// For splash screens, this is OK to do, but eventually we will need an investigation why this is necessary
|
||||
Bsa::addDir(dataDirectory + "/Splash", mFSStrict);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace MWGui
|
|||
, WindowBase("openmw_loading_screen.layout", parWindowManager)
|
||||
, mLoadingOn(false)
|
||||
, mLastRenderTime(0.f)
|
||||
, mLastWallpaperChangeTime(0.f)
|
||||
, mFirstLoad(true)
|
||||
{
|
||||
getWidget(mLoadingText, "LoadingText");
|
||||
|
@ -107,6 +108,11 @@ namespace MWGui
|
|||
{
|
||||
mLastRenderTime = mTimer.getMilliseconds ();
|
||||
|
||||
if (mFirstLoad && mTimer.getMilliseconds () > mLastWallpaperChangeTime + 3000*1)
|
||||
{
|
||||
mLastWallpaperChangeTime = mTimer.getMilliseconds ();
|
||||
changeWallpaper();
|
||||
}
|
||||
|
||||
// Turn off rendering except the GUI
|
||||
mSceneMgr->clearSpecialCaseRenderQueues();
|
||||
|
@ -129,13 +135,14 @@ namespace MWGui
|
|||
|
||||
if (!hasCompositor)
|
||||
{
|
||||
//mWindow->getViewport(0)->setClearEveryFrame(false);
|
||||
mWindow->getViewport(0)->setClearEveryFrame(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!mFirstLoad)
|
||||
{
|
||||
//mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(chain->getCompositor ("gbufferFinalizer")->getTextureInstance ("no_mrt_output", 0)->getName());
|
||||
mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(chain->getCompositor ("gbufferFinalizer")->getTextureInstance ("no_mrt_output", 0)->getName());
|
||||
mRectangle->setVisible(true);
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i<chain->getNumCompositors(); ++i)
|
||||
|
@ -144,9 +151,6 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
mRectangle->setVisible(hasCompositor || mFirstLoad);
|
||||
std::cout << "rect vis? " << mRectangle->getVisible () << " first load? " << mFirstLoad << std::endl;
|
||||
mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName("Splash/Splash_Bonelord.tga");
|
||||
mWindow->update();
|
||||
|
||||
if (!hasCompositor)
|
||||
|
@ -174,44 +178,49 @@ namespace MWGui
|
|||
|
||||
void LoadingScreen::loadingOn()
|
||||
{
|
||||
std::cout << "loading on " <<std::endl;
|
||||
setVisible(true);
|
||||
mLoadingOn = true;
|
||||
|
||||
if (mFirstLoad)
|
||||
{
|
||||
/// \todo use a directory listing here
|
||||
std::vector<std::string> splash;
|
||||
splash.push_back ("Splash/Splash_Bonelord.tga");
|
||||
splash.push_back ("Splash/Splash_ClannDaddy.tga");
|
||||
splash.push_back ("Splash/Splash_ClannFear.tga");
|
||||
splash.push_back ("Splash/Splash_Daedroth.tga");
|
||||
splash.push_back ("Splash/Splash_Hunger.tga");
|
||||
splash.push_back ("Splash/Splash_KwamaWarrior.tga");
|
||||
splash.push_back ("Splash/Splash_Netch.tga");
|
||||
splash.push_back ("Splash/Splash_NixHound.tga");
|
||||
splash.push_back ("Splash/Splash_Siltstriker.tga");
|
||||
splash.push_back ("Splash/Splash_Skeleton.tga");
|
||||
splash.push_back ("Splash/Splash_SphereCenturion.tga");
|
||||
|
||||
mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(splash[rand() % splash.size()]);
|
||||
mRectangle->setVisible(true);
|
||||
changeWallpaper();
|
||||
|
||||
mWindowManager.pushGuiMode(GM_LoadingWallpaper);
|
||||
}
|
||||
else
|
||||
{
|
||||
mBackgroundImage->setImageTexture("");
|
||||
mWindowManager.pushGuiMode(GM_Loading);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LoadingScreen::loadingOff()
|
||||
{
|
||||
std::cout << "loading off " << std::endl;
|
||||
setVisible(false);
|
||||
mLoadingOn = false;
|
||||
//mFirstLoad = false;
|
||||
mFirstLoad = false;
|
||||
|
||||
mWindowManager.removeGuiMode(GM_Loading);
|
||||
mWindowManager.removeGuiMode(GM_LoadingWallpaper);
|
||||
}
|
||||
|
||||
void LoadingScreen::changeWallpaper ()
|
||||
{
|
||||
/// \todo use a directory listing here
|
||||
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()]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,7 @@ namespace MWGui
|
|||
Ogre::SceneManager* mSceneMgr;
|
||||
Ogre::RenderWindow* mWindow;
|
||||
|
||||
unsigned long mLastWallpaperChangeTime;
|
||||
unsigned long mLastRenderTime;
|
||||
Ogre::Timer mTimer;
|
||||
|
||||
|
@ -46,6 +47,8 @@ namespace MWGui
|
|||
|
||||
void loadingOn();
|
||||
void loadingOff();
|
||||
|
||||
void changeWallpaper();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue