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/ui/studio.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/ui/studio.cpp') diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp index 7aa2d22..bf2ff33 100644 --- a/src/ui/studio.cpp +++ b/src/ui/studio.cpp @@ -15,23 +15,26 @@ // * You should have received a copy of the GNU General Public License // * along with this program. If not, see http://www.gnu.org/licenses/. -// studio.cpp - -#include "studio.h" +#include "ui/studio.h" #include "CBot/CBotDll.h" #include "app/app.h" + #include "common/event.h" -#include "common/iman.h" #include "common/misc.h" + #include "graphics/engine/camera.h" #include "graphics/engine/engine.h" + #include "object/object.h" + #include "script/cbottoken.h" #include "script/script.h" + #include "sound/sound.h" + #include "ui/check.h" #include "ui/control.h" #include "ui/color.h" @@ -61,16 +64,13 @@ namespace Ui { CStudio::CStudio() { - m_iMan = CInstanceManager::GetInstancePointer(); - m_iMan->AddInstance(CLASS_STUDIO, this); - - m_engine = static_cast(m_iMan->SearchInstance(CLASS_ENGINE)); - m_event = static_cast(m_iMan->SearchInstance(CLASS_EVENT)); - m_interface = static_cast(m_iMan->SearchInstance(CLASS_INTERFACE)); - m_main = static_cast(m_iMan->SearchInstance(CLASS_MAIN)); - m_camera = static_cast(m_iMan->SearchInstance(CLASS_CAMERA)); - m_sound = static_cast(m_iMan->SearchInstance(CLASS_SOUND)); - m_app = CApplication::GetInstancePointer(); + m_app = CApplication::GetInstancePointer(); + m_sound = m_app->GetSound(); + m_event = m_app->GetEventQueue(); + m_engine = Gfx::CEngine::GetInstancePointer(); + m_main = CRobotMain::GetInstancePointer(); + m_interface = m_main->GetInterface(); + m_camera = m_main->GetCamera(); m_bEditMaximized = false; m_bEditMinimized = false; @@ -87,7 +87,6 @@ CStudio::CStudio() CStudio::~CStudio() { - m_iMan->DeleteInstance(CLASS_STUDIO, this); } -- cgit v1.2.3-1-g7c22