summaryrefslogtreecommitdiffstats
path: root/src/ui/studio.cpp
diff options
context:
space:
mode:
authorPiotr Dziwiński <piotr.dziwinski@nsn.com>2013-02-16 22:37:43 +0100
committerPiotr Dziwiński <piotr.dziwinski@nsn.com>2013-02-17 12:11:56 +0100
commit001d37b257b126dd6ef1dced70f94ff3d2806d28 (patch)
tree1025979c635c899f196d606f7d74170e33ef4f3a /src/ui/studio.cpp
parent45040318b026f8864d244e39f1703685ad688470 (diff)
downloadcolobot-001d37b257b126dd6ef1dced70f94ff3d2806d28.tar.gz
colobot-001d37b257b126dd6ef1dced70f94ff3d2806d28.tar.bz2
colobot-001d37b257b126dd6ef1dced70f94ff3d2806d28.zip
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
Diffstat (limited to 'src/ui/studio.cpp')
-rw-r--r--src/ui/studio.cpp29
1 files changed, 14 insertions, 15 deletions
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<Gfx::CEngine*>(m_iMan->SearchInstance(CLASS_ENGINE));
- m_event = static_cast<CEventQueue*>(m_iMan->SearchInstance(CLASS_EVENT));
- m_interface = static_cast<CInterface*>(m_iMan->SearchInstance(CLASS_INTERFACE));
- m_main = static_cast<CRobotMain*>(m_iMan->SearchInstance(CLASS_MAIN));
- m_camera = static_cast<Gfx::CCamera*>(m_iMan->SearchInstance(CLASS_CAMERA));
- m_sound = static_cast<CSoundInterface*>(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);
}