diff --git a/src/app/pausemanager.cpp b/src/app/pausemanager.cpp index 0aa17ddb..1ee2b9cd 100644 --- a/src/app/pausemanager.cpp +++ b/src/app/pausemanager.cpp @@ -28,9 +28,6 @@ #include -template<> CPauseManager* CSingleton::m_instance = nullptr; - - CPauseManager::CPauseManager() {} diff --git a/src/app/pausemanager.h b/src/app/pausemanager.h index 81e0ce1f..581d74a5 100644 --- a/src/app/pausemanager.h +++ b/src/app/pausemanager.h @@ -23,8 +23,6 @@ */ #pragma once -#include "common/singleton.h" - #include #include #include @@ -59,7 +57,7 @@ private: PauseType type; }; -class CPauseManager : public CSingleton +class CPauseManager { public: CPauseManager(); diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index 3b6c131c..b9b29211 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -270,6 +270,11 @@ CCloud* CEngine::GetCloud() return m_cloud.get(); } +CPauseManager* CEngine::GetPauseManager() +{ + return m_pause.get(); +} + void CEngine::SetTerrain(CTerrain* terrain) { m_terrain = terrain; diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h index bf5248f9..20f06825 100644 --- a/src/graphics/engine/engine.h +++ b/src/graphics/engine/engine.h @@ -646,6 +646,8 @@ public: CPlanet* GetPlanet(); //! Returns the fog manager CCloud* GetCloud(); + //! Returns the pause manager + CPauseManager* GetPauseManager(); //! Sets the terrain object void SetTerrain(CTerrain* terrain); diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp index 9cca897d..3873bf49 100644 --- a/src/level/robotmain.cpp +++ b/src/level/robotmain.cpp @@ -135,7 +135,7 @@ CRobotMain::CRobotMain() m_cloud = m_engine->GetCloud(); m_lightning = m_engine->GetLightning(); m_planet = m_engine->GetPlanet(); - m_pause = CPauseManager::GetInstancePointer(); + m_pause = m_engine->GetPauseManager(); m_input = CInput::GetInstancePointer(); m_modelManager = MakeUnique(); diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp index ed01cb4c..d1fdc845 100644 --- a/src/ui/displayinfo.cpp +++ b/src/ui/displayinfo.cpp @@ -69,7 +69,7 @@ CDisplayInfo::CDisplayInfo() m_main = CRobotMain::GetInstancePointer(); m_interface = m_main->GetInterface(); m_camera = m_main->GetCamera(); - m_pause = CPauseManager::GetInstancePointer(); + m_pause = m_engine->GetPauseManager(); m_bInfoMaximized = true; m_bInfoMinimized = false; diff --git a/src/ui/mainshort.cpp b/src/ui/mainshort.cpp index ccae2c39..c74dbaba 100644 --- a/src/ui/mainshort.cpp +++ b/src/ui/mainshort.cpp @@ -113,9 +113,9 @@ bool CMainShort::CreateShortcuts() { return true; } - CPauseManager* pause = CPauseManager::GetInstancePointer(); + PauseType pauseType = m_engine->GetPauseManager()->GetPauseType(); - if (pause->GetPauseType() == PAUSE_SATCOM || pause->GetPauseType() == PAUSE_EDITOR || pause->GetPauseType() == PAUSE_DIALOG) + if (pauseType == PAUSE_SATCOM || pauseType == PAUSE_EDITOR || pauseType == PAUSE_DIALOG) return true; // Create new shortcuts diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp index e4ec199d..93a452d0 100644 --- a/src/ui/studio.cpp +++ b/src/ui/studio.cpp @@ -80,7 +80,7 @@ CStudio::CStudio() m_main = CRobotMain::GetInstancePointer(); m_interface = m_main->GetInterface(); m_camera = m_main->GetCamera(); - m_pause = CPauseManager::GetInstancePointer(); + m_pause = m_engine->GetPauseManager(); m_settings = CSettings::GetInstancePointer(); m_program = nullptr;