Browse Source

Compilation and link delta

Josh Engebretson 9 years ago
parent
commit
3c9817df7f
100 changed files with 1338 additions and 1396 deletions
  1. 1 1
      Script/Packages/Atomic/Atomic2D.json
  2. 0 43
      Script/Packages/Atomic/Atomic3D.json
  3. 30 2
      Script/Packages/Atomic/Graphics.json
  4. 1 1
      Script/Packages/Atomic/Package.json
  5. 1 1
      Script/Packages/Atomic/Physics.json
  6. 2 2
      Source/Atomic/Atomic2D/AnimatedSprite2D.cpp
  7. 1 1
      Source/Atomic/Atomic2D/Atomic2D.cpp
  8. 2 2
      Source/Atomic/Atomic2D/CollisionBox2D.cpp
  9. 2 2
      Source/Atomic/Atomic2D/CollisionChain2D.cpp
  10. 2 2
      Source/Atomic/Atomic2D/CollisionCircle2D.cpp
  11. 2 2
      Source/Atomic/Atomic2D/CollisionEdge2D.cpp
  12. 2 2
      Source/Atomic/Atomic2D/CollisionPolygon2D.cpp
  13. 1 1
      Source/Atomic/Atomic2D/Constraint2D.cpp
  14. 2 2
      Source/Atomic/Atomic2D/ConstraintDistance2D.cpp
  15. 2 2
      Source/Atomic/Atomic2D/ConstraintFriction2D.cpp
  16. 2 2
      Source/Atomic/Atomic2D/ConstraintGear2D.cpp
  17. 2 2
      Source/Atomic/Atomic2D/ConstraintMotor2D.cpp
  18. 2 2
      Source/Atomic/Atomic2D/ConstraintMouse2D.cpp
  19. 2 2
      Source/Atomic/Atomic2D/ConstraintPrismatic2D.cpp
  20. 2 2
      Source/Atomic/Atomic2D/ConstraintPulley2D.cpp
  21. 2 2
      Source/Atomic/Atomic2D/ConstraintRevolute2D.cpp
  22. 2 2
      Source/Atomic/Atomic2D/ConstraintRope2D.cpp
  23. 2 2
      Source/Atomic/Atomic2D/ConstraintWeld2D.cpp
  24. 2 2
      Source/Atomic/Atomic2D/ConstraintWheel2D.cpp
  25. 2 2
      Source/Atomic/Atomic2D/ParticleEmitter2D.cpp
  26. 2 2
      Source/Atomic/Atomic2D/RigidBody2D.cpp
  27. 2 2
      Source/Atomic/Atomic2D/StaticSprite2D.cpp
  28. 2 2
      Source/Atomic/Atomic2D/TileMap2D.cpp
  29. 1 1
      Source/Atomic/Container/RefCounted.h
  30. 8 0
      Source/Atomic/Core/CoreEvents.h
  31. 0 465
      Source/Atomic/Engine/Console.cpp
  32. 0 170
      Source/Atomic/Engine/Console.h
  33. 0 318
      Source/Atomic/Engine/DebugHud.cpp
  34. 0 137
      Source/Atomic/Engine/DebugHud.h
  35. 13 2
      Source/Atomic/Engine/Engine.cpp
  36. 5 0
      Source/Atomic/Engine/Engine.h
  37. 35 0
      Source/Atomic/Graphics/AnimatedModel.cpp
  38. 47 30
      Source/Atomic/Graphics/BillboardSet.cpp
  39. 39 3
      Source/Atomic/Graphics/BillboardSet.h
  40. 62 1
      Source/Atomic/Graphics/DebugRenderer.cpp
  41. 34 0
      Source/Atomic/Graphics/DebugRenderer.h
  42. 33 0
      Source/Atomic/Graphics/Graphics.cpp
  43. 9 1
      Source/Atomic/Graphics/Graphics.h
  44. 106 0
      Source/Atomic/Graphics/LMStaticModel.cpp
  45. 46 0
      Source/Atomic/Graphics/LMStaticModel.h
  46. 27 0
      Source/Atomic/Graphics/Model.cpp
  47. 13 0
      Source/Atomic/Graphics/Model.h
  48. 4 4
      Source/Atomic/Graphics/OpenGL/OGLGraphics.cpp
  49. 30 30
      Source/Atomic/Graphics/ParticleEmitter.cpp
  50. 5 2
      Source/Atomic/Graphics/Renderer.h
  51. 128 1
      Source/Atomic/Graphics/StaticModel.cpp
  52. 28 0
      Source/Atomic/Graphics/StaticModel.h
  53. 17 0
      Source/Atomic/IO/File.cpp
  54. 4 0
      Source/Atomic/IO/File.h
  55. 174 0
      Source/Atomic/IO/FileSystem.cpp
  56. 17 0
      Source/Atomic/IO/FileSystem.h
  57. 14 0
      Source/Atomic/Input/InputEvents.h
  58. 24 0
      Source/Atomic/Math/BoundingBox.h
  59. 1 1
      Source/Atomic/Math/Rect.h
  60. 3 0
      Source/Atomic/Math/Vector2.h
  61. 10 0
      Source/Atomic/Network/Connection.cpp
  62. 3 0
      Source/Atomic/Network/Connection.h
  63. 154 0
      Source/Atomic/Resource/Image.cpp
  64. 6 0
      Source/Atomic/Resource/Image.h
  65. 5 0
      Source/Atomic/Resource/ResourceCache.cpp
  66. 6 0
      Source/Atomic/Resource/ResourceCache.h
  67. 13 0
      Source/Atomic/Resource/ResourceEvents.h
  68. 5 2
      Source/Atomic/Scene/Node.cpp
  69. 1 1
      Source/Atomic/Scene/Node.h
  70. 3 3
      Source/AtomicApp/AppBase.cpp
  71. 1 1
      Source/AtomicApp/AppBase.h
  72. 2 2
      Source/AtomicApp/IPCClientApp.cpp
  73. 1 1
      Source/AtomicApp/IPCClientApp.h
  74. 11 11
      Source/AtomicApp/Player/IPCPlayerApp.cpp
  75. 1 1
      Source/AtomicApp/Player/IPCPlayerApp.h
  76. 13 13
      Source/AtomicApp/Player/IPCPlayerAppEvents.h
  77. 1 1
      Source/AtomicApp/Player/PlayerApp.h
  78. 1 5
      Source/AtomicEditor/Application/AEEditorApp.cpp
  79. 1 1
      Source/AtomicEditor/Application/AEEditorApp.h
  80. 2 2
      Source/AtomicEditor/Application/AEEditorPrefs.cpp
  81. 1 1
      Source/AtomicEditor/Application/AEEditorPrefs.h
  82. 1 1
      Source/AtomicEditor/Application/AEPlayerApp.h
  83. 7 7
      Source/AtomicEditor/Components/CubemapGenerator.cpp
  84. 1 1
      Source/AtomicEditor/Components/CubemapGenerator.h
  85. 1 1
      Source/AtomicEditor/Components/EditorComponent.h
  86. 41 41
      Source/AtomicEditor/EditorMode/AEEditorEvents.h
  87. 10 10
      Source/AtomicEditor/EditorMode/AEEditorMode.cpp
  88. 1 1
      Source/AtomicEditor/EditorMode/AEEditorMode.h
  89. 2 2
      Source/AtomicEditor/EditorMode/AEEditorNETService.cpp
  90. 2 2
      Source/AtomicEditor/EditorMode/AEEditorNETService.h
  91. 3 3
      Source/AtomicEditor/Editors/JSResourceEditor.cpp
  92. 1 1
      Source/AtomicEditor/Editors/JSResourceEditor.h
  93. 3 3
      Source/AtomicEditor/Editors/ResourceEditor.cpp
  94. 1 1
      Source/AtomicEditor/Editors/ResourceEditor.h
  95. 4 4
      Source/AtomicEditor/Editors/ResourceEditorEvents.h
  96. 1 1
      Source/AtomicEditor/Editors/SceneEditor3D/Gizmo3D.cpp
  97. 3 3
      Source/AtomicEditor/Editors/SceneEditor3D/Gizmo3D.h
  98. 6 6
      Source/AtomicEditor/Editors/SceneEditor3D/SceneEditHistory.cpp
  99. 1 1
      Source/AtomicEditor/Editors/SceneEditor3D/SceneEditHistory.h
  100. 4 4
      Source/AtomicEditor/Editors/SceneEditor3D/SceneEditOp.cpp

+ 1 - 1
Script/Packages/Atomic/Atomic2D.json

@@ -3,7 +3,7 @@
 	"sources" : ["Source/Atomic/Atomic2D"],
 	"sources" : ["Source/Atomic/Atomic2D"],
 	"includes" : ["<Atomic/Graphics/Texture2D.h>", "<Atomic/Scene/Node.h>", "<Atomic/Graphics/Material.h>"],
 	"includes" : ["<Atomic/Graphics/Texture2D.h>", "<Atomic/Scene/Node.h>", "<Atomic/Graphics/Material.h>"],
 	"classes" : [ "SpriteSheet2D", "Sprite2D", "Drawable2D", "StaticSprite2D", "AnimationSet2D", "AnimatedSprite2D",
 	"classes" : [ "SpriteSheet2D", "Sprite2D", "Drawable2D", "StaticSprite2D", "AnimationSet2D", "AnimatedSprite2D",
-				 "CollisionShape2D", "CollisionBox2D", "RigidBody2D", "Animation2D", "CollisionChain2D",
+				 "CollisionShape2D", "CollisionBox2D", "RigidBody2D", "CollisionChain2D",
 				 "CollisionCircle2D", "CollisionEdge2D", "CollisionPolygon2D",
 				 "CollisionCircle2D", "CollisionEdge2D", "CollisionPolygon2D",
 				 "Constraint2D", "ConstraintDistance2D", "ConstraintFriction2D", "ConstraintGear2D",
 				 "Constraint2D", "ConstraintDistance2D", "ConstraintFriction2D", "ConstraintGear2D",
 				 "ConstraintMotor2D", "ConstraintMouse2D", "ConstraintPrismatic2D", "ConstraintPulley2D",
 				 "ConstraintMotor2D", "ConstraintMouse2D", "ConstraintPrismatic2D", "ConstraintPulley2D",

+ 0 - 43
Script/Packages/Atomic/Atomic3D.json

@@ -1,43 +0,0 @@
-{
-	"name" : "Atomic3D",
-	"sources" : ["Source/Atomic/Atomic3D"],
-	"requires" : ["3D"],
-	"includes" : ["<Atomic/Container/ArrayPtr.h>","<Atomic/Scene/Scene.h>", "<Atomic/Atomic3D/Animation.h>", "<Atomic/Graphics/OcclusionBuffer.h>",
-			      "<Atomic/Scene/ValueAnimation.h>", "<Atomic/Graphics/Material.h>", "<Atomic/Resource/Image.h>", "<Atomic/Graphics/VertexBuffer.h>"],
-	"classes" : ["Model",
-				 "StaticModel",
-				 "Animation", "AnimatedModel", "AnimationController", "AnimationState", "Billboard", "BillboardSet", "CustomGeometry",
-				 "DecalSet", "ParticleEffect", "ParticleEmitter",
-				 "Skybox", "StaticModelGroup", "Terrain", "TerrainPatch"],
-	"overloads" : {
-		"StaticModel" : {
-			"SetMaterial" : ["Material"]
-		},
-		"AnimationState" : {
-			"AnimationState" : ["AnimatedModel", "Animation"]
-		},
-		"CustomGeometry" : {
-			"SetMaterial" : ["Material"]
-		}
-
-	},
-	"typescript_decl" : {
-		"StaticModel" : [
-			"setMaterialIndex(index:number, material:Material);"
-		],
-		"CustomGeometry" : [
-			"setMaterialIndex(index:number, material:Material);"
-		]
-	},
-
-	"haxe_decl" : {
-		"StaticModel" : [
-			"function setMaterialIndex(index:UInt, material:Material):Void;"
-		],
-		"CustomGeometry" : [
-			"function setMaterialIndex(index:UInt, material:Material):Void;"
-		]
-	}
-
-
-}

+ 30 - 2
Script/Packages/Atomic/Graphics.json

@@ -1,14 +1,20 @@
 {
 {
 	"name" : "Graphics",
 	"name" : "Graphics",
 	"sources" : ["Source/Atomic/Graphics"],
 	"sources" : ["Source/Atomic/Graphics"],
-	"includes" : ["<Atomic/Scene/Scene.h>", "<Atomic/Graphics/OcclusionBuffer.h>", "<Atomic/Scene/ValueAnimation.h>"],
+	"includes" : ["<Atomic/Scene/Scene.h>", "<Atomic/Graphics/OcclusionBuffer.h>", "<Atomic/Scene/ValueAnimation.h>",
+							  "<Atomic/Container/ArrayPtr.h>", "<Atomic/Graphics/Animation.h>",
+							 "<Atomic/Graphics/Material.h>", "<Atomic/Resource/Image.h>", "<Atomic/Graphics/VertexBuffer.h>"],
 	"classes" : ["Graphics", "Texture", "Texture2D", "Material", "Drawable",
 	"classes" : ["Graphics", "Texture", "Texture2D", "Material", "Drawable",
 				 "Viewport", "Renderer", "Octree", "Zone", "Camera", "Light", "RenderPath",
 				 "Viewport", "Renderer", "Octree", "Zone", "Camera", "Light", "RenderPath",
 				 "DebugRenderer",
 				 "DebugRenderer",
 				 "RenderSurface", "Shader", "ShaderPrecache", "ShaderVariation",
 				 "RenderSurface", "Shader", "ShaderPrecache", "ShaderVariation",
 				 "Pass", "Technique",
 				 "Pass", "Technique",
 				 "Texture3D", "TextureCube", "View",
 				 "Texture3D", "TextureCube", "View",
-			 	 "VertexBuffer"],
+			 	 "VertexBuffer", "Model",
+ 				 "StaticModel",
+ 				 "Animation", "AnimatedModel", "AnimationController", "AnimationState", "Billboard", "BillboardSet", "CustomGeometry",
+ 				 "DecalSet", "ParticleEffect", "ParticleEmitter",
+ 				 "Skybox", "StaticModelGroup", "Terrain", "TerrainPatch"],
 	"overloads" : {
 	"overloads" : {
 		"Viewport" : {
 		"Viewport" : {
 			"Viewport" : ["Context", "Scene", "Camera", "RenderPath"],
 			"Viewport" : ["Context", "Scene", "Camera", "RenderPath"],
@@ -20,8 +26,18 @@
 		"Graphics" : {
 		"Graphics" : {
 			"SetWindowPosition" : ["int", "int"],
 			"SetWindowPosition" : ["int", "int"],
 			"Draw" : ["PrimitiveType", "unsigned", "unsigned"]
 			"Draw" : ["PrimitiveType", "unsigned", "unsigned"]
+		},
+		"StaticModel" : {
+			"SetMaterial" : ["Material"]
+		},
+		"AnimationState" : {
+			"AnimationState" : ["AnimatedModel", "Animation"]
+		},
+		"CustomGeometry" : {
+			"SetMaterial" : ["Material"]
 		}
 		}
 
 
+
 	},
 	},
 	"typescript_decl" : {
 	"typescript_decl" : {
 
 
@@ -33,6 +49,12 @@
 			"getShadowCascade():Number[];",
 			"getShadowCascade():Number[];",
 			"setShadowCascade(split1:number, split2:number, split3:number, split4:number, fadeStart:number, biasAutoAdjust?:number);",
 			"setShadowCascade(split1:number, split2:number, split3:number, split4:number, fadeStart:number, biasAutoAdjust?:number);",
 			"setShadowCascadeParameter(index:number, value:number);"
 			"setShadowCascadeParameter(index:number, value:number);"
+		],
+		"StaticModel" : [
+			"setMaterialIndex(index:number, material:Material);"
+		],
+		"CustomGeometry" : [
+			"setMaterialIndex(index:number, material:Material);"
 		]
 		]
 
 
 	},
 	},
@@ -42,6 +64,12 @@
 			"function getShadowCascade():Array<Float>;",
 			"function getShadowCascade():Array<Float>;",
 			"function setShadowCascade(split1:Float, split2:Float, split3:Float, split4:Float, fadeStart:Float, ?biasAutoAdjust:Float):Void;",
 			"function setShadowCascade(split1:Float, split2:Float, split3:Float, split4:Float, fadeStart:Float, ?biasAutoAdjust:Float):Void;",
 			"function setShadowCascadeParameter(index:Int, value:Float):Void;"
 			"function setShadowCascadeParameter(index:Int, value:Float):Void;"
+		],
+		"StaticModel" : [
+			"function setMaterialIndex(index:UInt, material:Material):Void;"
+		],
+		"CustomGeometry" : [
+			"function setMaterialIndex(index:UInt, material:Material):Void;"
 		]
 		]
 
 
 	}
 	}

+ 1 - 1
Script/Packages/Atomic/Package.json

@@ -2,7 +2,7 @@
 {
 {
 	"name" : "Atomic",
 	"name" : "Atomic",
 	"namespace" : "Atomic",
 	"namespace" : "Atomic",
-	"modules" : ["Container", "Math", "Core", "Scene", "Graphics", "Atomic3D", "Atomic2D", "Audio",
+	"modules" : ["Container", "Math", "Core", "Scene", "Graphics", "Atomic2D", "Audio",
 		"Physics", "Navigation", "Input", "UI", "Resource", "Network", "IO",
 		"Physics", "Navigation", "Input", "UI", "Resource", "Network", "IO",
 		"Engine", "Script", "Javascript", "Environment", "Web", "IPC"],
 		"Engine", "Script", "Javascript", "Environment", "Web", "IPC"],
 		"moduleExclude" : {
 		"moduleExclude" : {

+ 1 - 1
Script/Packages/Atomic/Physics.json

@@ -2,7 +2,7 @@
 	"name" : "Physics",
 	"name" : "Physics",
 	"requires" : ["3D"],
 	"requires" : ["3D"],
 	"sources" : ["Source/Atomic/Physics"],
 	"sources" : ["Source/Atomic/Physics"],
-	"includes" : ["<Atomic/Atomic3D/Model.h>"],
+	"includes" : ["<Atomic/Graphics/Model.h>"],
 	"classes" : ["CollisionShape", "Constraint", "PhysicsWorld", "RigidBody"],
 	"classes" : ["CollisionShape", "Constraint", "PhysicsWorld", "RigidBody"],
  	"overloads" : {
  	"overloads" : {
 		"RigidBody" : {
 		"RigidBody" : {

+ 2 - 2
Source/Atomic/Atomic2D/AnimatedSprite2D.cpp

@@ -41,7 +41,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 extern const char* blendModeNames[];
 extern const char* blendModeNames[];
 
 
 const char* loopModeNames[] =
 const char* loopModeNames[] =
@@ -72,7 +72,7 @@ AnimatedSprite2D::~AnimatedSprite2D()
 
 
 void AnimatedSprite2D::RegisterObject(Context* context)
 void AnimatedSprite2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<AnimatedSprite2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<AnimatedSprite2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_COPY_BASE_ATTRIBUTES(StaticSprite2D);
     ATOMIC_COPY_BASE_ATTRIBUTES(StaticSprite2D);
     ATOMIC_REMOVE_ATTRIBUTE("Sprite");
     ATOMIC_REMOVE_ATTRIBUTE("Sprite");

+ 1 - 1
Source/Atomic/Atomic2D/Atomic2D.cpp

@@ -57,7 +57,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-const char* URHO2D_CATEGORY = "Atomic2D";
+const char* ATOMIC2D_CATEGORY = "Atomic2D";
 
 
 void RegisterAtomic2DLibrary(Context* context)
 void RegisterAtomic2DLibrary(Context* context)
 {
 {

+ 2 - 2
Source/Atomic/Atomic2D/CollisionBox2D.cpp

@@ -31,7 +31,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 static const Vector2 DEFAULT_BOX_SIZE(0.01f, 0.01f);
 static const Vector2 DEFAULT_BOX_SIZE(0.01f, 0.01f);
 
 
 CollisionBox2D::CollisionBox2D(Context* context) :
 CollisionBox2D::CollisionBox2D(Context* context) :
@@ -52,7 +52,7 @@ CollisionBox2D::~CollisionBox2D()
 
 
 void CollisionBox2D::RegisterObject(Context* context)
 void CollisionBox2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<CollisionBox2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<CollisionBox2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Size", GetSize, SetSize, Vector2, DEFAULT_BOX_SIZE, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Size", GetSize, SetSize, Vector2, DEFAULT_BOX_SIZE, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/CollisionChain2D.cpp

@@ -33,7 +33,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 CollisionChain2D::CollisionChain2D(Context* context) :
 CollisionChain2D::CollisionChain2D(Context* context) :
     CollisionShape2D(context),
     CollisionShape2D(context),
@@ -48,7 +48,7 @@ CollisionChain2D::~CollisionChain2D()
 
 
 void CollisionChain2D::RegisterObject(Context* context)
 void CollisionChain2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<CollisionChain2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<CollisionChain2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Loop", GetLoop, SetLoop, bool, false, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Loop", GetLoop, SetLoop, bool, false, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/CollisionCircle2D.cpp

@@ -31,7 +31,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 static const float DEFAULT_CLRCLE_RADIUS(0.01f);
 static const float DEFAULT_CLRCLE_RADIUS(0.01f);
 
 
 CollisionCircle2D::CollisionCircle2D(Context* context) :
 CollisionCircle2D::CollisionCircle2D(Context* context) :
@@ -49,7 +49,7 @@ CollisionCircle2D::~CollisionCircle2D()
 
 
 void CollisionCircle2D::RegisterObject(Context* context)
 void CollisionCircle2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<CollisionCircle2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<CollisionCircle2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Radius", GetRadius, SetRadius, float, DEFAULT_CLRCLE_RADIUS, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Radius", GetRadius, SetRadius, float, DEFAULT_CLRCLE_RADIUS, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/CollisionEdge2D.cpp

@@ -31,7 +31,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 static const Vector2 DEFAULT_VERTEX1(-0.01f, 0.0f);
 static const Vector2 DEFAULT_VERTEX1(-0.01f, 0.0f);
 static const Vector2 DEFAULT_VERTEX2(0.01f, 0.0f);
 static const Vector2 DEFAULT_VERTEX2(0.01f, 0.0f);
 
 
@@ -52,7 +52,7 @@ CollisionEdge2D::~CollisionEdge2D()
 
 
 void CollisionEdge2D::RegisterObject(Context* context)
 void CollisionEdge2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<CollisionEdge2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<CollisionEdge2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Vertex 1", GetVertex1, SetVertex1, Vector2, DEFAULT_VERTEX1, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Vertex 1", GetVertex1, SetVertex1, Vector2, DEFAULT_VERTEX1, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/CollisionPolygon2D.cpp

@@ -33,7 +33,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 CollisionPolygon2D::CollisionPolygon2D(Context* context) :
 CollisionPolygon2D::CollisionPolygon2D(Context* context) :
     CollisionShape2D(context)
     CollisionShape2D(context)
@@ -47,7 +47,7 @@ CollisionPolygon2D::~CollisionPolygon2D()
 
 
 void CollisionPolygon2D::RegisterObject(Context* context)
 void CollisionPolygon2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<CollisionPolygon2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<CollisionPolygon2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_COPY_BASE_ATTRIBUTES(CollisionShape2D);
     ATOMIC_COPY_BASE_ATTRIBUTES(CollisionShape2D);

+ 1 - 1
Source/Atomic/Atomic2D/Constraint2D.cpp

@@ -36,7 +36,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 Constraint2D::Constraint2D(Context* context) :
 Constraint2D::Constraint2D(Context* context) :
     Component(context),
     Component(context),

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintDistance2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintDistance2D::ConstraintDistance2D(Context* context) :
 ConstraintDistance2D::ConstraintDistance2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -48,7 +48,7 @@ ConstraintDistance2D::~ConstraintDistance2D()
 
 
 void ConstraintDistance2D::RegisterObject(Context* context)
 void ConstraintDistance2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintDistance2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintDistance2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Owner Body Anchor", GetOwnerBodyAnchor, SetOwnerBodyAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Owner Body Anchor", GetOwnerBodyAnchor, SetOwnerBodyAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintFriction2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintFriction2D::ConstraintFriction2D(Context* context) :
 ConstraintFriction2D::ConstraintFriction2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -47,7 +47,7 @@ ConstraintFriction2D::~ConstraintFriction2D()
 
 
 void ConstraintFriction2D::RegisterObject(Context* context)
 void ConstraintFriction2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintFriction2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintFriction2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintGear2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintGear2D::ConstraintGear2D(Context* context) :
 ConstraintGear2D::ConstraintGear2D(Context* context) :
     Constraint2D(context)
     Constraint2D(context)
@@ -45,7 +45,7 @@ ConstraintGear2D::~ConstraintGear2D()
 
 
 void ConstraintGear2D::RegisterObject(Context* context)
 void ConstraintGear2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintGear2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintGear2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Ratio", GetRatio, SetRatio, float, 0.0f, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Ratio", GetRatio, SetRatio, float, 0.0f, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintMotor2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintMotor2D::ConstraintMotor2D(Context* context) :
 ConstraintMotor2D::ConstraintMotor2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -47,7 +47,7 @@ ConstraintMotor2D::~ConstraintMotor2D()
 
 
 void ConstraintMotor2D::RegisterObject(Context* context)
 void ConstraintMotor2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintMotor2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintMotor2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Linear Offset", GetLinearOffset, SetLinearOffset, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Linear Offset", GetLinearOffset, SetLinearOffset, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintMouse2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintMouse2D::ConstraintMouse2D(Context* context) :
 ConstraintMouse2D::ConstraintMouse2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -47,7 +47,7 @@ ConstraintMouse2D::~ConstraintMouse2D()
 
 
 void ConstraintMouse2D::RegisterObject(Context* context)
 void ConstraintMouse2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintMouse2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintMouse2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Target", GetTarget, SetTarget, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Target", GetTarget, SetTarget, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintPrismatic2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintPrismatic2D::ConstraintPrismatic2D(Context* context) :
 ConstraintPrismatic2D::ConstraintPrismatic2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -47,7 +47,7 @@ ConstraintPrismatic2D::~ConstraintPrismatic2D()
 
 
 void ConstraintPrismatic2D::RegisterObject(Context* context)
 void ConstraintPrismatic2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintPrismatic2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintPrismatic2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintPulley2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintPulley2D::ConstraintPulley2D(Context* context) :
 ConstraintPulley2D::ConstraintPulley2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -50,7 +50,7 @@ ConstraintPulley2D::~ConstraintPulley2D()
 
 
 void ConstraintPulley2D::RegisterObject(Context* context)
 void ConstraintPulley2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintPulley2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintPulley2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Owner Body Ground Anchor", GetOwnerBodyGroundAnchor, SetOwnerBodyGroundAnchor, Vector2, Vector2::ZERO,
     ATOMIC_ACCESSOR_ATTRIBUTE("Owner Body Ground Anchor", GetOwnerBodyGroundAnchor, SetOwnerBodyGroundAnchor, Vector2, Vector2::ZERO,

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintRevolute2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintRevolute2D::ConstraintRevolute2D(Context* context) :
 ConstraintRevolute2D::ConstraintRevolute2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -46,7 +46,7 @@ ConstraintRevolute2D::~ConstraintRevolute2D()
 
 
 void ConstraintRevolute2D::RegisterObject(Context* context)
 void ConstraintRevolute2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintRevolute2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintRevolute2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintRope2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintRope2D::ConstraintRope2D(Context* context) :
 ConstraintRope2D::ConstraintRope2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -48,7 +48,7 @@ ConstraintRope2D::~ConstraintRope2D()
 
 
 void ConstraintRope2D::RegisterObject(Context* context)
 void ConstraintRope2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintRope2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintRope2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Owner Body Anchor", GetOwnerBodyAnchor, SetOwnerBodyAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Owner Body Anchor", GetOwnerBodyAnchor, SetOwnerBodyAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintWeld2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintWeld2D::ConstraintWeld2D(Context* context) :
 ConstraintWeld2D::ConstraintWeld2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -46,7 +46,7 @@ ConstraintWeld2D::~ConstraintWeld2D()
 
 
 void ConstraintWeld2D::RegisterObject(Context* context)
 void ConstraintWeld2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintWeld2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintWeld2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ConstraintWheel2D.cpp

@@ -32,7 +32,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 ConstraintWheel2D::ConstraintWheel2D(Context* context) :
 ConstraintWheel2D::ConstraintWheel2D(Context* context) :
     Constraint2D(context),
     Constraint2D(context),
@@ -47,7 +47,7 @@ ConstraintWheel2D::~ConstraintWheel2D()
 
 
 void ConstraintWheel2D::RegisterObject(Context* context)
 void ConstraintWheel2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ConstraintWheel2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ConstraintWheel2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Anchor", GetAnchor, SetAnchor, Vector2, Vector2::ZERO, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/ParticleEmitter2D.cpp

@@ -38,7 +38,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 extern const char* blendModeNames[];
 extern const char* blendModeNames[];
 
 
 ParticleEmitter2D::ParticleEmitter2D(Context* context) :
 ParticleEmitter2D::ParticleEmitter2D(Context* context) :
@@ -60,7 +60,7 @@ ParticleEmitter2D::~ParticleEmitter2D()
 
 
 void ParticleEmitter2D::RegisterObject(Context* context)
 void ParticleEmitter2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<ParticleEmitter2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<ParticleEmitter2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_COPY_BASE_ATTRIBUTES(Drawable2D);
     ATOMIC_COPY_BASE_ATTRIBUTES(Drawable2D);

+ 2 - 2
Source/Atomic/Atomic2D/RigidBody2D.cpp

@@ -36,7 +36,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 static const BodyType2D DEFAULT_BODYTYPE = BT_STATIC;
 static const BodyType2D DEFAULT_BODYTYPE = BT_STATIC;
 
 
 static const char* bodyTypeNames[] =
 static const char* bodyTypeNames[] =
@@ -73,7 +73,7 @@ RigidBody2D::~RigidBody2D()
 
 
 void RigidBody2D::RegisterObject(Context* context)
 void RigidBody2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<RigidBody2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<RigidBody2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ENUM_ACCESSOR_ATTRIBUTE("Body Type", GetBodyType, SetBodyType, BodyType2D, bodyTypeNames, DEFAULT_BODYTYPE, AM_DEFAULT);
     ATOMIC_ENUM_ACCESSOR_ATTRIBUTE("Body Type", GetBodyType, SetBodyType, BodyType2D, bodyTypeNames, DEFAULT_BODYTYPE, AM_DEFAULT);

+ 2 - 2
Source/Atomic/Atomic2D/StaticSprite2D.cpp

@@ -36,7 +36,7 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 extern const char* blendModeNames[];
 extern const char* blendModeNames[];
 
 
 StaticSprite2D::StaticSprite2D(Context* context) :
 StaticSprite2D::StaticSprite2D(Context* context) :
@@ -58,7 +58,7 @@ StaticSprite2D::~StaticSprite2D()
 
 
 void StaticSprite2D::RegisterObject(Context* context)
 void StaticSprite2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<StaticSprite2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<StaticSprite2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_COPY_BASE_ATTRIBUTES(Drawable2D);
     ATOMIC_COPY_BASE_ATTRIBUTES(Drawable2D);

+ 2 - 2
Source/Atomic/Atomic2D/TileMap2D.cpp

@@ -37,7 +37,7 @@ namespace Atomic
 {
 {
 
 
 extern const float PIXEL_SIZE;
 extern const float PIXEL_SIZE;
-extern const char* URHO2D_CATEGORY;
+extern const char* ATOMIC2D_CATEGORY;
 
 
 TileMap2D::TileMap2D(Context* context) :
 TileMap2D::TileMap2D(Context* context) :
     Component(context)
     Component(context)
@@ -50,7 +50,7 @@ TileMap2D::~TileMap2D()
 
 
 void TileMap2D::RegisterObject(Context* context)
 void TileMap2D::RegisterObject(Context* context)
 {
 {
-    context->RegisterFactory<TileMap2D>(URHO2D_CATEGORY);
+    context->RegisterFactory<TileMap2D>(ATOMIC2D_CATEGORY);
 
 
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("Is Enabled", IsEnabled, SetEnabled, bool, true, AM_DEFAULT);
     ATOMIC_MIXED_ACCESSOR_ATTRIBUTE("Tmx File", GetTmxFileAttr, SetTmxFileAttr, ResourceRef, ResourceRef(TmxFile2D::GetTypeStatic()),
     ATOMIC_MIXED_ACCESSOR_ATTRIBUTE("Tmx File", GetTmxFileAttr, SetTmxFileAttr, ResourceRef, ResourceRef(TmxFile2D::GetTypeStatic()),

+ 1 - 1
Source/Atomic/Container/RefCounted.h

@@ -29,7 +29,7 @@ namespace Atomic
 
 
 // ATOMIC BEGIN
 // ATOMIC BEGIN
 
 
-struct RefCounted;
+class RefCounted;
 typedef void (*RefCountedDeletedFunction)(RefCounted*);
 typedef void (*RefCountedDeletedFunction)(RefCounted*);
 typedef const void* ClassID;
 typedef const void* ClassID;
 
 

+ 8 - 0
Source/Atomic/Core/CoreEvents.h

@@ -63,4 +63,12 @@ ATOMIC_EVENT(E_ENDFRAME, EndFrame)
 {
 {
 }
 }
 
 
+// ATOMIC BEGIN
+/// Updating paused or resumed event.
+ATOMIC_EVENT(E_UPDATESPAUSEDRESUMED, UpdatesPaused)
+{
+    ATOMIC_PARAM(P_PAUSED, Paused);            // bool
+}
+// ATOMIC END
+
 }
 }

+ 0 - 465
Source/Atomic/Engine/Console.cpp

@@ -1,465 +0,0 @@
-#ifdef DISABLED__
-
-//
-// Copyright (c) 2008-2016 the Urho3D project.
-//
-// 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.
-//
-
-#include "../Precompiled.h"
-
-#include "../Core/Context.h"
-#include "../Core/CoreEvents.h"
-#include "../Engine/Console.h"
-#include "../Engine/EngineEvents.h"
-#include "../Graphics/Graphics.h"
-#include "../Input/Input.h"
-#include "../IO/IOEvents.h"
-#include "../IO/Log.h"
-#include "../Resource/ResourceCache.h"
-#include "../UI/DropDownList.h"
-#include "../UI/Font.h"
-#include "../UI/LineEdit.h"
-#include "../UI/ListView.h"
-#include "../UI/ScrollBar.h"
-#include "../UI/Text.h"
-#include "../UI/UI.h"
-#include "../UI/UIEvents.h"
-
-#include "../DebugNew.h"
-
-namespace Atomic
-{
-
-static const int DEFAULT_CONSOLE_ROWS = 16;
-static const int DEFAULT_HISTORY_SIZE = 16;
-
-Console::Console(Context* context) :
-    Object(context),
-    autoVisibleOnError_(false),
-    historyRows_(DEFAULT_HISTORY_SIZE),
-    historyPosition_(0),
-    printing_(false)
-{
-    UI* ui = GetSubsystem<UI>();
-    UIElement* uiRoot = ui->GetRoot();
-
-    // By default prevent the automatic showing of the screen keyboard
-    focusOnShow_ = !ui->GetUseScreenKeyboard();
-
-    background_ = uiRoot->CreateChild<BorderImage>();
-    background_->SetBringToBack(false);
-    background_->SetClipChildren(true);
-    background_->SetEnabled(true);
-    background_->SetVisible(false); // Hide by default
-    background_->SetPriority(200); // Show on top of the debug HUD
-    background_->SetBringToBack(false);
-    background_->SetLayout(LM_VERTICAL);
-
-    rowContainer_ = background_->CreateChild<ListView>();
-    rowContainer_->SetHighlightMode(HM_ALWAYS);
-    rowContainer_->SetMultiselect(true);
-
-    commandLine_ = background_->CreateChild<UIElement>();
-    commandLine_->SetLayoutMode(LM_HORIZONTAL);
-    commandLine_->SetLayoutSpacing(1);
-    interpreters_ = commandLine_->CreateChild<DropDownList>();
-    lineEdit_ = commandLine_->CreateChild<LineEdit>();
-    lineEdit_->SetFocusMode(FM_FOCUSABLE);  // Do not allow defocus with ESC
-
-    closeButton_ = uiRoot->CreateChild<Button>();
-    closeButton_->SetVisible(false);
-    closeButton_->SetPriority(background_->GetPriority() + 1);  // Show on top of console's background
-    closeButton_->SetBringToBack(false);
-
-    SetNumRows(DEFAULT_CONSOLE_ROWS);
-
-    SubscribeToEvent(interpreters_, E_ITEMSELECTED, ATOMIC_HANDLER(Console, HandleInterpreterSelected));
-    SubscribeToEvent(lineEdit_, E_TEXTFINISHED, ATOMIC_HANDLER(Console, HandleTextFinished));
-    SubscribeToEvent(lineEdit_, E_UNHANDLEDKEY, ATOMIC_HANDLER(Console, HandleLineEditKey));
-    SubscribeToEvent(closeButton_, E_RELEASED, ATOMIC_HANDLER(Console, HandleCloseButtonPressed));
-    SubscribeToEvent(uiRoot, E_RESIZED, ATOMIC_HANDLER(Console, HandleRootElementResized));
-    SubscribeToEvent(E_LOGMESSAGE, ATOMIC_HANDLER(Console, HandleLogMessage));
-    SubscribeToEvent(E_POSTUPDATE, ATOMIC_HANDLER(Console, HandlePostUpdate));
-}
-
-Console::~Console()
-{
-    background_->Remove();
-    closeButton_->Remove();
-}
-
-void Console::SetDefaultStyle(XMLFile* style)
-{
-    if (!style)
-        return;
-
-    background_->SetDefaultStyle(style);
-    background_->SetStyle("ConsoleBackground");
-    rowContainer_->SetStyleAuto();
-    for (unsigned i = 0; i < rowContainer_->GetNumItems(); ++i)
-        rowContainer_->GetItem(i)->SetStyle("ConsoleText");
-    interpreters_->SetStyleAuto();
-    for (unsigned i = 0; i < interpreters_->GetNumItems(); ++i)
-        interpreters_->GetItem(i)->SetStyle("ConsoleText");
-    lineEdit_->SetStyle("ConsoleLineEdit");
-
-    closeButton_->SetDefaultStyle(style);
-    closeButton_->SetStyle("CloseButton");
-
-    UpdateElements();
-}
-
-void Console::SetVisible(bool enable)
-{
-    Input* input = GetSubsystem<Input>();
-    UI* ui = GetSubsystem<UI>();
-    Cursor* cursor = ui->GetCursor();
-
-    background_->SetVisible(enable);
-    closeButton_->SetVisible(enable);
-
-    if (enable)
-    {
-        // Check if we have receivers for E_CONSOLECOMMAND every time here in case the handler is being added later dynamically
-        bool hasInterpreter = PopulateInterpreter();
-        commandLine_->SetVisible(hasInterpreter);
-        if (hasInterpreter && focusOnShow_)
-            ui->SetFocusElement(lineEdit_);
-
-        // Ensure the background has no empty space when shown without the lineedit
-        background_->SetHeight(background_->GetMinHeight());
-
-        if (!cursor)
-        {
-            // Show OS mouse
-            input->SetMouseMode(MM_FREE, true);
-            input->SetMouseVisible(true, true);
-        }
-
-        input->SetMouseGrabbed(false, true);
-    }
-    else
-    {
-        rowContainer_->SetFocus(false);
-        interpreters_->SetFocus(false);
-        lineEdit_->SetFocus(false);
-
-        if (!cursor)
-        {
-            // Restore OS mouse visibility
-            input->ResetMouseMode();
-            input->ResetMouseVisible();
-        }
-
-        input->ResetMouseGrabbed();
-    }
-}
-
-void Console::Toggle()
-{
-    SetVisible(!IsVisible());
-}
-
-void Console::SetNumBufferedRows(unsigned rows)
-{
-    if (rows < displayedRows_)
-        return;
-
-    rowContainer_->DisableLayoutUpdate();
-
-    int delta = rowContainer_->GetNumItems() - rows;
-    if (delta > 0)
-    {
-        // We have more, remove oldest rows first
-        for (int i = 0; i < delta; ++i)
-            rowContainer_->RemoveItem((unsigned)0);
-    }
-    else
-    {
-        // We have less, add more rows at the top
-        for (int i = 0; i > delta; --i)
-        {
-            Text* text = new Text(context_);
-            // If style is already set, apply here to ensure proper height of the console when
-            // amount of rows is changed
-            if (background_->GetDefaultStyle())
-                text->SetStyle("ConsoleText");
-            rowContainer_->InsertItem(0, text);
-        }
-    }
-
-    rowContainer_->EnsureItemVisibility(rowContainer_->GetItem(rowContainer_->GetNumItems() - 1));
-    rowContainer_->EnableLayoutUpdate();
-    rowContainer_->UpdateLayout();
-
-    UpdateElements();
-}
-
-void Console::SetNumRows(unsigned rows)
-{
-    if (!rows)
-        return;
-
-    displayedRows_ = rows;
-    if (GetNumBufferedRows() < rows)
-        SetNumBufferedRows(rows);
-
-    UpdateElements();
-}
-
-void Console::SetNumHistoryRows(unsigned rows)
-{
-    historyRows_ = rows;
-    if (history_.Size() > rows)
-        history_.Resize(rows);
-    if (historyPosition_ > rows)
-        historyPosition_ = rows;
-}
-
-void Console::SetFocusOnShow(bool enable)
-{
-    focusOnShow_ = enable;
-}
-
-void Console::UpdateElements()
-{
-    int width = GetSubsystem<UI>()->GetRoot()->GetWidth();
-    const IntRect& border = background_->GetLayoutBorder();
-    const IntRect& panelBorder = rowContainer_->GetScrollPanel()->GetClipBorder();
-    rowContainer_->SetFixedWidth(width - border.left_ - border.right_);
-    rowContainer_->SetFixedHeight(
-        displayedRows_ * rowContainer_->GetItem((unsigned)0)->GetHeight() + panelBorder.top_ + panelBorder.bottom_ +
-        (rowContainer_->GetHorizontalScrollBar()->IsVisible() ? rowContainer_->GetHorizontalScrollBar()->GetHeight() : 0));
-    background_->SetFixedWidth(width);
-    background_->SetHeight(background_->GetMinHeight());
-}
-
-XMLFile* Console::GetDefaultStyle() const
-{
-    return background_->GetDefaultStyle(false);
-}
-
-bool Console::IsVisible() const
-{
-    return background_ && background_->IsVisible();
-}
-
-unsigned Console::GetNumBufferedRows() const
-{
-    return rowContainer_->GetNumItems();
-}
-
-void Console::CopySelectedRows() const
-{
-    rowContainer_->CopySelectedItemsToClipboard();
-}
-
-const String& Console::GetHistoryRow(unsigned index) const
-{
-    return index < history_.Size() ? history_[index] : String::EMPTY;
-}
-
-bool Console::PopulateInterpreter()
-{
-    interpreters_->RemoveAllItems();
-
-    HashSet<Object*>* receivers = context_->GetEventReceivers(E_CONSOLECOMMAND);
-    if (!receivers || receivers->Empty())
-        return false;
-
-    Vector<String> names;
-    for (HashSet<Object*>::ConstIterator iter = receivers->Begin(); iter != receivers->End(); ++iter)
-        names.Push((*iter)->GetTypeName());
-    Sort(names.Begin(), names.End());
-
-    unsigned selection = M_MAX_UNSIGNED;
-    for (unsigned i = 0; i < names.Size(); ++i)
-    {
-        const String& name = names[i];
-        if (name == commandInterpreter_)
-            selection = i;
-        Text* text = new Text(context_);
-        text->SetStyle("ConsoleText");
-        text->SetText(name);
-        interpreters_->AddItem(text);
-    }
-
-    const IntRect& border = interpreters_->GetPopup()->GetLayoutBorder();
-    interpreters_->SetMaxWidth(interpreters_->GetListView()->GetContentElement()->GetWidth() + border.left_ + border.right_);
-    bool enabled = interpreters_->GetNumItems() > 1;
-    interpreters_->SetEnabled(enabled);
-    interpreters_->SetFocusMode(enabled ? FM_FOCUSABLE_DEFOCUSABLE : FM_NOTFOCUSABLE);
-
-    if (selection == M_MAX_UNSIGNED)
-    {
-        selection = 0;
-        commandInterpreter_ = names[selection];
-    }
-    interpreters_->SetSelection(selection);
-
-    return true;
-}
-
-void Console::HandleInterpreterSelected(StringHash eventType, VariantMap& eventData)
-{
-    commandInterpreter_ = static_cast<Text*>(interpreters_->GetSelectedItem())->GetText();
-    lineEdit_->SetFocus(true);
-}
-
-void Console::HandleTextFinished(StringHash eventType, VariantMap& eventData)
-{
-    using namespace TextFinished;
-
-    String line = lineEdit_->GetText();
-    if (!line.Empty())
-    {
-        // Send the command as an event for script subsystem
-        using namespace ConsoleCommand;
-
-#if ATOMIC_CXX11
-        SendEvent(E_CONSOLECOMMAND, P_COMMAND, line, P_ID, static_cast<Text*>(interpreters_->GetSelectedItem())->GetText());
-#else
-        VariantMap& newEventData = GetEventDataMap();
-        newEventData[P_COMMAND] = line;
-        newEventData[P_ID] = static_cast<Text*>(interpreters_->GetSelectedItem())->GetText();
-        SendEvent(E_CONSOLECOMMAND, newEventData);
-#endif
-
-        // Store to history, then clear the lineedit
-        history_.Push(line);
-        if (history_.Size() > historyRows_)
-            history_.Erase(history_.Begin());
-        historyPosition_ = history_.Size();
-
-        currentRow_.Clear();
-        lineEdit_->SetText(currentRow_);
-    }
-}
-
-void Console::HandleLineEditKey(StringHash eventType, VariantMap& eventData)
-{
-    if (!historyRows_)
-        return;
-
-    using namespace UnhandledKey;
-
-    bool changed = false;
-
-    switch (eventData[P_KEY].GetInt())
-    {
-    case KEY_UP:
-        if (historyPosition_ > 0)
-        {
-            if (historyPosition_ == history_.Size())
-                currentRow_ = lineEdit_->GetText();
-            --historyPosition_;
-            changed = true;
-        }
-        break;
-
-    case KEY_DOWN:
-        if (historyPosition_ < history_.Size())
-        {
-            ++historyPosition_;
-            changed = true;
-        }
-        break;
-
-    default: break;
-    }
-
-    if (changed)
-    {
-        if (historyPosition_ < history_.Size())
-            lineEdit_->SetText(history_[historyPosition_]);
-        else
-            lineEdit_->SetText(currentRow_);
-    }
-}
-
-void Console::HandleCloseButtonPressed(StringHash eventType, VariantMap& eventData)
-{
-    SetVisible(false);
-}
-
-void Console::HandleRootElementResized(StringHash eventType, VariantMap& eventData)
-{
-    UpdateElements();
-}
-
-void Console::HandleLogMessage(StringHash eventType, VariantMap& eventData)
-{
-    // If printing a log message causes more messages to be logged (error accessing font), disregard them
-    if (printing_)
-        return;
-
-    using namespace LogMessage;
-
-    int level = eventData[P_LEVEL].GetInt();
-    // The message may be multi-line, so split to rows in that case
-    Vector<String> rows = eventData[P_MESSAGE].GetString().Split('\n');
-
-    for (unsigned i = 0; i < rows.Size(); ++i)
-        pendingRows_.Push(MakePair(level, rows[i]));
-
-    if (autoVisibleOnError_ && level == LOG_ERROR && !IsVisible())
-        SetVisible(true);
-}
-
-void Console::HandlePostUpdate(StringHash eventType, VariantMap& eventData)
-{
-    // Ensure UI-elements are not detached
-    if (!background_->GetParent())
-    {
-        UI* ui = GetSubsystem<UI>();
-        UIElement* uiRoot = ui->GetRoot();
-        uiRoot->AddChild(background_);
-        uiRoot->AddChild(closeButton_);
-    }
-
-    if (!rowContainer_->GetNumItems() || pendingRows_.Empty())
-        return;
-
-    printing_ = true;
-    rowContainer_->DisableLayoutUpdate();
-
-    Text* text = 0;
-    for (unsigned i = 0; i < pendingRows_.Size(); ++i)
-    {
-        rowContainer_->RemoveItem((unsigned)0);
-        text = new Text(context_);
-        text->SetText(pendingRows_[i].second_);
-        // Make error message highlight
-        text->SetStyle(pendingRows_[i].first_ == LOG_ERROR ? "ConsoleHighlightedText" : "ConsoleText");
-        rowContainer_->AddItem(text);
-    }
-
-    pendingRows_.Clear();
-
-    rowContainer_->EnsureItemVisibility(text);
-    rowContainer_->EnableLayoutUpdate();
-    rowContainer_->UpdateLayout();
-    UpdateElements();   // May need to readjust the height due to scrollbar visibility changes
-    printing_ = false;
-}
-
-}
-
-#endif

+ 0 - 170
Source/Atomic/Engine/Console.h

@@ -1,170 +0,0 @@
-//
-// Copyright (c) 2008-2016 the Urho3D project.
-//
-// 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 "../Core/Object.h"
-
-namespace Atomic
-{
-
-class Button;
-class BorderImage;
-class DropDownList;
-class Engine;
-class Font;
-class LineEdit;
-class ListView;
-class Text;
-class UIElement;
-class XMLFile;
-
-/// %Console window with log history and command line prompt.
-class ATOMIC_API Console : public Object
-{
-    ATOMIC_OBJECT(Console, Object);
-
-public:
-    /// Construct.
-    Console(Context* context);
-    /// Destruct.
-    ~Console();
-
-    /// Set UI elements' style from an XML file.
-    void SetDefaultStyle(XMLFile* style);
-    /// Show or hide.
-    void SetVisible(bool enable);
-    /// Toggle visibility.
-    void Toggle();
-
-    /// Automatically set console to visible when receiving an error log message.
-    void SetAutoVisibleOnError(bool enable) { autoVisibleOnError_ = enable; }
-
-    /// Set the command interpreter.
-    void SetCommandInterpreter(const String& interpreter) { commandInterpreter_ = interpreter; }
-
-    /// Set number of buffered rows.
-    void SetNumBufferedRows(unsigned rows);
-    /// Set number of displayed rows.
-    void SetNumRows(unsigned rows);
-    /// Set command history maximum size, 0 disables history.
-    void SetNumHistoryRows(unsigned rows);
-    /// Set whether to automatically focus the line edit when showing. Default true on desktops and false on mobile devices, as on mobiles it would pop up the screen keyboard.
-    void SetFocusOnShow(bool enable);
-    /// Update elements to layout properly. Call this after manually adjusting the sub-elements.
-    void UpdateElements();
-
-    /// Return the UI style file.
-    XMLFile* GetDefaultStyle() const;
-
-    /// Return the background element.
-    BorderImage* GetBackground() const { return background_; }
-
-    /// Return the line edit element.
-    LineEdit* GetLineEdit() const { return lineEdit_; }
-
-    /// Return the close butoon element.
-    Button* GetCloseButton() const { return closeButton_; }
-
-    /// Return whether is visible.
-    bool IsVisible() const;
-
-    /// Return true when console is set to automatically visible when receiving an error log message.
-    bool IsAutoVisibleOnError() const { return autoVisibleOnError_; }
-
-    /// Return the last used command interpreter.
-    const String& GetCommandInterpreter() const { return commandInterpreter_; }
-
-    /// Return number of buffered rows.
-    unsigned GetNumBufferedRows() const;
-
-    /// Return number of displayed rows.
-    unsigned GetNumRows() const { return displayedRows_; }
-
-    /// Copy selected rows to system clipboard.
-    void CopySelectedRows() const;
-
-    /// Return history maximum size.
-    unsigned GetNumHistoryRows() const { return historyRows_; }
-
-    /// Return current history position.
-    unsigned GetHistoryPosition() const { return historyPosition_; }
-
-    /// Return history row at index.
-    const String& GetHistoryRow(unsigned index) const;
-
-    /// Return whether automatically focuses the line edit when showing.
-    bool GetFocusOnShow() const { return focusOnShow_; }
-
-private:
-    /// Populate the command line interpreters that could handle the console command.
-    bool PopulateInterpreter();
-    /// Handle interpreter being selected on the drop down list.
-    void HandleInterpreterSelected(StringHash eventType, VariantMap& eventData);
-    /// Handle enter pressed on the line edit.
-    void HandleTextFinished(StringHash eventType, VariantMap& eventData);
-    /// Handle unhandled key on the line edit for scrolling the history.
-    void HandleLineEditKey(StringHash eventType, VariantMap& eventData);
-    /// Handle close button being pressed.
-    void HandleCloseButtonPressed(StringHash eventType, VariantMap& eventData);
-    /// Handle UI root resize.
-    void HandleRootElementResized(StringHash eventType, VariantMap& eventData);
-    /// Handle a log message.
-    void HandleLogMessage(StringHash eventType, VariantMap& eventData);
-    /// Handle the application post-update.
-    void HandlePostUpdate(StringHash eventType, VariantMap& eventData);
-
-    /// Auto visible on error flag.
-    bool autoVisibleOnError_;
-    /// Background.
-    SharedPtr<BorderImage> background_;
-    /// Container for text rows.
-    ListView* rowContainer_;
-    /// Container for the command line.
-    UIElement* commandLine_;
-    /// Interpreter drop down list.
-    DropDownList* interpreters_;
-    /// Line edit.
-    LineEdit* lineEdit_;
-    /// Close button.
-    SharedPtr<Button> closeButton_;
-    /// Last used command interpreter.
-    String commandInterpreter_;
-    /// Command history.
-    Vector<String> history_;
-    /// Pending log message rows.
-    Vector<Pair<int, String> > pendingRows_;
-    /// Current row being edited.
-    String currentRow_;
-    /// Maximum displayed rows.
-    unsigned displayedRows_;
-    /// Command history maximum rows.
-    unsigned historyRows_;
-    /// Command history current position.
-    unsigned historyPosition_;
-    /// Flag when printing messages to prevent endless loop.
-    bool printing_;
-    /// Flag for automatically focusing the line edit on showing the console.
-    bool focusOnShow_;
-};
-
-}

+ 0 - 318
Source/Atomic/Engine/DebugHud.cpp

@@ -1,318 +0,0 @@
-#ifdef DISABLED__
-
-//
-// Copyright (c) 2008-2016 the Urho3D project.
-//
-// 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.
-//
-
-#include "../Precompiled.h"
-
-#include "../Core/CoreEvents.h"
-#include "../Core/Profiler.h"
-#include "../Core/EventProfiler.h"
-#include "../Core/Context.h"
-#include "../Engine/DebugHud.h"
-#include "../Engine/Engine.h"
-#include "../Graphics/Graphics.h"
-#include "../Graphics/Renderer.h"
-#include "../Resource/ResourceCache.h"
-#include "../IO/Log.h"
-#include "../UI/Font.h"
-#include "../UI/Text.h"
-#include "../UI/UI.h"
-
-#include "../DebugNew.h"
-
-namespace Atomic
-{
-
-static const char* qualityTexts[] =
-{
-    "Low",
-    "Med",
-    "High"
-};
-
-static const char* shadowQualityTexts[] =
-{
-    "16bit Simple",
-    "24bit Simple",
-    "16bit PCF",
-    "24bit PCF",
-    "VSM",
-    "Blurred VSM"
-};
-
-DebugHud::DebugHud(Context* context) :
-    Object(context),
-    profilerMaxDepth_(M_MAX_UNSIGNED),
-    profilerInterval_(1000),
-    useRendererStats_(false),
-    mode_(DEBUGHUD_SHOW_NONE)
-{
-    UI* ui = GetSubsystem<UI>();
-    UIElement* uiRoot = ui->GetRoot();
-
-    statsText_ = new Text(context_);
-    statsText_->SetAlignment(HA_LEFT, VA_TOP);
-    statsText_->SetPriority(100);
-    statsText_->SetVisible(false);
-    uiRoot->AddChild(statsText_);
-
-    modeText_ = new Text(context_);
-    modeText_->SetAlignment(HA_LEFT, VA_BOTTOM);
-    modeText_->SetPriority(100);
-    modeText_->SetVisible(false);
-    uiRoot->AddChild(modeText_);
-
-    profilerText_ = new Text(context_);
-    profilerText_->SetAlignment(HA_RIGHT, VA_TOP);
-    profilerText_->SetPriority(100);
-    profilerText_->SetVisible(false);
-    uiRoot->AddChild(profilerText_);
-
-    memoryText_ = new Text(context_);
-    memoryText_->SetAlignment(HA_RIGHT, VA_TOP);
-    memoryText_->SetPriority(100);
-    memoryText_->SetVisible(false);
-    uiRoot->AddChild(memoryText_);
-
-    eventProfilerText_ = new Text(context_);
-    eventProfilerText_->SetAlignment(HA_RIGHT, VA_TOP);
-    eventProfilerText_->SetPriority(100);
-    eventProfilerText_->SetVisible(false);
-    uiRoot->AddChild(eventProfilerText_);
-
-    SubscribeToEvent(E_POSTUPDATE, ATOMIC_HANDLER(DebugHud, HandlePostUpdate));
-}
-
-DebugHud::~DebugHud()
-{
-    statsText_->Remove();
-    modeText_->Remove();
-    profilerText_->Remove();
-    memoryText_->Remove();
-    eventProfilerText_->Remove();
-}
-
-void DebugHud::Update()
-{
-    Graphics* graphics = GetSubsystem<Graphics>();
-    Renderer* renderer = GetSubsystem<Renderer>();
-    if (!renderer || !graphics)
-        return;
-
-    // Ensure UI-elements are not detached
-    if (!statsText_->GetParent())
-    {
-        UI* ui = GetSubsystem<UI>();
-        UIElement* uiRoot = ui->GetRoot();
-        uiRoot->AddChild(statsText_);
-        uiRoot->AddChild(modeText_);
-        uiRoot->AddChild(profilerText_);
-    }
-
-    if (statsText_->IsVisible())
-    {
-        unsigned primitives, batches;
-        if (!useRendererStats_)
-        {
-            primitives = graphics->GetNumPrimitives();
-            batches = graphics->GetNumBatches();
-        }
-        else
-        {
-            primitives = renderer->GetNumPrimitives();
-            batches = renderer->GetNumBatches();
-        }
-
-        String stats;
-        stats.AppendWithFormat("Triangles %u\nBatches %u\nViews %u\nLights %u\nShadowmaps %u\nOccluders %u",
-            primitives,
-            batches,
-            renderer->GetNumViews(),
-            renderer->GetNumLights(true),
-            renderer->GetNumShadowMaps(true),
-            renderer->GetNumOccluders(true));
-
-        if (!appStats_.Empty())
-        {
-            stats.Append("\n");
-            for (HashMap<String, String>::ConstIterator i = appStats_.Begin(); i != appStats_.End(); ++i)
-                stats.AppendWithFormat("\n%s %s", i->first_.CString(), i->second_.CString());
-        }
-
-        statsText_->SetText(stats);
-    }
-
-    if (modeText_->IsVisible())
-    {
-        String mode;
-        mode.AppendWithFormat("Tex:%s Mat:%s Spec:%s Shadows:%s Size:%i Quality:%s Occlusion:%s Instancing:%s API:%s",
-            qualityTexts[renderer->GetTextureQuality()],
-            qualityTexts[renderer->GetMaterialQuality()],
-            renderer->GetSpecularLighting() ? "On" : "Off",
-            renderer->GetDrawShadows() ? "On" : "Off",
-            renderer->GetShadowMapSize(),
-            shadowQualityTexts[renderer->GetShadowQuality()],
-            renderer->GetMaxOccluderTriangles() > 0 ? "On" : "Off",
-            renderer->GetDynamicInstancing() ? "On" : "Off",
-            graphics->GetApiName().CString());
-
-        modeText_->SetText(mode);
-    }
-
-    Profiler* profiler = GetSubsystem<Profiler>();
-    EventProfiler* eventProfiler = GetSubsystem<EventProfiler>();
-    if (profiler)
-    {
-        if (profilerTimer_.GetMSec(false) >= profilerInterval_)
-        {
-            profilerTimer_.Reset();
-
-            if (profilerText_->IsVisible())
-            {
-                String profilerOutput = profiler->PrintData(false, false, profilerMaxDepth_);
-                profilerText_->SetText(profilerOutput);
-            }
-
-            profiler->BeginInterval();
-
-            if (eventProfiler)
-            {
-                if (eventProfilerText_->IsVisible())
-                {
-                    String profilerOutput = eventProfiler->PrintData(false, false, profilerMaxDepth_);
-                    eventProfilerText_->SetText(profilerOutput);
-                }
-
-                eventProfiler->BeginInterval();
-            }
-        }
-    }
-
-    if (memoryText_->IsVisible())
-    {
-        ResourceCache* cache = GetSubsystem<ResourceCache>();
-        memoryText_->SetText(cache->PrintMemoryUsage());
-    }
-}
-
-void DebugHud::SetDefaultStyle(XMLFile* style)
-{
-    if (!style)
-        return;
-
-    statsText_->SetDefaultStyle(style);
-    statsText_->SetStyle("DebugHudText");
-    modeText_->SetDefaultStyle(style);
-    modeText_->SetStyle("DebugHudText");
-    profilerText_->SetDefaultStyle(style);
-    profilerText_->SetStyle("DebugHudText");
-    memoryText_->SetDefaultStyle(style);
-    memoryText_->SetStyle("DebugHudText");
-    eventProfilerText_->SetDefaultStyle(style);
-    eventProfilerText_->SetStyle("DebugHudText");
-}
-
-void DebugHud::SetMode(unsigned mode)
-{
-    statsText_->SetVisible((mode & DEBUGHUD_SHOW_STATS) != 0);
-    modeText_->SetVisible((mode & DEBUGHUD_SHOW_MODE) != 0);
-    profilerText_->SetVisible((mode & DEBUGHUD_SHOW_PROFILER) != 0);
-    memoryText_->SetVisible((mode & DEBUGHUD_SHOW_MEMORY) != 0);
-    eventProfilerText_->SetVisible((mode & DEBUGHUD_SHOW_EVENTPROFILER) != 0);
-#ifdef ATOMIC_PROFILING
-    // Event profiler is created on engine initialization if "EventProfiler" parameter is set
-    EventProfiler* eventProfiler = GetSubsystem<EventProfiler>();
-    if (eventProfiler)
-        EventProfiler::SetActive((mode & DEBUGHUD_SHOW_EVENTPROFILER) != 0);
-#endif
-    mode_ = mode;
-}
-
-void DebugHud::SetProfilerMaxDepth(unsigned depth)
-{
-    profilerMaxDepth_ = depth;
-}
-
-void DebugHud::SetProfilerInterval(float interval)
-{
-    profilerInterval_ = Max((unsigned)(interval * 1000.0f), 0U);
-}
-
-void DebugHud::SetUseRendererStats(bool enable)
-{
-    useRendererStats_ = enable;
-}
-
-void DebugHud::Toggle(unsigned mode)
-{
-    SetMode(GetMode() ^ mode);
-}
-
-void DebugHud::ToggleAll()
-{
-    Toggle(DEBUGHUD_SHOW_ALL);
-}
-
-XMLFile* DebugHud::GetDefaultStyle() const
-{
-    return statsText_->GetDefaultStyle(false);
-}
-
-float DebugHud::GetProfilerInterval() const
-{
-    return (float)profilerInterval_ / 1000.0f;
-}
-
-void DebugHud::SetAppStats(const String& label, const Variant& stats)
-{
-    SetAppStats(label, stats.ToString());
-}
-
-void DebugHud::SetAppStats(const String& label, const String& stats)
-{
-    bool newLabel = !appStats_.Contains(label);
-    appStats_[label] = stats;
-    if (newLabel)
-        appStats_.Sort();
-}
-
-bool DebugHud::ResetAppStats(const String& label)
-{
-    return appStats_.Erase(label);
-}
-
-void DebugHud::ClearAppStats()
-{
-    appStats_.Clear();
-}
-
-void DebugHud::HandlePostUpdate(StringHash eventType, VariantMap& eventData)
-{
-    using namespace PostUpdate;
-
-    Update();
-}
-
-}
-
-#endif

+ 0 - 137
Source/Atomic/Engine/DebugHud.h

@@ -1,137 +0,0 @@
-//
-// Copyright (c) 2008-2016 the Urho3D project.
-//
-// 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 "../Core/Object.h"
-#include "../Core/Timer.h"
-
-namespace Atomic
-{
-
-class Engine;
-class Font;
-class Text;
-class XMLFile;
-
-static const unsigned DEBUGHUD_SHOW_NONE = 0x0;
-static const unsigned DEBUGHUD_SHOW_STATS = 0x1;
-static const unsigned DEBUGHUD_SHOW_MODE = 0x2;
-static const unsigned DEBUGHUD_SHOW_PROFILER = 0x4;
-static const unsigned DEBUGHUD_SHOW_MEMORY = 0x8;
-static const unsigned DEBUGHUD_SHOW_ALL = 0x7;
-static const unsigned DEBUGHUD_SHOW_ALL_MEMORY = 0xB;
-static const unsigned DEBUGHUD_SHOW_EVENTPROFILER = 0x10;
-
-/// Displays rendering stats and profiling information.
-class ATOMIC_API DebugHud : public Object
-{
-    ATOMIC_OBJECT(DebugHud, Object);
-
-public:
-    /// Construct.
-    DebugHud(Context* context);
-    /// Destruct.
-    ~DebugHud();
-
-    /// Update. Called by HandlePostUpdate().
-    void Update();
-    /// Set UI elements' style from an XML file.
-    void SetDefaultStyle(XMLFile* style);
-    /// Set elements to show.
-    void SetMode(unsigned mode);
-    /// Set maximum profiler block depth, default unlimited.
-    void SetProfilerMaxDepth(unsigned depth);
-    /// Set profiler accumulation interval in seconds.
-    void SetProfilerInterval(float interval);
-    /// Set whether to show 3D geometry primitive/batch count only. Default false.
-    void SetUseRendererStats(bool enable);
-    /// Toggle elements.
-    void Toggle(unsigned mode);
-    /// Toggle all elements.
-    void ToggleAll();
-
-    /// Return the UI style file.
-    XMLFile* GetDefaultStyle() const;
-
-    /// Return rendering stats text.
-    Text* GetStatsText() const { return statsText_; }
-
-    /// Return rendering mode text.
-    Text* GetModeText() const { return modeText_; }
-
-    /// Return profiler text.
-    Text* GetProfilerText() const { return profilerText_; }
-
-    /// Return memory text.
-    Text* GetMemoryText() const { return memoryText_; }
-
-    /// Return currently shown elements.
-    unsigned GetMode() const { return mode_; }
-
-    /// Return maximum profiler block depth.
-    unsigned GetProfilerMaxDepth() const { return profilerMaxDepth_; }
-
-    /// Return profiler accumulation interval in seconds
-    float GetProfilerInterval() const;
-
-    /// Return whether showing 3D geometry primitive/batch count only.
-    bool GetUseRendererStats() const { return useRendererStats_; }
-
-    /// Set application-specific stats.
-    void SetAppStats(const String& label, const Variant& stats);
-    /// Set application-specific stats.
-    void SetAppStats(const String& label, const String& stats);
-    /// Reset application-specific stats. Return true if it was erased successfully.
-    bool ResetAppStats(const String& label);
-    /// Clear all application-specific stats.
-    void ClearAppStats();
-
-private:
-    /// Handle logic post-update event. The HUD texts are updated here.
-    void HandlePostUpdate(StringHash eventType, VariantMap& eventData);
-
-    /// Rendering stats text.
-    SharedPtr<Text> statsText_;
-    /// Rendering mode text.
-    SharedPtr<Text> modeText_;
-    /// Profiling information text.
-    SharedPtr<Text> profilerText_;
-    /// Event profiling information text.
-    SharedPtr<Text> eventProfilerText_;
-    /// Memory stats text.
-    SharedPtr<Text> memoryText_;
-    /// Hashmap containing application specific stats.
-    HashMap<String, String> appStats_;
-    /// Profiler timer.
-    Timer profilerTimer_;
-    /// Profiler max block depth.
-    unsigned profilerMaxDepth_;
-    /// Profiler accumulation interval.
-    unsigned profilerInterval_;
-    /// Show 3D geometry primitive/batch count flag.
-    bool useRendererStats_;
-    /// Current shown-element mode.
-    unsigned mode_;
-};
-
-}

+ 13 - 2
Source/Atomic/Engine/Engine.cpp

@@ -29,8 +29,6 @@
 #include "../Core/Profiler.h"
 #include "../Core/Profiler.h"
 #include "../Core/EventProfiler.h"
 #include "../Core/EventProfiler.h"
 #include "../Core/WorkQueue.h"
 #include "../Core/WorkQueue.h"
-#include "../Engine/Console.h"
-#include "../Engine/DebugHud.h"
 #include "../Engine/Engine.h"
 #include "../Engine/Engine.h"
 #include "../Graphics/Graphics.h"
 #include "../Graphics/Graphics.h"
 #include "../Graphics/Renderer.h"
 #include "../Graphics/Renderer.h"
@@ -962,4 +960,17 @@ void Engine::DoExit()
 #endif
 #endif
 }
 }
 
 
+// ATOMIC BEGIN
+
+bool Engine::GetDebugBuild() const
+{
+#ifdef ATOMIC_DEBUG
+    return true;
+#else
+    return false;
+#endif
+}
+
+// ATOMIC END
+
 }
 }

+ 5 - 0
Source/Atomic/Engine/Engine.h

@@ -118,6 +118,11 @@ public:
     static const Variant
     static const Variant
         & GetParameter(const VariantMap& parameters, const String& parameter, const Variant& defaultValue = Variant::EMPTY);
         & GetParameter(const VariantMap& parameters, const String& parameter, const Variant& defaultValue = Variant::EMPTY);
 
 
+
+    // ATOMIC BEGIN
+    bool GetDebugBuild() const;
+    // ATOMIC END
+
 private:
 private:
     /// Handle exit requested event. Auto-exit if enabled.
     /// Handle exit requested event. Auto-exit if enabled.
     void HandleExitRequested(StringHash eventType, VariantMap& eventData);
     void HandleExitRequested(StringHash eventType, VariantMap& eventData);

+ 35 - 0
Source/Atomic/Graphics/AnimatedModel.cpp

@@ -280,6 +280,34 @@ void AnimatedModel::UpdateBatches(const FrameInfo& frame)
         lodDistance_ = newLodDistance;
         lodDistance_ = newLodDistance;
         CalculateLodLevels();
         CalculateLodLevels();
     }
     }
+
+    // ATOMIC BEGIN
+
+    // Handle mesh hiding
+    if (geometryDisabled_)
+    {
+        for (unsigned i = 0; i < batches_.Size(); ++i)
+        {
+            SourceBatch* batch = &batches_[i];
+            StaticModelGeometryData* data = &geometryData_[i];
+
+            if (batch->geometry_)
+                data->batchGeometry_ = batch->geometry_;
+
+            if (data->enabled_ && !batch->geometry_)
+            {
+                batch->geometry_ = data->batchGeometry_;
+            }
+            else if (!data->enabled_ && batch->geometry_)
+            {
+                data->batchGeometry_ = batch->geometry_;
+                batch->geometry_ = 0;
+            }
+        }
+    }
+
+    // ATOMIC END
+
 }
 }
 
 
 void AnimatedModel::UpdateGeometry(const FrameInfo& frame)
 void AnimatedModel::UpdateGeometry(const FrameInfo& frame)
@@ -340,6 +368,13 @@ void AnimatedModel::SetModel(Model* model, bool createBones)
         {
         {
             geometries_[i] = geometries[i];
             geometries_[i] = geometries[i];
             geometryData_[i].center_ = geometryCenters[i];
             geometryData_[i].center_ = geometryCenters[i];
+
+            // ATOMIC BEGIN
+
+            geometryData_[i].enabled_ = true;
+            geometryData_[i].batchGeometry_ = 0;
+
+            // ATOMIC END
         }
         }
 
 
         // Copy geometry bone mappings
         // Copy geometry bone mappings

+ 47 - 30
Source/Atomic/Graphics/BillboardSet.cpp

@@ -61,6 +61,16 @@ inline bool CompareBillboards(Billboard* lhs, Billboard* rhs)
     return lhs->sortDistance_ > rhs->sortDistance_;
     return lhs->sortDistance_ > rhs->sortDistance_;
 }
 }
 
 
+Billboard::Billboard()
+{
+
+}
+
+Billboard::~Billboard()
+{
+
+}
+
 BillboardSet::BillboardSet(Context* context) :
 BillboardSet::BillboardSet(Context* context) :
     Drawable(context, DRAWABLE_GEOMETRY),
     Drawable(context, DRAWABLE_GEOMETRY),
     animationLodBias_(1.0f),
     animationLodBias_(1.0f),
@@ -138,14 +148,14 @@ void BillboardSet::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQue
 
 
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     {
     {
-        if (!billboards_[i].enabled_)
+        if (!billboards_[i]->enabled_)
             continue;
             continue;
 
 
         // Approximate the billboards as spheres for raycasting
         // Approximate the billboards as spheres for raycasting
-        float size = INV_SQRT_TWO * (billboards_[i].size_.x_ * billboardScale.x_ + billboards_[i].size_.y_ * billboardScale.y_);
+        float size = INV_SQRT_TWO * (billboards_[i]->size_.x_ * billboardScale.x_ + billboards_[i]->size_.y_ * billboardScale.y_);
         if (fixedScreenSize_)
         if (fixedScreenSize_)
-            size *= billboards_[i].screenScaleFactor_;
-        Vector3 center = billboardTransform * billboards_[i].position_;
+            size *= billboards_[i]->screenScaleFactor_;
+        Vector3 center = billboardTransform * billboards_[i]->position_;
         Sphere billboardSphere(center, size);
         Sphere billboardSphere(center, size);
 
 
         float distance = query.ray_.HitDistance(billboardSphere);
         float distance = query.ray_.HitDistance(billboardSphere);
@@ -262,14 +272,16 @@ void BillboardSet::SetNumBillboards(unsigned num)
     // Set default values to new billboards
     // Set default values to new billboards
     for (unsigned i = oldNum; i < num; ++i)
     for (unsigned i = oldNum; i < num; ++i)
     {
     {
-        billboards_[i].position_ = Vector3::ZERO;
-        billboards_[i].size_ = Vector2::ONE;
-        billboards_[i].uv_ = Rect::POSITIVE;
-        billboards_[i].color_ = Color(1.0f, 1.0f, 1.0f);
-        billboards_[i].rotation_ = 0.0f;
-        billboards_[i].direction_ = Vector3::UP;
-        billboards_[i].enabled_ = false;
-        billboards_[i].screenScaleFactor_ = 1.0f;
+        Billboard *bb = new Billboard();
+        billboards_[i] = bb;
+        bb->position_ = Vector3::ZERO;
+        bb->size_ = Vector2::ONE;
+        bb->uv_ = Rect::POSITIVE;
+        bb->color_ = Color(1.0f, 1.0f, 1.0f);
+        bb->rotation_ = 0.0f;
+        bb->direction_ = Vector3::UP;
+        bb->enabled_ = false;
+        bb->screenScaleFactor_ = 1.0f;
     }
     }
 
 
     bufferSizeDirty_ = true;
     bufferSizeDirty_ = true;
@@ -339,7 +351,7 @@ Material* BillboardSet::GetMaterial() const
 
 
 Billboard* BillboardSet::GetBillboard(unsigned index)
 Billboard* BillboardSet::GetBillboard(unsigned index)
 {
 {
-    return index < billboards_.Size() ? &billboards_[index] : (Billboard*)0;
+    return index < billboards_.Size() ? billboards_[index] : (Billboard*)0;
 }
 }
 
 
 void BillboardSet::SetMaterialAttr(const ResourceRef& value)
 void BillboardSet::SetMaterialAttr(const ResourceRef& value)
@@ -357,8 +369,9 @@ void BillboardSet::SetBillboardsAttr(const VariantVector& value)
     // Dealing with old billboard format
     // Dealing with old billboard format
     if (value.Size() == billboards_.Size() * 6 + 1)
     if (value.Size() == billboards_.Size() * 6 + 1)
     {
     {
-        for (PODVector<Billboard>::Iterator i = billboards_.Begin(); i != billboards_.End() && index < value.Size(); ++i)
+        for (Vector<SharedPtr<Billboard>>::Iterator ii = billboards_.Begin(); ii != billboards_.End() && index < value.Size(); ++ii)
         {
         {
+            Billboard* i = *ii;
             i->position_ = value[index++].GetVector3();
             i->position_ = value[index++].GetVector3();
             i->size_ = value[index++].GetVector2();
             i->size_ = value[index++].GetVector2();
             Vector4 uv = value[index++].GetVector4();
             Vector4 uv = value[index++].GetVector4();
@@ -371,8 +384,9 @@ void BillboardSet::SetBillboardsAttr(const VariantVector& value)
     // New billboard format
     // New billboard format
     else
     else
     {
     {
-        for (PODVector<Billboard>::Iterator i = billboards_.Begin(); i != billboards_.End() && index < value.Size(); ++i)
+        for (Vector<SharedPtr<Billboard>>::Iterator ii = billboards_.Begin(); ii != billboards_.End() && index < value.Size(); ++ii)
         {
         {
+            Billboard* i = *ii;
             i->position_ = value[index++].GetVector3();
             i->position_ = value[index++].GetVector3();
             i->size_ = value[index++].GetVector2();
             i->size_ = value[index++].GetVector2();
             Vector4 uv = value[index++].GetVector4();
             Vector4 uv = value[index++].GetVector4();
@@ -393,8 +407,9 @@ void BillboardSet::SetNetBillboardsAttr(const PODVector<unsigned char>& value)
     unsigned numBillboards = buf.ReadVLE();
     unsigned numBillboards = buf.ReadVLE();
     SetNumBillboards(numBillboards);
     SetNumBillboards(numBillboards);
 
 
-    for (PODVector<Billboard>::Iterator i = billboards_.Begin(); i != billboards_.End(); ++i)
+    for (Vector<SharedPtr<Billboard>>::Iterator ii = billboards_.Begin(); ii != billboards_.End(); ++ii)
     {
     {
+        Billboard* i = *ii;
         i->position_ = buf.ReadVector3();
         i->position_ = buf.ReadVector3();
         i->size_ = buf.ReadVector2();
         i->size_ = buf.ReadVector2();
         i->uv_ = buf.ReadRect();
         i->uv_ = buf.ReadRect();
@@ -418,8 +433,9 @@ VariantVector BillboardSet::GetBillboardsAttr() const
     ret.Reserve(billboards_.Size() * 7 + 1);
     ret.Reserve(billboards_.Size() * 7 + 1);
     ret.Push(billboards_.Size());
     ret.Push(billboards_.Size());
 
 
-    for (PODVector<Billboard>::ConstIterator i = billboards_.Begin(); i != billboards_.End(); ++i)
+    for (Vector<SharedPtr<Billboard>>::ConstIterator ii = billboards_.Begin(); ii != billboards_.End(); ++ii)
     {
     {
+        const Billboard* i = *ii;
         ret.Push(i->position_);
         ret.Push(i->position_);
         ret.Push(i->size_);
         ret.Push(i->size_);
         ret.Push(Vector4(i->uv_.min_.x_, i->uv_.min_.y_, i->uv_.max_.x_, i->uv_.max_.y_));
         ret.Push(Vector4(i->uv_.min_.x_, i->uv_.min_.y_, i->uv_.max_.x_, i->uv_.max_.y_));
@@ -437,8 +453,9 @@ const PODVector<unsigned char>& BillboardSet::GetNetBillboardsAttr() const
     attrBuffer_.Clear();
     attrBuffer_.Clear();
     attrBuffer_.WriteVLE(billboards_.Size());
     attrBuffer_.WriteVLE(billboards_.Size());
 
 
-    for (PODVector<Billboard>::ConstIterator i = billboards_.Begin(); i != billboards_.End(); ++i)
+    for (Vector<SharedPtr<Billboard>>::ConstIterator ii = billboards_.Begin(); ii != billboards_.End(); ++ii)
     {
     {
+        const Billboard* i = *ii;
         attrBuffer_.WriteVector3(i->position_);
         attrBuffer_.WriteVector3(i->position_);
         attrBuffer_.WriteVector2(i->size_);
         attrBuffer_.WriteVector2(i->size_);
         attrBuffer_.WriteRect(i->uv_);
         attrBuffer_.WriteRect(i->uv_);
@@ -461,14 +478,14 @@ void BillboardSet::OnWorldBoundingBoxUpdate()
 
 
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     {
     {
-        if (!billboards_[i].enabled_)
+        if (!billboards_[i]->enabled_)
             continue;
             continue;
 
 
-        float size = INV_SQRT_TWO * (billboards_[i].size_.x_ * billboardScale.x_ + billboards_[i].size_.y_ * billboardScale.y_);
+        float size = INV_SQRT_TWO * (billboards_[i]->size_.x_ * billboardScale.x_ + billboards_[i]->size_.y_ * billboardScale.y_);
         if (fixedScreenSize_)
         if (fixedScreenSize_)
-            size *= billboards_[i].screenScaleFactor_;
+            size *= billboards_[i]->screenScaleFactor_;
 
 
-        Vector3 center = billboardTransform * billboards_[i].position_;
+        Vector3 center = billboardTransform * billboards_[i]->position_;
         Vector3 edge = Vector3::ONE * size;
         Vector3 edge = Vector3::ONE * size;
         worldBox.Merge(BoundingBox(center - edge, center + edge));
         worldBox.Merge(BoundingBox(center - edge, center + edge));
 
 
@@ -558,7 +575,7 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
     // First check number of enabled billboards
     // First check number of enabled billboards
     for (unsigned i = 0; i < numBillboards; ++i)
     for (unsigned i = 0; i < numBillboards; ++i)
     {
     {
-        if (billboards_[i].enabled_)
+        if (billboards_[i]->enabled_)
             ++enabledBillboards;
             ++enabledBillboards;
     }
     }
 
 
@@ -568,12 +585,12 @@ void BillboardSet::UpdateVertexBuffer(const FrameInfo& frame)
     // Then set initial sort order and distances
     // Then set initial sort order and distances
     for (unsigned i = 0; i < numBillboards; ++i)
     for (unsigned i = 0; i < numBillboards; ++i)
     {
     {
-        Billboard& billboard = billboards_[i];
-        if (billboard.enabled_)
+        Billboard* billboard = billboards_[i];
+        if (billboard->enabled_)
         {
         {
-            sortedBillboards_[index++] = &billboard;
+            sortedBillboards_[index++] = billboard;
             if (sorted_)
             if (sorted_)
-                billboard.sortDistance_ = frame.camera_->GetDistanceSquared(billboardTransform * billboards_[i].position_);
+                billboard->sortDistance_ = frame.camera_->GetDistanceSquared(billboardTransform * billboards_[i]->position_);
         }
         }
     }
     }
 
 
@@ -742,14 +759,14 @@ void BillboardSet::CalculateFixedScreenSize(const FrameInfo& frame)
 
 
         for (unsigned i = 0; i < billboards_.Size(); ++i)
         for (unsigned i = 0; i < billboards_.Size(); ++i)
         {
         {
-            Vector4 projPos(viewProj * Vector4(billboardTransform * billboards_[i].position_, 1.0f));
-            billboards_[i].screenScaleFactor_ = invViewHeight * halfViewWorldSize * projPos.w_;
+            Vector4 projPos(viewProj * Vector4(billboardTransform * billboards_[i]->position_, 1.0f));
+            billboards_[i]->screenScaleFactor_ = invViewHeight * halfViewWorldSize * projPos.w_;
         }
         }
     }
     }
     else
     else
     {
     {
         for (unsigned i = 0; i < billboards_.Size(); ++i)
         for (unsigned i = 0; i < billboards_.Size(); ++i)
-            billboards_[i].screenScaleFactor_ = invViewHeight * halfViewWorldSize;
+            billboards_[i]->screenScaleFactor_ = invViewHeight * halfViewWorldSize;
     }
     }
 
 
     bufferDirty_ = true;
     bufferDirty_ = true;

+ 39 - 3
Source/Atomic/Graphics/BillboardSet.h

@@ -35,8 +35,41 @@ class IndexBuffer;
 class VertexBuffer;
 class VertexBuffer;
 
 
 /// One billboard in the billboard set.
 /// One billboard in the billboard set.
-struct ATOMIC_API Billboard
+class ATOMIC_API Billboard : public RefCounted
 {
 {
+    friend class BillboardSet;
+    friend class ParticleEmitter;
+
+    ATOMIC_REFCOUNTED(Billboard);
+
+public:
+    Billboard();
+    virtual ~Billboard();
+
+    const Vector3& GetPosition() const { return position_; }
+    void SetPosition(Vector3 &position) { position_ = position; }
+
+    const Vector2 GetSize() const { return size_; }
+    void SetSize(Vector2 &size) { size_ = size; }
+
+    const Rect& GetUV() const { return uv_; }
+    void SetUV(Rect &uv) { uv_ = uv; }
+
+    const Color& GetColor() const { return color_; }
+    void SetColor(Color &color) { color_ = color; }
+
+    float GetRotation() const { return rotation_; }
+    void SetRotation(float rotation) { rotation_ = rotation; }
+
+    const Vector3& GetDirection() const { return direction_; }
+    void SetDirection(const Vector3& direction) { direction_ = direction; }
+
+    bool IsEnabled() const { return enabled_; }
+    void SetEnabled(bool enabled) { enabled_ = enabled; }
+
+    float GetSortDistance() const { return sortDistance_; }
+    void SetSortDistance(float sortDistance) { sortDistance_ = sortDistance; }
+
     /// Position.
     /// Position.
     Vector3 position_;
     Vector3 position_;
     /// Two-dimensional size. If BillboardSet has fixed screen size enabled, this is measured in pixels instead of world units.
     /// Two-dimensional size. If BillboardSet has fixed screen size enabled, this is measured in pixels instead of world units.
@@ -57,6 +90,7 @@ struct ATOMIC_API Billboard
     float screenScaleFactor_;
     float screenScaleFactor_;
 };
 };
 
 
+
 static const unsigned MAX_BILLBOARDS = 65536 / 4;
 static const unsigned MAX_BILLBOARDS = 65536 / 4;
 
 
 /// %Billboard component.
 /// %Billboard component.
@@ -107,7 +141,7 @@ public:
     unsigned GetNumBillboards() const { return billboards_.Size(); }
     unsigned GetNumBillboards() const { return billboards_.Size(); }
 
 
     /// Return all billboards.
     /// Return all billboards.
-    PODVector<Billboard>& GetBillboards() { return billboards_; }
+    Vector<SharedPtr<Billboard>>& GetBillboards() { return billboards_; }
 
 
     /// Return billboard by index.
     /// Return billboard by index.
     Billboard* GetBillboard(unsigned index);
     Billboard* GetBillboard(unsigned index);
@@ -150,7 +184,9 @@ protected:
     void MarkPositionsDirty();
     void MarkPositionsDirty();
 
 
     /// Billboards.
     /// Billboards.
-    PODVector<Billboard> billboards_;
+    // ATOMIC BEGIN
+    Vector<SharedPtr<Billboard>> billboards_;
+    // ATOMIC END
     /// Animation LOD bias.
     /// Animation LOD bias.
     float animationLodBias_;
     float animationLodBias_;
     /// Animation LOD timer.
     /// Animation LOD timer.

+ 62 - 1
Source/Atomic/Graphics/DebugRenderer.cpp

@@ -48,7 +48,17 @@ static const unsigned MAX_LINES = 1000000;
 static const unsigned MAX_TRIANGLES = 100000;
 static const unsigned MAX_TRIANGLES = 100000;
 
 
 DebugRenderer::DebugRenderer(Context* context) :
 DebugRenderer::DebugRenderer(Context* context) :
-    Component(context)
+    Component(context),
+    // ATOMIC BEGIN
+    position1_(0, 0, 0),
+    position2_(0, 0, 0),
+    position3_(0, 0, 0),
+    numGridLines_(100),
+    scale_(0),
+    lineLength_(0),
+    offset_(0),
+    scaleIncrement_(10)
+  // ATOMIC END
 {
 {
     vertexBuffer_ = new VertexBuffer(context_);
     vertexBuffer_ = new VertexBuffer(context_);
 
 
@@ -571,4 +581,55 @@ void DebugRenderer::HandleEndFrame(StringHash eventType, VariantMap& eventData)
         noDepthTriangles_.Reserve(noDepthTrianglesSize);
         noDepthTriangles_.Reserve(noDepthTrianglesSize);
 }
 }
 
 
+// ATOMIC BEGIN
+
+void DebugRenderer::CreateXAxisLines(unsigned gridColor, bool depthTest, int x, int y, int z)
+{
+    for (int i = 0; i < numGridLines_; i++)
+    {
+        position1_ = Vector3(x, y, z - offset_);
+        position2_ = Vector3(position1_.x_ + lineLength_, y, z - offset_);
+        position3_ = Vector3(position1_.x_ + -lineLength_, y, z - offset_);
+
+        AddLine(position1_, position2_, gridColor, depthTest);
+        AddLine(position3_, position1_, gridColor, depthTest);
+
+        z += scale_;
+    }
+
+}
+
+void DebugRenderer::CreateZAxisLines(unsigned gridColor, bool depthTest, int x, int y, int z)
+{
+    for (int j = 0; j < numGridLines_; j++)
+    {
+        position1_ = Vector3(x - offset_, y, z);
+        position2_ = Vector3(x - offset_, y, position1_.z_ + lineLength_);
+        position3_ = Vector3(x - offset_, y, position1_.z_ + -lineLength_);
+
+        AddLine(position1_, position2_, gridColor, depthTest);
+        AddLine(position3_, position1_, gridColor, depthTest);
+
+        x += scale_;
+    }
+}
+
+void DebugRenderer::CreateGrid(const Color& grid, bool depthTest, Vector3 position)
+{
+    unsigned gridColor = grid.ToUInt();
+
+    scale_ = position.y_ / scaleIncrement_;
+
+    if (position.y_ < scaleIncrement_)
+        scale_ = 1;
+
+    lineLength_ = (numGridLines_ / 2) * scale_;
+    offset_ = (numGridLines_ / 2) * scale_;
+
+    CreateXAxisLines(gridColor, depthTest, 0, 0, 0);
+    CreateZAxisLines(gridColor, depthTest, 0, 0, 0);
+}
+
+// ATOMIC END
+
 }
 }

+ 34 - 0
Source/Atomic/Graphics/DebugRenderer.h

@@ -158,6 +158,17 @@ public:
     /// Return whether has something to render.
     /// Return whether has something to render.
     bool HasContent() const;
     bool HasContent() const;
 
 
+    // ATOMIC BEGIN
+
+    /// Creates a grid on all axis
+    void CreateGrid(const Color& grid, bool depthTest, Vector3 position);
+
+    void CreateXAxisLines(unsigned gridColor, bool depthTest, int x, int y, int z);
+    void CreateZAxisLines(unsigned gridColor, bool depthTest, int x, int y, int z);
+
+    // ATOMIC END
+
+
 private:
 private:
     /// Handle end of frame. Clear debug geometry.
     /// Handle end of frame. Clear debug geometry.
     void HandleEndFrame(StringHash eventType, VariantMap& eventData);
     void HandleEndFrame(StringHash eventType, VariantMap& eventData);
@@ -178,6 +189,29 @@ private:
     Frustum frustum_;
     Frustum frustum_;
     /// Vertex buffer.
     /// Vertex buffer.
     SharedPtr<VertexBuffer> vertexBuffer_;
     SharedPtr<VertexBuffer> vertexBuffer_;
+
+    // ATOMIC BEGIN
+
+    /// Positioning of grid lines point 1
+    Vector3 position1_;
+    /// Positioning of grid lines point 2
+    Vector3 position2_;
+    /// Positioning of grid lines point 3
+    Vector3 position3_;
+
+    /// Number of total grid lines
+    int numGridLines_;
+    /// Length of a grid line
+    int lineLength_;
+    /// Offset centres the grid
+    int offset_;
+    /// Scales the grid according to y-position of camera
+    int scale_;
+    /// The amount the scale gets incremented
+    int scaleIncrement_;
+
+    // ATOMIC END
+
 };
 };
 
 
 }
 }

+ 33 - 0
Source/Atomic/Graphics/Graphics.cpp

@@ -309,4 +309,37 @@ void RegisterGraphicsLibrary(Context* context)
     Zone::RegisterObject(context);
     Zone::RegisterObject(context);
 }
 }
 
 
+// ATOMIC BEGIN
+int Graphics::GetCurrentMonitor()
+{
+    return SDL_GetWindowDisplayIndex((SDL_Window*) this->GetSDLWindow());
+}
+
+int Graphics::GetNumMonitors()
+{
+    return SDL_GetNumVideoDisplays();
+}
+bool Graphics::GetMaximized()
+{
+    if (!window_)
+        return false;
+
+    return SDL_GetWindowFlags(window_) & SDL_WINDOW_MAXIMIZED;
+}
+IntVector2 Graphics::GetMonitorResolution(int monitorId) const
+{
+    SDL_DisplayMode mode;
+    SDL_GetDesktopDisplayMode(monitorId, &mode);
+    return IntVector2(mode.w, mode.h);
+}
+
+void Graphics::RaiseWindow()
+{
+    if (window_)
+        SDL_RaiseWindow(window_);
+}
+
+
+// ATOMIC END
+
 }
 }

+ 9 - 1
Source/Atomic/Graphics/Graphics.h

@@ -119,7 +119,7 @@ public:
     /// Close the window.
     /// Close the window.
     void Close();
     void Close();
     /// Take a screenshot. Return true if successful.
     /// Take a screenshot. Return true if successful.
-    bool TakeScreenShot(Image& destImage);
+    bool TakeScreenShot(Image* destImage);
     /// Begin frame rendering. Return true if device available and can render.
     /// Begin frame rendering. Return true if device available and can render.
     bool BeginFrame();
     bool BeginFrame();
     /// End frame rendering and swap buffers.
     /// End frame rendering and swap buffers.
@@ -533,8 +533,16 @@ public:
     static bool GetGL3Support();
     static bool GetGL3Support();
 
 
     // ATOMIC BEGIN
     // ATOMIC BEGIN
+
     /// Get the SDL_Window as a void* to avoid having to include the graphics implementation
     /// Get the SDL_Window as a void* to avoid having to include the graphics implementation
     void* GetSDLWindow() { return window_; }
     void* GetSDLWindow() { return window_; }
+
+    int GetCurrentMonitor();
+    int GetNumMonitors();
+    bool GetMaximized();
+    IntVector2 GetMonitorResolution(int monitorId) const;
+    void RaiseWindow();
+
     // ATOMIC END
     // ATOMIC END
 
 
 private:
 private:

+ 106 - 0
Source/Atomic/Graphics/LMStaticModel.cpp

@@ -0,0 +1,106 @@
+// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
+// Please see LICENSE.md in repository root for license information
+// https://github.com/AtomicGameEngine/AtomicGameEngine
+
+#include "Precompiled.h"
+#include "../Core/Context.h"
+#include "../Resource/ResourceCache.h"
+#include "../Graphics/Technique.h"
+#include "../Atomic3D/LMStaticModel.h"
+
+namespace Atomic
+{
+
+extern const char* GEOMETRY_CATEGORY;
+
+
+LMStaticModel::LMStaticModel(Context* context) :
+    StaticModel(context),
+    lightmapTilingOffset_(1.0f, 1.0f, 0.0f, 0.0f)
+{
+
+}
+
+LMStaticModel::~LMStaticModel()
+{
+
+}
+
+void LMStaticModel::RegisterObject(Context* context)
+{
+    context->RegisterFactory<LMStaticModel>(GEOMETRY_CATEGORY);
+
+    ATOMIC_COPY_BASE_ATTRIBUTES(StaticModel);
+    ATOMIC_ATTRIBUTE("Lightmap Tiling Offset", Vector4, lightmapTilingOffset_ , Vector4(1.0f, 1.0f, 0.0f, 0.0f), AM_DEFAULT);
+    ATOMIC_MIXED_ACCESSOR_ATTRIBUTE("LightmapTexture", GetLightmapTextureAttr, SetLightmapTextureAttr, ResourceRef, ResourceRef(Texture2D::GetTypeStatic()), AM_DEFAULT);
+
+}
+
+void LMStaticModel::SetLightmapTextureAttr(const ResourceRef& value)
+{
+    ResourceCache* cache = GetSubsystem<ResourceCache>();
+
+    if (value.name_.Length())
+    {
+        lightmapTexture_ = cache->GetResource<Texture2D>(value.name_);
+    }
+    else
+    {
+        lightmapTexture_ = NULL;
+    }
+
+    // TODO: This is making a separate material for each model
+    // we should be able to factor this into batching
+    if (lightmapTexture_.NotNull() && lightmapMaterial_.Null())
+    {
+        Material* base = GetMaterial(0);
+        if (base)
+        {
+            ResourceCache* cache = GetSubsystem<ResourceCache>();
+            lightmapMaterial_ = base->Clone();
+            Technique* technique = cache->GetResource<Technique>("Techniques/DiffLightMap.xml");
+            lightmapMaterial_->SetTechnique(0, technique);
+            lightmapMaterial_->SetTexture(TU_EMISSIVE, lightmapTexture_);
+        }
+    }
+
+
+}
+
+ResourceRef LMStaticModel::GetLightmapTextureAttr() const
+{
+    return GetResourceRef(lightmapTexture_, Texture2D::GetTypeStatic());
+}
+
+void LMStaticModel::UpdateBatches(const FrameInfo& frame)
+{
+    /*
+    StaticModel::UpdateBatches(frame);
+
+    if (batches_.Size() > 1)
+    {
+        for (unsigned i = 0; i < batches_.Size(); ++i)
+        {
+            batches_[i].lightmapTilingOffset_ = &lightmapTilingOffset_;
+            batches_[i].geometryType_ = GEOM_STATIC_NOINSTANCING;
+
+            if (!lightmapMaterial_.Null())
+                batches_[i].material_ = lightmapMaterial_;
+        }
+    }
+    else if (batches_.Size() == 1)
+    {
+        batches_[0].lightmapTilingOffset_ = &lightmapTilingOffset_;
+        batches_[0].geometryType_ = GEOM_STATIC_NOINSTANCING;
+        if (!lightmapMaterial_.Null())
+            batches_[0].material_ = lightmapMaterial_;
+
+    }
+    */
+
+}
+
+
+}
+
+

+ 46 - 0
Source/Atomic/Graphics/LMStaticModel.h

@@ -0,0 +1,46 @@
+// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
+// Please see LICENSE.md in repository root for license information
+// https://github.com/AtomicGameEngine/AtomicGameEngine
+
+#pragma once
+
+#include "../Graphics/StaticModel.h"
+#include "../Graphics/Texture2D.h"
+#include "../Graphics/Material.h"
+
+namespace Atomic
+{
+
+class LMStaticModel: public StaticModel
+{
+    ATOMIC_OBJECT(LMStaticModel, StaticModel);
+
+public:
+    /// Construct.
+    LMStaticModel(Context* context);
+    /// Destruct.
+    virtual ~LMStaticModel();
+
+    /// Register object factory. StaticModel must be registered first.
+    static void RegisterObject(Context* context);
+
+    virtual void UpdateBatches(const FrameInfo& frame);
+
+    Vector4 lightmapTilingOffset_;
+
+    void SetLightmapTextureAttr(const ResourceRef& value);
+    ResourceRef GetLightmapTextureAttr() const;
+
+    void SetLightmapTexure(Texture2D* texture)
+    {
+        lightmapTexture_ = texture;
+    }
+
+private:
+    SharedPtr<Texture2D> lightmapTexture_;
+
+    SharedPtr<Material> lightmapMaterial_;
+
+};
+
+}

+ 27 - 0
Source/Atomic/Graphics/Model.cpp

@@ -753,4 +753,31 @@ unsigned Model::GetMorphRangeCount(unsigned bufferIndex) const
     return bufferIndex < vertexBuffers_.Size() ? morphRangeCounts_[bufferIndex] : 0;
     return bufferIndex < vertexBuffers_.Size() ? morphRangeCounts_[bufferIndex] : 0;
 }
 }
 
 
+// ATOMIC BEGIN
+
+bool Model::SetGeometryName(unsigned index, const String& name)
+{
+    if (index >= geometryNames_.Size())
+    {
+        ATOMIC_LOGERROR("Geometry name index out of bounds");
+        return false;
+    }
+
+    geometryNames_[index] = name;
+
+    return true;
+
+}
+
+const String& Model::GetGeometryName(unsigned index) const
+{
+    if (index >= geometryNames_.Size())
+        return String::EMPTY;
+
+    return geometryNames_[index];
+
+}
+
+// ATOMIC END
+
 }
 }

+ 13 - 0
Source/Atomic/Graphics/Model.h

@@ -201,6 +201,14 @@ public:
     /// Return vertex buffer morph range vertex count.
     /// Return vertex buffer morph range vertex count.
     unsigned GetMorphRangeCount(unsigned bufferIndex) const;
     unsigned GetMorphRangeCount(unsigned bufferIndex) const;
 
 
+    // ATOMIC BEGIN
+
+    bool SetGeometryName(unsigned index, const String& name);
+    const String& GetGeometryName(unsigned index) const;
+    const Vector<String>& GetGeometryNames() const { return geometryNames_; }
+
+    // ATOMIC END
+
 private:
 private:
     /// Bounding box.
     /// Bounding box.
     BoundingBox boundingBox_;
     BoundingBox boundingBox_;
@@ -228,6 +236,11 @@ private:
     Vector<IndexBufferDesc> loadIBData_;
     Vector<IndexBufferDesc> loadIBData_;
     /// Geometry definitions for asynchronous loading.
     /// Geometry definitions for asynchronous loading.
     Vector<PODVector<GeometryDesc> > loadGeometries_;
     Vector<PODVector<GeometryDesc> > loadGeometries_;
+
+    // ATOMIC BEGIN
+    Vector<String> geometryNames_;
+    // ATOMIC END
+
 };
 };
 
 
 }
 }

+ 4 - 4
Source/Atomic/Graphics/OpenGL/OGLGraphics.cpp

@@ -585,7 +585,7 @@ void Graphics::Close()
     Release(true, true);
     Release(true, true);
 }
 }
 
 
-bool Graphics::TakeScreenShot(Image& destImage)
+bool Graphics::TakeScreenShot(Image* destImage)
 {
 {
     ATOMIC_PROFILE(TakeScreenShot);
     ATOMIC_PROFILE(TakeScreenShot);
 
 
@@ -600,10 +600,10 @@ bool Graphics::TakeScreenShot(Image& destImage)
 
 
     ResetRenderTargets();
     ResetRenderTargets();
 
 
-    destImage.SetSize(width_, height_, 3);
-    glReadPixels(0, 0, width_, height_, GL_RGB, GL_UNSIGNED_BYTE, destImage.GetData());
+    destImage->SetSize(width_, height_, 3);
+    glReadPixels(0, 0, width_, height_, GL_RGB, GL_UNSIGNED_BYTE, destImage->GetData());
     // On OpenGL we need to flip the image vertically after reading
     // On OpenGL we need to flip the image vertically after reading
-    destImage.FlipVertical();
+    destImage->FlipVertical();
 
 
     return true;
     return true;
 }
 }

+ 30 - 30
Source/Atomic/Graphics/ParticleEmitter.cpp

@@ -173,16 +173,16 @@ void ParticleEmitter::Update(const FrameInfo& frame)
     for (unsigned i = 0; i < particles_.Size(); ++i)
     for (unsigned i = 0; i < particles_.Size(); ++i)
     {
     {
         Particle& particle = particles_[i];
         Particle& particle = particles_[i];
-        Billboard& billboard = billboards_[i];
+        Billboard* billboard = billboards_[i];
 
 
-        if (billboard.enabled_)
+        if (billboard->enabled_)
         {
         {
             needCommit = true;
             needCommit = true;
 
 
             // Time to live
             // Time to live
             if (particle.timer_ >= particle.timeToLive_)
             if (particle.timer_ >= particle.timeToLive_)
             {
             {
-                billboard.enabled_ = false;
+                billboard->enabled_ = false;
                 continue;
                 continue;
             }
             }
             particle.timer_ += lastTimeStep_;
             particle.timer_ += lastTimeStep_;
@@ -203,11 +203,11 @@ void ParticleEmitter::Update(const FrameInfo& frame)
                 Vector3 force = -dampingForce * particle.velocity_;
                 Vector3 force = -dampingForce * particle.velocity_;
                 particle.velocity_ += lastTimeStep_ * force;
                 particle.velocity_ += lastTimeStep_ * force;
             }
             }
-            billboard.position_ += lastTimeStep_ * particle.velocity_ * scaleVector;
-            billboard.direction_ = particle.velocity_.Normalized();
+            billboard->position_ += lastTimeStep_ * particle.velocity_ * scaleVector;
+            billboard->direction_ = particle.velocity_.Normalized();
 
 
             // Rotation
             // Rotation
-            billboard.rotation_ += lastTimeStep_ * particle.rotationSpeed_;
+            billboard->rotation_ += lastTimeStep_ * particle.rotationSpeed_;
 
 
             // Scaling
             // Scaling
             float sizeAdd = effect_->GetSizeAdd();
             float sizeAdd = effect_->GetSizeAdd();
@@ -219,7 +219,7 @@ void ParticleEmitter::Update(const FrameInfo& frame)
                     particle.scale_ = 0.0f;
                     particle.scale_ = 0.0f;
                 if (sizeMul != 1.0f)
                 if (sizeMul != 1.0f)
                     particle.scale_ *= (lastTimeStep_ * (sizeMul - 1.0f)) + 1.0f;
                     particle.scale_ *= (lastTimeStep_ * (sizeMul - 1.0f)) + 1.0f;
-                billboard.size_ = particle.size_ * particle.scale_;
+                billboard->size_ = particle.size_ * particle.scale_;
             }
             }
 
 
             // Color interpolation
             // Color interpolation
@@ -233,9 +233,9 @@ void ParticleEmitter::Update(const FrameInfo& frame)
                         ++index;
                         ++index;
                 }
                 }
                 if (index < colorFrames_.Size() - 1)
                 if (index < colorFrames_.Size() - 1)
-                    billboard.color_ = colorFrames_[index].Interpolate(colorFrames_[index + 1], particle.timer_);
+                    billboard->color_ = colorFrames_[index].Interpolate(colorFrames_[index + 1], particle.timer_);
                 else
                 else
-                    billboard.color_ = colorFrames_[index].color_;
+                    billboard->color_ = colorFrames_[index].color_;
             }
             }
 
 
             // Texture animation
             // Texture animation
@@ -245,7 +245,7 @@ void ParticleEmitter::Update(const FrameInfo& frame)
             {
             {
                 if (particle.timer_ >= textureFrames_[texIndex + 1].time_)
                 if (particle.timer_ >= textureFrames_[texIndex + 1].time_)
                 {
                 {
-                    billboard.uv_ = textureFrames_[texIndex + 1].uv_;
+                    billboard->uv_ = textureFrames_[texIndex + 1].uv_;
                     ++texIndex;
                     ++texIndex;
                 }
                 }
             }
             }
@@ -314,8 +314,8 @@ void ParticleEmitter::ResetEmissionTimer()
 
 
 void ParticleEmitter::RemoveAllParticles()
 void ParticleEmitter::RemoveAllParticles()
 {
 {
-    for (PODVector<Billboard>::Iterator i = billboards_.Begin(); i != billboards_.End(); ++i)
-        i->enabled_ = false;
+    for (Vector<SharedPtr<Billboard>>::Iterator i = billboards_.Begin(); i != billboards_.End(); ++i)
+        (*i)->enabled_ = false;
 
 
     Commit();
     Commit();
 }
 }
@@ -413,15 +413,15 @@ VariantVector ParticleEmitter::GetParticleBillboardsAttr() const
     ret.Reserve(billboards_.Size() * 7 + 1);
     ret.Reserve(billboards_.Size() * 7 + 1);
     ret.Push(billboards_.Size());
     ret.Push(billboards_.Size());
 
 
-    for (PODVector<Billboard>::ConstIterator i = billboards_.Begin(); i != billboards_.End(); ++i)
+    for (Vector<SharedPtr<Billboard>>::ConstIterator i = billboards_.Begin(); i != billboards_.End(); ++i)
     {
     {
-        ret.Push(i->position_);
-        ret.Push(i->size_);
-        ret.Push(Vector4(i->uv_.min_.x_, i->uv_.min_.y_, i->uv_.max_.x_, i->uv_.max_.y_));
-        ret.Push(i->color_);
-        ret.Push(i->rotation_);
-        ret.Push(i->direction_);
-        ret.Push(i->enabled_);
+        ret.Push((*i)->position_);
+        ret.Push((*i)->size_);
+        ret.Push(Vector4((*i)->uv_.min_.x_, (*i)->uv_.min_.y_, (*i)->uv_.max_.x_, (*i)->uv_.max_.y_));
+        ret.Push((*i)->color_);
+        ret.Push((*i)->rotation_);
+        ret.Push((*i)->direction_);
+        ret.Push((*i)->enabled_);
     }
     }
 
 
     return ret;
     return ret;
@@ -444,7 +444,7 @@ bool ParticleEmitter::EmitNewParticle()
         return false;
         return false;
     assert(index < particles_.Size());
     assert(index < particles_.Size());
     Particle& particle = particles_[index];
     Particle& particle = particles_[index];
-    Billboard& billboard = billboards_[index];
+    Billboard* billboard = billboards_[index];
 
 
     Vector3 startDir;
     Vector3 startDir;
     Vector3 startPos;
     Vector3 startPos;
@@ -499,15 +499,15 @@ bool ParticleEmitter::EmitNewParticle()
 
 
     particle.velocity_ = effect_->GetRandomVelocity() * startDir;
     particle.velocity_ = effect_->GetRandomVelocity() * startDir;
 
 
-    billboard.position_ = startPos;
-    billboard.size_ = particles_[index].size_;
+    billboard->position_ = startPos;
+    billboard->size_ = particles_[index].size_;
     const Vector<TextureFrame>& textureFrames_ = effect_->GetTextureFrames();
     const Vector<TextureFrame>& textureFrames_ = effect_->GetTextureFrames();
-    billboard.uv_ = textureFrames_.Size() ? textureFrames_[0].uv_ : Rect::POSITIVE;
-    billboard.rotation_ = effect_->GetRandomRotation();
+    billboard->uv_ = textureFrames_.Size() ? textureFrames_[0].uv_ : Rect::POSITIVE;
+    billboard->rotation_ = effect_->GetRandomRotation();
     const Vector<ColorFrame>& colorFrames_ = effect_->GetColorFrames();
     const Vector<ColorFrame>& colorFrames_ = effect_->GetColorFrames();
-    billboard.color_ = colorFrames_.Size() ? colorFrames_[0].color_ : Color();
-    billboard.enabled_ = true;
-    billboard.direction_ = startDir;
+    billboard->color_ = colorFrames_.Size() ? colorFrames_[0].color_ : Color();
+    billboard->enabled_ = true;
+    billboard->direction_ = startDir;
 
 
     return true;
     return true;
 }
 }
@@ -516,7 +516,7 @@ unsigned ParticleEmitter::GetFreeParticle() const
 {
 {
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     for (unsigned i = 0; i < billboards_.Size(); ++i)
     {
     {
-        if (!billboards_[i].enabled_)
+        if (!billboards_[i]->enabled_)
             return i;
             return i;
     }
     }
 
 
@@ -545,7 +545,7 @@ void ParticleEmitter::HandleScenePostUpdate(StringHash eventType, VariantMap& ev
 
 
         for (unsigned i = 0; i < billboards_.Size(); ++i)
         for (unsigned i = 0; i < billboards_.Size(); ++i)
         {
         {
-            if (billboards_[i].enabled_)
+            if (billboards_[i]->enabled_)
             {
             {
                 hasEnabledBillboards = true;
                 hasEnabledBillboards = true;
                 break;
                 break;

+ 5 - 2
Source/Atomic/Graphics/Renderer.h

@@ -423,6 +423,11 @@ public:
     /// Return a view or its source view if it uses one. Used internally for render statistics.
     /// Return a view or its source view if it uses one. Used internally for render statistics.
     static View* GetActualView(View* view);
     static View* GetActualView(View* view);
 
 
+    // ATOMIC BEGIN
+    /// Reload textures.
+    void ReloadTextures();
+    // ATOMIC END
+
 private:
 private:
     /// Initialize when screen mode initially set.
     /// Initialize when screen mode initially set.
     void Initialize();
     void Initialize();
@@ -432,8 +437,6 @@ private:
     void LoadPassShaders(Pass* pass);
     void LoadPassShaders(Pass* pass);
     /// Release shaders used in materials.
     /// Release shaders used in materials.
     void ReleaseMaterialShaders();
     void ReleaseMaterialShaders();
-    /// Reload textures.
-    void ReloadTextures();
     /// Create light volume geometries.
     /// Create light volume geometries.
     void CreateGeometries();
     void CreateGeometries();
     /// Create instancing vertex buffer.
     /// Create instancing vertex buffer.

+ 128 - 1
Source/Atomic/Graphics/StaticModel.cpp

@@ -47,7 +47,8 @@ extern const char* GEOMETRY_CATEGORY;
 StaticModel::StaticModel(Context* context) :
 StaticModel::StaticModel(Context* context) :
     Drawable(context, DRAWABLE_GEOMETRY),
     Drawable(context, DRAWABLE_GEOMETRY),
     occlusionLodLevel_(M_MAX_UNSIGNED),
     occlusionLodLevel_(M_MAX_UNSIGNED),
-    materialsAttr_(Material::GetTypeStatic())
+    materialsAttr_(Material::GetTypeStatic()),
+    geometryDisabled_(false)
 {
 {
 }
 }
 
 
@@ -71,6 +72,14 @@ void StaticModel::RegisterObject(Context* context)
     ATOMIC_ACCESSOR_ATTRIBUTE("LOD Bias", GetLodBias, SetLodBias, float, 1.0f, AM_DEFAULT);
     ATOMIC_ACCESSOR_ATTRIBUTE("LOD Bias", GetLodBias, SetLodBias, float, 1.0f, AM_DEFAULT);
     ATOMIC_COPY_BASE_ATTRIBUTES(Drawable);
     ATOMIC_COPY_BASE_ATTRIBUTES(Drawable);
     ATOMIC_ATTRIBUTE("Occlusion LOD Level", int, occlusionLodLevel_, M_MAX_UNSIGNED, AM_DEFAULT);
     ATOMIC_ATTRIBUTE("Occlusion LOD Level", int, occlusionLodLevel_, M_MAX_UNSIGNED, AM_DEFAULT);
+
+    // ATOMIC BEGIN
+
+    ATOMIC_ACCESSOR_ATTRIBUTE("Geometry Enabled", GetGeometryEnabledAttr, SetGeometryEnabledAttr, VariantVector,
+        Variant::emptyVariantVector, AM_FILE | AM_NOEDIT);
+
+    // ATOMIC END
+
 }
 }
 
 
 void StaticModel::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results)
 void StaticModel::ProcessRayQuery(const RayOctreeQuery& query, PODVector<RayQueryResult>& results)
@@ -263,6 +272,12 @@ void StaticModel::SetModel(Model* model)
             batches_[i].worldTransform_ = worldTransform;
             batches_[i].worldTransform_ = worldTransform;
             geometries_[i] = geometries[i];
             geometries_[i] = geometries[i];
             geometryData_[i].center_ = geometryCenters[i];
             geometryData_[i].center_ = geometryCenters[i];
+
+            // ATOMIC BEGIN
+            geometryData_[i].enabled_ = true;
+            geometryData_[i].batchGeometry_ = 0;
+            // ATOMIC END
+
         }
         }
 
 
         SetBoundingBox(model->GetBoundingBox());
         SetBoundingBox(model->GetBoundingBox());
@@ -455,4 +470,116 @@ void StaticModel::HandleModelReloadFinished(StringHash eventType, VariantMap& ev
     SetModel(currentModel);
     SetModel(currentModel);
 }
 }
 
 
+// ATOMIC BEGIN
+
+bool StaticModel::GetGeometryVisible(const String& name)
+{
+    if (!model_)
+        return false;
+
+    const Vector<String>& names = model_->GetGeometryNames();
+
+    for (unsigned i = 0; i < names.Size(); i++)
+    {
+        if (name == names[i])
+            return geometryData_[i].enabled_;
+    }
+
+    return false;
+
+}
+
+void StaticModel::ShowGeometry(const String& name)
+{
+    if (!model_)
+        return;
+
+    const Vector<String>& names = model_->GetGeometryNames();
+
+    for (unsigned i = 0; i < names.Size(); i++)
+    {
+        if (name == names[i])
+        {
+            if (geometryData_[i].batchGeometry_)
+                batches_[i].geometry_ = geometryData_[i].batchGeometry_;
+
+            geometryData_[i].batchGeometry_ = 0;
+            geometryData_[i].enabled_ = true;
+        }
+    }
+
+    geometryDisabled_ = false;
+    for (unsigned i = 0; i < geometryData_.Size(); i++)
+    {
+        if (!geometryData_[i].enabled_)
+        {
+            geometryDisabled_ = true;
+            break;
+        }
+    }
+
+}
+
+void StaticModel::HideGeometry(const String& name)
+{
+    if (!model_)
+        return;
+
+    const Vector<String>& names = model_->GetGeometryNames();
+
+    for (unsigned i = 0; i < names.Size(); i++)
+    {
+        if (name == names[i])
+        {
+            geometryDisabled_ = true;
+
+            if (batches_[i].geometry_)
+                geometryData_[i].batchGeometry_ = batches_[i].geometry_;
+
+            geometryData_[i].enabled_ = false;
+        }
+    }
+}
+
+void StaticModel::SetGeometryEnabledAttr(const VariantVector& value)
+{
+    if (!value.Size() || value.Size() != geometryData_.Size())
+    {
+        geometryDisabled_ = false;
+        geometryEnabled_.Clear();
+        return;
+    }
+
+    bool init = !geometryEnabled_.Size();
+
+    geometryEnabled_ = value;
+
+    for (unsigned i = 0; i < geometryData_.Size(); i++)
+    {
+        geometryData_[i].enabled_ = geometryEnabled_[i].GetBool();
+        if (!geometryData_[i].enabled_)
+            geometryDisabled_ = true;
+        if (init)
+            geometryData_[i].batchGeometry_ = 0;
+    }
+
+}
+const VariantVector& StaticModel::GetGeometryEnabledAttr() const
+{
+    geometryEnabled_.Resize(geometryData_.Size());
+
+    geometryDisabled_ = false;
+    for (unsigned i = 0; i < geometryData_.Size(); i++)
+    {
+        geometryEnabled_[i] = geometryData_[i].enabled_;
+
+        if (!geometryData_[i].enabled_)
+            geometryDisabled_ = true;
+    }
+
+    return geometryEnabled_;
+}
+
+// ATOMIC END
+
 }
 }

+ 28 - 0
Source/Atomic/Graphics/StaticModel.h

@@ -36,6 +36,14 @@ struct StaticModelGeometryData
     Vector3 center_;
     Vector3 center_;
     /// Current LOD level.
     /// Current LOD level.
     unsigned lodLevel_;
     unsigned lodLevel_;
+
+    // ATOMIC BEGIN
+
+    bool enabled_;
+    Geometry* batchGeometry_;
+
+    // ATOMIC END
+
 };
 };
 
 
 /// Static model component.
 /// Static model component.
@@ -99,6 +107,20 @@ public:
     /// Return materials attribute.
     /// Return materials attribute.
     const ResourceRefList& GetMaterialsAttr() const;
     const ResourceRefList& GetMaterialsAttr() const;
 
 
+    // ATOMIC BEGIN
+
+    /// Get whether a named submesh is visible
+    bool GetGeometryVisible(const String& name);
+    /// Show a named submesh
+    void ShowGeometry(const String& name);
+    /// Hide a named submesh
+    void HideGeometry(const String& name);
+
+    void SetGeometryEnabledAttr(const VariantVector& value);
+    const VariantVector& GetGeometryEnabledAttr() const;
+
+    // ATOMIC END
+
 protected:
 protected:
     /// Recalculate the world-space bounding box.
     /// Recalculate the world-space bounding box.
     virtual void OnWorldBoundingBoxUpdate();
     virtual void OnWorldBoundingBoxUpdate();
@@ -122,6 +144,12 @@ protected:
     /// Material list attribute.
     /// Material list attribute.
     mutable ResourceRefList materialsAttr_;
     mutable ResourceRefList materialsAttr_;
 
 
+    // ATOMIC BEGIN
+    mutable VariantVector geometryEnabled_;
+    /// true if any geometry has been disabled
+    mutable bool geometryDisabled_;
+    // ATOMIC END
+
 private:
 private:
     /// Handle model reload finished.
     /// Handle model reload finished.
     void HandleModelReloadFinished(StringHash eventType, VariantMap& eventData);
     void HandleModelReloadFinished(StringHash eventType, VariantMap& eventData);

+ 17 - 0
Source/Atomic/IO/File.cpp

@@ -567,6 +567,23 @@ void File::ReadText(String& text)
     Read((void*)text.CString(), size_);
     Read((void*)text.CString(), size_);
 }
 }
 
 
+bool File::Copy(File* srcFile)
+{
+    if (!srcFile || !srcFile->IsOpen() || srcFile->GetMode() != FILE_READ)
+        return false;
+
+    if (!IsOpen() || GetMode() != FILE_WRITE)
+        return false;
+
+    unsigned fileSize = srcFile->GetSize();
+    SharedArrayPtr<unsigned char> buffer(new unsigned char[fileSize]);
+
+    unsigned bytesRead = srcFile->Read(buffer.Get(), fileSize);
+    unsigned bytesWritten = Write(buffer.Get(), fileSize);
+    return bytesRead == fileSize && bytesWritten == fileSize;
+
+}
+
 // ATOMIC END
 // ATOMIC END
 
 
 }
 }

+ 4 - 0
Source/Atomic/IO/File.h

@@ -116,6 +116,10 @@ public:
     /// Return the fullpath to the file
     /// Return the fullpath to the file
     const String& GetFullPath() const { return fullPath_; }
     const String& GetFullPath() const { return fullPath_; }
 
 
+    /// Copy a file from a source file, must be opened and FILE_WRITE
+    /// Unlike FileSystem.Copy this copy works when the source file is in a package file
+    bool Copy(File* srcFile);
+
     // ATOMIC END
     // ATOMIC END
 
 
 private:
 private:

+ 174 - 0
Source/Atomic/IO/FileSystem.cpp

@@ -1078,4 +1078,178 @@ bool IsAbsolutePath(const String& pathName)
     return false;
     return false;
 }
 }
 
 
+// ATOMIC BEGIN
+bool FileSystem::CreateDirs(const String& root, const String& subdirectory)
+{
+    String folder = AddTrailingSlash(GetInternalPath(root));
+    String sub = GetInternalPath(subdirectory);
+    Vector<String> subs = sub.Split('/');
+
+    for (unsigned i = 0; i < subs.Size(); i++)
+    {
+        folder += subs[i];
+        folder += "/";
+
+        if (DirExists(folder))
+            continue;
+
+        CreateDir(folder);
+
+        if (!DirExists(folder))
+            return false;
+    }
+
+    return true;
+
+}
+
+bool FileSystem::CreateDirsRecursive(const String& directoryIn)
+{
+    String directory = AddTrailingSlash(GetInternalPath(directoryIn));
+
+    if (DirExists(directory))
+        return true;
+
+    if (FileExists(directory))
+        return false;
+
+    String parentPath = directory;
+
+    Vector<String> paths;
+
+    paths.Push(directory);
+
+    while (true)
+    {
+        parentPath = GetParentPath(parentPath);
+
+        if (!parentPath.Length())
+            break;
+
+        paths.Push(parentPath);
+    }
+
+    if (!paths.Size())
+        return false;
+
+    for (int i = (int) (paths.Size() - 1); i >= 0; i--)
+    {
+        const String& pathName = paths[i];
+
+        if (FileExists(pathName))
+            return false;
+
+        if (DirExists(pathName))
+            continue;
+
+        if (!CreateDir(pathName))
+            return false;
+
+        // double check
+        if (!DirExists(pathName))
+            return false;
+
+    }
+
+    return true;
+
+}
+
+bool FileSystem::RemoveDir(const String& directoryIn, bool recursive)
+{
+    String directory = AddTrailingSlash(directoryIn);
+
+    if (!DirExists(directory))
+        return false;
+
+    Vector<String> results;
+
+    // ensure empty if not recursive
+    if (!recursive)
+    {
+        ScanDir(results, directory, "*", SCAN_DIRS | SCAN_FILES | SCAN_HIDDEN, true );
+        while (results.Remove(".")) {}
+        while (results.Remove("..")) {}
+
+        if (results.Size())
+            return false;
+
+#ifdef WIN32
+        return RemoveDirectoryW(GetWideNativePath(directory).CString()) != 0;
+#endif
+
+#ifdef __APPLE__
+        return remove(GetNativePath(directory).CString()) == 0;
+#endif
+    }
+
+    // delete all files at this level
+    ScanDir(results, directory, "*", SCAN_FILES | SCAN_HIDDEN, false );
+    for (unsigned i = 0; i < results.Size(); i++)
+    {
+        if (!Delete(directory + results[i]))
+            return false;
+    }
+    results.Clear();
+
+    // recurse into subfolders
+    ScanDir(results, directory, "*", SCAN_DIRS, false );
+    for (unsigned i = 0; i < results.Size(); i++)
+    {
+        if (results[i] == "." || results[i] == "..")
+            continue;
+
+        if (!RemoveDir(directory + results[i], true))
+            return false;
+    }
+
+    return RemoveDir(directory, false);
+
+}
+
+bool FileSystem::CopyDir(const String& directoryIn, const String& directoryOut)
+{
+    if (FileExists(directoryOut) || DirExists(directoryOut))
+        return false;
+
+    Vector<String> results;
+    ScanDir(results, directoryIn, "*", SCAN_FILES, true );
+
+    for (unsigned i = 0; i < results.Size(); i++)
+    {
+        String srcFile = directoryIn + "/" + results[i];
+        String dstFile = directoryOut + "/" + results[i];
+
+        String dstPath = GetPath(dstFile);
+
+        if (!CreateDirsRecursive(dstPath))
+            return false;
+
+        //LOGINFOF("SRC: %s DST: %s", srcFile.CString(), dstFile.CString());
+        if (!Copy(srcFile, dstFile))
+            return false;
+    }
+
+    return true;
+
+}
+
+bool IsAbsoluteParentPath(const String& absParentPath, const String& fullPath)
+{
+    if (!IsAbsolutePath(absParentPath) || !IsAbsolutePath(fullPath))
+        return false;
+
+    String path1 = AddTrailingSlash(absParentPath);
+    String path2 = AddTrailingSlash(GetPath(fullPath));
+
+    if (path2.StartsWith(path1))
+        return true;
+
+    return false;
+}
+
+
+
+// ATOMIC END
+
 }
 }

+ 17 - 0
Source/Atomic/IO/FileSystem.h

@@ -102,6 +102,19 @@ public:
     /// Return the application preferences directory.
     /// Return the application preferences directory.
     String GetAppPreferencesDir(const String& org, const String& app) const;
     String GetAppPreferencesDir(const String& org, const String& app) const;
 
 
+// ATOMIC BEGIN
+
+    /// Check if a file or directory exists at the specified path
+    bool Exists(const String& pathName) const { return FileExists(pathName) || DirExists(pathName); }
+
+    bool CopyDir(const String& directoryIn, const String& directoryOut);
+
+    bool CreateDirs(const String& root, const String& subdirectory);
+    bool CreateDirsRecursive(const String& directoryIn);
+
+    bool RemoveDir(const String& directoryIn, bool recursive);
+// ATOMIC END
+
 private:
 private:
     /// Scan directory, called internally.
     /// Scan directory, called internally.
     void ScanDirInternal
     void ScanDirInternal
@@ -151,4 +164,8 @@ ATOMIC_API WString GetWideNativePath(const String& pathName);
 /// Return whether a path is absolute.
 /// Return whether a path is absolute.
 ATOMIC_API bool IsAbsolutePath(const String& pathName);
 ATOMIC_API bool IsAbsolutePath(const String& pathName);
 
 
+// ATOMIC BEGIN
+ATOMIC_API bool IsAbsoluteParentPath(const String& absParentPath, const String& fullPath);
+// ATOMIC END
+
 }
 }

+ 14 - 0
Source/Atomic/Input/InputEvents.h

@@ -223,6 +223,20 @@ ATOMIC_EVENT(E_EXITREQUESTED, ExitRequested)
 {
 {
 }
 }
 
 
+// ATOMIC BEGIN
+
+/// Application pause requested.
+ATOMIC_EVENT(E_PAUSERESUMEREQUESTED, PauseResumeRequested)
+{
+}
+
+/// Application step frame while paused requested.
+ATOMIC_EVENT(E_PAUSESTEPREQUESTED, PauseStepRequested)
+{
+}
+
+// ATOMIC END
+
 static const int MOUSEB_LEFT = SDL_BUTTON_LMASK;
 static const int MOUSEB_LEFT = SDL_BUTTON_LMASK;
 static const int MOUSEB_MIDDLE = SDL_BUTTON_MMASK;
 static const int MOUSEB_MIDDLE = SDL_BUTTON_MMASK;
 static const int MOUSEB_RIGHT = SDL_BUTTON_RMASK;
 static const int MOUSEB_RIGHT = SDL_BUTTON_RMASK;

+ 24 - 0
Source/Atomic/Math/BoundingBox.h

@@ -321,6 +321,30 @@ public:
     /// Maximum vector.
     /// Maximum vector.
     Vector3 max_;
     Vector3 max_;
     float dummyMax_; // This is never used, but exists to pad the max_ value to four floats.
     float dummyMax_; // This is never used, but exists to pad the max_ value to four floats.
+
+    // ATOMIC BEGIN
+    float data_[6];
+
+    BoundingBox(float* data) :
+        min_(Vector3(data[0], data[1], data[2])),
+        max_(Vector3(data[3], data[4], data[5]))
+    {
+    }
+
+    float* Data() const
+    {
+        float* data = const_cast<BoundingBox*>(this)->data_;
+
+        data[0] = min_.x_;
+        data[1] = min_.y_;
+        data[2] = min_.z_;
+        data[3] = max_.x_;
+        data[4] = max_.y_;
+        data[5] = max_.z_;
+        return data;
+    }
+    // ATOMIC END
+
 };
 };
 
 
 }
 }

+ 1 - 1
Source/Atomic/Math/Rect.h

@@ -171,7 +171,7 @@ public:
     }
     }
 
 
     /// Return float data.
     /// Return float data.
-    const void* Data() const { return &min_.x_; }
+    const float* Data() const { return &min_.x_; }
 
 
     /// Return as a vector.
     /// Return as a vector.
     Vector4 ToVector4() const { return Vector4(min_.x_, min_.y_, max_.x_, max_.y_); }
     Vector4 ToVector4() const { return Vector4(min_.x_, min_.y_, max_.x_, max_.y_); }

+ 3 - 0
Source/Atomic/Math/Vector2.h

@@ -330,6 +330,9 @@ public:
 
 
     /// Zero vector.
     /// Zero vector.
     static const IntVector2 ZERO;
     static const IntVector2 ZERO;
+
+    // ATOMIC BEGIN
+
 };
 };
 
 
 /// Multiply IntVector2 with a scalar.
 /// Multiply IntVector2 with a scalar.

+ 10 - 0
Source/Atomic/Network/Connection.cpp

@@ -62,6 +62,16 @@ PackageUpload::PackageUpload() :
 {
 {
 }
 }
 
 
+Connection::Connection(Context* context) : Object(context),
+    timeStamp_(0),
+    sendMode_(OPSM_NONE),
+    connectPending_(false),
+    sceneLoaded_(false),
+    logStatistics_(false)
+{
+
+}
+
 Connection::Connection(Context* context, bool isClient, kNet::SharedPtr<kNet::MessageConnection> connection) :
 Connection::Connection(Context* context, bool isClient, kNet::SharedPtr<kNet::MessageConnection> connection) :
     Object(context),
     Object(context),
     timeStamp_(0),
     timeStamp_(0),

+ 3 - 0
Source/Atomic/Network/Connection.h

@@ -109,6 +109,9 @@ class ATOMIC_API Connection : public Object
     ATOMIC_OBJECT(Connection, Object);
     ATOMIC_OBJECT(Connection, Object);
 
 
 public:
 public:
+
+    Connection(Context* context);
+
     /// Construct with context and kNet message connection pointers.
     /// Construct with context and kNet message connection pointers.
     Connection(Context* context, bool isClient, kNet::SharedPtr<kNet::MessageConnection> connection);
     Connection(Context* context, bool isClient, kNet::SharedPtr<kNet::MessageConnection> connection);
     /// Destruct.
     /// Destruct.

+ 154 - 0
Source/Atomic/Resource/Image.cpp

@@ -33,6 +33,11 @@
 
 
 // ATOMIC BEGIN
 // ATOMIC BEGIN
 #include <SDL/include/SDL_surface.h>
 #include <SDL/include/SDL_surface.h>
+
+#ifdef ATOMIC_PLATFORM_DESKTOP
+#include <libsquish/squish.h>
+#endif
+
 // ATOMIC END
 // ATOMIC END
 
 
 #define STB_IMAGE_IMPLEMENTATION
 #define STB_IMAGE_IMPLEMENTATION
@@ -82,6 +87,26 @@ static const unsigned DDS_DXGI_FORMAT_BC2_UNORM_SRGB = 75;
 static const unsigned DDS_DXGI_FORMAT_BC3_UNORM = 77;
 static const unsigned DDS_DXGI_FORMAT_BC3_UNORM = 77;
 static const unsigned DDS_DXGI_FORMAT_BC3_UNORM_SRGB = 78;
 static const unsigned DDS_DXGI_FORMAT_BC3_UNORM_SRGB = 78;
 
 
+// ATOMIC BEGIN
+static const unsigned DDSD_CAPS = 0x00000001;
+static const unsigned DDSD_HEIGHT = 0x00000002;
+static const unsigned DDSD_WIDTH = 0x00000004;
+static const unsigned DDSD_PITCH = 0x00000008;
+static const unsigned DDSD_PIXELFORMAT = 0x00001000;
+static const unsigned DDSD_MIPMAPCOUNT = 0x00020000;
+static const unsigned DDSD_LINEARSIZE = 0x00080000;
+static const unsigned DDSD_DEPTH = 0x00800000;
+
+static const unsigned DDPF_ALPHAPIXELS = 0x00000001;
+static const unsigned DDPF_ALPHA = 0x00000002;
+static const unsigned DDPF_FOURCC = 0x00000004;
+static const unsigned DDPF_PALETTEINDEXED8 = 0x00000020;
+static const unsigned DDPF_RGB = 0x00000040;
+static const unsigned DDPF_LUMINANCE = 0x00020000;
+static const unsigned DDPF_NORMAL = 0x80000000;  // nvidia specific
+// ATOMIC END
+
+
 namespace Atomic
 namespace Atomic
 {
 {
 
 
@@ -2049,5 +2074,134 @@ void Image::FreeImageData(unsigned char* pixelData)
 
 
     stbi_image_free(pixelData);
     stbi_image_free(pixelData);
 }
 }
+
+// ATOMIC BEGIN
+bool Image::SaveDDS(const String& fileName) const
+{
+#if !defined(ATOMIC_PLATFORM_DESKTOP)
+
+    LOGERRORF("Image::SaveDDS - Unsupported on current platform: %s", fileName.CString());
+    return false;
+
+#else
+    ATOMIC_PROFILE(SaveImageDDS);
+
+    FileSystem* fileSystem = GetSubsystem<FileSystem>();
+    if (fileSystem && !fileSystem->CheckAccess(GetPath(fileName)))
+    {
+        ATOMIC_LOGERROR("Access denied to " + fileName);
+        return false;
+    }
+
+    if (IsCompressed())
+    {
+        ATOMIC_LOGERROR("Can not save compressed image to DDS");
+        return false;
+    }
+
+    if (data_)
+    {
+        // #623 BEGIN TODO: Should have an abstract ImageReader and ImageWriter classes
+        // with subclasses for particular image output types. Also should have image settings in the image meta.
+        // ImageReader/Writers should also support a progress callback so UI can be updated.
+
+        if (!width_ || !height_)
+        {
+            ATOMIC_LOGERRORF("Attempting to save zero width/height DDS to %s", fileName.CString());
+            return false;
+        }
+
+        squish::u8 *inputData = (squish::u8 *) data_.Get();
+
+        SharedPtr<Image> tempImage;
+
+        // libsquish expects 4 channel RGBA, so create a temporary image if necessary
+        if (components_ != 4)
+        {
+            if (components_ != 3)
+            {
+                ATOMIC_LOGERROR("Can only save images with 3 or 4 components to DDS");
+                return false;
+            }
+
+            tempImage = new Image(context_);
+            tempImage->SetSize(width_, height_, 4);
+
+            squish::u8* srcBits = (squish::u8*) data_;
+            squish::u8* dstBits = (squish::u8*) tempImage->data_;
+
+            for (unsigned i = 0; i < (unsigned) width_ * (unsigned) height_; i++)
+            {
+                *dstBits++ = *srcBits++;
+                *dstBits++ = *srcBits++;
+                *dstBits++ = *srcBits++;
+                *dstBits++ = 255;
+            }
+
+            inputData = (squish::u8 *) tempImage->data_.Get();
+        }
+
+        unsigned squishFlags = HasAlphaChannel() ? squish::kDxt5 : squish::kDxt1;
+
+        // Use a slow but high quality colour compressor (the default). (TODO: expose other settings as parameter)
+        squishFlags |= squish::kColourClusterFit;
+
+        unsigned storageRequirements = (unsigned) squish::GetStorageRequirements( width_, height_,  squishFlags);
+
+        SharedArrayPtr<unsigned char> compressedData(new unsigned char[storageRequirements]);
+
+        squish::CompressImage(inputData, width_, height_, compressedData.Get(), squishFlags);
+
+        DDSurfaceDesc2 sdesc;
+
+        if (sizeof(sdesc) != 124)
+        {
+            ATOMIC_LOGERROR("Image::SaveDDS - sizeof(DDSurfaceDesc2) != 124");
+            return false;
+        }
+        memset(&sdesc, 0, sizeof(sdesc));
+        sdesc.dwSize_ = 124;
+        sdesc.dwFlags_ = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT;
+        sdesc.dwWidth_ = width_;
+        sdesc.dwHeight_ = height_;
+
+        sdesc.ddpfPixelFormat_.dwSize_ = 32;
+        sdesc.ddpfPixelFormat_.dwFlags_ = DDPF_FOURCC | (HasAlphaChannel() ? DDPF_ALPHAPIXELS : 0);
+        sdesc.ddpfPixelFormat_.dwFourCC_ = HasAlphaChannel() ? FOURCC_DXT5 : FOURCC_DXT1;
+
+        SharedPtr<File> dest(new File(context_, fileName, FILE_WRITE));
+
+        if (!dest->IsOpen())
+        {
+            ATOMIC_LOGERRORF("Failed to open DXT image file for writing %s", fileName.CString());
+            return false;
+        }
+        else
+        {
+
+            dest->Write((void*)"DDS ", 4);
+            dest->Write((void*)&sdesc, sizeof(sdesc));
+
+            bool success = dest->Write(compressedData.Get(), storageRequirements) == storageRequirements;
+
+            if (!success)
+                ATOMIC_LOGERRORF("Failed to write image to DXT, file size mismatch %s", fileName.CString());
+
+            return success;
+        }
+        // #623 END TODO
+    }
+#endif
+
+    return false;
+}
+
+bool Image::HasAlphaChannel() const
+{
+    return components_ > 3;
+}
+
+
+// ATOMIC END
  
  
 }
 }

+ 6 - 0
Source/Atomic/Resource/Image.h

@@ -198,6 +198,12 @@ public:
     /// Precalculate the mip levels. Used by asynchronous texture loading.
     /// Precalculate the mip levels. Used by asynchronous texture loading.
     void PrecalculateLevels();
     void PrecalculateLevels();
 
 
+    // ATOMIC BEGIN
+    /// Whether this texture has an alpha channel
+    bool HasAlphaChannel() const;
+    bool SaveDDS(const String& fileName) const;
+    // ATOMIC END
+
 private:
 private:
     /// Decode an image using stb_image.
     /// Decode an image using stb_image.
     static unsigned char* GetImageData(Deserializer& source, int& width, int& height, unsigned& components);
     static unsigned char* GetImageData(Deserializer& source, int& width, int& height, unsigned& components);

+ 5 - 0
Source/Atomic/Resource/ResourceCache.cpp

@@ -45,6 +45,11 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
+// ATOMIC BEGIN
+const char* PAK_EXTENSION = ".pak";
+// ATOMIC END
+
+
 static const char* checkDirs[] =
 static const char* checkDirs[] =
 {
 {
     "Fonts",
     "Fonts",

+ 6 - 0
Source/Atomic/Resource/ResourceCache.h

@@ -301,4 +301,10 @@ template <class T> void ResourceCache::GetResources(PODVector<T*>& result) const
 /// Register Resource library subsystems and objects.
 /// Register Resource library subsystems and objects.
 void ATOMIC_API RegisterResourceLibrary(Context* context);
 void ATOMIC_API RegisterResourceLibrary(Context* context);
 
 
+// ATOMIC BEGIN
+/// Extension used for package files
+extern const char* PAK_EXTENSION;
+// ATOMIC END
+
+
 }
 }

+ 13 - 0
Source/Atomic/Resource/ResourceEvents.h

@@ -80,4 +80,17 @@ ATOMIC_EVENT(E_CHANGELANGUAGE, ChangeLanguage)
 {
 {
 }
 }
 
 
+// ATOMIC BEGIN
+
+/// Resource was renamed
+ATOMIC_EVENT(E_RENAMERESOURCENOTIFICATION, RenameResourceNotification)
+{
+    ATOMIC_PARAM(P_RESOURCEPATH, Path);                    // String
+    ATOMIC_PARAM(P_NEWRESOURCEPATH, NewPath);              // String
+    ATOMIC_PARAM(P_NEWNAME, NewName);                      // String
+    ATOMIC_PARAM(P_RESOURCE, Asset);                       // Resource pointer
+}
+
+// ATOMIC END
+
 }
 }

+ 5 - 2
Source/Atomic/Scene/Node.cpp

@@ -372,9 +372,12 @@ void Node::AddTag(const String& tag)
     MarkNetworkUpdate();
     MarkNetworkUpdate();
 }
 }
 
 
-void Node::AddTags(const String& tags, char separator)
+void Node::AddTags(const String& tags, String separator)
 {
 {
-    StringVector tagVector = tags.Split(separator);
+    if (!separator.Length())
+        return;
+
+    StringVector tagVector = tags.Split(separator[0]);
     AddTags(tagVector);
     AddTags(tagVector);
 }
 }
 
 

+ 1 - 1
Source/Atomic/Scene/Node.h

@@ -101,7 +101,7 @@ public:
     /// Add a tag.
     /// Add a tag.
     void AddTag(const String& tag);
     void AddTag(const String& tag);
     /// Add tags with the specified separator, by default ;
     /// Add tags with the specified separator, by default ;
-    void AddTags(const String& tags, char separator = ';');
+    void AddTags(const String& tags, String separator = ";");
     /// Add tags.
     /// Add tags.
     void AddTags(const StringVector& tags);
     void AddTags(const StringVector& tags);
     /// Remove tag. Return true if existed.
     /// Remove tag. Return true if existed.

+ 3 - 3
Source/AtomicApp/AppBase.cpp

@@ -62,7 +62,7 @@ namespace Atomic
 
 
                 if (argument == "--log-std")
                 if (argument == "--log-std")
                 {
                 {
-                    SubscribeToEvent(E_LOGMESSAGE, HANDLER(AppBase, HandleLogMessage));
+                    SubscribeToEvent(E_LOGMESSAGE, ATOMIC_HANDLER(AppBase, HandleLogMessage));
                 }
                 }
             }
             }
         }
         }
@@ -89,7 +89,7 @@ namespace Atomic
         context_->RegisterSubsystem(javascript);
         context_->RegisterSubsystem(javascript);
         vm_ = javascript->InstantiateVM("MainVM");
         vm_ = javascript->InstantiateVM("MainVM");
 
 
-        SubscribeToEvent(E_JSERROR, HANDLER(AppBase, HandleJSError));
+        SubscribeToEvent(E_JSERROR, ATOMIC_HANDLER(AppBase, HandleJSError));
 
 
     }
     }
 
 
@@ -173,7 +173,7 @@ namespace Atomic
         String errorString = ToString("%s - %s - Line: %i",
         String errorString = ToString("%s - %s - Line: %i",
             errFilename.CString(), errMessage.CString(), errLineNumber);
             errFilename.CString(), errMessage.CString(), errLineNumber);
 
 
-        LOGERROR(errorString);
+        ATOMIC_LOGERROR(errorString);
 
 
     }
     }
 
 

+ 1 - 1
Source/AtomicApp/AppBase.h

@@ -31,7 +31,7 @@ namespace Atomic
 
 
     class AppBase : public Application
     class AppBase : public Application
     {
     {
-        OBJECT(AppBase)
+        ATOMIC_OBJECT(AppBase, Application)
 
 
     public:
     public:
         /// Construct.
         /// Construct.

+ 2 - 2
Source/AtomicApp/IPCClientApp.cpp

@@ -55,7 +55,7 @@ namespace Atomic
         ipc_ = new IPC(context_);
         ipc_ = new IPC(context_);
         context_->RegisterSubsystem(ipc_);
         context_->RegisterSubsystem(ipc_);
 
 
-        SubscribeToEvent(E_LOGMESSAGE, HANDLER(IPCClientApp, HandleLogMessage));
+        SubscribeToEvent(E_LOGMESSAGE, ATOMIC_HANDLER(IPCClientApp, HandleLogMessage));
     }
     }
 
 
     void IPCClientApp::HandleIPCInitialize(StringHash eventType, VariantMap& eventData)
     void IPCClientApp::HandleIPCInitialize(StringHash eventType, VariantMap& eventData)
@@ -70,7 +70,7 @@ namespace Atomic
         if (!IPC::ProcessArguments(arguments, id, fd_[0], fd_[1]))
         if (!IPC::ProcessArguments(arguments, id, fd_[0], fd_[1]))
             return false;
             return false;
 
 
-        SubscribeToEvent(E_IPCINITIALIZE, HANDLER(IPCClientApp, HandleIPCInitialize));
+        SubscribeToEvent(E_IPCINITIALIZE, ATOMIC_HANDLER(IPCClientApp, HandleIPCInitialize));
         ipc_->InitWorker((unsigned)id, fd_[0], fd_[1]);
         ipc_->InitWorker((unsigned)id, fd_[0], fd_[1]);
 
 
         return true;
         return true;

+ 1 - 1
Source/AtomicApp/IPCClientApp.h

@@ -32,7 +32,7 @@ namespace Atomic
     class IPCClientApp : public AppBase
     class IPCClientApp : public AppBase
     {
     {
 
 
-        OBJECT(IPCClientApp)
+        ATOMIC_OBJECT(IPCClientApp, AppBase)
 
 
     public:
     public:
         /// Construct.
         /// Construct.

+ 11 - 11
Source/AtomicApp/Player/IPCPlayerApp.cpp

@@ -132,7 +132,7 @@ namespace Atomic
                         value.CString(), value.CString(), value.CString(), value.CString());
                         value.CString(), value.CString(), value.CString(), value.CString());
 #endif
 #endif
 
 
-                    LOGINFOF("Adding ResourcePaths: %s", resourcePaths.CString());
+                    ATOMIC_LOGINFOF("Adding ResourcePaths: %s", resourcePaths.CString());
 
 
                     engineParameters_["ResourcePaths"] = resourcePaths;
                     engineParameters_["ResourcePaths"] = resourcePaths;
 
 
@@ -161,13 +161,13 @@ namespace Atomic
 
 
         if (IPC::ProcessArguments(arguments_, id, fd_[0], fd_[1]))
         if (IPC::ProcessArguments(arguments_, id, fd_[0], fd_[1]))
         {
         {
-            SubscribeToEvent(E_IPCINITIALIZE, HANDLER(IPCPlayerApp, HandleIPCInitialize));
-            SubscribeToEvent(E_LOGMESSAGE, HANDLER(IPCPlayerApp, HandleLogMessage));
-            SubscribeToEvent(E_JSERROR, HANDLER(IPCPlayerApp, HandleJSError));
-            SubscribeToEvent(E_EXITREQUESTED, HANDLER(IPCPlayerApp, HandleExitRequest));
-            SubscribeToEvent(E_SCREENMODE, HANDLER(IPCPlayerApp, HandlePlayerWindowChanged));
-            SubscribeToEvent(E_WINDOWPOS, HANDLER(IPCPlayerApp, HandlePlayerWindowChanged));
-            SubscribeToEvent(E_UPDATESPAUSEDRESUMED, HANDLER(IPCPlayerApp, HandleUpdatesPausedResumed));
+            SubscribeToEvent(E_IPCINITIALIZE, ATOMIC_HANDLER(IPCPlayerApp, HandleIPCInitialize));
+            SubscribeToEvent(E_LOGMESSAGE, ATOMIC_HANDLER(IPCPlayerApp, HandleLogMessage));
+            SubscribeToEvent(E_JSERROR, ATOMIC_HANDLER(IPCPlayerApp, HandleJSError));
+            SubscribeToEvent(E_EXITREQUESTED, ATOMIC_HANDLER(IPCPlayerApp, HandleExitRequest));
+            SubscribeToEvent(E_SCREENMODE, ATOMIC_HANDLER(IPCPlayerApp, HandlePlayerWindowChanged));
+            SubscribeToEvent(E_WINDOWPOS, ATOMIC_HANDLER(IPCPlayerApp, HandlePlayerWindowChanged));
+            SubscribeToEvent(E_UPDATESPAUSEDRESUMED, ATOMIC_HANDLER(IPCPlayerApp, HandleUpdatesPausedResumed));
 
 
             if (ipc_->InitWorker((unsigned)id, fd_[0], fd_[1]))
             if (ipc_->InitWorker((unsigned)id, fd_[0], fd_[1]))
             {
             {
@@ -175,7 +175,7 @@ namespace Atomic
             }
             }
             else if (subprocess_)
             else if (subprocess_)
             {
             {
-                LOGERROR("IPCPlayerApp::Start() - Unable to initialize IPC Worker");
+                ATOMIC_LOGERROR("IPCPlayerApp::Start() - Unable to initialize IPC Worker");
             }
             }
         }
         }
 
 
@@ -188,7 +188,7 @@ namespace Atomic
                 SendEvent(E_EXITREQUESTED);
                 SendEvent(E_EXITREQUESTED);
             }
             }
 
 
-            SubscribeToEvent(E_PLAYERQUIT, HANDLER(IPCPlayerApp, HandleQuit));
+            SubscribeToEvent(E_PLAYERQUIT, ATOMIC_HANDLER(IPCPlayerApp, HandleQuit));
         }
         }
 
 
         
         
@@ -237,7 +237,7 @@ namespace Atomic
 
 
             ipc_->SendEventToBroker(E_IPCJSERROR, ipcErrorData);
             ipc_->SendEventToBroker(E_IPCJSERROR, ipcErrorData);
 
 
-            LOGERROR("SENDING E_IPCJSERROR");
+            ATOMIC_LOGERROR("SENDING E_IPCJSERROR");
 
 
         }
         }
 
 

+ 1 - 1
Source/AtomicApp/Player/IPCPlayerApp.h

@@ -31,7 +31,7 @@ namespace Atomic
 
 
     class IPCPlayerApp : public PlayerApp
     class IPCPlayerApp : public PlayerApp
     {
     {
-        OBJECT(IPCPlayerApp)
+        ATOMIC_OBJECT(IPCPlayerApp, PlayerApp)
 
 
     public:
     public:
         /// Construct.
         /// Construct.

+ 13 - 13
Source/AtomicApp/Player/IPCPlayerAppEvents.h

@@ -27,37 +27,37 @@
 namespace Atomic
 namespace Atomic
 {
 {
 
 
-    EVENT(E_IPCPLAYERPAUSERESUMEREQUEST, IPCPlayerPauseResumeRequest)
+    ATOMIC_EVENT(E_IPCPLAYERPAUSERESUMEREQUEST, IPCPlayerPauseResumeRequest)
     {
     {
 
 
     }
     }
 
 
-    EVENT(E_IPCPLAYERUPDATESPAUSEDRESUMED, IPCPlayerUpdatesPausedResumed)
+    ATOMIC_EVENT(E_IPCPLAYERUPDATESPAUSEDRESUMED, IPCPlayerUpdatesPausedResumed)
     {
     {
-        PARAM(P_PAUSED, Paused);            // bool
+        ATOMIC_PARAM(P_PAUSED, Paused);            // bool
     }
     }
 
 
-    EVENT(E_IPCPLAYERPAUSESTEPREQUEST, IPCPlayerPauseStepRequest)
+    ATOMIC_EVENT(E_IPCPLAYERPAUSESTEPREQUEST, IPCPlayerPauseStepRequest)
     {
     {
 
 
     }
     }
 
 
-    EVENT(E_IPCPLAYEREXITREQUEST, IPCPlayerExitRequest)
+    ATOMIC_EVENT(E_IPCPLAYEREXITREQUEST, IPCPlayerExitRequest)
     {
     {
 
 
     }
     }
 
 
-    EVENT(E_IPCPLAYERWINDOWCHANGED, IPCPlayerWindowChanged)
+    ATOMIC_EVENT(E_IPCPLAYERWINDOWCHANGED, IPCPlayerWindowChanged)
     {
     {
-        PARAM(P_POSX, PosX);
-        PARAM(P_POSY, PosY);
-        PARAM(P_WIDTH, Width);
-        PARAM(P_HEIGHT, Height);
-        PARAM(P_MONITOR, Monitor);
-        PARAM(P_MAXIMIZED, Maximized);
+        ATOMIC_PARAM(P_POSX, PosX);
+        ATOMIC_PARAM(P_POSY, PosY);
+        ATOMIC_PARAM(P_WIDTH, Width);
+        ATOMIC_PARAM(P_HEIGHT, Height);
+        ATOMIC_PARAM(P_MONITOR, Monitor);
+        ATOMIC_PARAM(P_MAXIMIZED, Maximized);
     }
     }
 
 
-    EVENT(E_PLAYERQUIT, PlayerQuit)
+    ATOMIC_EVENT(E_PLAYERQUIT, PlayerQuit)
     {
     {
 
 
     }
     }

+ 1 - 1
Source/AtomicApp/Player/PlayerApp.h

@@ -29,7 +29,7 @@ namespace Atomic
 
 
     class PlayerApp : public AppBase
     class PlayerApp : public AppBase
     {
     {
-        OBJECT(PlayerApp)
+        ATOMIC_OBJECT(PlayerApp, AppBase)
 
 
     public:
     public:
         /// Construct.
         /// Construct.

+ 1 - 5
Source/AtomicEditor/Application/AEEditorApp.cpp

@@ -26,7 +26,7 @@
 #include <Atomic/IPC/IPC.h>
 #include <Atomic/IPC/IPC.h>
 
 
 // This can be removed once bone hack is fixed
 // This can be removed once bone hack is fixed
-#include <Atomic/Atomic3D/AnimatedModel.h>
+#include <Atomic/Graphics/AnimatedModel.h>
 
 
 #include <ToolCore/License/LicenseSystem.h>
 #include <ToolCore/License/LicenseSystem.h>
 #include <ToolCore/ToolSystem.h>
 #include <ToolCore/ToolSystem.h>
@@ -152,10 +152,6 @@ namespace AtomicEditor
 
 
     void AEEditorApp::Start()
     void AEEditorApp::Start()
     {
     {
-        // Do not create bone structure by default when in the editor
-        // this can be toggled temporarily, for example to setup an animation preview
-        AnimatedModel::SetBoneCreationEnabled(false);
-
         GetSubsystem<AEEditorPrefs>()->ValidateWindow();
         GetSubsystem<AEEditorPrefs>()->ValidateWindow();
 
 
         context_->RegisterSubsystem(new EditorMode(context_));
         context_->RegisterSubsystem(new EditorMode(context_));

+ 1 - 1
Source/AtomicEditor/Application/AEEditorApp.h

@@ -30,7 +30,7 @@ namespace AtomicEditor
 {
 {
     class AEEditorApp : public AppBase
     class AEEditorApp : public AppBase
     {
     {
-        OBJECT(AEEditorApp)
+        ATOMIC_OBJECT(AEEditorApp, AppBase)
 
 
     public:
     public:
         /// Construct.
         /// Construct.

+ 2 - 2
Source/AtomicEditor/Application/AEEditorPrefs.cpp

@@ -50,7 +50,7 @@ namespace AtomicEditor
         // It could be better to split this all out to a native, scriptable
         // It could be better to split this all out to a native, scriptable
         // preferences object
         // preferences object
 
 
-        LOGINFOF("Creating default Atomic Editor preferences: %s", path.CString());
+        ATOMIC_LOGINFOF("Creating default Atomic Editor preferences: %s", path.CString());
 
 
         SharedPtr<JSONFile> jsonFile(new JSONFile(context_));
         SharedPtr<JSONFile> jsonFile(new JSONFile(context_));
 
 
@@ -197,7 +197,7 @@ namespace AtomicEditor
 
 
         if (!file->IsOpen())
         if (!file->IsOpen())
         {
         {
-            LOGERRORF("Unable to open Atomic Editor preferences for writing: %s", path.CString());
+            ATOMIC_LOGERRORF("Unable to open Atomic Editor preferences for writing: %s", path.CString());
             return false;
             return false;
         }
         }
 
 

+ 1 - 1
Source/AtomicEditor/Application/AEEditorPrefs.h

@@ -31,7 +31,7 @@ namespace AtomicEditor
 
 
     class AEEditorPrefs : public Object
     class AEEditorPrefs : public Object
     {
     {
-        OBJECT(AEEditorPrefs)
+        ATOMIC_OBJECT(AEEditorPrefs, Object)
 
 
     public:
     public:
         /// Construct.
         /// Construct.

+ 1 - 1
Source/AtomicEditor/Application/AEPlayerApp.h

@@ -30,7 +30,7 @@ namespace AtomicEditor
 {
 {
     class AEPlayerApplication : public IPCPlayerApp
     class AEPlayerApplication : public IPCPlayerApp
     {
     {
-        OBJECT(AEPlayerApplication)
+        ATOMIC_OBJECT(AEPlayerApplication, IPCPlayerApp)
 
 
     public:
     public:
         /// Construct.
         /// Construct.

+ 7 - 7
Source/AtomicEditor/Components/CubemapGenerator.cpp

@@ -67,13 +67,13 @@ bool CubemapGenerator::Render()
 
 
     if(!InitRender())
     if(!InitRender())
     {
     {
-        LOGERRORF("Unable to init render");
+        ATOMIC_LOGERRORF("Unable to init render");
         return false;
         return false;
     }
     }
 
 
     GetScene()->SendEvent(E_CUBEMAPRENDERBEGIN);
     GetScene()->SendEvent(E_CUBEMAPRENDERBEGIN);
-    SubscribeToEvent(E_BEGINFRAME, HANDLER(CubemapGenerator, HandleBeginFrame));
-    SubscribeToEvent(E_ENDFRAME, HANDLER(CubemapGenerator, HandleEndFrame));
+    SubscribeToEvent(E_BEGINFRAME, ATOMIC_HANDLER(CubemapGenerator, HandleBeginFrame));
+    SubscribeToEvent(E_ENDFRAME, ATOMIC_HANDLER(CubemapGenerator, HandleEndFrame));
 
 
     return true;
     return true;
 
 
@@ -98,7 +98,7 @@ bool CubemapGenerator::InitPaths()
     {
     {
         if (!fileSystem->CreateDirs(pathName,  "Cubemaps/" + fileName + "/"))
         if (!fileSystem->CreateDirs(pathName,  "Cubemaps/" + fileName + "/"))
         {
         {
-            LOGERRORF("CubemapGenerator::InitRender - Unable to create path: %s", outputPathAbsolute_.CString());
+            ATOMIC_LOGERRORF("CubemapGenerator::InitRender - Unable to create path: %s", outputPathAbsolute_.CString());
             return false;
             return false;
         }
         }
     }
     }
@@ -122,7 +122,7 @@ bool CubemapGenerator::InitRender()
 
 
     if (sceneEditor_.Null())
     if (sceneEditor_.Null())
     {
     {
-        LOGERROR("CubemapGenerator::InitRender - unable to get scene editor");
+        ATOMIC_LOGERROR("CubemapGenerator::InitRender - unable to get scene editor");
         return false;
         return false;
     }
     }
 
 
@@ -330,8 +330,8 @@ void CubemapGenerator::RegisterObject(Context* context)
 {
 {
     context->RegisterFactory<CubemapGenerator>();
     context->RegisterFactory<CubemapGenerator>();
 
 
-    ATTRIBUTE("Name Prefix", String, namePrefix_, "Cubemap", AM_DEFAULT);
-    ATTRIBUTE("Image Size", int, imageSize_, 512, AM_DEFAULT);
+    ATOMIC_ATTRIBUTE("Name Prefix", String, namePrefix_, "Cubemap", AM_DEFAULT);
+    ATOMIC_ATTRIBUTE("Image Size", int, imageSize_, 512, AM_DEFAULT);
 
 
 }
 }
 
 

+ 1 - 1
Source/AtomicEditor/Components/CubemapGenerator.h

@@ -45,7 +45,7 @@ namespace AtomicEditor
 
 
 class CubemapGenerator : public EditorComponent
 class CubemapGenerator : public EditorComponent
 {
 {
-    OBJECT(CubemapGenerator);
+    ATOMIC_OBJECT(CubemapGenerator, EditorComponent);
 
 
 public:
 public:
     /// Construct.
     /// Construct.

+ 1 - 1
Source/AtomicEditor/Components/EditorComponent.h

@@ -35,7 +35,7 @@ class SceneEditor3D;
 /// IMPORTANT: Other tool related components, which don't require the editor, should be in ToolCore
 /// IMPORTANT: Other tool related components, which don't require the editor, should be in ToolCore
 class EditorComponent : public Component
 class EditorComponent : public Component
 {
 {
-    OBJECT(EditorComponent);
+    ATOMIC_OBJECT(EditorComponent, Component);
 
 
 public:
 public:
 
 

+ 41 - 41
Source/AtomicEditor/EditorMode/AEEditorEvents.h

@@ -36,75 +36,75 @@ static const unsigned FINDTEXT_FLAG_WRAP = 0x4;
 static const unsigned FINDTEXT_FLAG_NEXT = 0x8;
 static const unsigned FINDTEXT_FLAG_NEXT = 0x8;
 static const unsigned FINDTEXT_FLAG_PREV = 0x10;
 static const unsigned FINDTEXT_FLAG_PREV = 0x10;
 
 
-EVENT(E_FINDTEXT, FindText)
+ATOMIC_EVENT(E_FINDTEXT, FindText)
 {
 {
-    PARAM(P_FLAGS, Flags);    // int
-    PARAM(P_TEXT, Text);      // string
+    ATOMIC_PARAM(P_FLAGS, Flags);    // int
+    ATOMIC_PARAM(P_TEXT, Text);      // string
 }
 }
 
 
-EVENT(E_FINDTEXTCLOSE, FindTextClose)
+ATOMIC_EVENT(E_FINDTEXTCLOSE, FindTextClose)
 {
 {
 
 
 }
 }
 
 
-EVENT(E_FINDTEXTOPEN, FindTextOpen)
+ATOMIC_EVENT(E_FINDTEXTOPEN, FindTextOpen)
 {
 {
 
 
 }
 }
 
 
-EVENT(E_JAVASCRIPTSAVED, JavascriptSaved)
+ATOMIC_EVENT(E_JAVASCRIPTSAVED, JavascriptSaved)
 {
 {
 
 
 }
 }
 
 
 // editor play request
 // editor play request
-EVENT(E_EDITORPLAYREQUEST, EditorPlayRequest)
+ATOMIC_EVENT(E_EDITORPLAYREQUEST, EditorPlayRequest)
 {
 {
-    PARAM(P_MODE, Mode);    // uint (AEPlayerMode)
+    ATOMIC_PARAM(P_MODE, Mode);    // uint (AEPlayerMode)
 
 
 }
 }
 
 
 // stop play mode
 // stop play mode
-EVENT(E_EDITORPLAYSTOP, EditorPlayStop)
+ATOMIC_EVENT(E_EDITORPLAYSTOP, EditorPlayStop)
 {
 {
 
 
 }
 }
 
 
 // stop play mode
 // stop play mode
-EVENT(E_EDITORRESOURCEEDITORCHANGED, EditorResourceEditorChanged)
+ATOMIC_EVENT(E_EDITORRESOURCEEDITORCHANGED, EditorResourceEditorChanged)
 {
 {
-    PARAM(P_RESOURCEEDITOR, ResourceEditor); // ResourceEditor*
+    ATOMIC_PARAM(P_RESOURCEEDITOR, ResourceEditor); // ResourceEditor*
 }
 }
 
 
 
 
 // emitted once play has started
 // emitted once play has started
-EVENT(E_EDITORPLAYERSTARTED, EditorPlayerStarted)
+ATOMIC_EVENT(E_EDITORPLAYERSTARTED, EditorPlayerStarted)
 {
 {
-    PARAM(P_MODE, Mode);    // uint (AEPlayerMode)
+    ATOMIC_PARAM(P_MODE, Mode);    // uint (AEPlayerMode)
 }
 }
 
 
 // emitted once player has paused
 // emitted once player has paused
-EVENT(E_EDITORPLAYERPAUSED, EditorPlayerPaused)
+ATOMIC_EVENT(E_EDITORPLAYERPAUSED, EditorPlayerPaused)
 {
 {
 
 
 }
 }
 
 
 // emitted once paused player has resumed
 // emitted once paused player has resumed
-EVENT(E_EDITORPLAYERRESUMED, EditorPlayerResumed)
+ATOMIC_EVENT(E_EDITORPLAYERRESUMED, EditorPlayerResumed)
 {
 {
 
 
 }
 }
 
 
 // emitted once play has stopped
 // emitted once play has stopped
-EVENT(E_EDITORPLAYERSTOPPED, EditorPlayerStopped)
+ATOMIC_EVENT(E_EDITORPLAYERSTOPPED, EditorPlayerStopped)
 {
 {
 
 
 }
 }
 
 
-EVENT(E_EDITORBUILD, EditorBuild)
+ATOMIC_EVENT(E_EDITORBUILD, EditorBuild)
 {
 {
-    PARAM(P_PLATFORM, Platform);      // string
-    PARAM(P_BUILDPATH, BuildPath);    // string
+    ATOMIC_PARAM(P_PLATFORM, Platform);      // string
+    ATOMIC_PARAM(P_BUILDPATH, BuildPath);    // string
 }
 }
 
 
 
 
@@ -114,56 +114,56 @@ static const unsigned EDITOR_MODALERROR = 0x1;
 static const unsigned EDITOR_MODALINFO = 0x2;
 static const unsigned EDITOR_MODALINFO = 0x2;
 
 
 
 
-EVENT(E_EDITORMODAL, EditorModal)
+ATOMIC_EVENT(E_EDITORMODAL, EditorModal)
 {
 {
-    PARAM(P_TYPE, Type);      // uint (EDITOR_ERROR_MODAL, etc)
-    PARAM(P_TITLE, Title);      // for modal errors, title text
-    PARAM(P_MESSAGE, Message);    // for modal errors, error text
+    ATOMIC_PARAM(P_TYPE, Type);      // uint (EDITOR_ERROR_MODAL, etc)
+    ATOMIC_PARAM(P_TITLE, Title);      // for modal errors, title text
+    ATOMIC_PARAM(P_MESSAGE, Message);    // for modal errors, error text
 }
 }
 
 
-EVENT(E_EDITORACTIVESCENEEDITORCHANGE, EditorActiveSceneEditorChange)
+ATOMIC_EVENT(E_EDITORACTIVESCENEEDITORCHANGE, EditorActiveSceneEditorChange)
 {
 {
-    PARAM(P_SCENEEDITOR, SceneEditor);
+    ATOMIC_PARAM(P_SCENEEDITOR, SceneEditor);
 }
 }
 
 
 
 
-EVENT(E_PLAYERERROR, PlayerError)
+ATOMIC_EVENT(E_PLAYERERROR, PlayerError)
 {
 {
-    PARAM(P_TEXT, Text);      // string
+    ATOMIC_PARAM(P_TEXT, Text);      // string
 }
 }
 
 
-EVENT(E_CONSOLEMESSAGE, ConsoleMessage)
+ATOMIC_EVENT(E_CONSOLEMESSAGE, ConsoleMessage)
 {
 {
-    PARAM(P_TEXT, Text);      // string
+    ATOMIC_PARAM(P_TEXT, Text);      // string
 }
 }
 
 
-EVENT(E_CONSOLEERRORMESSAGE, ConsoleErrorMessage)
+ATOMIC_EVENT(E_CONSOLEERRORMESSAGE, ConsoleErrorMessage)
 {
 {
-    PARAM(P_TEXT, Text);      // string
+    ATOMIC_PARAM(P_TEXT, Text);      // string
 }
 }
 
 
-EVENT(E_PLATFORMCHANGE, PlatformChange)
+ATOMIC_EVENT(E_PLATFORMCHANGE, PlatformChange)
 {
 {
-    PARAM(P_PLATFORM, Platform);      // uint (AEEditorPlatform)
+    ATOMIC_PARAM(P_PLATFORM, Platform);      // uint (AEEditorPlatform)
 }
 }
 
 
-EVENT(E_SUBPROCESSOUTPUT, SubprocessOutput)
+ATOMIC_EVENT(E_SUBPROCESSOUTPUT, SubprocessOutput)
 {
 {
-    PARAM(P_TEXT, Text);      // string
+    ATOMIC_PARAM(P_TEXT, Text);      // string
 }
 }
 
 
-EVENT(E_SUBPROCESSCOMPLETE, SubprocessComplete)
+ATOMIC_EVENT(E_SUBPROCESSCOMPLETE, SubprocessComplete)
 {
 {
-    PARAM(P_PROCESSKEY, ProcessKey); // unsigned
-    PARAM(P_RETCODE, RetCode);      // int (return code of process)
+    ATOMIC_PARAM(P_PROCESSKEY, ProcessKey); // unsigned
+    ATOMIC_PARAM(P_RETCODE, RetCode);      // int (return code of process)
 }
 }
 
 
-EVENT(E_CURLCOMPLETE, CurlComplete)
+ATOMIC_EVENT(E_CURLCOMPLETE, CurlComplete)
 {
 {
-    PARAM(P_CURLREQUEST, Request);      // CurlRequest*
+    ATOMIC_PARAM(P_CURLREQUEST, Request);      // CurlRequest*
 }
 }
 
 
-EVENT(E_EDITORSHUTDOWN, EditorShutdown)
+ATOMIC_EVENT(E_EDITORSHUTDOWN, EditorShutdown)
 {
 {
 
 
 }
 }

+ 10 - 10
Source/AtomicEditor/EditorMode/AEEditorMode.cpp

@@ -101,7 +101,7 @@ void EditorMode::HandleIPCWorkerExit(StringHash eventType, VariantMap& eventData
     }
     }
     else
     else
     {
     {
-        LOGERROR("EditorMode::HandleIPCWorkerExit - Unknown Broker");
+        ATOMIC_LOGERROR("EditorMode::HandleIPCWorkerExit - Unknown Broker");
     }
     }
 }
 }
 
 
@@ -179,24 +179,24 @@ bool EditorMode::PlayProject(String addArgs, bool debug)
 
 
     String dump;
     String dump;
     dump.Join(vargs, " ");
     dump.Join(vargs, " ");
-    LOGINFOF("Launching Broker %s %s", playerBinary.CString(), dump.CString());
+    ATOMIC_LOGINFOF("Launching Broker %s %s", playerBinary.CString(), dump.CString());
 
 
     IPC* ipc = GetSubsystem<IPC>();
     IPC* ipc = GetSubsystem<IPC>();
     playerBroker_ = ipc->SpawnWorker(playerBinary, vargs);
     playerBroker_ = ipc->SpawnWorker(playerBinary, vargs);
 
 
     if (playerBroker_)
     if (playerBroker_)
     {
     {
-        SubscribeToEvent(playerBroker_, E_IPCWORKERSTART, HANDLER(EditorMode, HandleIPCWorkerStarted));
+        SubscribeToEvent(playerBroker_, E_IPCWORKERSTART, ATOMIC_HANDLER(EditorMode, HandleIPCWorkerStarted));
 
 
-        SubscribeToEvent(E_IPCPLAYERPAUSERESUMEREQUEST, HANDLER(EditorMode, HandleIPCPlayerPauseResumeRequest));
-        SubscribeToEvent(E_IPCPLAYERUPDATESPAUSEDRESUMED, HANDLER(EditorMode, HandleIPCPlayerUpdatesPausedResumed));
-        SubscribeToEvent(E_IPCPLAYERPAUSESTEPREQUEST, HANDLER(EditorMode, HandleIPCPlayerPauseStepRequest));
-        SubscribeToEvent(E_IPCPLAYEREXITREQUEST, HANDLER(EditorMode, HandleIPCPlayerExitRequest));
+        SubscribeToEvent(E_IPCPLAYERPAUSERESUMEREQUEST, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerPauseResumeRequest));
+        SubscribeToEvent(E_IPCPLAYERUPDATESPAUSEDRESUMED, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerUpdatesPausedResumed));
+        SubscribeToEvent(E_IPCPLAYERPAUSESTEPREQUEST, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerPauseStepRequest));
+        SubscribeToEvent(E_IPCPLAYEREXITREQUEST, ATOMIC_HANDLER(EditorMode, HandleIPCPlayerExitRequest));
     
     
 
 
-        SubscribeToEvent(playerBroker_, E_IPCJSERROR, HANDLER(EditorMode, HandleIPCJSError));
-        SubscribeToEvent(playerBroker_, E_IPCWORKEREXIT, HANDLER(EditorMode, HandleIPCWorkerExit));
-        SubscribeToEvent(playerBroker_, E_IPCWORKERLOG, HANDLER(EditorMode, HandleIPCWorkerLog));
+        SubscribeToEvent(playerBroker_, E_IPCJSERROR, ATOMIC_HANDLER(EditorMode, HandleIPCJSError));
+        SubscribeToEvent(playerBroker_, E_IPCWORKEREXIT, ATOMIC_HANDLER(EditorMode, HandleIPCWorkerExit));
+        SubscribeToEvent(playerBroker_, E_IPCWORKERLOG, ATOMIC_HANDLER(EditorMode, HandleIPCWorkerLog));
     }
     }
 
 
     return playerBroker_.NotNull();
     return playerBroker_.NotNull();

+ 1 - 1
Source/AtomicEditor/EditorMode/AEEditorMode.h

@@ -39,7 +39,7 @@ namespace AtomicEditor
 /// EditorMode subsystem
 /// EditorMode subsystem
 class EditorMode : public Object
 class EditorMode : public Object
 {
 {
-    OBJECT(EditorMode)
+    ATOMIC_OBJECT(EditorMode, Object)
 
 
 public:
 public:
     /// Construct.
     /// Construct.

+ 2 - 2
Source/AtomicEditor/EditorMode/AEEditorNETService.cpp

@@ -56,7 +56,7 @@ namespace AtomicEditor
         if (!netService_->Start())
         if (!netService_->Start())
         {
         {
             netService_ = nullptr;
             netService_ = nullptr;
-            LOGERRORF("Unable to start AtomicNETService");
+            ATOMIC_LOGERRORF("Unable to start AtomicNETService");
             return false;
             return false;
         }
         }
 
 
@@ -65,4 +65,4 @@ namespace AtomicEditor
         return true;
         return true;
     }
     }
 
 
-}
+}

+ 2 - 2
Source/AtomicEditor/EditorMode/AEEditorNETService.h

@@ -38,7 +38,7 @@ namespace AtomicEditor
 
 
     class EditorNETService : public Object
     class EditorNETService : public Object
     {
     {
-        OBJECT(EditorNETService)
+        ATOMIC_OBJECT(EditorNETService, Object)
 
 
     public:
     public:
 
 
@@ -55,4 +55,4 @@ namespace AtomicEditor
 
 
     };
     };
 
 
-}
+}

+ 3 - 3
Source/AtomicEditor/Editors/JSResourceEditor.cpp

@@ -74,9 +74,9 @@ JSResourceEditor ::JSResourceEditor(Context* context, const String &fullpath, UI
 
 
     webView_->GetWebTexture2D()->SetClearColor(Color(.23f, .23f, .23f, 1));
     webView_->GetWebTexture2D()->SetClearColor(Color(.23f, .23f, .23f, 1));
 
 
-    SubscribeToEvent(messageHandler_, E_WEBMESSAGE, HANDLER(JSResourceEditor, HandleWebMessage));
+    SubscribeToEvent(messageHandler_, E_WEBMESSAGE, ATOMIC_HANDLER(JSResourceEditor, HandleWebMessage));
 
 
-    SubscribeToEvent(E_RENAMERESOURCENOTIFICATION, HANDLER(JSResourceEditor, HandleRenameResourceNotification));
+    SubscribeToEvent(E_RENAMERESOURCENOTIFICATION, ATOMIC_HANDLER(JSResourceEditor, HandleRenameResourceNotification));
 
 
     c->AddChild(webView_->GetInternalWidget());
     c->AddChild(webView_->GetInternalWidget());
 
 
@@ -156,7 +156,7 @@ void JSResourceEditor::HandleWebMessage(StringHash eventType, VariantMap& eventD
                     file.Write((void*) code.CString(), code.Length());
                     file.Write((void*) code.CString(), code.Length());
                     file.Close();
                     file.Close();
             } else {
             } else {
-                LOGWARNING("Ignoring attempt to write file: " + fn);
+                ATOMIC_LOGWARNING("Ignoring attempt to write file: " + fn);
             }
             }
         }
         }
     }
     }

+ 1 - 1
Source/AtomicEditor/Editors/JSResourceEditor.h

@@ -39,7 +39,7 @@ namespace AtomicEditor
 
 
 class JSResourceEditor: public ResourceEditor
 class JSResourceEditor: public ResourceEditor
 {
 {
-    OBJECT(JSResourceEditor);
+    ATOMIC_OBJECT(JSResourceEditor, ResourceEditor);
 
 
 public:
 public:
 
 

+ 3 - 3
Source/AtomicEditor/Editors/ResourceEditor.cpp

@@ -122,7 +122,7 @@ public:
 
 
 ResourceEditor::ResourceEditor(Context* context, const String& fullpath, UITabContainer *container):
 ResourceEditor::ResourceEditor(Context* context, const String& fullpath, UITabContainer *container):
     Object(context), fullpath_(fullpath), container_(container),
     Object(context), fullpath_(fullpath), container_(container),
-    editorTabLayout_(0), rootContentWidget_(0), button_(0), modified_(false)
+    editorTabLayout_(nullptr), rootContentWidget_(nullptr), button_(nullptr), modified_(false)
 {
 {
 
 
     String filename = GetFileNameAndExtension(fullpath_);
     String filename = GetFileNameAndExtension(fullpath_);
@@ -154,8 +154,8 @@ ResourceEditor::ResourceEditor(Context* context, const String& fullpath, UITabCo
     rootContentWidget_->SetGravity(UI_GRAVITY_ALL);
     rootContentWidget_->SetGravity(UI_GRAVITY_ALL);
     container_->GetContentRoot()->AddChild(rootContentWidget_);
     container_->GetContentRoot()->AddChild(rootContentWidget_);
 
 
-    SubscribeToEvent(E_FILECHANGED, HANDLER(ResourceEditor, HandleFileChanged));
-    SubscribeToEvent(E_RENAMERESOURCENOTIFICATION, HANDLER(ResourceEditor, HandleRenameResourceNotification));
+    SubscribeToEvent(E_FILECHANGED, ATOMIC_HANDLER(ResourceEditor, HandleFileChanged));
+    SubscribeToEvent(E_RENAMERESOURCENOTIFICATION, ATOMIC_HANDLER(ResourceEditor, HandleRenameResourceNotification));
 
 
 }
 }
 
 

+ 1 - 1
Source/AtomicEditor/Editors/ResourceEditor.h

@@ -37,7 +37,7 @@ class EditorTabLayout;
 
 
 class ResourceEditor: public Object
 class ResourceEditor: public Object
 {
 {
-    OBJECT(ResourceEditor);
+    ATOMIC_OBJECT(ResourceEditor, Object);
 
 
 public:
 public:
 
 

+ 4 - 4
Source/AtomicEditor/Editors/ResourceEditorEvents.h

@@ -27,13 +27,13 @@
 namespace AtomicEditor
 namespace AtomicEditor
 {
 {
 
 
-EVENT(E_EDITORRESOURCECLOSE, EditorResourceClose)
+ATOMIC_EVENT(E_EDITORRESOURCECLOSE, EditorResourceClose)
 {
 {
-PARAM(P_EDITOR, Editor);            // ResourceEditor
-PARAM(P_NAVIGATE, NavigateToAvailableResource); // bool
+    ATOMIC_PARAM(P_EDITOR, Editor);            // ResourceEditor
+    ATOMIC_PARAM(P_NAVIGATE, NavigateToAvailableResource); // bool
 }
 }
 
 
-EVENT(E_EDITORRESOURCECLOSECANCELED, EditorResourceCloseCanceled)
+ATOMIC_EVENT(E_EDITORRESOURCECLOSECANCELED, EditorResourceCloseCanceled)
 {
 {
 
 
 }
 }

+ 1 - 1
Source/AtomicEditor/Editors/SceneEditor3D/Gizmo3D.cpp

@@ -22,7 +22,7 @@
 // THE SOFTWARE.
 // THE SOFTWARE.
 //
 //
 
 
-#include <Atomic/Atomic3D/Model.h>
+#include <Atomic/Graphics/Model.h>
 #include <Atomic/Graphics/Material.h>
 #include <Atomic/Graphics/Material.h>
 #include <Atomic/Graphics/Octree.h>
 #include <Atomic/Graphics/Octree.h>
 #include <Atomic/Resource/ResourceCache.h>
 #include <Atomic/Resource/ResourceCache.h>

+ 3 - 3
Source/AtomicEditor/Editors/SceneEditor3D/Gizmo3D.h

@@ -30,7 +30,7 @@
 #include <Atomic/Math/Ray.h>
 #include <Atomic/Math/Ray.h>
 #include <Atomic/Scene/Scene.h>
 #include <Atomic/Scene/Scene.h>
 
 
-#include <Atomic/Atomic3D/StaticModel.h>
+#include <Atomic/Graphics/StaticModel.h>
 #include <Atomic/Graphics/Camera.h>
 #include <Atomic/Graphics/Camera.h>
 
 
 
 
@@ -88,7 +88,7 @@ public:
         // Update selected status only when not dragging
         // Update selected status only when not dragging
         if (!drag)
         if (!drag)
         {
         {
-            selected_ = Abs(d_) < axisMaxD * scale && t_ >= -axisMaxD * scale && t_ <= axisMaxT * scale;
+            selected_ = Atomic::Abs(d_) < axisMaxD * scale && t_ >= -axisMaxD * scale && t_ <= axisMaxT * scale;
             lastT_ = t_;
             lastT_ = t_;
             lastD_ = d_;
             lastD_ = d_;
         }
         }
@@ -117,7 +117,7 @@ enum AxisMode
 
 
 class Gizmo3D: public Object
 class Gizmo3D: public Object
 {
 {
-    OBJECT(Gizmo3D);
+    ATOMIC_OBJECT(Gizmo3D, Object);
 
 
 public:
 public:
 
 

+ 6 - 6
Source/AtomicEditor/Editors/SceneEditor3D/SceneEditHistory.cpp

@@ -38,15 +38,15 @@ SceneEditHistory::SceneEditHistory(Context* context, SceneEditor3D* sceneEditor)
     curSelEditOp_(0),
     curSelEditOp_(0),
     addingRemovingNodes_(false)
     addingRemovingNodes_(false)
 {
 {
-    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENENODESELECTED, HANDLER(SceneEditHistory, HandleSceneNodeSelected));
+    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENENODESELECTED, ATOMIC_HANDLER(SceneEditHistory, HandleSceneNodeSelected));
 
 
-    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITBEGIN, HANDLER(SceneEditHistory, HandleSceneEditBegin));
-    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITEND, HANDLER(SceneEditHistory, HandleSceneEditEnd));
+    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITBEGIN, ATOMIC_HANDLER(SceneEditHistory, HandleSceneEditBegin));
+    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITEND, ATOMIC_HANDLER(SceneEditHistory, HandleSceneEditEnd));
 
 
-    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITADDREMOVENODES, HANDLER(SceneEditHistory, HandleSceneEditAddRemoveNodes));
+    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITADDREMOVENODES, ATOMIC_HANDLER(SceneEditHistory, HandleSceneEditAddRemoveNodes));
 
 
-    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITNODEADDED, HANDLER(SceneEditHistory, HandleSceneEditNodeAdded));
-    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITNODEREMOVED, HANDLER(SceneEditHistory, HandleSceneEditNodeRemoved));
+    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITNODEADDED, ATOMIC_HANDLER(SceneEditHistory, HandleSceneEditNodeAdded));
+    SubscribeToEvent(sceneEditor_->GetScene(), E_SCENEEDITNODEREMOVED, ATOMIC_HANDLER(SceneEditHistory, HandleSceneEditNodeRemoved));
 
 
 }
 }
 
 

+ 1 - 1
Source/AtomicEditor/Editors/SceneEditor3D/SceneEditHistory.h

@@ -39,7 +39,7 @@ class SelectionEditOp;
 
 
 class SceneEditHistory: public Object
 class SceneEditHistory: public Object
 {
 {
-    OBJECT(SceneEditHistory);
+    ATOMIC_OBJECT(SceneEditHistory, Object);
 
 
 public:
 public:
 
 

+ 4 - 4
Source/AtomicEditor/Editors/SceneEditor3D/SceneEditOp.cpp

@@ -215,7 +215,7 @@ bool SelectionEditOp::Undo()
         bool changed = !CompareStates(enode->stateBegin_, enode->stateEnd_);
         bool changed = !CompareStates(enode->stateBegin_, enode->stateEnd_);
         if (changed && !node->Serializable::Load(enode->stateBegin_))
         if (changed && !node->Serializable::Load(enode->stateBegin_))
         {
         {
-            LOGERRORF("Unable to Undo node serializable");
+            ATOMIC_LOGERRORF("Unable to Undo node serializable");
             return false;
             return false;
         }
         }
 
 
@@ -273,7 +273,7 @@ bool SelectionEditOp::Undo()
             changed = !CompareStates(ecomponent->stateBegin_, ecomponent->stateEnd_);
             changed = !CompareStates(ecomponent->stateBegin_, ecomponent->stateEnd_);
             if (changed && !component->Serializable::Load(ecomponent->stateBegin_))
             if (changed && !component->Serializable::Load(ecomponent->stateBegin_))
             {
             {
-                LOGERRORF("Unable to Undo component serializable");
+                ATOMIC_LOGERRORF("Unable to Undo component serializable");
                 return false;
                 return false;
             }
             }
 
 
@@ -334,7 +334,7 @@ bool SelectionEditOp::Redo()
         bool changed = !CompareStates(enode->stateBegin_, enode->stateEnd_);
         bool changed = !CompareStates(enode->stateBegin_, enode->stateEnd_);
         if ( changed && !node->Serializable::Load(enode->stateEnd_))
         if ( changed && !node->Serializable::Load(enode->stateEnd_))
         {
         {
-            LOGERRORF("Unable to Redo node serializable");
+            ATOMIC_LOGERRORF("Unable to Redo node serializable");
             return false;
             return false;
         }
         }
 
 
@@ -391,7 +391,7 @@ bool SelectionEditOp::Redo()
             changed = !CompareStates(ecomponent->stateBegin_, ecomponent->stateEnd_);
             changed = !CompareStates(ecomponent->stateBegin_, ecomponent->stateEnd_);
             if ( changed && !component->Serializable::Load(ecomponent->stateEnd_))
             if ( changed && !component->Serializable::Load(ecomponent->stateEnd_))
             {
             {
-                LOGERRORF("Unable to Redo component serializable");
+                ATOMIC_LOGERRORF("Unable to Redo component serializable");
                 return false;
                 return false;
             }
             }
 
 

Some files were not shown because too many files changed in this diff