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/cloud.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/graphics/engine/cloud.cpp') diff --git a/src/graphics/engine/cloud.cpp b/src/graphics/engine/cloud.cpp index 0df0d12..d9ebf5a 100644 --- a/src/graphics/engine/cloud.cpp +++ b/src/graphics/engine/cloud.cpp @@ -18,12 +18,12 @@ #include "graphics/engine/cloud.h" -#include "common/iman.h" - #include "graphics/core/device.h" #include "graphics/engine/engine.h" #include "graphics/engine/terrain.h" +#include "object/robotmain.h" + #include "math/geometry.h" @@ -37,11 +37,8 @@ const int CLOUD_LINE_PREALLOCATE_COUNT = 100; const int CLOUD_SIZE_EXPAND = 4; -CCloud::CCloud(CInstanceManager* iMan, CEngine* engine) +CCloud::CCloud(CEngine* engine) { - m_iMan = iMan; - m_iMan->AddInstance(CLASS_CLOUD, this); - m_engine = engine; m_terrain = nullptr; @@ -55,7 +52,6 @@ CCloud::CCloud(CInstanceManager* iMan, CEngine* engine) CCloud::~CCloud() { - m_iMan = nullptr; m_engine = nullptr; m_terrain = nullptr; } @@ -84,7 +80,7 @@ bool CCloud::EventFrame(const Event &event) } void CCloud::AdjustLevel(Math::Vector& pos, Math::Vector& eye, float deep, - Math::Point& uv1, Math::Point& uv2) + Math::Point& uv1, Math::Point& uv2) { uv1.x = (pos.x+20000.0f)/1280.0f; uv1.y = (pos.z+20000.0f)/1280.0f; @@ -211,8 +207,8 @@ void CCloud::CreateLine(int x, int y, int len) } void CCloud::Create(const std::string& fileName, - const Color& diffuse, const Color& ambient, - float level) + const Color& diffuse, const Color& ambient, + float level) { m_diffuse = diffuse; m_ambient = ambient; @@ -225,7 +221,7 @@ void CCloud::Create(const std::string& fileName, m_engine->LoadTexture(m_fileName); if (m_terrain == nullptr) - m_terrain = static_cast(m_iMan->SearchInstance(CLASS_TERRAIN)); + m_terrain = CRobotMain::GetInstancePointer()->GetTerrain(); m_wind = m_terrain->GetWind(); @@ -250,7 +246,6 @@ void CCloud::Flush() m_level = 0.0f; } - void CCloud::SetLevel(float level) { m_level = level; -- cgit v1.2.3-1-g7c22