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/graphics/engine/engine.h | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) (limited to 'src/graphics/engine/engine.h') diff --git a/src/graphics/engine/engine.h b/src/graphics/engine/engine.h index e5c75bc..0647fbd 100644 --- a/src/graphics/engine/engine.h +++ b/src/graphics/engine/engine.h @@ -26,6 +26,7 @@ #include "app/system.h" #include "common/event.h" +#include "common/singleton.h" #include "graphics/core/color.h" #include "graphics/core/material.h" @@ -47,7 +48,6 @@ class CApplication; -class CInstanceManager; class CObject; class CSoundInterface; class CImage; @@ -671,22 +671,36 @@ struct EngineMouse * which is what OpenGL actually wants. The old method is kept for now, with mapping between texture names * and texture structs but it will also be subject to refactoring in the future. */ -class CEngine +class CEngine : public CSingleton { public: - CEngine(CInstanceManager* iMan, CApplication* app); + CEngine(CApplication* app); ~CEngine(); //! Sets the device to be used void SetDevice(CDevice* device); //! Returns the current device - CDevice* GetDevice(); - - //! Sets the terrain object - void SetTerrain(CTerrain* terrain); + CDevice* GetDevice(); //! Returns the text rendering engine CText* GetText(); + //! Returns the light manager + CLightManager* GetLightManager(); + //! Returns the particle manager + CParticle* GetParticle(); + //! Returns the terrain manager + CTerrain* GetTerrain(); + //! Returns the water manager + CWater* GetWater(); + //! Returns the lighting manager + CLightning* GetLightning(); + //! Returns the planet manager + CPlanet* GetPlanet(); + //! Returns the fog manager + CCloud* GetCloud(); + + //! Sets the terrain object + void SetTerrain(CTerrain* terrain); //! Performs the initialization; must be called after device was set @@ -735,8 +749,6 @@ public: //! Returns current size of viewport window Math::IntPoint GetWindowSize(); - //! Returns the last size of viewport window - Math::IntPoint GetLastWindowSize(); //@{ //! Conversion functions between window and interface coordinates @@ -1251,7 +1263,6 @@ protected: void UpdateStaticBuffers(); protected: - CInstanceManager* m_iMan; CApplication* m_app; CSoundInterface* m_sound; CDevice* m_device; -- cgit v1.2.3-1-g7c22