Kaynağa Gözat

Add WorldTypes.h

Daniele Bartolini 12 yıl önce
ebeveyn
işleme
6d1c8e96ca

+ 1 - 0
engine/CMakeLists.txt

@@ -403,6 +403,7 @@ set (WORLD_HEADERS
 	world/Unit.h
 	world/World.h
 	world/WorldManager.h
+	world/WorldTypes.h
 )
 
 set (COMPILER_SRC

+ 13 - 16
engine/Device.h

@@ -32,33 +32,30 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "LinearAllocator.h"
 #include "Resource.h"
 #include "Physics.h"
+#include "WorldTypes.h"
 
 namespace crown
 {
 
-class Filesystem;
-class ResourceManager;
-class OsWindow;
+class Accelerometer;
 class Bundle;
-class Renderer;
+class BundleCompiler;
+class ConsoleServer;
+class Filesystem;
 class Keyboard;
-class Mouse;
-class Touch;
-class Accelerometer;
 class LuaEnvironment;
-class SoundRenderer;
-class BundleCompiler;
+class Mouse;
+class OsWindow;
+class Renderer;
+class ResourceManager;
 class ResourcePackage;
-class ConsoleServer;
+class SoundRenderer;
+class Touch;
 class World;
-struct Camera;
 class WorldManager;
+struct Camera;
 
-typedef Id CameraId;
-typedef Id WorldId;
-
-/// The Engine.
-/// It is the place where to look for accessing all of
+/// This is the place where to look for accessing all of
 /// the engine subsystems and related stuff.
 class CE_EXPORT Device
 {

+ 9 - 1
engine/physics/PhysicsTypes.h

@@ -26,6 +26,12 @@ OTHER DEALINGS IN THE SOFTWARE.
 
 #pragma once
 
+namespace crown
+{
+
+typedef Id ActorId;
+typedef Id ControllerId;
+
 //-----------------------------------------------------------------------------
 struct ActorType
 {
@@ -46,4 +52,6 @@ struct ShapeType
 		BOX,
 		PLANE
 	};
-};
+};
+
+} // namespace crown

+ 0 - 3
engine/physics/PhysicsWorld.h

@@ -44,9 +44,6 @@ using physx::PxDefaultCpuDispatcher;
 namespace crown
 {
 
-typedef Id ActorId;
-typedef Id ControllerId;
-
 struct PhysicsResource;
 struct Controller;
 struct Vector3;

+ 1 - 1
engine/world/Camera.h

@@ -30,6 +30,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Frustum.h"
 #include "Matrix4x4.h"
 #include "Vector3.h"
+#include "WorldTypes.h"
 
 namespace crown
 {
@@ -43,7 +44,6 @@ struct ProjectionType
 	};
 };
 
-typedef Id UnitId;
 struct Quaternion;
 struct Unit;
 class SceneGraph;

+ 0 - 1
engine/world/Unit.cpp

@@ -40,7 +40,6 @@ OTHER DEALINGS IN THE SOFTWARE.
 namespace crown
 {
 
-typedef Id CameraId;
 typedef Id SpriteId;
 
 //-----------------------------------------------------------------------------

+ 2 - 4
engine/world/Unit.h

@@ -33,6 +33,8 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "Hash.h"
 #include "SceneGraph.h"
 #include "StringUtils.h"
+#include "PhysicsTypes.h"
+#include "WorldTypes.h"
 
 namespace crown
 {
@@ -57,12 +59,8 @@ struct Component
 };
 
 //-----------------------------------------------------------------------------
-typedef Id UnitId;
-typedef Id CameraId;
 typedef Id MeshId;
 typedef Id SpriteId;
-typedef Id ActorId;
-typedef Id ControllerId;
 typedef	Id ComponentId;
 typedef Id MaterialId;
 

+ 1 - 4
engine/world/World.h

@@ -39,6 +39,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "PoolAllocator.h"
 #include "SceneGraphManager.h"
 #include "PhysicsTypes.h"
+#include "WorldTypes.h"
 
 namespace crown
 {
@@ -47,13 +48,9 @@ namespace crown
 #define	MAX_SOUNDS 64
 #define MAX_CAMERAS 16
 
-typedef Id UnitId;
-typedef Id CameraId;
 typedef Id MeshId;
 typedef Id SoundId;
 typedef Id SpriteId;
-typedef Id ActorId;
-typedef Id WorldId;
 
 struct Sound
 {

+ 38 - 0
engine/world/WorldTypes.h

@@ -0,0 +1,38 @@
+/*
+Copyright (c) 2013 Daniele Bartolini, Michele Rossi
+Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+#pragma once
+
+#include "Types.h"
+
+namespace crown
+{
+
+typedef Id UnitId;
+typedef Id WorldId;
+typedef Id CameraId;
+
+} // namespace crown