diff --git a/src/Core/Core.pro b/src/Core/Core.pro index 8fe9fa2d..0387b397 100644 --- a/src/Core/Core.pro +++ b/src/Core/Core.pro @@ -145,7 +145,6 @@ HEADERS += \ Scene/CLightNode.h \ Scene/CModelNode.h \ Scene/CRootNode.h \ - Scene/CSceneManager.h \ Scene/CSceneNode.h \ Scene/CScriptNode.h \ Scene/CStaticNode.h \ @@ -179,7 +178,8 @@ HEADERS += \ Resource/Script/IPropertyTemplate.h \ Resource/Script/IProperty.h \ Resource/Model/EVertexAttribute.h \ - Render/FRenderOptions.h + Render/FRenderOptions.h \ + Scene/CScene.h # Source Files SOURCES += \ @@ -235,7 +235,6 @@ SOURCES += \ Scene/CCollisionNode.cpp \ Scene/CLightNode.cpp \ Scene/CModelNode.cpp \ - Scene/CSceneManager.cpp \ Scene/CSceneNode.cpp \ Scene/CScriptNode.cpp \ Scene/CStaticNode.cpp \ @@ -263,4 +262,5 @@ SOURCES += \ ScriptExtra/CRadiusSphereExtra.cpp \ Resource/Cooker/CAreaCooker.cpp \ Resource/Script/IPropertyTemplate.cpp \ - Resource/Script/IProperty.cpp + Resource/Script/IProperty.cpp \ + Scene/CScene.cpp diff --git a/src/Core/Render/SViewInfo.h b/src/Core/Render/SViewInfo.h index 119643d0..65a3f54d 100644 --- a/src/Core/Render/SViewInfo.h +++ b/src/Core/Render/SViewInfo.h @@ -7,10 +7,10 @@ struct SViewInfo { - class CSceneManager *pScene; + class CScene *pScene; class CRenderer *pRenderer; - class CCamera *pCamera; + bool GameMode; CFrustumPlanes ViewFrustum; CMatrix4f RotationOnlyViewMatrix; diff --git a/src/Core/Scene/CCollisionNode.cpp b/src/Core/Scene/CCollisionNode.cpp index 8fcd1aff..880754db 100644 --- a/src/Core/Scene/CCollisionNode.cpp +++ b/src/Core/Scene/CCollisionNode.cpp @@ -3,7 +3,7 @@ #include "Core/Render/CGraphics.h" #include "Core/Render/CRenderer.h" -CCollisionNode::CCollisionNode(CSceneManager *pScene, CSceneNode *pParent, CCollisionMeshGroup *pCollision) +CCollisionNode::CCollisionNode(CScene *pScene, CSceneNode *pParent, CCollisionMeshGroup *pCollision) : CSceneNode(pScene, pParent) { SetCollision(pCollision); diff --git a/src/Core/Scene/CCollisionNode.h b/src/Core/Scene/CCollisionNode.h index 15ab524b..5837c01c 100644 --- a/src/Core/Scene/CCollisionNode.h +++ b/src/Core/Scene/CCollisionNode.h @@ -9,7 +9,7 @@ class CCollisionNode : public CSceneNode TResPtr mpCollision; public: - CCollisionNode(CSceneManager *pScene, CSceneNode *pParent = 0, CCollisionMeshGroup *pCollision = 0); + CCollisionNode(CScene *pScene, CSceneNode *pParent = 0, CCollisionMeshGroup *pCollision = 0); ENodeType NodeType(); void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo); void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo); diff --git a/src/Core/Scene/CLightNode.cpp b/src/Core/Scene/CLightNode.cpp index 7e08b805..c7f025a3 100644 --- a/src/Core/Scene/CLightNode.cpp +++ b/src/Core/Scene/CLightNode.cpp @@ -4,7 +4,7 @@ #include "Core/Render/CRenderer.h" #include -CLightNode::CLightNode(CSceneManager *pScene, CSceneNode *pParent, CLight *Light) +CLightNode::CLightNode(CScene *pScene, CSceneNode *pParent, CLight *Light) : CSceneNode(pScene, pParent) { mpLight = Light; diff --git a/src/Core/Scene/CLightNode.h b/src/Core/Scene/CLightNode.h index 6a4218f1..c3e4adc4 100644 --- a/src/Core/Scene/CLightNode.h +++ b/src/Core/Scene/CLightNode.h @@ -8,7 +8,7 @@ class CLightNode : public CSceneNode { CLight *mpLight; public: - CLightNode(CSceneManager *pScene, CSceneNode *pParent = 0, CLight *Light = 0); + CLightNode(CScene *pScene, CSceneNode *pParent = 0, CLight *Light = 0); ENodeType NodeType(); void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo); void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo); diff --git a/src/Core/Scene/CModelNode.cpp b/src/Core/Scene/CModelNode.cpp index 9205d4c7..14019e4d 100644 --- a/src/Core/Scene/CModelNode.cpp +++ b/src/Core/Scene/CModelNode.cpp @@ -4,7 +4,7 @@ #include "Core/Render/CGraphics.h" #include -CModelNode::CModelNode(CSceneManager *pScene, CSceneNode *pParent, CModel *pModel) : CSceneNode(pScene, pParent) +CModelNode::CModelNode(CScene *pScene, CSceneNode *pParent, CModel *pModel) : CSceneNode(pScene, pParent) { SetModel(pModel); mScale = CVector3f(1.f); diff --git a/src/Core/Scene/CModelNode.h b/src/Core/Scene/CModelNode.h index 6d7cd857..eb75a3f3 100644 --- a/src/Core/Scene/CModelNode.h +++ b/src/Core/Scene/CModelNode.h @@ -12,7 +12,7 @@ class CModelNode : public CSceneNode bool mForceAlphaOn; public: - explicit CModelNode(CSceneManager *pScene, CSceneNode *pParent = 0, CModel *pModel = 0); + explicit CModelNode(CScene *pScene, CSceneNode *pParent = 0, CModel *pModel = 0); virtual ENodeType NodeType(); virtual void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo); diff --git a/src/Core/Scene/CRootNode.h b/src/Core/Scene/CRootNode.h index eeb6c384..289b83fb 100644 --- a/src/Core/Scene/CRootNode.h +++ b/src/Core/Scene/CRootNode.h @@ -8,7 +8,7 @@ class CRootNode : public CSceneNode { public: - explicit CRootNode(CSceneManager *pScene, CSceneNode *pParent = 0) : CSceneNode(pScene, pParent) {} + explicit CRootNode(CScene *pScene, CSceneNode *pParent = 0) : CSceneNode(pScene, pParent) {} ~CRootNode() {} ENodeType NodeType() { diff --git a/src/Core/Scene/CSceneManager.cpp b/src/Core/Scene/CScene.cpp similarity index 89% rename from src/Core/Scene/CSceneManager.cpp rename to src/Core/Scene/CScene.cpp index 9979462b..3faa2dee 100644 --- a/src/Core/Scene/CSceneManager.cpp +++ b/src/Core/Scene/CScene.cpp @@ -1,4 +1,4 @@ -#include "CSceneManager.h" +#include "CScene.h" #include "Core/Render/CGraphics.h" #include "Core/Resource/CResCache.h" #include "Core/Resource/Script/CScriptLayer.h" @@ -18,7 +18,7 @@ * Advantage of this is that I don't need to write separate functions for every single node type * They can all be tracked together and the code could be streamlined a lot. */ -CSceneManager::CSceneManager() +CScene::CScene() { mSplitTerrain = true; mNodeCount = 0; @@ -28,12 +28,12 @@ CSceneManager::CSceneManager() mpAreaRootNode = nullptr; } -CSceneManager::~CSceneManager() +CScene::~CScene() { ClearScene(); } -CModelNode* CSceneManager::AddModel(CModel *m) +CModelNode* CScene::AddModel(CModel *m) { if (m == nullptr) return nullptr; @@ -43,7 +43,7 @@ CModelNode* CSceneManager::AddModel(CModel *m) return node; } -CStaticNode* CSceneManager::AddStaticModel(CStaticModel *mdl) +CStaticNode* CScene::AddStaticModel(CStaticModel *mdl) { if (mdl == nullptr) return nullptr; @@ -53,7 +53,7 @@ CStaticNode* CSceneManager::AddStaticModel(CStaticModel *mdl) return node; } -CCollisionNode* CSceneManager::AddCollision(CCollisionMeshGroup *mesh) +CCollisionNode* CScene::AddCollision(CCollisionMeshGroup *mesh) { if (mesh == nullptr) return nullptr; @@ -63,7 +63,7 @@ CCollisionNode* CSceneManager::AddCollision(CCollisionMeshGroup *mesh) return node; } -CScriptNode* CSceneManager::AddScriptObject(CScriptObject *obj) +CScriptNode* CScene::AddScriptObject(CScriptObject *obj) { if (obj == nullptr) return nullptr; @@ -73,7 +73,7 @@ CScriptNode* CSceneManager::AddScriptObject(CScriptObject *obj) return node; } -CLightNode* CSceneManager::AddLight(CLight *Light) +CLightNode* CScene::AddLight(CLight *Light) { if (Light == nullptr) return nullptr; @@ -83,7 +83,7 @@ CLightNode* CSceneManager::AddLight(CLight *Light) return node; } -void CSceneManager::SetActiveArea(CGameArea* _area) +void CScene::SetActiveArea(CGameArea* _area) { // Clear existing area delete mpAreaRootNode; @@ -188,12 +188,12 @@ void CSceneManager::SetActiveArea(CGameArea* _area) std::cout << CSceneNode::NumNodes() << " nodes\n"; } -void CSceneManager::SetActiveWorld(CWorld* _world) +void CScene::SetActiveWorld(CWorld* _world) { mpWorld = _world; } -void CSceneManager::ClearScene() +void CScene::ClearScene() { if (mpAreaRootNode) { @@ -212,7 +212,7 @@ void CSceneManager::ClearScene() mNodeCount = 0; } -void CSceneManager::AddSceneToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo) +void CScene::AddSceneToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo) { FRenderOptions Options = pRenderer->RenderOptions(); @@ -249,7 +249,7 @@ void CSceneManager::AddSceneToRenderer(CRenderer *pRenderer, const SViewInfo& Vi } } -SRayIntersection CSceneManager::SceneRayCast(const CRay& Ray, const SViewInfo& ViewInfo) +SRayIntersection CScene::SceneRayCast(const CRay& Ray, const SViewInfo& ViewInfo) { // Terribly hacky stuff to avoid having tons of redundant code // because I'm too lazy to rewrite CSceneManager right now and fix it @@ -295,7 +295,7 @@ SRayIntersection CSceneManager::SceneRayCast(const CRay& Ray, const SViewInfo& V return Tester.TestNodes(ViewInfo); } -void CSceneManager::PickEnvironmentObjects() +void CScene::PickEnvironmentObjects() { // Pick AreaAttributes for (auto it = mAreaAttributesObjects.begin(); it != mAreaAttributesObjects.end(); it++) @@ -308,7 +308,7 @@ void CSceneManager::PickEnvironmentObjects() } } -CScriptNode* CSceneManager::ScriptNodeByID(u32 InstanceID) +CScriptNode* CScene::ScriptNodeByID(u32 InstanceID) { auto it = mScriptNodeMap.find(InstanceID); @@ -316,12 +316,12 @@ CScriptNode* CSceneManager::ScriptNodeByID(u32 InstanceID) else return nullptr; } -CScriptNode* CSceneManager::NodeForObject(CScriptObject *pObj) +CScriptNode* CScene::NodeForObject(CScriptObject *pObj) { return ScriptNodeByID(pObj->InstanceID()); } -CLightNode* CSceneManager::NodeForLight(CLight *pLight) +CLightNode* CScene::NodeForLight(CLight *pLight) { // Slow. Is there a better way to do this? for (auto it = mLightNodes.begin(); it != mLightNodes.end(); it++) @@ -330,7 +330,7 @@ CLightNode* CSceneManager::NodeForLight(CLight *pLight) return nullptr; } -CModel* CSceneManager::GetActiveSkybox() +CModel* CScene::GetActiveSkybox() { if (mpActiveAreaAttributes) { @@ -347,7 +347,7 @@ CModel* CSceneManager::GetActiveSkybox() else return nullptr; } -CGameArea* CSceneManager::GetActiveArea() +CGameArea* CScene::GetActiveArea() { return mpArea; } diff --git a/src/Core/Scene/CSceneManager.h b/src/Core/Scene/CScene.h similarity index 93% rename from src/Core/Scene/CSceneManager.h rename to src/Core/Scene/CScene.h index 730f8370..7eb07c28 100644 --- a/src/Core/Scene/CSceneManager.h +++ b/src/Core/Scene/CScene.h @@ -1,5 +1,5 @@ -#ifndef CSCENEMANAGER_h -#define CSCENEMANAGER_h +#ifndef CSCENE_H +#define CSCENE_H #include "CSceneNode.h" #include "CRootNode.h" @@ -19,7 +19,7 @@ #include #include -class CSceneManager +class CScene { bool mSplitTerrain; @@ -43,8 +43,8 @@ class CSceneManager std::unordered_map mScriptNodeMap; public: - CSceneManager(); - ~CSceneManager(); + CScene(); + ~CScene(); // Scene Management CModelNode* AddModel(CModel *mdl); @@ -67,4 +67,4 @@ public: CGameArea* GetActiveArea(); }; -#endif // CSCENEMANAGER_H +#endif // CSCENE_H diff --git a/src/Core/Scene/CSceneNode.cpp b/src/Core/Scene/CSceneNode.cpp index 06514fe0..03efd7b6 100644 --- a/src/Core/Scene/CSceneNode.cpp +++ b/src/Core/Scene/CSceneNode.cpp @@ -13,7 +13,7 @@ u32 CSceneNode::smNumNodes = 0; CColor CSceneNode::skSelectionTint = CColor::Integral(39, 154, 167); -CSceneNode::CSceneNode(CSceneManager *pScene, CSceneNode *pParent) +CSceneNode::CSceneNode(CScene *pScene, CSceneNode *pParent) { smNumNodes++; mpScene = pScene; @@ -322,7 +322,7 @@ CSceneNode* CSceneNode::Parent() const return mpParent; } -CSceneManager* CSceneNode::Scene() const +CScene* CSceneNode::Scene() const { return mpScene; } diff --git a/src/Core/Scene/CSceneNode.h b/src/Core/Scene/CSceneNode.h index 0b85a1c2..da0c2236 100644 --- a/src/Core/Scene/CSceneNode.h +++ b/src/Core/Scene/CSceneNode.h @@ -16,7 +16,7 @@ #include class CRenderer; -class CSceneManager; +class CScene; class CSceneNode : public IRenderable { @@ -33,7 +33,7 @@ protected: static u32 smNumNodes; TString mName; CSceneNode *mpParent; - CSceneManager *mpScene; + CScene *mpScene; CVector3f mPosition; CQuaternion mRotation; @@ -51,7 +51,7 @@ protected: CColor mAmbientColor; public: - explicit CSceneNode(CSceneManager *pScene, CSceneNode *pParent = 0); + explicit CSceneNode(CScene *pScene, CSceneNode *pParent = 0); virtual ~CSceneNode(); virtual ENodeType NodeType() = 0; virtual void AddToRenderer(CRenderer* /*pRenderer*/, const SViewInfo& /*ViewInfo*/) {} @@ -89,7 +89,7 @@ public: // Getters TString Name() const; CSceneNode* Parent() const; - CSceneManager* Scene() const; + CScene* Scene() const; CVector3f LocalPosition() const; CVector3f AbsolutePosition() const; CQuaternion LocalRotation() const; diff --git a/src/Core/Scene/CScriptNode.cpp b/src/Core/Scene/CScriptNode.cpp index 0e9c826c..e0d33227 100644 --- a/src/Core/Scene/CScriptNode.cpp +++ b/src/Core/Scene/CScriptNode.cpp @@ -1,5 +1,5 @@ #include "CScriptNode.h" -#include "CSceneManager.h" +#include "CScene.h" #include "Core/Render/CDrawUtil.h" #include "Core/Render/CGraphics.h" #include "Core/Render/CRenderer.h" @@ -10,7 +10,7 @@ #include #include -CScriptNode::CScriptNode(CSceneManager *pScene, CSceneNode *pParent, CScriptObject *pObject) +CScriptNode::CScriptNode(CScene *pScene, CSceneNode *pParent, CScriptObject *pObject) : CSceneNode(pScene, pParent) { mpVolumePreviewNode = nullptr; diff --git a/src/Core/Scene/CScriptNode.h b/src/Core/Scene/CScriptNode.h index 0384070d..dc6536d3 100644 --- a/src/Core/Scene/CScriptNode.h +++ b/src/Core/Scene/CScriptNode.h @@ -23,7 +23,7 @@ class CScriptNode : public CSceneNode CLightParameters *mpLightParameters; public: - CScriptNode(CSceneManager *pScene, CSceneNode *pParent = 0, CScriptObject *pObject = 0); + CScriptNode(CScene *pScene, CSceneNode *pParent = 0, CScriptObject *pObject = 0); ENodeType NodeType(); void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo); void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo); diff --git a/src/Core/Scene/CStaticNode.cpp b/src/Core/Scene/CStaticNode.cpp index 1433ff9b..2163863c 100644 --- a/src/Core/Scene/CStaticNode.cpp +++ b/src/Core/Scene/CStaticNode.cpp @@ -5,7 +5,7 @@ #include #include -CStaticNode::CStaticNode(CSceneManager *pScene, CSceneNode *pParent, CStaticModel *pModel) +CStaticNode::CStaticNode(CScene *pScene, CSceneNode *pParent, CStaticModel *pModel) : CSceneNode(pScene, pParent) { mpModel = pModel; diff --git a/src/Core/Scene/CStaticNode.h b/src/Core/Scene/CStaticNode.h index 7a94319b..bab0f96f 100644 --- a/src/Core/Scene/CStaticNode.h +++ b/src/Core/Scene/CStaticNode.h @@ -9,7 +9,7 @@ class CStaticNode : public CSceneNode CStaticModel *mpModel; public: - CStaticNode(CSceneManager *pScene, CSceneNode *pParent = 0, CStaticModel *pModel = 0); + CStaticNode(CScene *pScene, CSceneNode *pParent = 0, CStaticModel *pModel = 0); ENodeType NodeType(); void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo); void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo); diff --git a/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp b/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp index 1bb500ae..cf31ab65 100644 --- a/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp +++ b/src/Core/ScriptExtra/CDamageableTriggerExtra.cpp @@ -2,7 +2,7 @@ #include "Core/Render/CDrawUtil.h" #include "Core/Render/CRenderer.h" -CDamageableTriggerExtra::CDamageableTriggerExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent) +CDamageableTriggerExtra::CDamageableTriggerExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent) : CScriptExtra(pInstance, pScene, pParent) , mpRenderSideProp(nullptr) , mpMat(nullptr) diff --git a/src/Core/ScriptExtra/CDamageableTriggerExtra.h b/src/Core/ScriptExtra/CDamageableTriggerExtra.h index 48836be9..9df89d8d 100644 --- a/src/Core/ScriptExtra/CDamageableTriggerExtra.h +++ b/src/Core/ScriptExtra/CDamageableTriggerExtra.h @@ -29,7 +29,7 @@ class CDamageableTriggerExtra : public CScriptExtra CVector2f mCoordScale; public: - explicit CDamageableTriggerExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent = 0); + explicit CDamageableTriggerExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0); ~CDamageableTriggerExtra(); void CreateMaterial(); void UpdatePlaneTransform(); diff --git a/src/Core/ScriptExtra/CDoorExtra.cpp b/src/Core/ScriptExtra/CDoorExtra.cpp index a3d68028..a85fd6f4 100644 --- a/src/Core/ScriptExtra/CDoorExtra.cpp +++ b/src/Core/ScriptExtra/CDoorExtra.cpp @@ -1,7 +1,7 @@ #include "CDoorExtra.h" #include "Core/Render/CRenderer.h" -CDoorExtra::CDoorExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent) +CDoorExtra::CDoorExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent) : CScriptExtra(pInstance, pScene, pParent) , mpShieldModelProp(nullptr) , mpShieldColorProp(nullptr) diff --git a/src/Core/ScriptExtra/CDoorExtra.h b/src/Core/ScriptExtra/CDoorExtra.h index c0050578..86fbd8ff 100644 --- a/src/Core/ScriptExtra/CDoorExtra.h +++ b/src/Core/ScriptExtra/CDoorExtra.h @@ -13,7 +13,7 @@ class CDoorExtra : public CScriptExtra CColor mShieldColor; public: - explicit CDoorExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent = 0); + explicit CDoorExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0); void PropertyModified(IProperty *pProperty); void AddToRenderer(CRenderer *pRenderer, const SViewInfo& ViewInfo); void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& ViewInfo); diff --git a/src/Core/ScriptExtra/CPointOfInterestExtra.cpp b/src/Core/ScriptExtra/CPointOfInterestExtra.cpp index 702a6078..a596ba16 100644 --- a/src/Core/ScriptExtra/CPointOfInterestExtra.cpp +++ b/src/Core/ScriptExtra/CPointOfInterestExtra.cpp @@ -3,7 +3,7 @@ const CColor CPointOfInterestExtra::skRegularColor = CColor::Integral(0xFF,0x70,0x00); const CColor CPointOfInterestExtra::skImportantColor = CColor::Integral(0xFF,0x00,0x00); -CPointOfInterestExtra::CPointOfInterestExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent) +CPointOfInterestExtra::CPointOfInterestExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent) : CScriptExtra(pInstance, pScene, pParent) , mpScanProperty(nullptr) , mpScanData(nullptr) diff --git a/src/Core/ScriptExtra/CPointOfInterestExtra.h b/src/Core/ScriptExtra/CPointOfInterestExtra.h index 9cfd1b84..7db7fe46 100644 --- a/src/Core/ScriptExtra/CPointOfInterestExtra.h +++ b/src/Core/ScriptExtra/CPointOfInterestExtra.h @@ -12,7 +12,7 @@ class CPointOfInterestExtra : public CScriptExtra TResPtr mpScanData; public: - explicit CPointOfInterestExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent = 0); + explicit CPointOfInterestExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0); void PropertyModified(IProperty* pProperty); void ModifyTintColor(CColor& Color); diff --git a/src/Core/ScriptExtra/CRadiusSphereExtra.cpp b/src/Core/ScriptExtra/CRadiusSphereExtra.cpp index 66280681..2365573a 100644 --- a/src/Core/ScriptExtra/CRadiusSphereExtra.cpp +++ b/src/Core/ScriptExtra/CRadiusSphereExtra.cpp @@ -2,7 +2,7 @@ #include "Core/Render/CDrawUtil.h" #include "Core/Render/CRenderer.h" -CRadiusSphereExtra::CRadiusSphereExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent) +CRadiusSphereExtra::CRadiusSphereExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent) : CScriptExtra(pInstance, pScene, pParent) , mpRadius(nullptr) { diff --git a/src/Core/ScriptExtra/CRadiusSphereExtra.h b/src/Core/ScriptExtra/CRadiusSphereExtra.h index c7fda10f..4c5e25cb 100644 --- a/src/Core/ScriptExtra/CRadiusSphereExtra.h +++ b/src/Core/ScriptExtra/CRadiusSphereExtra.h @@ -10,7 +10,7 @@ class CRadiusSphereExtra : public CScriptExtra TFloatProperty *mpRadius; public: - explicit CRadiusSphereExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent = 0); + explicit CRadiusSphereExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0); void AddToRenderer(CRenderer *pRenderer, const SViewInfo& rkViewInfo); void Draw(FRenderOptions Options, int ComponentIndex, const SViewInfo& rkViewInfo); CColor Color() const; diff --git a/src/Core/ScriptExtra/CScriptExtra.h b/src/Core/ScriptExtra/CScriptExtra.h index d561a72f..59520108 100644 --- a/src/Core/ScriptExtra/CScriptExtra.h +++ b/src/Core/ScriptExtra/CScriptExtra.h @@ -19,7 +19,7 @@ protected: EGame mGame; public: - explicit CScriptExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent = 0) + explicit CScriptExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0) : CSceneNode(pScene, pParent), mpInstance(pInstance), mGame(pInstance->Template()->Game()) diff --git a/src/Core/ScriptExtra/CSpacePirateExtra.cpp b/src/Core/ScriptExtra/CSpacePirateExtra.cpp index a8b29004..cf81c454 100644 --- a/src/Core/ScriptExtra/CSpacePirateExtra.cpp +++ b/src/Core/ScriptExtra/CSpacePirateExtra.cpp @@ -1,6 +1,6 @@ #include "CSpacePirateExtra.h" -CSpacePirateExtra::CSpacePirateExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent) +CSpacePirateExtra::CSpacePirateExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent) : CScriptExtra(pInstance, pScene ,pParent) , mpPowerVuln(nullptr) , mpWaveVuln(nullptr) diff --git a/src/Core/ScriptExtra/CSpacePirateExtra.h b/src/Core/ScriptExtra/CSpacePirateExtra.h index dd1f7cb3..805f31f3 100644 --- a/src/Core/ScriptExtra/CSpacePirateExtra.h +++ b/src/Core/ScriptExtra/CSpacePirateExtra.h @@ -13,7 +13,7 @@ class CSpacePirateExtra : public CScriptExtra TLongProperty *mpPlasmaVuln; public: - explicit CSpacePirateExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent = 0); + explicit CSpacePirateExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0); CColor TevColor(); }; diff --git a/src/Core/ScriptExtra/CWaypointExtra.cpp b/src/Core/ScriptExtra/CWaypointExtra.cpp index 224e88c6..f4a2bcdd 100644 --- a/src/Core/ScriptExtra/CWaypointExtra.cpp +++ b/src/Core/ScriptExtra/CWaypointExtra.cpp @@ -1,9 +1,9 @@ #include "CWaypointExtra.h" #include "Core/Render/CDrawUtil.h" #include "Core/Render/CRenderer.h" -#include "Core/Scene/CSceneManager.h" +#include "Core/Scene/CScene.h" -CWaypointExtra::CWaypointExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent) +CWaypointExtra::CWaypointExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent) : CScriptExtra(pInstance, pScene, pParent) , mColor(CColor::skBlack) , mLinksBuilt(false) diff --git a/src/Core/ScriptExtra/CWaypointExtra.h b/src/Core/ScriptExtra/CWaypointExtra.h index 2826ecc1..d5665c49 100644 --- a/src/Core/ScriptExtra/CWaypointExtra.h +++ b/src/Core/ScriptExtra/CWaypointExtra.h @@ -18,7 +18,7 @@ class CWaypointExtra : public CScriptExtra std::vector mLinks; public: - explicit CWaypointExtra(CScriptObject *pInstance, CSceneManager *pScene, CSceneNode *pParent = 0); + explicit CWaypointExtra(CScriptObject *pInstance, CScene *pScene, CSceneNode *pParent = 0); void BuildLinks(); bool IsPathLink(const SLink& rkLink); diff --git a/src/Editor/CNodeSelection.cpp b/src/Editor/CNodeSelection.cpp index 3c371c82..7caf4050 100644 --- a/src/Editor/CNodeSelection.cpp +++ b/src/Editor/CNodeSelection.cpp @@ -1,6 +1,6 @@ #include "CNodeSelection.h" -CSceneSelection::CSceneSelection(CSceneManager *pScene) +CSceneSelection::CSceneSelection(CScene *pScene) { mpScene = pScene; } diff --git a/src/Editor/CNodeSelection.h b/src/Editor/CNodeSelection.h index 6fe1cfa1..6ff0a231 100644 --- a/src/Editor/CNodeSelection.h +++ b/src/Editor/CNodeSelection.h @@ -6,11 +6,11 @@ class CSceneSelection { - CSceneManager *mpScene; + CScene *mpScene; std::vector mSelectedNodes; public: - CSceneSelection(CSceneManager *pScene); + CSceneSelection(CScene *pScene); void SelectNode(CSceneNode *pNode); void DeselectNode(CSceneNode *pNode); u32 SelectionSize(); diff --git a/src/Editor/CSceneViewport.cpp b/src/Editor/CSceneViewport.cpp index 76a5bb36..5d683b58 100644 --- a/src/Editor/CSceneViewport.cpp +++ b/src/Editor/CSceneViewport.cpp @@ -31,7 +31,7 @@ CSceneViewport::~CSceneViewport() delete mpRenderer; } -void CSceneViewport::SetScene(INodeEditor *pEditor, CSceneManager *pScene) +void CSceneViewport::SetScene(INodeEditor *pEditor, CScene *pScene) { mpEditor = pEditor; mpScene = pScene; diff --git a/src/Editor/CSceneViewport.h b/src/Editor/CSceneViewport.h index ae675206..e701b5d3 100644 --- a/src/Editor/CSceneViewport.h +++ b/src/Editor/CSceneViewport.h @@ -9,7 +9,7 @@ class CSceneViewport : public CBasicViewport Q_OBJECT INodeEditor *mpEditor; - CSceneManager *mpScene; + CScene *mpScene; CRenderer *mpRenderer; // Render settings @@ -33,7 +33,7 @@ class CSceneViewport : public CBasicViewport public: CSceneViewport(QWidget *pParent = 0); ~CSceneViewport(); - void SetScene(INodeEditor *pEditor, CSceneManager *pScene); + void SetScene(INodeEditor *pEditor, CScene *pScene); void SetSkyEnabled(bool b); CRenderer* Renderer(); CSceneNode* HoverNode(); diff --git a/src/Editor/INodeEditor.cpp b/src/Editor/INodeEditor.cpp index e204dbef..5b2fd44d 100644 --- a/src/Editor/INodeEditor.cpp +++ b/src/Editor/INodeEditor.cpp @@ -61,7 +61,7 @@ QUndoStack* INodeEditor::UndoStack() return &mUndoStack; } -CSceneManager* INodeEditor::Scene() +CScene* INodeEditor::Scene() { return &mScene; } diff --git a/src/Editor/INodeEditor.h b/src/Editor/INodeEditor.h index d0544ab3..6dbc0f3d 100644 --- a/src/Editor/INodeEditor.h +++ b/src/Editor/INodeEditor.h @@ -3,7 +3,7 @@ #include "CGizmo.h" #include -#include +#include #include #include @@ -22,7 +22,7 @@ protected: QList mUndoActions; // Node management - CSceneManager mScene; + CScene mScene; QList mSelection; CAABox mSelectionBounds; @@ -43,7 +43,7 @@ public: explicit INodeEditor(QWidget *pParent = 0); virtual ~INodeEditor(); QUndoStack* UndoStack(); - CSceneManager* Scene(); + CScene* Scene(); CGizmo* Gizmo(); bool IsGizmoVisible(); void BeginGizmoTransform(); diff --git a/src/Editor/ModelEditor/CModelEditorWindow.cpp b/src/Editor/ModelEditor/CModelEditorWindow.cpp index 9da3bd6c..5304dc8d 100644 --- a/src/Editor/ModelEditor/CModelEditorWindow.cpp +++ b/src/Editor/ModelEditor/CModelEditorWindow.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include @@ -28,7 +28,7 @@ CModelEditorWindow::CModelEditorWindow(QWidget *parent) : { ui->setupUi(this); - mpScene = new CSceneManager(); + mpScene = new CScene(); mpCurrentMat = nullptr; mpCurrentModel = nullptr; mpCurrentModelNode = new CModelNode(mpScene); diff --git a/src/Editor/ModelEditor/CModelEditorWindow.h b/src/Editor/ModelEditor/CModelEditorWindow.h index f1126847..681bb861 100644 --- a/src/Editor/ModelEditor/CModelEditorWindow.h +++ b/src/Editor/ModelEditor/CModelEditorWindow.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include @@ -21,7 +21,7 @@ class CModelEditorWindow : public QMainWindow Q_OBJECT Ui::CModelEditorWindow *ui; - CSceneManager *mpScene; + CScene *mpScene; QString mOutputFilename; TResPtr mpCurrentModel; CModelNode *mpCurrentModelNode; diff --git a/src/Editor/WorldEditor/CLayersInstanceModel.h b/src/Editor/WorldEditor/CLayersInstanceModel.h index 55b50947..c9ef1748 100644 --- a/src/Editor/WorldEditor/CLayersInstanceModel.h +++ b/src/Editor/WorldEditor/CLayersInstanceModel.h @@ -23,7 +23,7 @@ public: private: CWorldEditor *mpEditor; - CSceneManager *mpScene; + CScene *mpScene; TResPtr mpArea; public: diff --git a/src/Editor/WorldEditor/CTypesInstanceModel.h b/src/Editor/WorldEditor/CTypesInstanceModel.h index 00097347..4da589b9 100644 --- a/src/Editor/WorldEditor/CTypesInstanceModel.h +++ b/src/Editor/WorldEditor/CTypesInstanceModel.h @@ -30,7 +30,7 @@ public: private: CWorldEditor *mpEditor; - CSceneManager *mpScene; + CScene *mpScene; TResPtr mpArea; CMasterTemplate *mpCurrentMaster; EInstanceModelType mModelType; diff --git a/src/Editor/WorldEditor/CWorldEditor.h b/src/Editor/WorldEditor/CWorldEditor.h index 770e0586..1d33ac8c 100644 --- a/src/Editor/WorldEditor/CWorldEditor.h +++ b/src/Editor/WorldEditor/CWorldEditor.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/Editor/WorldEditor/WInstancesTab.cpp b/src/Editor/WorldEditor/WInstancesTab.cpp index d9563df6..2f852749 100644 --- a/src/Editor/WorldEditor/WInstancesTab.cpp +++ b/src/Editor/WorldEditor/WInstancesTab.cpp @@ -3,7 +3,7 @@ #include "CWorldEditor.h" #include -#include +#include WInstancesTab::WInstancesTab(QWidget *parent) : QWidget(parent), @@ -47,7 +47,7 @@ WInstancesTab::~WInstancesTab() delete ui; } -void WInstancesTab::SetEditor(CWorldEditor *pEditor, CSceneManager *pScene) +void WInstancesTab::SetEditor(CWorldEditor *pEditor, CScene *pScene) { mpEditor = pEditor; mpScene = pScene; diff --git a/src/Editor/WorldEditor/WInstancesTab.h b/src/Editor/WorldEditor/WInstancesTab.h index d57acdea..ce401055 100644 --- a/src/Editor/WorldEditor/WInstancesTab.h +++ b/src/Editor/WorldEditor/WInstancesTab.h @@ -8,7 +8,7 @@ #include class CWorldEditor; -class CSceneManager; +class CScene; namespace Ui { class WInstancesTab; @@ -19,7 +19,7 @@ class WInstancesTab : public QWidget Q_OBJECT CWorldEditor *mpEditor; - CSceneManager *mpScene; + CScene *mpScene; CTypesInstanceModel *mpLayersModel; CTypesInstanceModel *mpTypesModel; @@ -32,7 +32,7 @@ class WInstancesTab : public QWidget public: explicit WInstancesTab(QWidget *parent = 0); ~WInstancesTab(); - void SetEditor(CWorldEditor *pEditor, CSceneManager *pScene); + void SetEditor(CWorldEditor *pEditor, CScene *pScene); void SetMaster(CMasterTemplate *pMaster); void SetArea(CGameArea *pArea);