summaryrefslogtreecommitdiffstats
path: root/src/graphics/engine/engine.h
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/graphics/engine/engine.h
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/graphics/engine/engine.h')
-rw-r--r--src/graphics/engine/engine.h31
1 files changed, 21 insertions, 10 deletions
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<CEngine>
{
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;