summaryrefslogtreecommitdiffstats
path: root/src/graphics
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2013-12-31 12:58:45 +0100
committerkrzys-h <krzys_h@interia.pl>2013-12-31 13:24:09 +0100
commit4a237f5925eb0d371e097416b17dd5e919cd2258 (patch)
tree9ce5e9347d0e0a655b247c530c8264581f19036a /src/graphics
parent3536f1c7cc52792a7d833b4f823aa515dc00d933 (diff)
downloadcolobot-4a237f5925eb0d371e097416b17dd5e919cd2258.tar.gz
colobot-4a237f5925eb0d371e097416b17dd5e919cd2258.tar.bz2
colobot-4a237f5925eb0d371e097416b17dd5e919cd2258.zip
CPauseManager
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/engine/engine.cpp13
-rw-r--r--src/graphics/engine/engine.h10
2 files changed, 8 insertions, 15 deletions
diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp
index 5cf7b23..0ee7715 100644
--- a/src/graphics/engine/engine.cpp
+++ b/src/graphics/engine/engine.cpp
@@ -63,6 +63,7 @@ CEngine::CEngine(CApplication *app)
m_planet = nullptr;
m_sound = nullptr;
m_terrain = nullptr;
+ m_pause = nullptr;
m_showStats = false;
@@ -80,7 +81,6 @@ CEngine::CEngine(CApplication *app)
m_fogStart[1] = 0.75f;
m_waterAddColor = Color(0.0f, 0.0f, 0.0f, 0.0f);
- m_pause = false;
m_render = true;
m_movieLock = false;
m_shadowVisible = true;
@@ -179,6 +179,7 @@ CEngine::~CEngine()
m_lightning = nullptr;
m_planet = nullptr;
m_terrain = nullptr;
+ m_pause = nullptr;
GetSystemUtils()->DestroyTimeStamp(m_lastFrameTime);
m_lastFrameTime = nullptr;
@@ -252,6 +253,7 @@ bool CEngine::Create()
m_cloud = new CCloud(this);
m_lightning = new CLightning(this);
m_planet = new CPlanet(this);
+ m_pause = new CPauseManager();
m_lightMan->SetDevice(m_device);
m_particle->SetDevice(m_device);
@@ -422,18 +424,13 @@ void CEngine::FrameUpdate()
bool CEngine::WriteScreenShot(const std::string& fileName, int width, int height)
{
// TODO write screenshot: not very important for now
- GetLogger()->Trace("CEngine::WriteSceenShot(): stub!\n");
+ GetLogger()->Debug("CEngine::WriteSceenShot(): stub!\n");
return true;
}
-void CEngine::SetPause(bool pause)
-{
- m_pause = pause;
-}
-
bool CEngine::GetPause()
{
- return m_pause;
+ return m_pause->GetPause();
}
void CEngine::SetMovieLock(bool lock)
diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h
index 5ecde8f..d56bf38 100644
--- a/src/graphics/engine/engine.h
+++ b/src/graphics/engine/engine.h
@@ -24,6 +24,7 @@
#include "app/system.h"
+#include "app/pausemanager.h"
#include "common/event.h"
#include "common/singleton.h"
@@ -734,11 +735,8 @@ public:
bool WriteScreenShot(const std::string& fileName, int width, int height);
- //@{
- //! Management of game pause mode
- void SetPause(bool pause);
+ //! Get pause mode
TEST_VIRTUAL bool GetPause();
- //@}
//@{
//! Management of lock for the duration of movie sequence
@@ -1288,6 +1286,7 @@ protected:
CLightning* m_lightning;
CPlanet* m_planet;
CTerrain* m_terrain;
+ CPauseManager* m_pause;
//! Last encountered error
std::string m_error;
@@ -1300,9 +1299,6 @@ protected:
//! Whether to show stats (FPS, etc)
bool m_showStats;
std::string m_fpsText;
-
- //! Pause mode
- bool m_pause;
//! Rendering enabled?
bool m_render;
//! Lock for duration of movie?