|
|
@ -11,6 +11,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwbase/environment.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
#include "../mwbase/world.hpp"
|
|
|
|
|
|
|
|
#include "../mwbase/statemanager.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
#include "../mwbase/windowmanager.hpp"
|
|
|
|
#include "../mwbase/inputmanager.hpp"
|
|
|
|
#include "../mwbase/inputmanager.hpp"
|
|
|
@ -26,7 +27,6 @@ namespace MWGui
|
|
|
|
, WindowBase("openmw_loading_screen.layout")
|
|
|
|
, WindowBase("openmw_loading_screen.layout")
|
|
|
|
, mLastRenderTime(0.f)
|
|
|
|
, mLastRenderTime(0.f)
|
|
|
|
, mLastWallpaperChangeTime(0.f)
|
|
|
|
, mLastWallpaperChangeTime(0.f)
|
|
|
|
, mFirstLoad(true)
|
|
|
|
|
|
|
|
, mProgress(0)
|
|
|
|
, mProgress(0)
|
|
|
|
, mVSyncWasEnabled(false)
|
|
|
|
, mVSyncWasEnabled(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -77,7 +77,11 @@ namespace MWGui
|
|
|
|
mWindow->setVSyncEnabled(false);
|
|
|
|
mWindow->setVSyncEnabled(false);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
if (!mFirstLoad)
|
|
|
|
bool showWallpaper = (MWBase::Environment::get().getStateManager()->getState()
|
|
|
|
|
|
|
|
== MWBase::StateManager::State_NoGame);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!showWallpaper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mBackgroundImage->setImageTexture("");
|
|
|
|
mBackgroundImage->setImageTexture("");
|
|
|
|
int width = mWindow->getWidth();
|
|
|
|
int width = mWindow->getWidth();
|
|
|
@ -103,12 +107,12 @@ namespace MWGui
|
|
|
|
|
|
|
|
|
|
|
|
setVisible(true);
|
|
|
|
setVisible(true);
|
|
|
|
|
|
|
|
|
|
|
|
if (mFirstLoad)
|
|
|
|
if (showWallpaper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
changeWallpaper();
|
|
|
|
changeWallpaper();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(mFirstLoad ? GM_LoadingWallpaper : GM_Loading);
|
|
|
|
MWBase::Environment::get().getWindowManager()->pushGuiMode(showWallpaper ? GM_LoadingWallpaper : GM_Loading);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LoadingScreen::loadingOff()
|
|
|
|
void LoadingScreen::loadingOff()
|
|
|
@ -188,11 +192,6 @@ namespace MWGui
|
|
|
|
draw();
|
|
|
|
draw();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LoadingScreen::removeWallpaper()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mFirstLoad = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LoadingScreen::draw()
|
|
|
|
void LoadingScreen::draw()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const float loadingScreenFps = 20.f;
|
|
|
|
const float loadingScreenFps = 20.f;
|
|
|
@ -201,7 +200,10 @@ namespace MWGui
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mLastRenderTime = mTimer.getMilliseconds ();
|
|
|
|
mLastRenderTime = mTimer.getMilliseconds ();
|
|
|
|
|
|
|
|
|
|
|
|
if (mFirstLoad && mTimer.getMilliseconds () > mLastWallpaperChangeTime + 5000*1)
|
|
|
|
bool showWallpaper = (MWBase::Environment::get().getStateManager()->getState()
|
|
|
|
|
|
|
|
== MWBase::StateManager::State_NoGame);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (showWallpaper && mTimer.getMilliseconds () > mLastWallpaperChangeTime + 5000*1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mLastWallpaperChangeTime = mTimer.getMilliseconds ();
|
|
|
|
mLastWallpaperChangeTime = mTimer.getMilliseconds ();
|
|
|
|
changeWallpaper();
|
|
|
|
changeWallpaper();
|
|
|
|