diff --git a/source/graphics/GameView.cpp b/source/graphics/GameView.cpp index 70f878bc01..6194448e89 100755 --- a/source/graphics/GameView.cpp +++ b/source/graphics/GameView.cpp @@ -17,6 +17,10 @@ #include "Hotkey.h" #include "ConfigDB.h" +#include "Quaternion.h" +#include "Unit.h" +#include "Model.h" + #include "sdl.h" #include "input.h" #include "lib.h" diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index 4151ada9b7..4499be3071 100755 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -3,6 +3,7 @@ #include "types.h" #include "MapReader.h" #include "UnitManager.h" +#include "Unit.h" #include "ObjectManager.h" #include "BaseEntity.h" #include "BaseEntityCollection.h" diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index e2f538fa54..0daf31a931 100755 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -3,6 +3,7 @@ #include "types.h" #include "MapWriter.h" #include "UnitManager.h" +#include "Unit.h" #include "ObjectManager.h" #include "Model.h" #include "Terrain.h" diff --git a/source/graphics/MeshManager.cpp b/source/graphics/MeshManager.cpp index 336476b7d2..9bc435d252 100755 --- a/source/graphics/MeshManager.cpp +++ b/source/graphics/MeshManager.cpp @@ -2,6 +2,7 @@ #include "graphics/MeshManager.h" #include "CLogger.h" #include "FileUnpacker.h" // to get access to its CError +#include "ModelDef.h" CMeshManager::CMeshManager() { diff --git a/source/graphics/MeshManager.h b/source/graphics/MeshManager.h index 689d901f6b..488c0b4ef4 100755 --- a/source/graphics/MeshManager.h +++ b/source/graphics/MeshManager.h @@ -2,16 +2,16 @@ #define __H_MESHMANAGER_H__ #include "Singleton.h" -#include "graphics/ModelDef.h" +#include "CStr.h" #include "boost/shared_ptr.hpp" #include "boost/weak_ptr.hpp" - +// #define g_MeshManager CMeshManager::GetSingleton() -typedef STL_HASH_MAP, CStr_hash_compare> mesh_map; - +class CModelDef; typedef boost::shared_ptr CModelDefPtr; +typedef STL_HASH_MAP, CStr_hash_compare> mesh_map; class CMeshManager : public Singleton { diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp index 86c49385c3..9de1f6a195 100755 --- a/source/graphics/Model.cpp +++ b/source/graphics/Model.cpp @@ -9,6 +9,7 @@ #include "precompiled.h" #include "Model.h" +#include "ModelDef.h" #include "Quaternion.h" #include "Bound.h" #include "SkeletonAnim.h" diff --git a/source/graphics/Model.h b/source/graphics/Model.h index ee577520ad..5e2ec25c6c 100755 --- a/source/graphics/Model.h +++ b/source/graphics/Model.h @@ -12,11 +12,11 @@ #include #include "Texture.h" -#include "ModelDef.h" #include "MeshManager.h" #include "RenderableObject.h" #include "SkeletonAnim.h" #include "Material.h" +struct SPropPoint; #define MODELFLAG_CASTSHADOWS (1<<0) #define MODELFLAG_NOLOOPANIMATION (1<<1) diff --git a/source/graphics/ModelDef.h b/source/graphics/ModelDef.h index 44569fe259..ba0775c3ba 100755 --- a/source/graphics/ModelDef.h +++ b/source/graphics/ModelDef.h @@ -125,9 +125,9 @@ public: // prop point data u32 m_NumPropPoints; SPropPoint* m_PropPoints; + protected: - static CModelDef* Load(const char* filename); - //CStr m_Filename; + static CModelDef* Load(const char* filename); }; #endif diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp index eba2e19782..cff5d7351b 100755 --- a/source/graphics/ObjectEntry.cpp +++ b/source/graphics/ObjectEntry.cpp @@ -9,6 +9,7 @@ #include "MeshManager.h" #include "UnitManager.h" +#include "Unit.h" #include "ps/Xeromyces.h" diff --git a/source/graphics/ObjectEntry.h b/source/graphics/ObjectEntry.h index df2f3a2b71..6815fa3a9e 100755 --- a/source/graphics/ObjectEntry.h +++ b/source/graphics/ObjectEntry.h @@ -6,8 +6,6 @@ class CSkeletonAnim; #include #include "CStr.h" -#include "Bound.h" -#include "ModelDef.h" class CObjectEntry { diff --git a/source/graphics/Unit.cpp b/source/graphics/Unit.cpp new file mode 100644 index 0000000000..4926703296 --- /dev/null +++ b/source/graphics/Unit.cpp @@ -0,0 +1,8 @@ +#include "precompiled.h" + +#include "Unit.h" +#include "Model.h" + +CUnit::~CUnit() { + delete m_Model; +} diff --git a/source/graphics/Unit.h b/source/graphics/Unit.h index 22ea8499f0..78e48707a7 100755 --- a/source/graphics/Unit.h +++ b/source/graphics/Unit.h @@ -2,8 +2,8 @@ #define _UNIT_H #include -#include "Model.h" +class CModel; class CObjectEntry; class CEntity; @@ -21,9 +21,7 @@ public: } // destructor - ~CUnit() { - delete m_Model; - } + ~CUnit(); // get unit's template object diff --git a/source/graphics/UnitManager.cpp b/source/graphics/UnitManager.cpp index df2f4350c5..a1803dd187 100755 --- a/source/graphics/UnitManager.cpp +++ b/source/graphics/UnitManager.cpp @@ -11,6 +11,8 @@ #include "res/res.h" #include "Model.h" #include "UnitManager.h" +#include "Unit.h" + #include /////////////////////////////////////////////////////////////////////////////// diff --git a/source/graphics/UnitManager.h b/source/graphics/UnitManager.h index bf0d5bcbe5..8486907698 100755 --- a/source/graphics/UnitManager.h +++ b/source/graphics/UnitManager.h @@ -10,9 +10,9 @@ #define _UNITMANAGER_H #include -#include "Unit.h" #include "Singleton.h" +class CUnit; class CVector3D; // access to sole CUnitManager object diff --git a/source/gui/MiniMap.cpp b/source/gui/MiniMap.cpp index 197c1e9dae..9402c35052 100755 --- a/source/gui/MiniMap.cpp +++ b/source/gui/MiniMap.cpp @@ -7,6 +7,7 @@ #include "renderer/Renderer.h" #include "graphics/TextureEntry.h" #include "graphics/TextureManager.h" +#include "graphics/Unit.h" static unsigned int ScaleColor(unsigned int color,float x) { diff --git a/source/gui/MiniMap.h b/source/gui/MiniMap.h index 8c8a92fb34..b45e5753df 100755 --- a/source/gui/MiniMap.h +++ b/source/gui/MiniMap.h @@ -2,8 +2,10 @@ #define __H_MINIMAP_H__ #include "GUI.h" -#include "graphics/Terrain.h" -#include "graphics/UnitManager.h" +#include "Vector2D.h" +#include "Vector3D.h" +class CTerrain; +class CUnitManager; class CMiniMap : public IGUIObject { diff --git a/source/ps/Interact.cpp b/source/ps/Interact.cpp index 0c3783660d..1285f69686 100755 --- a/source/ps/Interact.cpp +++ b/source/ps/Interact.cpp @@ -8,6 +8,9 @@ #include "timer.h" #include "Game.h" #include "Network/NetMessage.h" +#include "BoundingObjects.h" +#include "Unit.h" +#include "Model.h" extern CConsole* g_Console; extern int mouse_x, mouse_y; diff --git a/source/renderer/ModelRData.cpp b/source/renderer/ModelRData.cpp index 8d34232af9..73a3f6f3f6 100755 --- a/source/renderer/ModelRData.cpp +++ b/source/renderer/ModelRData.cpp @@ -7,6 +7,7 @@ #include "TransparencyRenderer.h" #include "ModelRData.h" #include "Model.h" +#include "ModelDef.h" #include "MaterialManager.h" /////////////////////////////////////////////////////////////////// diff --git a/source/scripting/JSConversions.cpp b/source/scripting/JSConversions.cpp index 5d9569f0f4..d67aa43b2e 100755 --- a/source/scripting/JSConversions.cpp +++ b/source/scripting/JSConversions.cpp @@ -4,6 +4,7 @@ #include "ObjectManager.h" #include "scripting/JSInterface_Vector3D.h" #include "Parser.h" +#include "BaseEntity.h" // HEntity diff --git a/source/simulation/Entity.cpp b/source/simulation/Entity.cpp index d01d4964f0..5b50fff177 100755 --- a/source/simulation/Entity.cpp +++ b/source/simulation/Entity.cpp @@ -5,6 +5,7 @@ #include "Entity.h" #include "EntityManager.h" #include "BaseEntityCollection.h" +#include "Unit.h" #include "Renderer.h" #include "Model.h" diff --git a/source/simulation/Entity.h b/source/simulation/Entity.h index d975a6210b..fbd0ecf3db 100755 --- a/source/simulation/Entity.h +++ b/source/simulation/Entity.h @@ -34,19 +34,21 @@ #include #include "scripting/ScriptableObject.h" -#include "BaseEntity.h" #include "Vector2D.h" -#include "BoundingObjects.h" #include "Vector3D.h" -#include "Unit.h" #include "UnitManager.h" #include "EntityOrders.h" #include "EntityHandles.h" #include "EntityMessage.h" #include "EventHandlers.h" +#include "ScriptObject.h" #include "EntitySupport.h" +class CBaseEntity; +class CBoundingObject; +class CUnit; + // TODO MT: Put this is /some/ sort of order... class CEntity : public CJSObject @@ -201,7 +203,7 @@ public: // General entity globals -// In it's current incarnation, inefficient but pretty +// In its current incarnation, inefficient but pretty #define SELECTION_TERRAIN_CONFORMANCE extern int SELECTION_CIRCLE_POINTS; diff --git a/source/simulation/EntityStateProcessing.cpp b/source/simulation/EntityStateProcessing.cpp index b5e9a55c7e..2c91f0be08 100755 --- a/source/simulation/EntityStateProcessing.cpp +++ b/source/simulation/EntityStateProcessing.cpp @@ -4,6 +4,8 @@ #include "Entity.h" #include "Model.h" +#include "ObjectEntry.h" +#include "Unit.h" #include "Collision.h" #include "PathfindEngine.h" diff --git a/source/simulation/Simulation.cpp b/source/simulation/Simulation.cpp index 956261ce52..505c4cee4c 100755 --- a/source/simulation/Simulation.cpp +++ b/source/simulation/Simulation.cpp @@ -10,6 +10,8 @@ #include "Network/NetMessage.h" #include "CLogger.h" #include "CConsole.h" +#include "Unit.h" +#include "Model.h" #include "gui/CGUI.h"