From 001d37b257b126dd6ef1dced70f94ff3d2806d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Dziwi=C5=84ski?= Date: Sat, 16 Feb 2013 22:37:43 +0100 Subject: CInstanceManager refactoring * removed classes managed by CInstanceManager except for CObject, CPyro, CBrain and CPhysics because of dependencies * refactored instance searching to use existing singleton instances of CApplication, CEngine and CRobotMain and calling their getter functions --- src/app/app.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/app/app.cpp') diff --git a/src/app/app.cpp b/src/app/app.cpp index 9886b24..ae5ac88 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -46,7 +46,7 @@ #endif -template<> CApplication* CSingleton::mInstance = nullptr; +template<> CApplication* CSingleton::m_instance = nullptr; //! Static buffer for putenv locale static char S_LANGUAGE[50] = { 0 }; @@ -94,7 +94,7 @@ CApplication::CApplication() { m_private = new ApplicationPrivate(); m_iMan = new CInstanceManager(); - m_eventQueue = new CEventQueue(m_iMan); + m_eventQueue = new CEventQueue(); m_profile = new CProfile(); m_engine = nullptr; @@ -187,6 +187,16 @@ CApplication::~CApplication() } } +CEventQueue* CApplication::GetEventQueue() +{ + return m_eventQueue; +} + +CSoundInterface* CApplication::GetSound() +{ + return m_sound; +} + ParseArgsStatus CApplication::ParseArguments(int argc, char *argv[]) { bool waitDataDir = false; @@ -410,7 +420,7 @@ bool CApplication::Create() } // Create the 3D engine - m_engine = new Gfx::CEngine(m_iMan, this); + m_engine = new Gfx::CEngine(this); m_engine->SetDevice(m_device); @@ -425,7 +435,7 @@ bool CApplication::Create() m_modelManager = new Gfx::CModelManager(m_engine); // Create the robot application. - m_robotMain = new CRobotMain(m_iMan, this); + m_robotMain = new CRobotMain(this); m_robotMain->ChangePhase(PHASE_WELCOME1); -- cgit v1.2.3-1-g7c22