1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwgui/loadingscreen.hpp

78 lines
1.6 KiB
C++
Raw Normal View History

2012-09-11 16:37:54 +02:00
#ifndef MWGUI_LOADINGSCREEN_H
#define MWGUI_LOADINGSCREEN_H
2015-05-03 16:58:05 +02:00
#include <osg/Timer>
#include <osg/ref_ptr>
2012-09-11 16:37:54 +02:00
#include "windowbase.hpp"
2012-09-11 16:37:54 +02:00
#include <components/loadinglistener/loadinglistener.hpp>
2015-05-03 16:58:05 +02:00
namespace osgViewer
2015-01-10 03:56:06 +01:00
{
2015-05-03 16:58:05 +02:00
class Viewer;
}
namespace VFS
{
class Manager;
2015-01-10 03:56:06 +01:00
}
2012-09-11 16:37:54 +02:00
namespace MWGui
{
class BackgroundImage;
class LoadingScreen : public WindowBase, public Loading::Listener
2012-09-11 16:37:54 +02:00
{
public:
2015-05-03 16:58:05 +02:00
LoadingScreen(const VFS::Manager* vfs, osgViewer::Viewer* viewer);
virtual ~LoadingScreen();
virtual void setLabel (const std::string& label);
/// Indicate that some progress has been made, without specifying how much
virtual void indicateProgress ();
virtual void loadingOn();
virtual void loadingOff();
virtual void setProgressRange (size_t range);
virtual void setProgress (size_t value);
virtual void increaseProgress (size_t increase=1);
virtual void setVisible(bool visible);
2012-09-11 16:37:54 +02:00
void setLoadingProgress (const std::string& stage, int depth, int current, int total);
2012-09-13 00:21:58 +02:00
void loadingDone();
2012-09-11 16:37:54 +02:00
private:
2015-05-03 16:58:05 +02:00
void findSplashScreens();
const VFS::Manager* mVFS;
osg::ref_ptr<osgViewer::Viewer> mViewer;
2012-09-11 16:37:54 +02:00
double mLastWallpaperChangeTime;
double mLastRenderTime;
2015-05-03 16:58:05 +02:00
osg::Timer mTimer;
2012-09-11 16:37:54 +02:00
size_t mProgress;
MyGUI::Widget* mLoadingBox;
2012-09-11 16:37:54 +02:00
MyGUI::TextBox* mLoadingText;
MyGUI::ScrollBar* mProgressBar;
BackgroundImage* mBackgroundImage;
2012-09-11 19:18:26 +02:00
2015-05-03 16:58:05 +02:00
std::vector<std::string> mSplashScreens;
2012-09-11 16:37:54 +02:00
bool mVSyncWasEnabled;
2012-09-13 12:33:09 +02:00
void changeWallpaper();
void draw();
2012-09-11 16:37:54 +02:00
};
}
#endif