Browse Source

Merge remote-tracking branch 'upstream/master'

Conflicts:
	Source/ToolCore/JSBind/JSBClassWriter.cpp Theirs
	Source/ToolCore/JSBind/JSBClassWriter.h Theirs
	Source/ToolCore/JSBind/JSBFunctionWriter.cpp Theirs
Matt Benic 10 years ago
parent
commit
2e97bcad15
100 changed files with 6046 additions and 289 deletions
  1. 3 1
      .gitignore
  2. 28 6
      AUTHORS.md
  3. 75 0
      Attic/AtomicNETTest/MyClass.cs
  4. 38 0
      Attic/AtomicSharp/AtomicEditor/AtomicEditor.csproj
  5. 6 0
      Attic/AtomicSharp/AtomicEditor/MyClass.cs
  6. 27 0
      Attic/AtomicSharp/AtomicEditor/Properties/AssemblyInfo.cs
  7. 223 0
      Attic/AtomicSharp/AtomicEngine.cs
  8. 55 0
      Attic/AtomicSharp/AtomicInterop.cs
  9. 100 0
      Attic/AtomicSharp/AtomicSharp.csproj
  10. 35 0
      Attic/AtomicSharp/AtomicSharp.sln
  11. 44 0
      Attic/AtomicSharp/AtomicSharpTest/AtomicSharpTest.csproj
  12. 265 0
      Attic/AtomicSharp/AtomicSharpTest/Program.cs
  13. 27 0
      Attic/AtomicSharp/AtomicSharpTest/Properties/AssemblyInfo.cs
  14. 47 0
      Attic/AtomicSharp/AtomicSharpTool/AtomicSharpTool.csproj
  15. 51 0
      Attic/AtomicSharp/AtomicSharpTool/Program.cs
  16. 27 0
      Attic/AtomicSharp/AtomicSharpTool/Properties/AssemblyInfo.cs
  17. 48 0
      Attic/AtomicSharp/CSComponent.cs
  18. 105 0
      Attic/AtomicSharp/ComponentCore.cs
  19. 161 0
      Attic/AtomicSharp/EventCore.cs
  20. 138 0
      Attic/AtomicSharp/Math.cs
  21. 124 0
      Attic/AtomicSharp/NativeCore.cs
  22. 27 0
      Attic/AtomicSharp/Properties/AssemblyInfo.cs
  23. 635 0
      Attic/AtomicSharp/SDLConsts.cs
  24. 33 0
      Attic/AtomicSharp/ScriptObject.cs
  25. 0 0
      Attic/NETNative/AtomicSharpAPI.cpp
  26. 34 0
      Attic/NETNative/AtomicSharpAPI.h
  27. 295 0
      Attic/NETNative/AtomicSharpApp.cpp
  28. 72 0
      Attic/NETNative/AtomicSharpApp.h
  29. 27 0
      Attic/NETNative/CMakeLists.txt
  30. 2 0
      Build/CIScripts/Build.js
  31. 44 0
      Build/CIScripts/BuildAndroid.js
  32. 67 0
      Build/CIScripts/BuildCommon.js
  33. 49 0
      Build/CIScripts/BuildIOS.js
  34. 0 0
      Build/CIScripts/BuildLinux.js
  35. 75 0
      Build/CIScripts/BuildMac.js
  36. 51 0
      Build/CIScripts/BuildWeb.js
  37. 53 0
      Build/CIScripts/BuildWindows.js
  38. 194 0
      Build/CIScripts/GenEditorData.js
  39. 86 0
      Build/CIScripts/GenMacEditor.js
  40. 101 0
      Build/CIScripts/GenWindowsEditor.js
  41. 17 0
      Build/CIScripts/Host.js
  42. 53 0
      Build/CIScripts/HostMac.js
  43. 53 0
      Build/CIScripts/HostWindows.js
  44. 53 0
      Build/CIScripts/Mac/EditorApp/Info.plist
  45. 1 0
      Build/CIScripts/Mac/EditorApp/PkgInfo
  46. 0 0
      Build/CIScripts/Mac/EditorApp/Resources/Atomic.icns
  47. 53 0
      Build/CIScripts/Mac/PlayerApp/Info.plist
  48. 1 0
      Build/CIScripts/Mac/PlayerApp/PkgInfo
  49. BIN
      Build/CIScripts/Mac/PlayerApp/Resources/Atomic.icns
  50. 3 0
      Build/CIScripts/Windows/CompileAtomic.bat
  51. 3 0
      Build/CIScripts/Windows/CompileAtomicTool.bat
  52. 1 0
      Build/CIScripts/Windows/CreateInstaller.bat
  53. 138 0
      Build/CIScripts/Windows/Installer/AtomicEditor.nsi
  54. BIN
      Build/CIScripts/Windows/Installer/Windows_Installer_Header.bmp
  55. BIN
      Build/CIScripts/Windows/Installer/Windows_Installer_LeftImage.bmp
  56. BIN
      Build/CMake/Modules/Atomic.icns
  57. 0 0
      Build/CMake/Modules/Atomic.ico
  58. 0 0
      Build/CMake/Modules/Atomic.rc
  59. 1 1
      Build/CMake/Modules/AtomicAndroid.cmake
  60. 3 2
      Build/CMake/Modules/AtomicDesktop.cmake
  61. 10 1
      Build/CMake/Modules/AtomicIOS.cmake
  62. 1 1
      Build/CMake/Modules/AtomicLinux.cmake
  63. 5 1
      Build/CMake/Modules/AtomicMac.cmake
  64. 12 0
      Build/CMake/Modules/AtomicNET.cmake
  65. 0 0
      Build/CMake/Modules/AtomicUtils.cmake
  66. 0 0
      Build/CMake/Modules/AtomicWeb.cmake
  67. 4 3
      Build/CMake/Modules/AtomicWindows.cmake
  68. 0 0
      Build/CMake/Modules/MacOSXBundleInfo.plist.template
  69. 0 0
      Build/CMake/Modules/iOSBundleInfo.plist.template
  70. 0 0
      Build/CMake/Toolchains/android.toolchain.cmake
  71. 0 0
      Build/CMake/Toolchains/emscripten.toolchain.cmake
  72. 5 0
      Build/Docs/Readme.md
  73. 0 0
      Build/Docs/Setup_Notes.txt
  74. 1 0
      Build/Docs/gendocs.sh
  75. 0 0
      Build/Docs/jsdoc.conf
  76. 1 0
      Build/Scripts/Bootstrap.js
  77. 55 0
      Build/Scripts/BuildAndroid.js
  78. 40 0
      Build/Scripts/BuildCommon.js
  79. 112 0
      Build/Scripts/BuildMac.js
  80. 111 0
      Build/Scripts/BuildWindows.js
  81. 12 0
      Build/Scripts/Host.js
  82. 142 0
      Build/Scripts/HostCommon.js
  83. 6 0
      Build/Scripts/HostMac.js
  84. 5 0
      Build/Scripts/HostWindows.js
  85. 3 0
      Build/Scripts/Windows/CompileAndroid.bat
  86. 4 0
      Build/Scripts/Windows/CompileAtomicEditor.bat
  87. 3 0
      Build/Scripts/Windows/GenerateVS2015.bat
  88. 463 87
      Build/TypeScript/lib.d.ts
  89. 310 183
      Build/TypeScript/tsc.js
  90. BIN
      Build/Windows/7z/7z.dll
  91. BIN
      Build/Windows/7z/7z.exe
  92. 3 3
      Build/Windows/Compile.bat
  93. 2 0
      Build/Windows/CompileAndroid.bat
  94. 3 0
      Build/Windows/CompileAtomicTool.bat
  95. 8 0
      Build/node_modules/fs-extra/.npmignore
  96. 261 0
      Build/node_modules/fs-extra/CHANGELOG.md
  97. 15 0
      Build/node_modules/fs-extra/LICENSE
  98. 516 0
      Build/node_modules/fs-extra/README.md
  99. 34 0
      Build/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js
  100. 47 0
      Build/node_modules/fs-extra/lib/copy-sync/copy-sync.js

+ 3 - 1
.gitignore

@@ -11,13 +11,15 @@ Source/Atomic/Javascript/Modules/*
 Data/AtomicPlayer/Resources/CoreData/Shaders/HLSL/Cache
 Data/AtomicPlayer/Resources/CoreData/Shaders/HLSL/Cache
 Resources/CoreData/Shaders/HLSL/Cache
 Resources/CoreData/Shaders/HLSL/Cache
 Artifacts/*
 Artifacts/*
-Build/Source/*
 Docs/out/*
 Docs/out/*
 Docs/node_modules/*
 Docs/node_modules/*
 Data/AtomicEditor/Deployment/Web/AtomicPlayer.js
 Data/AtomicEditor/Deployment/Web/AtomicPlayer.js
+Data/AtomicEditor/Deployment/Web/AtomicPlayer.html.mem
 Data/AtomicEditor/Deployment/IOS/AtomicPlayer.app/AtomicPlayer
 Data/AtomicEditor/Deployment/IOS/AtomicPlayer.app/AtomicPlayer
 node_modules/*
 node_modules/*
 /.project
 /.project
 Script/TypeScript/*
 Script/TypeScript/*
 !Script/TypeScript/AtomicWork.d.ts
 !Script/TypeScript/AtomicWork.d.ts
 Script/Haxe/*
 Script/Haxe/*
+
+Submodules/*

+ 28 - 6
AUTHORS.md

@@ -15,6 +15,10 @@
 
 
 - Shaddock Heath (https://github.com/shaddockh)
 - Shaddock Heath (https://github.com/shaddockh)
 
 
+- C.Trauma (https://github.com/CTrauma)
+
+- Jay Sistar (https://github.com/type1j)
+
 ### Contribution Copyright and Licensing
 ### Contribution Copyright and Licensing
 
 
 Atomic Game Engine contribution copyrights are held by their authors.  Each author retains the copyright to their contribution and agrees to irrevocably license the contribution under the Atomic Game Engine Contribution License `CONTRIBUTION_LICENSE.md`.  Please see `CONTRIBUTING.md` for more details.
 Atomic Game Engine contribution copyrights are held by their authors.  Each author retains the copyright to their contribution and agrees to irrevocably license the contribution under the Atomic Game Engine Contribution License `CONTRIBUTION_LICENSE.md`.  Please see `CONTRIBUTING.md` for more details.
@@ -25,12 +29,14 @@ Atomic Game Engine contribution copyrights are held by their authors.  Each auth
 
 
 The Atomic Game Engine began as a fork of the Urho3D project in November 2014
 The Atomic Game Engine began as a fork of the Urho3D project in November 2014
 
 
-Website:
+### Urho3D Website
 
 
-http://urho3d.github.io/
+Main website: [http://urho3d.github.io/](http://urho3d.github.io/)
 
 
-Credits:
+##License
+Licensed under the MIT license, see [License.txt](https://github.com/urho3d/Urho3D/blob/master/License.txt) for details.
 
 
+##Credits
 Urho3D development, contributions and bugfixes by:
 Urho3D development, contributions and bugfixes by:
 - Lasse Öörni ([email protected], AgentC at GameDev.net)
 - Lasse Öörni ([email protected], AgentC at GameDev.net)
 - Wei Tjong Yao
 - Wei Tjong Yao
@@ -40,6 +46,7 @@ Urho3D development, contributions and bugfixes by:
 - Danny Boisvert
 - Danny Boisvert
 - Carlo Carollo
 - Carlo Carollo
 - Pete Chown
 - Pete Chown
+- Christian Clavet
 - Sebastian Delatorre (primitivewaste)
 - Sebastian Delatorre (primitivewaste)
 - Josh Engebretson
 - Josh Engebretson
 - Chris Friesen
 - Chris Friesen
@@ -50,6 +57,7 @@ Urho3D development, contributions and bugfixes by:
 - Gunnar Kriik
 - Gunnar Kriik
 - Ali Kämäräinen
 - Ali Kämäräinen
 - Pete Leigh
 - Pete Leigh
+- Thorbjørn Lindeijer
 - Jonne Nauha
 - Jonne Nauha
 - Paul Noome
 - Paul Noome
 - David Palacios
 - David Palacios
@@ -57,7 +65,9 @@ Urho3D development, contributions and bugfixes by:
 - Jordan Patterson
 - Jordan Patterson
 - Vladimir Pobedinsky
 - Vladimir Pobedinsky
 - Nick Royer
 - Nick Royer
+- Jonathan Sandusky
 - Miika Santala
 - Miika Santala
+- James Thomas
 - Joshua Tippetts
 - Joshua Tippetts
 - Daniel Wiberg
 - Daniel Wiberg
 - Steven Zhang
 - Steven Zhang
@@ -66,22 +76,31 @@ Urho3D development, contributions and bugfixes by:
 - Firegorilla
 - Firegorilla
 - Magic.Lixin
 - Magic.Lixin
 - Mike3D
 - Mike3D
+- Modanung
+- MonkeyFirst
 - OvermindDL1
 - OvermindDL1
+- Skrylar
+- 1vanK
 - andmar1x
 - andmar1x
 - amadeus_osa
 - amadeus_osa
 - atship
 - atship
 - att
 - att
 - celeron55
 - celeron55
+- cosmy1
+- feltech
 - hdunderscore
 - hdunderscore
+- marynate
 - mightyCelu
 - mightyCelu
 - nemerle
 - nemerle
 - ninjastone
 - ninjastone
+- raould
 - rasteron
 - rasteron
 - reattiva
 - reattiva
 - rifai
 - rifai
 - skaiware
 - skaiware
 - szamq
 - szamq
 - thebluefish
 - thebluefish
+- yushli
 
 
 Urho3D is greatly inspired by OGRE (http://www.ogre3d.org) and Horde3D
 Urho3D is greatly inspired by OGRE (http://www.ogre3d.org) and Horde3D
 (http://www.horde3d.org). Additional inspiration & research used:
 (http://www.horde3d.org). Additional inspiration & research used:
@@ -119,15 +138,18 @@ Urho3D uses the following third-party libraries:
 - LuaJIT 2.0.3 (http://www.luajit.org)
 - LuaJIT 2.0.3 (http://www.luajit.org)
 - LZ4 (http://code.google.com/p/lz4/)
 - LZ4 (http://code.google.com/p/lz4/)
 - MojoShader (http://icculus.org/mojoshader/)
 - MojoShader (http://icculus.org/mojoshader/)
+- nanodbc 2.2.2 (http://lexicalunit.github.io/nanodbc/)
 - Open Asset Import Library (http://assimp.sourceforge.net/)
 - Open Asset Import Library (http://assimp.sourceforge.net/)
-- pugixml 1.0 (http://pugixml.org/)
+- pugixml 1.5 (http://pugixml.org/)
 - rapidjson 0.11 (https://code.google.com/p/rapidjson/)
 - rapidjson 0.11 (https://code.google.com/p/rapidjson/)
 - Recast/Detour (https://github.com/memononen/recastnavigation/)
 - Recast/Detour (https://github.com/memononen/recastnavigation/)
 - SDL 2.0.3 (http://www.libsdl.org/)
 - SDL 2.0.3 (http://www.libsdl.org/)
 - StanHull (http://codesuppository.blogspot.com/2006/03/
 - StanHull (http://codesuppository.blogspot.com/2006/03/
   john-ratcliffs-code-suppository-blog.html)
   john-ratcliffs-code-suppository-blog.html)
-- stb_image 1.29 (http://nothings.org/)
-- stb_vorbis 0.99996 (http://nothings.org/)
+- stb_image 2.05 (http://nothings.org/)
+- stb_image_write 0.98 (http://nothings.org/)
+- stb_vorbis 1.05 (http://nothings.org/)
+- SQLite 3.8.10.2 (https://www.sqlite.org/)
 - tolua++ 1.0.93 (http://www.codenix.com/~tolua)
 - tolua++ 1.0.93 (http://www.codenix.com/~tolua)
 
 
 DXT / ETC1 / PVRTC decompression code based on the Squish library and the Oolong
 DXT / ETC1 / PVRTC decompression code based on the Squish library and the Oolong

+ 75 - 0
Attic/AtomicNETTest/MyClass.cs

@@ -0,0 +1,75 @@
+
+using AtomicEngine;
+using System;
+
+namespace AtomicNETTest
+{
+    public enum BehaviorState
+    {
+      Friendly,
+      Aggressive,
+      Neutral
+    }
+
+
+    public class Spinner : CSComponent
+    {
+
+        [Inspector]
+        float speed = 1.0f;
+
+        [Inspector]
+        float pitchSpeed = 0.0f;
+
+        public override void Update(float timeStep)
+        {
+          Node.Yaw(timeStep * speed * 75.0f);
+          Node.Pitch(timeStep * pitchSpeed * 75.0f);
+
+          //Console.WriteLine("TICK! : {0}", speed);
+        }
+    }
+
+    public class MyComponent : CSComponent
+    {
+
+        public override void Update(float timeStep)
+        {
+            //Node.Yaw(timeStep * 75);
+
+        }
+
+        [Inspector]
+        public bool MyBoolValue = true;
+
+        [Inspector]
+        public int MyIntValue = 5;
+
+        [Inspector]
+        public int MyOtherIntValue = 101;
+
+        [Inspector]
+        public Vector3 MyVector3Value = new Vector3(1, 1, 1);
+
+        [Inspector]
+        public Quaternion MyQuaternionValue = new Quaternion(1, 0, 0, 0);
+
+        [Inspector()]
+        public float MyFloatValue = 42.0f;
+
+        [Inspector]
+        public string MyStringValue = "Hey!";
+
+        [Inspector]
+        public BehaviorState State = BehaviorState.Neutral;
+
+        [Inspector("Textures/chest.png")]
+        public Sprite2D MySprite2DValue;
+
+        [Inspector(DefaultValue = "Textures/chest.png")]
+        public Sprite2D MyOtherSprite2DValue;
+
+
+    }
+
+}

+ 38 - 0
Attic/AtomicSharp/AtomicEditor/AtomicEditor.csproj

@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{91790BBE-7726-4B21-A746-0A4998F5BC7B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>AtomicEditor</RootNamespace>
+    <AssemblyName>AtomicEditor</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="MyClass.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>

+ 6 - 0
Attic/AtomicSharp/AtomicEditor/MyClass.cs

@@ -0,0 +1,6 @@
+using System;
+
+namespace AtomicEditor
+{
+}
+

+ 27 - 0
Attic/AtomicSharp/AtomicEditor/Properties/AssemblyInfo.cs

@@ -0,0 +1,27 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("AtomicEditor")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("josh")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion ("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+

+ 223 - 0
Attic/AtomicSharp/AtomicEngine.cs

@@ -0,0 +1,223 @@
+using System;
+using System.Collections.Generic;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+using AtomicPlayer;
+
+namespace AtomicEngine
+{
+	public static class Atomic
+	{
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl)]
+		private static extern int atomicsharp_initialize ();
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl)]
+		private static extern bool atomicsharp_runframe ();
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern IntPtr csb_AtomicEngine_GetSubsystem(string name);
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern uint csb_Atomic_StringToStringHash(string name);
+					
+		public static uint StringToStringHash(string value)
+		{
+			return csb_Atomic_StringToStringHash (value);
+		}
+
+		static Atomic()
+		{
+            try { 
+			    Initialize ();
+            }
+            catch (Exception e)
+            {
+                Console.WriteLine(e.ToString());
+                throw;
+            }
+        }
+
+		public static void Run()
+		{
+			
+			while (Atomic.RunFrame ()) {
+
+
+			}
+
+		}
+
+		public static bool RunFrame()
+		{
+			GC.Collect();
+			GC.WaitForPendingFinalizers();
+			GC.Collect();				
+			NativeCore.ReleaseExpiredNativeReferences ();
+
+			return atomicsharp_runframe ();
+		}
+
+		public static void RegisterAssemblyComponents(Assembly assembly)
+		{
+			ComponentCore.RegisterAssemblyComponents (assembly);
+		}
+
+		public static void Initialize()
+		{
+			ContainerModule.Initialize ();
+			CoreModule.Initialize ();
+			MathModule.Initialize ();
+			EngineModule.Initialize ();
+			InputModule.Initialize ();
+			IOModule.Initialize ();
+			ResourceModule.Initialize ();
+			AudioModule.Initialize ();
+			GraphicsModule.Initialize ();
+			SceneModule.Initialize ();	
+			Atomic2DModule.Initialize ();
+			Atomic3DModule.Initialize ();
+			NavigationModule.Initialize ();
+			NetworkModule.Initialize ();
+			PhysicsModule.Initialize ();
+			EnvironmentModule.Initialize ();
+			UIModule.Initialize ();
+
+			AtomicPlayer.PlayerModule.Initialize ();
+
+			AtomicInterop.Initialize ();
+
+			atomicsharp_initialize ();
+
+			initSubsystems ();
+		}
+
+		static Dictionary<Type, RefCounted> subSystems = new Dictionary<Type, RefCounted>();
+
+		static private void registerSubsystem (RefCounted subsystem)
+		{
+			subSystems[subsystem.GetType()] = subsystem;
+		}
+
+		static public T GetSubsystem<T>() where T : RefCounted
+		{
+			return (T) subSystems [typeof(T)];
+		}
+
+		static private void initSubsystems()
+		{
+			registerSubsystem (NativeCore.WrapNative<Player> (csb_AtomicEngine_GetSubsystem("Player")));	
+			registerSubsystem (NativeCore.WrapNative<Graphics> (csb_AtomicEngine_GetSubsystem("Graphics")));	
+			registerSubsystem (NativeCore.WrapNative<Renderer> (csb_AtomicEngine_GetSubsystem("Renderer")));	
+			registerSubsystem (NativeCore.WrapNative<ResourceCache> (csb_AtomicEngine_GetSubsystem("ResourceCache")));	
+		}
+
+	}
+
+	public static partial class Constants
+	{
+		public const string LIBNAME = "/Users/josh/Dev/atomic/AtomicGameEngineSharp-build/Source/AtomicSharp/AtomicSharp";
+	}
+		
+	public partial class RefCounted
+	{		
+		public RefCounted()
+		{
+
+		}
+
+		public void AllocGCHandle()
+		{
+			// if we're not a native type, we need to not be kept alive
+			// as we need to save managed state, native types don't 
+			// save managed state and can be trivially regenerated
+			// by creating a GCHandle this managed instance will
+			// be used whenever we get a native ptr back from engine
+
+			if (!handle.IsAllocated)
+			{
+				handle = GCHandle.Alloc (this);
+			}
+		}
+
+
+		public void FreeGCHandle()
+		{
+			if (handle.IsAllocated)
+			{
+				handle.Free();
+			}
+		}
+
+		protected RefCounted (IntPtr native)
+		{
+			nativeInstance = native;
+		}
+			
+		public IntPtr nativeInstance;
+
+
+		public static void SafeAddRef(uint id)
+		{
+			csb_Atomic_RefCounted_SafeAddRef (id);
+		}
+
+		public static void SafeReleaseRef(uint id)
+		{
+			csb_Atomic_RefCounted_SafeReleaseRef (id);
+		}
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		public static extern void csb_Atomic_RefCounted_SafeAddRef (uint id);
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		public static extern void csb_Atomic_RefCounted_SafeReleaseRef (uint id);
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		public static extern IntPtr csb_Atomic_RefCounted_GetClassID (IntPtr self);
+
+		GCHandle handle;
+
+	}
+
+
+	public partial class Component : Animatable
+	{
+		public void Destroy()
+		{
+			if (Node != null)
+				Node.RemoveComponent (this);
+
+			// if we're a CSComponent notify ComponentCore
+			ComponentCore.DestroyComponent (this);
+
+		}
+	}
+
+	public partial class Node : Animatable
+	{
+		public T GetComponent<T> (bool recursive  = false) where T:Component
+		{
+			return (T) GetComponent (typeof(T).Name, recursive);
+		}
+
+		public T AddComponent<T> () where T:Component, new()
+		{
+			T component = new T ();
+			AddComponent( component, 0, CreateMode.REPLICATED);
+			return component;
+		}
+
+		
+	}
+
+	public class InspectorAttribute : Attribute
+	{
+		public InspectorAttribute(string defaultValue = "")
+		{
+			DefaultValue = defaultValue;
+		}
+
+		public string DefaultValue;
+	}		
+}

+ 55 - 0
Attic/AtomicSharp/AtomicInterop.cs

@@ -0,0 +1,55 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace AtomicEngine
+{
+	internal static class AtomicInterop
+	{
+		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		delegate IntPtr CSComponentCreateDelegate (string name);
+
+		static IntPtr CSComponentCreate(string name)
+		{
+			return ComponentCore.CreateCSComponent (name);
+		}
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern void csb_AtomicEngine_AtomicInterop_Set_CSComponentCreate(CSComponentCreateDelegate method);
+
+
+		// ----
+
+		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		delegate void CSComponentCallMethodDelegate (uint componentID, CSComponentMethod method, float value);
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern void csb_AtomicEngine_AtomicInterop_Set_CSComponentCallMethod(CSComponentCallMethodDelegate method);	
+
+		static void CSComponentCallMethod(uint componentID, CSComponentMethod method, float value)
+		{
+			ComponentCore.CallComponentMethod (componentID, method, value);
+		}
+
+		// Events
+
+		[UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		delegate void CSBeginSendEventDelegate (uint senderRefId, uint eventType, IntPtr eventData);
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern void csb_AtomicEngine_AtomicInterop_Set_CSBeginSendEvent(CSBeginSendEventDelegate method);	
+
+		static void CSBeginSendEvent(uint senderRefId, uint eventType, IntPtr eventData)
+		{
+			EventCore.BeginSendEvent (senderRefId, eventType, eventData);
+		}
+
+		public static void Initialize()
+		{
+			csb_AtomicEngine_AtomicInterop_Set_CSComponentCreate (CSComponentCreate);	
+			csb_AtomicEngine_AtomicInterop_Set_CSComponentCallMethod (CSComponentCallMethod);
+			csb_AtomicEngine_AtomicInterop_Set_CSBeginSendEvent (CSBeginSendEvent);
+		}
+
+	}
+}
+

+ 100 - 0
Attic/AtomicSharp/AtomicSharp.csproj

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <RootNamespace>AtomicEngine</RootNamespace>
+    <AssemblyName>AtomicSharp</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <ConsolePause>false</ConsolePause>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleContainer.cs">
+      <Link>CSModuleContainer.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleCore.cs">
+      <Link>CSModuleCore.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleScene.cs">
+      <Link>CSModuleScene.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleResource.cs">
+      <Link>CSModuleResource.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleGraphics.cs">
+      <Link>CSModuleGraphics.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleIO.cs">
+      <Link>CSModuleIO.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\AtomicPlayer\Managed\CSModulePlayer.cs">
+      <Link>CSModulePlayer.cs</Link>
+    </Compile>
+    <Compile Include="AtomicEngine.cs" />
+    <Compile Include="ComponentCore.cs" />
+    <Compile Include="Math.cs" />
+    <Compile Include="CSComponent.cs" />
+    <Compile Include="AtomicInterop.cs" />
+    <Compile Include="NativeCore.cs" />
+    <Compile Include="EventCore.cs" />
+    <Compile Include="ScriptObject.cs" />
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleInput.cs">
+      <Link>CSModuleInput.cs</Link>
+    </Compile>
+    <Compile Include="SDLConsts.cs" />
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleAtomic2D.cs">
+      <Link>CSModuleAtomic2D.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleAtomic3D.cs">
+      <Link>CSModuleAtomic3D.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleAudio.cs">
+      <Link>CSModuleAudio.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleEngine.cs">
+      <Link>CSModuleEngine.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleEnvironment.cs">
+      <Link>CSModuleEnvironment.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleMath.cs">
+      <Link>CSModuleMath.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleNavigation.cs">
+      <Link>CSModuleNavigation.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleNetwork.cs">
+      <Link>CSModuleNetwork.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModulePhysics.cs">
+      <Link>CSModulePhysics.cs</Link>
+    </Compile>
+    <Compile Include="..\Source\Generated\MACOSX\CSharp\Packages\Atomic\Managed\CSModuleUI.cs">
+      <Link>CSModuleUI.cs</Link>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+</Project>

+ 35 - 0
Attic/AtomicSharp/AtomicSharp.sln

@@ -0,0 +1,35 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomicSharp", "AtomicSharp.csproj", "{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomicSharpTest", "AtomicSharpTest\AtomicSharpTest.csproj", "{DBD98CE5-11DE-47F8-BF9A-83BF8576794E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomicSharpTool", "AtomicSharpTool\AtomicSharpTool.csproj", "{BA7825F5-7175-4486-8B06-BB88167246F2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomicEditor", "AtomicEditor\AtomicEditor.csproj", "{91790BBE-7726-4B21-A746-0A4998F5BC7B}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{91790BBE-7726-4B21-A746-0A4998F5BC7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{91790BBE-7726-4B21-A746-0A4998F5BC7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{91790BBE-7726-4B21-A746-0A4998F5BC7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{91790BBE-7726-4B21-A746-0A4998F5BC7B}.Release|Any CPU.Build.0 = Release|Any CPU
+		{BA7825F5-7175-4486-8B06-BB88167246F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{BA7825F5-7175-4486-8B06-BB88167246F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{BA7825F5-7175-4486-8B06-BB88167246F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{BA7825F5-7175-4486-8B06-BB88167246F2}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DBD98CE5-11DE-47F8-BF9A-83BF8576794E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DBD98CE5-11DE-47F8-BF9A-83BF8576794E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DBD98CE5-11DE-47F8-BF9A-83BF8576794E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DBD98CE5-11DE-47F8-BF9A-83BF8576794E}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+EndGlobal

+ 44 - 0
Attic/AtomicSharp/AtomicSharpTest/AtomicSharpTest.csproj

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{DBD98CE5-11DE-47F8-BF9A-83BF8576794E}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>AtomicSharpTest</RootNamespace>
+    <AssemblyName>AtomicSharpTest</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <ProjectReference Include="..\AtomicSharp.csproj">
+      <Project>{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}</Project>
+      <Name>AtomicSharp</Name>
+    </ProjectReference>
+  </ItemGroup>
+</Project>

+ 265 - 0
Attic/AtomicSharp/AtomicSharpTest/Program.cs

@@ -0,0 +1,265 @@
+
+using System;
+using System.Collections.Generic;
+using AtomicEngine;
+using AtomicPlayer;
+
+class BunnyMark : ScriptObject
+{
+	class Bunny
+	{
+		public Node node;
+		public Vector2 position = new Vector2 ();
+		public Vector2 speed = new Vector2 ();
+	}
+
+	public BunnyMark ()
+	{
+		var player = Atomic.GetSubsystem<Player> ();
+
+		player.LoadScene ("Scenes/Scene.scene");	
+		scene = player.CurrentScene;
+
+		SubscribeToEvent ("Update", handleUpdate);
+		SubscribeToEvent ("MouseButtonDown", handleMouseButtonDown);
+		SubscribeToEvent ("MouseButtonUp", handleMouseButtonUp);
+
+		var graphics = Atomic.GetSubsystem<Graphics> ();
+		var cache = Atomic.GetSubsystem<ResourceCache> ();
+
+		halfWidth = graphics.Width * pixelSize * 0.5f;
+		halfHeight = graphics.Height * pixelSize * 0.5f;
+
+		maxX = halfWidth;
+		minX = -halfWidth;
+		maxY = halfHeight;
+		minY = -halfHeight;
+
+		// TODO: generic version of this
+		var sheet = (SpriteSheet2D)cache.GetResource ("SpriteSheet2D", "Sprites/bunnys_sheet.xml");
+
+		var bunny1 = sheet.GetSprite ("bunny1");
+		var bunny2 = sheet.GetSprite ("bunny2");
+		var bunny3 = sheet.GetSprite ("bunny3");
+		var bunny4 = sheet.GetSprite ("bunny4");
+		var bunny5 = sheet.GetSprite ("bunny5");
+
+		bunnyTextures = new Sprite2D[] { bunny1, bunny2, bunny3, bunny4, bunny5 };
+
+		bunnyType = 2;
+		currentTexture = bunnyTextures [bunnyType];
+
+	}
+
+	void handleMouseButtonDown (VariantMap eventData)
+	{
+		isAdding = true;
+	}
+
+	void handleMouseButtonUp (VariantMap eventData)
+	{
+		isAdding = false;
+		bunnyType++;
+		bunnyType %= 5;
+		currentTexture = bunnyTextures [bunnyType];
+
+	}
+
+	void handleUpdate (VariantMap eventData)
+	{
+
+		if (isAdding) {
+
+			var scale = new Vector2 ();
+			var initPos = new Vector2 (minX, maxY);
+
+
+			for (var i = 0; i < amount; i++) {
+
+				var bunny = new Bunny ();
+				bunnies.Add (bunny);
+
+				var node = scene.CreateChild ();
+				bunny.node = node;
+
+				var sprite = (StaticSprite2D)node.CreateComponent ("StaticSprite2D");
+				sprite.BlendMode = BlendMode.BLEND_ALPHA;
+				sprite.Sprite = currentTexture;
+
+				node.Position2D = bunny.position = initPos;
+				bunny.speed.x = (float)(random.NextDouble () * 10);
+				bunny.speed.y = (float)(random.NextDouble () * 10) - 5;
+
+
+				scale.x = scale.y = (0.5f + ((float)random.NextDouble ()) * 0.5f);
+				node.Scale2D = scale;
+
+				node.Rotation2D = (((float)random.NextDouble ()) - 0.5f);
+			}
+		}
+
+		foreach (var bunny in bunnies) {
+
+			var px = bunny.position.x;
+			var py = bunny.position.y;
+
+			var speedX = bunny.speed.x;
+			var speedY = bunny.speed.y;
+
+			px += speedX * .002f;
+			py += speedY * .002f;
+
+			if (px > maxX) {
+				speedX *= -1;
+				px = maxX;
+			} else if (px < minX) {
+				speedX *= -1;
+				px = minX;
+			}
+
+			if (py > maxY) {
+				speedY = 0;
+				py = maxY;
+
+			} else if (py < minY) {
+
+				speedY *= -0.95f;
+
+				if (((float)random.NextDouble ()) > 0.5f) {
+					speedY -= ((float)random.NextDouble ()) * 6f;
+				}
+
+				py = minY;
+			}
+
+			bunny.speed.x = speedX;
+			bunny.speed.y = speedY + gravity;
+
+			bunny.position.x = px;
+			bunny.position.y = py;
+			bunny.node.Position2D = bunny.position;
+			;
+
+		}
+				
+	}
+
+	Random random = new Random ();
+
+	List<Bunny> bunnies = new List<Bunny> ();
+
+	int amount = 3;
+	float gravity = -0.5f;
+	Scene scene;
+
+	Sprite2D[] bunnyTextures;
+
+	bool isAdding = false;
+
+	int bunnyType = 2;
+	Sprite2D currentTexture;
+
+
+	float pixelSize = 0.01f;
+
+	float halfWidth;
+	float halfHeight;
+
+	float maxX;
+	float minX;
+	float maxY;
+	float minY;
+
+}
+	
+enum MyEnum
+{
+	Peaceful,
+	Friendly,
+	Aggressive
+}
+
+class Spinner : CSComponent
+{
+	[Inspector]
+	public int MyField = 42;
+
+	[Inspector("Sprites/star.png")]
+	public Sprite2D MySprite;
+
+	[Inspector]
+	public Vector3 Vector3Field = new Vector3(1, 2, 3);
+
+	[Inspector]
+	public MyEnum Attitude = MyEnum.Friendly;
+
+	[Inspector]
+	public Sprite2D[] SpritesField;
+
+}
+
+/*
+class Spinner : CSComponent
+{
+	public float Speed = 1.0f;
+
+	override public void Start()
+	{
+		myObject = new MyObject ();
+
+		SubscribeToEvent (myObject, "MyEvent", handleMyObjectEvent);
+
+		var renderer = Atomic.GetSubsystem<Renderer> ();
+		SubscribeToEvent (renderer, "BeginViewUpdate", handleEvent);
+
+		SubscribeToEvent (this, "SelfEvent", handleSelfEvent);
+
+		SendEvent ("SelfEvent");
+	}
+
+	void handleSelfEvent(VariantMap eventData)
+	{
+		Console.WriteLine ("Got Self Event");		
+	}
+		
+	void handleMyObjectEvent(VariantMap eventData)
+	{
+		//Console.WriteLine ("Got My Event");		
+	}
+
+	void handleEvent(VariantMap eventData)
+	{
+		View view = eventData.Get<View> ("view");
+		view.Camera.Zoom = zoom;
+		zoom += .01f;
+
+		myObject.SendEvent ("MyEvent");
+	}
+
+	override public void Update(float timeStep)
+	{
+		Node.Yaw (timeStep * 75 * Speed);
+	}
+
+	float zoom = 1.0f;
+
+	MyObject myObject;
+
+}
+*/
+	
+class MyGame
+{
+	public static void Main (string[] args)
+	{		
+
+		Atomic.RegisterAssemblyComponents (typeof(MyGame).Assembly);
+
+		var bunnyMark = new BunnyMark ();
+
+		Atomic.Run ();
+
+	}
+}
+
+

+ 27 - 0
Attic/AtomicSharp/AtomicSharpTest/Properties/AssemblyInfo.cs

@@ -0,0 +1,27 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("AtomicSharpTest")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("josh")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion ("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+

+ 47 - 0
Attic/AtomicSharp/AtomicSharpTool/AtomicSharpTool.csproj

@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{BA7825F5-7175-4486-8B06-BB88167246F2}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <RootNamespace>AtomicSharpTool</RootNamespace>
+    <AssemblyName>AtomicSharpTool</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug</OutputPath>
+    <DefineConstants>DEBUG;</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>full</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release</OutputPath>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <Externalconsole>true</Externalconsole>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="Newtonsoft.Json">
+      <HintPath>bin\Debug\Newtonsoft.Json.dll</HintPath>
+    </Reference>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <ItemGroup>
+    <ProjectReference Include="..\AtomicSharp.csproj">
+      <Project>{3A4C776B-61D6-412E-B1E9-7A1C84CD6B5B}</Project>
+      <Name>AtomicSharp</Name>
+    </ProjectReference>
+  </ItemGroup>
+</Project>

+ 51 - 0
Attic/AtomicSharp/AtomicSharpTool/Program.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Reflection;
+using AtomicEngine;
+
+namespace AtomicSharpTool
+{
+	class MainClass
+	{
+		public static void Main (string[] args)
+		{
+			Assembly assembly = Assembly.LoadFrom("/Users/josh/Dev/atomic/AtomicGameEngineSharp/Build/AtomicSharp/AtomicSharpTest/bin/Debug/AtomicSharpTest.exe");
+
+			Type[] types = assembly.GetTypes ();
+
+			foreach (var type in types) 
+			{
+				if (type.BaseType.Name == "CSComponent") {
+
+					FieldInfo[] fields = type.GetFields ();
+
+					Console.WriteLine (type.Name);
+
+					object instance = null;
+
+					foreach (var field in fields)
+					{
+						foreach (var attribute in field.GetCustomAttributes(true)) {
+
+							if (attribute is InspectorAttribute) {
+
+								if (instance == null)
+									instance = Activator.CreateInstance (type);
+
+								var attr = attribute as InspectorAttribute;
+
+								string defaultValue = attr.DefaultValue;
+								if (defaultValue.Length == 0 && field.GetValue (instance) != null)
+									defaultValue = field.GetValue (instance).ToString ();
+
+							
+								Console.WriteLine ("Inspector Field: {0}, {1}, {2}", field.Name, 
+									field.FieldType.Name, defaultValue);
+								
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+}

+ 27 - 0
Attic/AtomicSharp/AtomicSharpTool/Properties/AssemblyInfo.cs

@@ -0,0 +1,27 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("AtomicSharpTool")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("josh")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion ("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+

+ 48 - 0
Attic/AtomicSharp/CSComponent.cs

@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace AtomicEngine
+{
+	public delegate void AtomicEventDelegate (VariantMap eventData);
+
+	public partial class CSComponent : Component
+	{
+		public uint ManagedID;
+
+		//public CSComponent ()
+		//{
+		//	nativeInstance = NativeCore.RegisterNative (csb_Atomic_CSComponent_Constructor(), this);
+//			ComponentCore.RegisterCSComponent (this);
+	//	}
+
+		virtual public void Start()
+		{
+
+		}
+
+		virtual public void Update(float timeStep)
+		{
+
+		}
+
+		public void SendEvent(string eventType, Dictionary<string, object> eventData = null)
+		{
+			EventCore.SendEvent (this, eventType);
+		}
+
+		public void SubscribeToEvent(AObject sender, string eventType, AtomicEventDelegate function)
+		{
+			EventCore.SubscribeToEvent (this, sender, eventType, function);
+		}
+
+		public void SubscribeToEvent(string eventType, AtomicEventDelegate function)
+		{
+			EventCore.SubscribeToEvent (this, null, eventType, function);
+		}
+
+		//[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		//private static extern IntPtr csb_Atomic_CSComponent_Constructor();
+
+	}
+}

+ 105 - 0
Attic/AtomicSharp/ComponentCore.cs

@@ -0,0 +1,105 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Reflection;
+
+namespace AtomicEngine
+{
+	static internal class ComponentCore
+	{
+		static Dictionary<String, Type> componentTypes = new Dictionary<String, Type>();
+
+		// holds a reference
+		static Dictionary<uint, CSComponent> liveComponents = new Dictionary<uint, CSComponent>();
+
+		public static IntPtr CurrentCSComponentNativeInstance = default(IntPtr);
+
+		public static void CallComponentMethod(uint componentID, CSComponentMethod method, float value)
+		{
+			CSComponent component;
+
+			if (liveComponents.TryGetValue (componentID, out component)) {
+
+				switch (method) {
+
+				//case CSComponentMethod.Start:
+				//	component.Start ();
+				//	break;
+
+				//case CSComponentMethod.Update:
+				//	component.Update (value);
+				//	break;
+				}
+
+			}
+
+		}
+
+		public static void RegisterCSComponent(CSComponent component)
+		{
+			// register (holds a reference)
+			liveComponents [component.RefID] = component;
+		}
+
+		public static void DestroyComponent(Component component)
+		{
+			var c = component as CSComponent;
+
+			if (c != null) {
+
+				liveComponents.Remove (c.RefID);
+			}
+		}
+
+		// native create CSComponent
+		public static IntPtr CreateCSComponent(string name)
+		{
+			Type type;
+
+			if (componentTypes.TryGetValue (name, out type)) {
+
+				// create an instance of the component type
+				var component = (CSComponent) Activator.CreateInstance(type);
+
+				return component.nativeInstance;
+
+			}
+
+			return IntPtr.Zero;
+
+		}
+
+		static void RegisterComponentType(Type componentType)
+		{
+			// TODO: Check for name clash, we don't want to use assembly qualified names, etc to keep it simple
+			componentTypes [componentType.Name] = componentType;
+		}
+
+		public static void RegisterAssemblyComponents(Assembly assembly)
+		{
+			Type csComponentType = typeof(CSComponent);
+			Type[] types = assembly.GetTypes ();
+
+			List<Type> componentTypes = new List<Type> ();
+
+			foreach (Type type in types)
+			{
+				for (var current = type.BaseType; current != null; current = current.BaseType) {
+
+					if (current == csComponentType) {
+						componentTypes.Add(type);
+						break;
+					}
+				}
+			}
+
+			foreach (Type type in componentTypes) {
+
+				RegisterComponentType (type);
+
+			}
+
+		}
+
+	}
+}

+ 161 - 0
Attic/AtomicSharp/EventCore.cs

@@ -0,0 +1,161 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace AtomicEngine
+{
+
+	public class VariantMap
+	{		
+		public VariantMap(IntPtr native)
+		{
+			this.native = native;
+		}
+
+		public void Invalidate()
+		{
+			native = IntPtr.Zero;
+		}
+
+		void checkValid()
+		{
+			if (native == IntPtr.Zero)
+				throw new System.AccessViolationException("Event data only valid during event");
+
+		}
+
+		public T Get<T>(string key) where T:RefCounted
+		{
+			checkValid ();
+
+			// TODO: safe case
+
+			IntPtr r = csb_Atomic_VariantMap_GetInstance (native, key);
+							
+			return r == IntPtr.Zero ? null :  NativeCore.WrapNative<T> (r);
+		}
+
+		public int GetInt(string key)
+		{
+			checkValid ();
+
+			return 0;
+		}
+
+		~VariantMap()
+		{
+
+		}
+
+		IntPtr native = default(IntPtr);
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern IntPtr csb_Atomic_VariantMap_GetInstance(IntPtr native, string key);
+
+
+	}
+
+	public static class EventCore
+	{
+		class Subscription
+		{
+			public uint SenderRefID;
+			public AtomicEventDelegate Handler;			
+		}
+
+		// event type -> subscribers
+		static Dictionary<uint, List<uint> > eventSubscribers = new Dictionary<uint, List<uint>>();
+
+		static Dictionary<uint, Dictionary<uint, Subscription> > subscriptions = new Dictionary<uint, Dictionary<uint, Subscription> >();
+
+
+		public static void SendEvent(AObject sender, string eventType)
+		{
+			csb_Atomic_AObject_SendEvent (sender.nativeInstance, eventType);	
+		}
+
+		public static void SubscribeToEvent(AObject subscriber, AObject sender, string eventType, AtomicEventDelegate function)
+		{
+			var eventTypeID = Atomic.StringToStringHash (eventType);			
+
+			Dictionary<uint, Subscription> subs;
+
+			if (!subscriptions.TryGetValue (subscriber.RefID, out subs)) {
+
+				subs = new Dictionary<uint, Subscription> ();
+				subscriptions [subscriber.RefID] = subs;
+
+			}
+
+			Subscription sub;
+
+			if (!subs.TryGetValue (eventTypeID, out sub)) {
+
+				sub = new Subscription ();
+				subs [eventTypeID] = sub;				
+			}
+
+			sub.SenderRefID = sender == null ? 0 : sender.RefID;
+			sub.Handler = function;
+
+			List<uint> subscribers;
+
+			if (!eventSubscribers.TryGetValue (eventTypeID, out subscribers)) {
+
+				subscribers = new List<uint> ();
+				eventSubscribers [eventTypeID] = subscribers;
+			}
+
+			if (!subscribers.Contains (subscriber.RefID)) {
+
+				subscribers.Add (subscriber.RefID);
+			}
+									
+		}
+
+		public static void BeginSendEvent(uint senderRefId, uint eventType, IntPtr eventData)
+		{
+			List<uint> subscribers;
+
+			if (!eventSubscribers.TryGetValue (eventType, out subscribers)) {				
+				return;			
+			}
+
+			if (subscribers.Count == 0) {
+				return;
+			}
+
+			VariantMap vmap = new VariantMap (eventData);
+
+			foreach (var id in subscribers) {
+
+				Dictionary<uint, Subscription> subs;
+
+				if (subscriptions.TryGetValue (id, out subs)) {
+
+					Subscription sub;
+
+					if (subs.TryGetValue (eventType, out sub)) {
+
+						if (sub.SenderRefID == 0 || sub.SenderRefID == senderRefId) {
+
+							sub.Handler (vmap);
+							
+						}
+
+					}
+
+				}
+
+			}
+
+			vmap.Invalidate ();
+
+		}
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern void csb_Atomic_AObject_SendEvent(IntPtr self, string eventType);
+
+	}
+}
+

+ 138 - 0
Attic/AtomicSharp/Math.cs

@@ -0,0 +1,138 @@
+using System;
+using System.Runtime.InteropServices;
+
+namespace AtomicEngine
+{
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct Vector3
+	{
+		public Vector3 (float x, float y, float z)
+		{
+			this.x = x;
+			this.y = y;
+			this.z = z;
+		}
+
+		public override string ToString()
+		{
+			return x + ", " + y + ", " + z;
+		}
+
+		public float x;
+		public float y;
+		public float z;
+
+
+		/// Zero vector.
+		static public readonly Vector3 Zero = new Vector3(0, 0, 0);
+		/// (-1,0,0) vector.
+		static public readonly Vector3 Left = new Vector3(-1, 0, 0);
+		/// (1,0,0) vector.
+		static public readonly Vector3 Right = new Vector3(1, 0, 0);
+		/// (0,1,0) vector.
+		static public readonly Vector3 Up = new Vector3(0, 1, 0);
+		/// (0,-1,0) vector.
+		static public readonly Vector3 Down = new Vector3(0, -1, 0);
+		/// (0,0,1) vector.
+		static public readonly Vector3 Forward = new Vector3(0, 0, 1);
+		/// (0,0,-1) vector.
+		static public readonly Vector3 Back = new Vector3(0, 0, -1);
+		/// (1,1,1) vector.
+		static public readonly Vector3 One = new Vector3(1, 1, 1);
+
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct Vector4
+	{
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct Vector2
+	{
+		public Vector2 (float x, float y)
+		{
+			this.x = x;
+			this.y = y;
+		}
+			
+		public float x;
+		public float y;
+
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct Quaternion
+	{
+		public Quaternion (float w = 1.0f, float x = 0.0f, float y = 0.0f, float z = 0.0f)
+		{
+			this.w = w;
+			this.x = x;
+			this.y = y;
+			this.z = z;
+		}
+
+		public override string ToString()
+		{
+			return x + ", " + y + ", " + z;
+		}
+
+		public float w;
+		public float x;
+		public float y;
+		public float z;
+			
+		static public readonly Quaternion Identity = new Quaternion();
+
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct Color
+	{
+		public Color (float r, float g, float b, float a = 1.0f)
+		{
+			this.r = r;
+			this.g = g;
+			this.b = b;
+			this.a = a;
+		}
+
+		public float r;
+		public float g;
+		public float b;
+		public float a;
+
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct IntRect
+	{
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct IntVector2
+	{
+		public int x;
+		public int y;
+
+		public IntVector2 (int x, int y)
+		{
+			this.x = x;
+			this.y = y;
+		}
+
+
+		static public readonly IntVector2 Zero = new IntVector2(0, 0);
+
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct BoundingBox
+	{
+	}
+
+	[StructLayout (LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+	public struct Rect
+	{
+	}}
+

+ 124 - 0
Attic/AtomicSharp/NativeCore.cs

@@ -0,0 +1,124 @@
+using System;
+using System.Runtime.InteropServices;
+using System.Collections.Generic;
+
+namespace AtomicEngine
+{
+	// Want to be able to inherit from CSComponent, ScriptObject, and the various UI classes
+	// This means that the managed side needs to be kept alive as will have object state
+	// and we might get these back from native code in a variety of ways
+
+	// a inherited instance must have a GCHandle to keep it alive
+	// it must also at some point along constructor chain create the backing native
+
+	// can we detect a native class?  
+
+	// we shouldn't go off IntPtr here, as a pointer could be reused native before recycles
+
+	static class NativeCore
+	{
+		// given an existing instance classID, construct the managed instance, with downcast support (ask for Component, get StaticModel for example)
+		public static Dictionary<IntPtr, Func<IntPtr, RefCounted>> nativeClassIDToManagedConstructor = new Dictionary<IntPtr, Func<IntPtr, RefCounted>>();
+
+		// native engine types, instances of these types can be trivially recreated managed side
+		private static Dictionary<Type, Type> nativeTypes = new Dictionary<Type, Type> ();
+
+		// RefID -> WeakReference of managed instance
+		public static Dictionary<uint, WeakReference> nativeLookup = new Dictionary<uint, WeakReference> ();
+
+
+		public static bool GetNativeType (Type type)
+		{
+			return nativeTypes.ContainsKey (type);
+		}
+			
+		public static void RegisterNativeType (Type type)
+		{
+			nativeTypes.Add (type, type);		
+		}
+
+		public static IntPtr RegisterNative (IntPtr native, RefCounted r)
+		{
+			r.nativeInstance = native;
+
+			var w = new WeakReference (r);
+			NativeCore.nativeLookup [r.RefID] = w;
+			r.AddRef();
+
+			return native;
+		}
+
+		public static void ReleaseExpiredNativeReferences()
+		{
+			List<uint> released = new List<uint> ();
+
+			foreach(KeyValuePair<uint, WeakReference> entry in nativeLookup)
+			{
+
+				if (entry.Value.Target == null || !entry.Value.IsAlive) {										
+					released.Add (entry.Key);
+
+				} else {
+
+				}
+
+			}
+
+			foreach (uint id in released) {
+
+				// use safe release
+				RefCounted.SafeReleaseRef (id);
+				nativeLookup.Remove (id);
+			}
+
+		}
+
+		// wraps an existing native instance, with downcast support
+		public static T WrapNative<T> (IntPtr native) where T:RefCounted
+		{
+			if (native == IntPtr.Zero)
+				return null;
+
+			// instance id
+			uint id = csb_Atomic_RefCounted_GetRefID (native);
+
+			WeakReference w;
+
+			// first see if we're already available
+			if (nativeLookup.TryGetValue (id, out w)) {
+
+				if (w.IsAlive) {
+
+					// we're alive!
+					return (T)w.Target; 
+
+				} else {
+
+					// we were seen before, but have since been GC'd, remove!
+					nativeLookup.Remove (id);
+				}
+			}
+
+			IntPtr classID = RefCounted.csb_Atomic_RefCounted_GetClassID (native);
+
+			// and store, with downcast support for instance Component -> StaticModel
+			// we never want to hit this path for script inherited natives
+
+			RefCounted r = nativeClassIDToManagedConstructor[classID](native);
+			w = new WeakReference (r);
+			NativeCore.nativeLookup [id] = w;
+
+			// store a ref, so native side will not be released while we still have a reference in managed code
+			r.AddRef();
+
+			return (T) r;
+
+		}
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern uint csb_Atomic_RefCounted_GetRefID(IntPtr self);
+
+	}
+
+}
+

+ 27 - 0
Attic/AtomicSharp/Properties/AssemblyInfo.cs

@@ -0,0 +1,27 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following attributes.
+// Change them to the values specific to your project.
+
+[assembly: AssemblyTitle ("AtomicSharp")]
+[assembly: AssemblyDescription ("")]
+[assembly: AssemblyConfiguration ("")]
+[assembly: AssemblyCompany ("")]
+[assembly: AssemblyProduct ("")]
+[assembly: AssemblyCopyright ("josh")]
+[assembly: AssemblyTrademark ("")]
+[assembly: AssemblyCulture ("")]
+
+// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
+// The form "{Major}.{Minor}.*" will automatically update the build and revision,
+// and "{Major}.{Minor}.{Build}.*" will update just the revision.
+
+[assembly: AssemblyVersion ("1.0.*")]
+
+// The following attributes are used to specify the signing key for the assembly,
+// if desired. See the Mono documentation for more information about signing.
+
+//[assembly: AssemblyDelaySign(false)]
+//[assembly: AssemblyKeyFile("")]
+

+ 635 - 0
Attic/AtomicSharp/SDLConsts.cs

@@ -0,0 +1,635 @@
+#region License
+/* SDL2# - C# Wrapper for SDL2
+ *
+ * Copyright (c) 2013-2015 Ethan Lee.
+ *
+ * This software is provided 'as-is', without any express or implied warranty.
+ * In no event will the authors be held liable for any damages arising from
+ * the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software in a
+ * product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source distribution.
+ *
+ * Ethan "flibitijibibo" Lee <[email protected]>
+ *
+ */
+#endregion
+
+namespace AtomicEngine
+{
+
+	public static class SDL
+	{
+
+
+		public const int SDL_BUTTON_LEFT =	1;
+		public const int SDL_BUTTON_MIDDLE =	2;
+		public const int SDL_BUTTON_RIGHT =	3;
+		public const int SDL_BUTTON_X1 =	4;
+		public const int SDL_BUTTON_X2 =	5;
+		public const int SDL_BUTTON_LMASK =	(1 << ((int)SDL_BUTTON_LEFT - 1));
+		public const int SDL_BUTTON_MMASK =	(1 << ((int)SDL_BUTTON_MIDDLE - 1));
+		public const int SDL_BUTTON_RMASK =	(1 << ((int)SDL_BUTTON_RIGHT - 1));
+		public const int SDL_BUTTON_X1MASK = (1 << ((int)SDL_BUTTON_X1 - 1));
+		public const int SDL_BUTTON_X2MASK = (1 << ((int)SDL_BUTTON_X2 - 1));
+
+		public const byte SDL_HAT_CENTERED =	0x00;
+		public const byte SDL_HAT_UP =		0x01;
+		public const byte SDL_HAT_RIGHT =	0x02;
+		public const byte SDL_HAT_DOWN =	0x04;
+		public const byte SDL_HAT_LEFT =	0x08;
+		public const byte SDL_HAT_RIGHTUP =	SDL_HAT_RIGHT | SDL_HAT_UP;
+		public const byte SDL_HAT_RIGHTDOWN =	SDL_HAT_RIGHT | SDL_HAT_DOWN;
+		public const byte SDL_HAT_LEFTUP =	SDL_HAT_LEFT | SDL_HAT_UP;
+		public const byte SDL_HAT_LEFTDOWN =	SDL_HAT_LEFT | SDL_HAT_DOWN;
+
+		public enum SDL_GameControllerButton
+		{
+			SDL_CONTROLLER_BUTTON_INVALID = -1,
+			SDL_CONTROLLER_BUTTON_A,
+			SDL_CONTROLLER_BUTTON_B,
+			SDL_CONTROLLER_BUTTON_X,
+			SDL_CONTROLLER_BUTTON_Y,
+			SDL_CONTROLLER_BUTTON_BACK,
+			SDL_CONTROLLER_BUTTON_GUIDE,
+			SDL_CONTROLLER_BUTTON_START,
+			SDL_CONTROLLER_BUTTON_LEFTSTICK,
+			SDL_CONTROLLER_BUTTON_RIGHTSTICK,
+			SDL_CONTROLLER_BUTTON_LEFTSHOULDER,
+			SDL_CONTROLLER_BUTTON_RIGHTSHOULDER,
+			SDL_CONTROLLER_BUTTON_DPAD_UP,
+			SDL_CONTROLLER_BUTTON_DPAD_DOWN,
+			SDL_CONTROLLER_BUTTON_DPAD_LEFT,
+			SDL_CONTROLLER_BUTTON_DPAD_RIGHT,
+			SDL_CONTROLLER_BUTTON_MAX,
+		}
+
+		public enum SDL_GameControllerAxis
+		{
+			SDL_CONTROLLER_AXIS_INVALID = -1,
+			SDL_CONTROLLER_AXIS_LEFTX,
+			SDL_CONTROLLER_AXIS_LEFTY,
+			SDL_CONTROLLER_AXIS_RIGHTX,
+			SDL_CONTROLLER_AXIS_RIGHTY,
+			SDL_CONTROLLER_AXIS_TRIGGERLEFT,
+			SDL_CONTROLLER_AXIS_TRIGGERRIGHT,
+			SDL_CONTROLLER_AXIS_MAX
+		}
+
+
+		/* Scancodes based off USB keyboard page (0x07) */
+		public enum SDL_Scancode
+		{
+			SDL_SCANCODE_UNKNOWN = 0,
+
+			SDL_SCANCODE_A = 4,
+			SDL_SCANCODE_B = 5,
+			SDL_SCANCODE_C = 6,
+			SDL_SCANCODE_D = 7,
+			SDL_SCANCODE_E = 8,
+			SDL_SCANCODE_F = 9,
+			SDL_SCANCODE_G = 10,
+			SDL_SCANCODE_H = 11,
+			SDL_SCANCODE_I = 12,
+			SDL_SCANCODE_J = 13,
+			SDL_SCANCODE_K = 14,
+			SDL_SCANCODE_L = 15,
+			SDL_SCANCODE_M = 16,
+			SDL_SCANCODE_N = 17,
+			SDL_SCANCODE_O = 18,
+			SDL_SCANCODE_P = 19,
+			SDL_SCANCODE_Q = 20,
+			SDL_SCANCODE_R = 21,
+			SDL_SCANCODE_S = 22,
+			SDL_SCANCODE_T = 23,
+			SDL_SCANCODE_U = 24,
+			SDL_SCANCODE_V = 25,
+			SDL_SCANCODE_W = 26,
+			SDL_SCANCODE_X = 27,
+			SDL_SCANCODE_Y = 28,
+			SDL_SCANCODE_Z = 29,
+
+			SDL_SCANCODE_1 = 30,
+			SDL_SCANCODE_2 = 31,
+			SDL_SCANCODE_3 = 32,
+			SDL_SCANCODE_4 = 33,
+			SDL_SCANCODE_5 = 34,
+			SDL_SCANCODE_6 = 35,
+			SDL_SCANCODE_7 = 36,
+			SDL_SCANCODE_8 = 37,
+			SDL_SCANCODE_9 = 38,
+			SDL_SCANCODE_0 = 39,
+
+			SDL_SCANCODE_RETURN = 40,
+			SDL_SCANCODE_ESCAPE = 41,
+			SDL_SCANCODE_BACKSPACE = 42,
+			SDL_SCANCODE_TAB = 43,
+			SDL_SCANCODE_SPACE = 44,
+
+			SDL_SCANCODE_MINUS = 45,
+			SDL_SCANCODE_EQUALS = 46,
+			SDL_SCANCODE_LEFTBRACKET = 47,
+			SDL_SCANCODE_RIGHTBRACKET = 48,
+			SDL_SCANCODE_BACKSLASH = 49,
+			SDL_SCANCODE_NONUSHASH = 50,
+			SDL_SCANCODE_SEMICOLON = 51,
+			SDL_SCANCODE_APOSTROPHE = 52,
+			SDL_SCANCODE_GRAVE = 53,
+			SDL_SCANCODE_COMMA = 54,
+			SDL_SCANCODE_PERIOD = 55,
+			SDL_SCANCODE_SLASH = 56,
+
+			SDL_SCANCODE_CAPSLOCK = 57,
+
+			SDL_SCANCODE_F1 = 58,
+			SDL_SCANCODE_F2 = 59,
+			SDL_SCANCODE_F3 = 60,
+			SDL_SCANCODE_F4 = 61,
+			SDL_SCANCODE_F5 = 62,
+			SDL_SCANCODE_F6 = 63,
+			SDL_SCANCODE_F7 = 64,
+			SDL_SCANCODE_F8 = 65,
+			SDL_SCANCODE_F9 = 66,
+			SDL_SCANCODE_F10 = 67,
+			SDL_SCANCODE_F11 = 68,
+			SDL_SCANCODE_F12 = 69,
+
+			SDL_SCANCODE_PRINTSCREEN = 70,
+			SDL_SCANCODE_SCROLLLOCK = 71,
+			SDL_SCANCODE_PAUSE = 72,
+			SDL_SCANCODE_INSERT = 73,
+			SDL_SCANCODE_HOME = 74,
+			SDL_SCANCODE_PAGEUP = 75,
+			SDL_SCANCODE_DELETE = 76,
+			SDL_SCANCODE_END = 77,
+			SDL_SCANCODE_PAGEDOWN = 78,
+			SDL_SCANCODE_RIGHT = 79,
+			SDL_SCANCODE_LEFT = 80,
+			SDL_SCANCODE_DOWN = 81,
+			SDL_SCANCODE_UP = 82,
+
+			SDL_SCANCODE_NUMLOCKCLEAR = 83,
+			SDL_SCANCODE_KP_DIVIDE = 84,
+			SDL_SCANCODE_KP_MULTIPLY = 85,
+			SDL_SCANCODE_KP_MINUS = 86,
+			SDL_SCANCODE_KP_PLUS = 87,
+			SDL_SCANCODE_KP_ENTER = 88,
+			SDL_SCANCODE_KP_1 = 89,
+			SDL_SCANCODE_KP_2 = 90,
+			SDL_SCANCODE_KP_3 = 91,
+			SDL_SCANCODE_KP_4 = 92,
+			SDL_SCANCODE_KP_5 = 93,
+			SDL_SCANCODE_KP_6 = 94,
+			SDL_SCANCODE_KP_7 = 95,
+			SDL_SCANCODE_KP_8 = 96,
+			SDL_SCANCODE_KP_9 = 97,
+			SDL_SCANCODE_KP_0 = 98,
+			SDL_SCANCODE_KP_PERIOD = 99,
+
+			SDL_SCANCODE_NONUSBACKSLASH = 100,
+			SDL_SCANCODE_APPLICATION = 101,
+			SDL_SCANCODE_POWER = 102,
+			SDL_SCANCODE_KP_EQUALS = 103,
+			SDL_SCANCODE_F13 = 104,
+			SDL_SCANCODE_F14 = 105,
+			SDL_SCANCODE_F15 = 106,
+			SDL_SCANCODE_F16 = 107,
+			SDL_SCANCODE_F17 = 108,
+			SDL_SCANCODE_F18 = 109,
+			SDL_SCANCODE_F19 = 110,
+			SDL_SCANCODE_F20 = 111,
+			SDL_SCANCODE_F21 = 112,
+			SDL_SCANCODE_F22 = 113,
+			SDL_SCANCODE_F23 = 114,
+			SDL_SCANCODE_F24 = 115,
+			SDL_SCANCODE_EXECUTE = 116,
+			SDL_SCANCODE_HELP = 117,
+			SDL_SCANCODE_MENU = 118,
+			SDL_SCANCODE_SELECT = 119,
+			SDL_SCANCODE_STOP = 120,
+			SDL_SCANCODE_AGAIN = 121,
+			SDL_SCANCODE_UNDO = 122,
+			SDL_SCANCODE_CUT = 123,
+			SDL_SCANCODE_COPY = 124,
+			SDL_SCANCODE_PASTE = 125,
+			SDL_SCANCODE_FIND = 126,
+			SDL_SCANCODE_MUTE = 127,
+			SDL_SCANCODE_VOLUMEUP = 128,
+			SDL_SCANCODE_VOLUMEDOWN = 129,
+			/* not sure whether there's a reason to enable these */
+			/*	SDL_SCANCODE_LOCKINGCAPSLOCK = 130,  */
+			/*	SDL_SCANCODE_LOCKINGNUMLOCK = 131, */
+			/*	SDL_SCANCODE_LOCKINGSCROLLLOCK = 132, */
+			SDL_SCANCODE_KP_COMMA = 133,
+			SDL_SCANCODE_KP_EQUALSAS400 = 134,
+
+			SDL_SCANCODE_INTERNATIONAL1 = 135,
+			SDL_SCANCODE_INTERNATIONAL2 = 136,
+			SDL_SCANCODE_INTERNATIONAL3 = 137,
+			SDL_SCANCODE_INTERNATIONAL4 = 138,
+			SDL_SCANCODE_INTERNATIONAL5 = 139,
+			SDL_SCANCODE_INTERNATIONAL6 = 140,
+			SDL_SCANCODE_INTERNATIONAL7 = 141,
+			SDL_SCANCODE_INTERNATIONAL8 = 142,
+			SDL_SCANCODE_INTERNATIONAL9 = 143,
+			SDL_SCANCODE_LANG1 = 144,
+			SDL_SCANCODE_LANG2 = 145,
+			SDL_SCANCODE_LANG3 = 146,
+			SDL_SCANCODE_LANG4 = 147,
+			SDL_SCANCODE_LANG5 = 148,
+			SDL_SCANCODE_LANG6 = 149,
+			SDL_SCANCODE_LANG7 = 150,
+			SDL_SCANCODE_LANG8 = 151,
+			SDL_SCANCODE_LANG9 = 152,
+
+			SDL_SCANCODE_ALTERASE = 153,
+			SDL_SCANCODE_SYSREQ = 154,
+			SDL_SCANCODE_CANCEL = 155,
+			SDL_SCANCODE_CLEAR = 156,
+			SDL_SCANCODE_PRIOR = 157,
+			SDL_SCANCODE_RETURN2 = 158,
+			SDL_SCANCODE_SEPARATOR = 159,
+			SDL_SCANCODE_OUT = 160,
+			SDL_SCANCODE_OPER = 161,
+			SDL_SCANCODE_CLEARAGAIN = 162,
+			SDL_SCANCODE_CRSEL = 163,
+			SDL_SCANCODE_EXSEL = 164,
+
+			SDL_SCANCODE_KP_00 = 176,
+			SDL_SCANCODE_KP_000 = 177,
+			SDL_SCANCODE_THOUSANDSSEPARATOR = 178,
+			SDL_SCANCODE_DECIMALSEPARATOR = 179,
+			SDL_SCANCODE_CURRENCYUNIT = 180,
+			SDL_SCANCODE_CURRENCYSUBUNIT = 181,
+			SDL_SCANCODE_KP_LEFTPAREN = 182,
+			SDL_SCANCODE_KP_RIGHTPAREN = 183,
+			SDL_SCANCODE_KP_LEFTBRACE = 184,
+			SDL_SCANCODE_KP_RIGHTBRACE = 185,
+			SDL_SCANCODE_KP_TAB = 186,
+			SDL_SCANCODE_KP_BACKSPACE = 187,
+			SDL_SCANCODE_KP_A = 188,
+			SDL_SCANCODE_KP_B = 189,
+			SDL_SCANCODE_KP_C = 190,
+			SDL_SCANCODE_KP_D = 191,
+			SDL_SCANCODE_KP_E = 192,
+			SDL_SCANCODE_KP_F = 193,
+			SDL_SCANCODE_KP_XOR = 194,
+			SDL_SCANCODE_KP_POWER = 195,
+			SDL_SCANCODE_KP_PERCENT = 196,
+			SDL_SCANCODE_KP_LESS = 197,
+			SDL_SCANCODE_KP_GREATER = 198,
+			SDL_SCANCODE_KP_AMPERSAND = 199,
+			SDL_SCANCODE_KP_DBLAMPERSAND = 200,
+			SDL_SCANCODE_KP_VERTICALBAR = 201,
+			SDL_SCANCODE_KP_DBLVERTICALBAR = 202,
+			SDL_SCANCODE_KP_COLON = 203,
+			SDL_SCANCODE_KP_HASH = 204,
+			SDL_SCANCODE_KP_SPACE = 205,
+			SDL_SCANCODE_KP_AT = 206,
+			SDL_SCANCODE_KP_EXCLAM = 207,
+			SDL_SCANCODE_KP_MEMSTORE = 208,
+			SDL_SCANCODE_KP_MEMRECALL = 209,
+			SDL_SCANCODE_KP_MEMCLEAR = 210,
+			SDL_SCANCODE_KP_MEMADD = 211,
+			SDL_SCANCODE_KP_MEMSUBTRACT = 212,
+			SDL_SCANCODE_KP_MEMMULTIPLY = 213,
+			SDL_SCANCODE_KP_MEMDIVIDE = 214,
+			SDL_SCANCODE_KP_PLUSMINUS = 215,
+			SDL_SCANCODE_KP_CLEAR = 216,
+			SDL_SCANCODE_KP_CLEARENTRY = 217,
+			SDL_SCANCODE_KP_BINARY = 218,
+			SDL_SCANCODE_KP_OCTAL = 219,
+			SDL_SCANCODE_KP_DECIMAL = 220,
+			SDL_SCANCODE_KP_HEXADECIMAL = 221,
+
+			SDL_SCANCODE_LCTRL = 224,
+			SDL_SCANCODE_LSHIFT = 225,
+			SDL_SCANCODE_LALT = 226,
+			SDL_SCANCODE_LGUI = 227,
+			SDL_SCANCODE_RCTRL = 228,
+			SDL_SCANCODE_RSHIFT = 229,
+			SDL_SCANCODE_RALT = 230,
+			SDL_SCANCODE_RGUI = 231,
+
+			SDL_SCANCODE_MODE = 257,
+
+			/* These come from the USB consumer page (0x0C) */
+			SDL_SCANCODE_AUDIONEXT = 258,
+			SDL_SCANCODE_AUDIOPREV = 259,
+			SDL_SCANCODE_AUDIOSTOP = 260,
+			SDL_SCANCODE_AUDIOPLAY = 261,
+			SDL_SCANCODE_AUDIOMUTE = 262,
+			SDL_SCANCODE_MEDIASELECT = 263,
+			SDL_SCANCODE_WWW = 264,
+			SDL_SCANCODE_MAIL = 265,
+			SDL_SCANCODE_CALCULATOR = 266,
+			SDL_SCANCODE_COMPUTER = 267,
+			SDL_SCANCODE_AC_SEARCH = 268,
+			SDL_SCANCODE_AC_HOME = 269,
+			SDL_SCANCODE_AC_BACK = 270,
+			SDL_SCANCODE_AC_FORWARD = 271,
+			SDL_SCANCODE_AC_STOP = 272,
+			SDL_SCANCODE_AC_REFRESH = 273,
+			SDL_SCANCODE_AC_BOOKMARKS = 274,
+
+			/* These come from other sources, and are mostly mac related */
+			SDL_SCANCODE_BRIGHTNESSDOWN = 275,
+			SDL_SCANCODE_BRIGHTNESSUP = 276,
+			SDL_SCANCODE_DISPLAYSWITCH = 277,
+			SDL_SCANCODE_KBDILLUMTOGGLE = 278,
+			SDL_SCANCODE_KBDILLUMDOWN = 279,
+			SDL_SCANCODE_KBDILLUMUP = 280,
+			SDL_SCANCODE_EJECT = 281,
+			SDL_SCANCODE_SLEEP = 282,
+
+			SDL_SCANCODE_APP1 = 283,
+			SDL_SCANCODE_APP2 = 284,
+
+			/* This is not a key, simply marks the number of scancodes
+			 * so that you know how big to make your arrays. */
+			SDL_NUM_SCANCODES = 512
+		}
+
+		public const int SDLK_SCANCODE_MASK = (1 << 30);
+
+		public enum SDL_Keycode
+		{
+			SDLK_UNKNOWN = 0,
+
+			SDLK_RETURN = '\r',
+			SDLK_ESCAPE = 27,
+			// '\033'
+			SDLK_BACKSPACE = '\b',
+			SDLK_TAB = '\t',
+			SDLK_SPACE = ' ',
+			SDLK_EXCLAIM = '!',
+			SDLK_QUOTEDBL = '"',
+			SDLK_HASH = '#',
+			SDLK_PERCENT = '%',
+			SDLK_DOLLAR = '$',
+			SDLK_AMPERSAND = '&',
+			SDLK_QUOTE = '\'',
+			SDLK_LEFTPAREN = '(',
+			SDLK_RIGHTPAREN = ')',
+			SDLK_ASTERISK = '*',
+			SDLK_PLUS = '+',
+			SDLK_COMMA = ',',
+			SDLK_MINUS = '-',
+			SDLK_PERIOD = '.',
+			SDLK_SLASH = '/',
+			SDLK_0 = '0',
+			SDLK_1 = '1',
+			SDLK_2 = '2',
+			SDLK_3 = '3',
+			SDLK_4 = '4',
+			SDLK_5 = '5',
+			SDLK_6 = '6',
+			SDLK_7 = '7',
+			SDLK_8 = '8',
+			SDLK_9 = '9',
+			SDLK_COLON = ':',
+			SDLK_SEMICOLON = ';',
+			SDLK_LESS = '<',
+			SDLK_EQUALS = '=',
+			SDLK_GREATER = '>',
+			SDLK_QUESTION = '?',
+			SDLK_AT = '@',
+			/*
+			Skip uppercase letters
+			*/
+			SDLK_LEFTBRACKET = '[',
+			SDLK_BACKSLASH = '\\',
+			SDLK_RIGHTBRACKET = ']',
+			SDLK_CARET = '^',
+			SDLK_UNDERSCORE = '_',
+			SDLK_BACKQUOTE = '`',
+			SDLK_a = 'a',
+			SDLK_b = 'b',
+			SDLK_c = 'c',
+			SDLK_d = 'd',
+			SDLK_e = 'e',
+			SDLK_f = 'f',
+			SDLK_g = 'g',
+			SDLK_h = 'h',
+			SDLK_i = 'i',
+			SDLK_j = 'j',
+			SDLK_k = 'k',
+			SDLK_l = 'l',
+			SDLK_m = 'm',
+			SDLK_n = 'n',
+			SDLK_o = 'o',
+			SDLK_p = 'p',
+			SDLK_q = 'q',
+			SDLK_r = 'r',
+			SDLK_s = 's',
+			SDLK_t = 't',
+			SDLK_u = 'u',
+			SDLK_v = 'v',
+			SDLK_w = 'w',
+			SDLK_x = 'x',
+			SDLK_y = 'y',
+			SDLK_z = 'z',
+
+			SDLK_CAPSLOCK = (int)SDL_Scancode.SDL_SCANCODE_CAPSLOCK | SDLK_SCANCODE_MASK,
+
+			SDLK_F1 = (int)SDL_Scancode.SDL_SCANCODE_F1 | SDLK_SCANCODE_MASK,
+			SDLK_F2 = (int)SDL_Scancode.SDL_SCANCODE_F2 | SDLK_SCANCODE_MASK,
+			SDLK_F3 = (int)SDL_Scancode.SDL_SCANCODE_F3 | SDLK_SCANCODE_MASK,
+			SDLK_F4 = (int)SDL_Scancode.SDL_SCANCODE_F4 | SDLK_SCANCODE_MASK,
+			SDLK_F5 = (int)SDL_Scancode.SDL_SCANCODE_F5 | SDLK_SCANCODE_MASK,
+			SDLK_F6 = (int)SDL_Scancode.SDL_SCANCODE_F6 | SDLK_SCANCODE_MASK,
+			SDLK_F7 = (int)SDL_Scancode.SDL_SCANCODE_F7 | SDLK_SCANCODE_MASK,
+			SDLK_F8 = (int)SDL_Scancode.SDL_SCANCODE_F8 | SDLK_SCANCODE_MASK,
+			SDLK_F9 = (int)SDL_Scancode.SDL_SCANCODE_F9 | SDLK_SCANCODE_MASK,
+			SDLK_F10 = (int)SDL_Scancode.SDL_SCANCODE_F10 | SDLK_SCANCODE_MASK,
+			SDLK_F11 = (int)SDL_Scancode.SDL_SCANCODE_F11 | SDLK_SCANCODE_MASK,
+			SDLK_F12 = (int)SDL_Scancode.SDL_SCANCODE_F12 | SDLK_SCANCODE_MASK,
+
+			SDLK_PRINTSCREEN = (int)SDL_Scancode.SDL_SCANCODE_PRINTSCREEN | SDLK_SCANCODE_MASK,
+			SDLK_SCROLLLOCK = (int)SDL_Scancode.SDL_SCANCODE_SCROLLLOCK | SDLK_SCANCODE_MASK,
+			SDLK_PAUSE = (int)SDL_Scancode.SDL_SCANCODE_PAUSE | SDLK_SCANCODE_MASK,
+			SDLK_INSERT = (int)SDL_Scancode.SDL_SCANCODE_INSERT | SDLK_SCANCODE_MASK,
+			SDLK_HOME = (int)SDL_Scancode.SDL_SCANCODE_HOME | SDLK_SCANCODE_MASK,
+			SDLK_PAGEUP = (int)SDL_Scancode.SDL_SCANCODE_PAGEUP | SDLK_SCANCODE_MASK,
+			SDLK_DELETE = 127,
+			SDLK_END = (int)SDL_Scancode.SDL_SCANCODE_END | SDLK_SCANCODE_MASK,
+			SDLK_PAGEDOWN = (int)SDL_Scancode.SDL_SCANCODE_PAGEDOWN | SDLK_SCANCODE_MASK,
+			SDLK_RIGHT = (int)SDL_Scancode.SDL_SCANCODE_RIGHT | SDLK_SCANCODE_MASK,
+			SDLK_LEFT = (int)SDL_Scancode.SDL_SCANCODE_LEFT | SDLK_SCANCODE_MASK,
+			SDLK_DOWN = (int)SDL_Scancode.SDL_SCANCODE_DOWN | SDLK_SCANCODE_MASK,
+			SDLK_UP = (int)SDL_Scancode.SDL_SCANCODE_UP | SDLK_SCANCODE_MASK,
+
+			SDLK_NUMLOCKCLEAR = (int)SDL_Scancode.SDL_SCANCODE_NUMLOCKCLEAR | SDLK_SCANCODE_MASK,
+			SDLK_KP_DIVIDE = (int)SDL_Scancode.SDL_SCANCODE_KP_DIVIDE | SDLK_SCANCODE_MASK,
+			SDLK_KP_MULTIPLY = (int)SDL_Scancode.SDL_SCANCODE_KP_MULTIPLY | SDLK_SCANCODE_MASK,
+			SDLK_KP_MINUS = (int)SDL_Scancode.SDL_SCANCODE_KP_MINUS | SDLK_SCANCODE_MASK,
+			SDLK_KP_PLUS = (int)SDL_Scancode.SDL_SCANCODE_KP_PLUS | SDLK_SCANCODE_MASK,
+			SDLK_KP_ENTER = (int)SDL_Scancode.SDL_SCANCODE_KP_ENTER | SDLK_SCANCODE_MASK,
+			SDLK_KP_1 = (int)SDL_Scancode.SDL_SCANCODE_KP_1 | SDLK_SCANCODE_MASK,
+			SDLK_KP_2 = (int)SDL_Scancode.SDL_SCANCODE_KP_2 | SDLK_SCANCODE_MASK,
+			SDLK_KP_3 = (int)SDL_Scancode.SDL_SCANCODE_KP_3 | SDLK_SCANCODE_MASK,
+			SDLK_KP_4 = (int)SDL_Scancode.SDL_SCANCODE_KP_4 | SDLK_SCANCODE_MASK,
+			SDLK_KP_5 = (int)SDL_Scancode.SDL_SCANCODE_KP_5 | SDLK_SCANCODE_MASK,
+			SDLK_KP_6 = (int)SDL_Scancode.SDL_SCANCODE_KP_6 | SDLK_SCANCODE_MASK,
+			SDLK_KP_7 = (int)SDL_Scancode.SDL_SCANCODE_KP_7 | SDLK_SCANCODE_MASK,
+			SDLK_KP_8 = (int)SDL_Scancode.SDL_SCANCODE_KP_8 | SDLK_SCANCODE_MASK,
+			SDLK_KP_9 = (int)SDL_Scancode.SDL_SCANCODE_KP_9 | SDLK_SCANCODE_MASK,
+			SDLK_KP_0 = (int)SDL_Scancode.SDL_SCANCODE_KP_0 | SDLK_SCANCODE_MASK,
+			SDLK_KP_PERIOD = (int)SDL_Scancode.SDL_SCANCODE_KP_PERIOD | SDLK_SCANCODE_MASK,
+
+			SDLK_APPLICATION = (int)SDL_Scancode.SDL_SCANCODE_APPLICATION | SDLK_SCANCODE_MASK,
+			SDLK_POWER = (int)SDL_Scancode.SDL_SCANCODE_POWER | SDLK_SCANCODE_MASK,
+			SDLK_KP_EQUALS = (int)SDL_Scancode.SDL_SCANCODE_KP_EQUALS | SDLK_SCANCODE_MASK,
+			SDLK_F13 = (int)SDL_Scancode.SDL_SCANCODE_F13 | SDLK_SCANCODE_MASK,
+			SDLK_F14 = (int)SDL_Scancode.SDL_SCANCODE_F14 | SDLK_SCANCODE_MASK,
+			SDLK_F15 = (int)SDL_Scancode.SDL_SCANCODE_F15 | SDLK_SCANCODE_MASK,
+			SDLK_F16 = (int)SDL_Scancode.SDL_SCANCODE_F16 | SDLK_SCANCODE_MASK,
+			SDLK_F17 = (int)SDL_Scancode.SDL_SCANCODE_F17 | SDLK_SCANCODE_MASK,
+			SDLK_F18 = (int)SDL_Scancode.SDL_SCANCODE_F18 | SDLK_SCANCODE_MASK,
+			SDLK_F19 = (int)SDL_Scancode.SDL_SCANCODE_F19 | SDLK_SCANCODE_MASK,
+			SDLK_F20 = (int)SDL_Scancode.SDL_SCANCODE_F20 | SDLK_SCANCODE_MASK,
+			SDLK_F21 = (int)SDL_Scancode.SDL_SCANCODE_F21 | SDLK_SCANCODE_MASK,
+			SDLK_F22 = (int)SDL_Scancode.SDL_SCANCODE_F22 | SDLK_SCANCODE_MASK,
+			SDLK_F23 = (int)SDL_Scancode.SDL_SCANCODE_F23 | SDLK_SCANCODE_MASK,
+			SDLK_F24 = (int)SDL_Scancode.SDL_SCANCODE_F24 | SDLK_SCANCODE_MASK,
+			SDLK_EXECUTE = (int)SDL_Scancode.SDL_SCANCODE_EXECUTE | SDLK_SCANCODE_MASK,
+			SDLK_HELP = (int)SDL_Scancode.SDL_SCANCODE_HELP | SDLK_SCANCODE_MASK,
+			SDLK_MENU = (int)SDL_Scancode.SDL_SCANCODE_MENU | SDLK_SCANCODE_MASK,
+			SDLK_SELECT = (int)SDL_Scancode.SDL_SCANCODE_SELECT | SDLK_SCANCODE_MASK,
+			SDLK_STOP = (int)SDL_Scancode.SDL_SCANCODE_STOP | SDLK_SCANCODE_MASK,
+			SDLK_AGAIN = (int)SDL_Scancode.SDL_SCANCODE_AGAIN | SDLK_SCANCODE_MASK,
+			SDLK_UNDO = (int)SDL_Scancode.SDL_SCANCODE_UNDO | SDLK_SCANCODE_MASK,
+			SDLK_CUT = (int)SDL_Scancode.SDL_SCANCODE_CUT | SDLK_SCANCODE_MASK,
+			SDLK_COPY = (int)SDL_Scancode.SDL_SCANCODE_COPY | SDLK_SCANCODE_MASK,
+			SDLK_PASTE = (int)SDL_Scancode.SDL_SCANCODE_PASTE | SDLK_SCANCODE_MASK,
+			SDLK_FIND = (int)SDL_Scancode.SDL_SCANCODE_FIND | SDLK_SCANCODE_MASK,
+			SDLK_MUTE = (int)SDL_Scancode.SDL_SCANCODE_MUTE | SDLK_SCANCODE_MASK,
+			SDLK_VOLUMEUP = (int)SDL_Scancode.SDL_SCANCODE_VOLUMEUP | SDLK_SCANCODE_MASK,
+			SDLK_VOLUMEDOWN = (int)SDL_Scancode.SDL_SCANCODE_VOLUMEDOWN | SDLK_SCANCODE_MASK,
+			SDLK_KP_COMMA = (int)SDL_Scancode.SDL_SCANCODE_KP_COMMA | SDLK_SCANCODE_MASK,
+			SDLK_KP_EQUALSAS400 =
+			(int)SDL_Scancode.SDL_SCANCODE_KP_EQUALSAS400 | SDLK_SCANCODE_MASK,
+
+			SDLK_ALTERASE = (int)SDL_Scancode.SDL_SCANCODE_ALTERASE | SDLK_SCANCODE_MASK,
+			SDLK_SYSREQ = (int)SDL_Scancode.SDL_SCANCODE_SYSREQ | SDLK_SCANCODE_MASK,
+			SDLK_CANCEL = (int)SDL_Scancode.SDL_SCANCODE_CANCEL | SDLK_SCANCODE_MASK,
+			SDLK_CLEAR = (int)SDL_Scancode.SDL_SCANCODE_CLEAR | SDLK_SCANCODE_MASK,
+			SDLK_PRIOR = (int)SDL_Scancode.SDL_SCANCODE_PRIOR | SDLK_SCANCODE_MASK,
+			SDLK_RETURN2 = (int)SDL_Scancode.SDL_SCANCODE_RETURN2 | SDLK_SCANCODE_MASK,
+			SDLK_SEPARATOR = (int)SDL_Scancode.SDL_SCANCODE_SEPARATOR | SDLK_SCANCODE_MASK,
+			SDLK_OUT = (int)SDL_Scancode.SDL_SCANCODE_OUT | SDLK_SCANCODE_MASK,
+			SDLK_OPER = (int)SDL_Scancode.SDL_SCANCODE_OPER | SDLK_SCANCODE_MASK,
+			SDLK_CLEARAGAIN = (int)SDL_Scancode.SDL_SCANCODE_CLEARAGAIN | SDLK_SCANCODE_MASK,
+			SDLK_CRSEL = (int)SDL_Scancode.SDL_SCANCODE_CRSEL | SDLK_SCANCODE_MASK,
+			SDLK_EXSEL = (int)SDL_Scancode.SDL_SCANCODE_EXSEL | SDLK_SCANCODE_MASK,
+
+			SDLK_KP_00 = (int)SDL_Scancode.SDL_SCANCODE_KP_00 | SDLK_SCANCODE_MASK,
+			SDLK_KP_000 = (int)SDL_Scancode.SDL_SCANCODE_KP_000 | SDLK_SCANCODE_MASK,
+			SDLK_THOUSANDSSEPARATOR =
+			(int)SDL_Scancode.SDL_SCANCODE_THOUSANDSSEPARATOR | SDLK_SCANCODE_MASK,
+			SDLK_DECIMALSEPARATOR =
+			(int)SDL_Scancode.SDL_SCANCODE_DECIMALSEPARATOR | SDLK_SCANCODE_MASK,
+			SDLK_CURRENCYUNIT = (int)SDL_Scancode.SDL_SCANCODE_CURRENCYUNIT | SDLK_SCANCODE_MASK,
+			SDLK_CURRENCYSUBUNIT =
+			(int)SDL_Scancode.SDL_SCANCODE_CURRENCYSUBUNIT | SDLK_SCANCODE_MASK,
+			SDLK_KP_LEFTPAREN = (int)SDL_Scancode.SDL_SCANCODE_KP_LEFTPAREN | SDLK_SCANCODE_MASK,
+			SDLK_KP_RIGHTPAREN = (int)SDL_Scancode.SDL_SCANCODE_KP_RIGHTPAREN | SDLK_SCANCODE_MASK,
+			SDLK_KP_LEFTBRACE = (int)SDL_Scancode.SDL_SCANCODE_KP_LEFTBRACE | SDLK_SCANCODE_MASK,
+			SDLK_KP_RIGHTBRACE = (int)SDL_Scancode.SDL_SCANCODE_KP_RIGHTBRACE | SDLK_SCANCODE_MASK,
+			SDLK_KP_TAB = (int)SDL_Scancode.SDL_SCANCODE_KP_TAB | SDLK_SCANCODE_MASK,
+			SDLK_KP_BACKSPACE = (int)SDL_Scancode.SDL_SCANCODE_KP_BACKSPACE | SDLK_SCANCODE_MASK,
+			SDLK_KP_A = (int)SDL_Scancode.SDL_SCANCODE_KP_A | SDLK_SCANCODE_MASK,
+			SDLK_KP_B = (int)SDL_Scancode.SDL_SCANCODE_KP_B | SDLK_SCANCODE_MASK,
+			SDLK_KP_C = (int)SDL_Scancode.SDL_SCANCODE_KP_C | SDLK_SCANCODE_MASK,
+			SDLK_KP_D = (int)SDL_Scancode.SDL_SCANCODE_KP_D | SDLK_SCANCODE_MASK,
+			SDLK_KP_E = (int)SDL_Scancode.SDL_SCANCODE_KP_E | SDLK_SCANCODE_MASK,
+			SDLK_KP_F = (int)SDL_Scancode.SDL_SCANCODE_KP_F | SDLK_SCANCODE_MASK,
+			SDLK_KP_XOR = (int)SDL_Scancode.SDL_SCANCODE_KP_XOR | SDLK_SCANCODE_MASK,
+			SDLK_KP_POWER = (int)SDL_Scancode.SDL_SCANCODE_KP_POWER | SDLK_SCANCODE_MASK,
+			SDLK_KP_PERCENT = (int)SDL_Scancode.SDL_SCANCODE_KP_PERCENT | SDLK_SCANCODE_MASK,
+			SDLK_KP_LESS = (int)SDL_Scancode.SDL_SCANCODE_KP_LESS | SDLK_SCANCODE_MASK,
+			SDLK_KP_GREATER = (int)SDL_Scancode.SDL_SCANCODE_KP_GREATER | SDLK_SCANCODE_MASK,
+			SDLK_KP_AMPERSAND = (int)SDL_Scancode.SDL_SCANCODE_KP_AMPERSAND | SDLK_SCANCODE_MASK,
+			SDLK_KP_DBLAMPERSAND =
+			(int)SDL_Scancode.SDL_SCANCODE_KP_DBLAMPERSAND | SDLK_SCANCODE_MASK,
+			SDLK_KP_VERTICALBAR =
+			(int)SDL_Scancode.SDL_SCANCODE_KP_VERTICALBAR | SDLK_SCANCODE_MASK,
+			SDLK_KP_DBLVERTICALBAR =
+			(int)SDL_Scancode.SDL_SCANCODE_KP_DBLVERTICALBAR | SDLK_SCANCODE_MASK,
+			SDLK_KP_COLON = (int)SDL_Scancode.SDL_SCANCODE_KP_COLON | SDLK_SCANCODE_MASK,
+			SDLK_KP_HASH = (int)SDL_Scancode.SDL_SCANCODE_KP_HASH | SDLK_SCANCODE_MASK,
+			SDLK_KP_SPACE = (int)SDL_Scancode.SDL_SCANCODE_KP_SPACE | SDLK_SCANCODE_MASK,
+			SDLK_KP_AT = (int)SDL_Scancode.SDL_SCANCODE_KP_AT | SDLK_SCANCODE_MASK,
+			SDLK_KP_EXCLAM = (int)SDL_Scancode.SDL_SCANCODE_KP_EXCLAM | SDLK_SCANCODE_MASK,
+			SDLK_KP_MEMSTORE = (int)SDL_Scancode.SDL_SCANCODE_KP_MEMSTORE | SDLK_SCANCODE_MASK,
+			SDLK_KP_MEMRECALL = (int)SDL_Scancode.SDL_SCANCODE_KP_MEMRECALL | SDLK_SCANCODE_MASK,
+			SDLK_KP_MEMCLEAR = (int)SDL_Scancode.SDL_SCANCODE_KP_MEMCLEAR | SDLK_SCANCODE_MASK,
+			SDLK_KP_MEMADD = (int)SDL_Scancode.SDL_SCANCODE_KP_MEMADD | SDLK_SCANCODE_MASK,
+			SDLK_KP_MEMSUBTRACT =
+			(int)SDL_Scancode.SDL_SCANCODE_KP_MEMSUBTRACT | SDLK_SCANCODE_MASK,
+			SDLK_KP_MEMMULTIPLY =
+			(int)SDL_Scancode.SDL_SCANCODE_KP_MEMMULTIPLY | SDLK_SCANCODE_MASK,
+			SDLK_KP_MEMDIVIDE = (int)SDL_Scancode.SDL_SCANCODE_KP_MEMDIVIDE | SDLK_SCANCODE_MASK,
+			SDLK_KP_PLUSMINUS = (int)SDL_Scancode.SDL_SCANCODE_KP_PLUSMINUS | SDLK_SCANCODE_MASK,
+			SDLK_KP_CLEAR = (int)SDL_Scancode.SDL_SCANCODE_KP_CLEAR | SDLK_SCANCODE_MASK,
+			SDLK_KP_CLEARENTRY = (int)SDL_Scancode.SDL_SCANCODE_KP_CLEARENTRY | SDLK_SCANCODE_MASK,
+			SDLK_KP_BINARY = (int)SDL_Scancode.SDL_SCANCODE_KP_BINARY | SDLK_SCANCODE_MASK,
+			SDLK_KP_OCTAL = (int)SDL_Scancode.SDL_SCANCODE_KP_OCTAL | SDLK_SCANCODE_MASK,
+			SDLK_KP_DECIMAL = (int)SDL_Scancode.SDL_SCANCODE_KP_DECIMAL | SDLK_SCANCODE_MASK,
+			SDLK_KP_HEXADECIMAL =
+			(int)SDL_Scancode.SDL_SCANCODE_KP_HEXADECIMAL | SDLK_SCANCODE_MASK,
+
+			SDLK_LCTRL = (int)SDL_Scancode.SDL_SCANCODE_LCTRL | SDLK_SCANCODE_MASK,
+			SDLK_LSHIFT = (int)SDL_Scancode.SDL_SCANCODE_LSHIFT | SDLK_SCANCODE_MASK,
+			SDLK_LALT = (int)SDL_Scancode.SDL_SCANCODE_LALT | SDLK_SCANCODE_MASK,
+			SDLK_LGUI = (int)SDL_Scancode.SDL_SCANCODE_LGUI | SDLK_SCANCODE_MASK,
+			SDLK_RCTRL = (int)SDL_Scancode.SDL_SCANCODE_RCTRL | SDLK_SCANCODE_MASK,
+			SDLK_RSHIFT = (int)SDL_Scancode.SDL_SCANCODE_RSHIFT | SDLK_SCANCODE_MASK,
+			SDLK_RALT = (int)SDL_Scancode.SDL_SCANCODE_RALT | SDLK_SCANCODE_MASK,
+			SDLK_RGUI = (int)SDL_Scancode.SDL_SCANCODE_RGUI | SDLK_SCANCODE_MASK,
+
+			SDLK_MODE = (int)SDL_Scancode.SDL_SCANCODE_MODE | SDLK_SCANCODE_MASK,
+
+			SDLK_AUDIONEXT = (int)SDL_Scancode.SDL_SCANCODE_AUDIONEXT | SDLK_SCANCODE_MASK,
+			SDLK_AUDIOPREV = (int)SDL_Scancode.SDL_SCANCODE_AUDIOPREV | SDLK_SCANCODE_MASK,
+			SDLK_AUDIOSTOP = (int)SDL_Scancode.SDL_SCANCODE_AUDIOSTOP | SDLK_SCANCODE_MASK,
+			SDLK_AUDIOPLAY = (int)SDL_Scancode.SDL_SCANCODE_AUDIOPLAY | SDLK_SCANCODE_MASK,
+			SDLK_AUDIOMUTE = (int)SDL_Scancode.SDL_SCANCODE_AUDIOMUTE | SDLK_SCANCODE_MASK,
+			SDLK_MEDIASELECT = (int)SDL_Scancode.SDL_SCANCODE_MEDIASELECT | SDLK_SCANCODE_MASK,
+			SDLK_WWW = (int)SDL_Scancode.SDL_SCANCODE_WWW | SDLK_SCANCODE_MASK,
+			SDLK_MAIL = (int)SDL_Scancode.SDL_SCANCODE_MAIL | SDLK_SCANCODE_MASK,
+			SDLK_CALCULATOR = (int)SDL_Scancode.SDL_SCANCODE_CALCULATOR | SDLK_SCANCODE_MASK,
+			SDLK_COMPUTER = (int)SDL_Scancode.SDL_SCANCODE_COMPUTER | SDLK_SCANCODE_MASK,
+			SDLK_AC_SEARCH = (int)SDL_Scancode.SDL_SCANCODE_AC_SEARCH | SDLK_SCANCODE_MASK,
+			SDLK_AC_HOME = (int)SDL_Scancode.SDL_SCANCODE_AC_HOME | SDLK_SCANCODE_MASK,
+			SDLK_AC_BACK = (int)SDL_Scancode.SDL_SCANCODE_AC_BACK | SDLK_SCANCODE_MASK,
+			SDLK_AC_FORWARD = (int)SDL_Scancode.SDL_SCANCODE_AC_FORWARD | SDLK_SCANCODE_MASK,
+			SDLK_AC_STOP = (int)SDL_Scancode.SDL_SCANCODE_AC_STOP | SDLK_SCANCODE_MASK,
+			SDLK_AC_REFRESH = (int)SDL_Scancode.SDL_SCANCODE_AC_REFRESH | SDLK_SCANCODE_MASK,
+			SDLK_AC_BOOKMARKS = (int)SDL_Scancode.SDL_SCANCODE_AC_BOOKMARKS | SDLK_SCANCODE_MASK,
+
+			SDLK_BRIGHTNESSDOWN =
+			(int)SDL_Scancode.SDL_SCANCODE_BRIGHTNESSDOWN | SDLK_SCANCODE_MASK,
+			SDLK_BRIGHTNESSUP = (int)SDL_Scancode.SDL_SCANCODE_BRIGHTNESSUP | SDLK_SCANCODE_MASK,
+			SDLK_DISPLAYSWITCH = (int)SDL_Scancode.SDL_SCANCODE_DISPLAYSWITCH | SDLK_SCANCODE_MASK,
+			SDLK_KBDILLUMTOGGLE =
+			(int)SDL_Scancode.SDL_SCANCODE_KBDILLUMTOGGLE | SDLK_SCANCODE_MASK,
+			SDLK_KBDILLUMDOWN = (int)SDL_Scancode.SDL_SCANCODE_KBDILLUMDOWN | SDLK_SCANCODE_MASK,
+			SDLK_KBDILLUMUP = (int)SDL_Scancode.SDL_SCANCODE_KBDILLUMUP | SDLK_SCANCODE_MASK,
+			SDLK_EJECT = (int)SDL_Scancode.SDL_SCANCODE_EJECT | SDLK_SCANCODE_MASK,
+			SDLK_SLEEP = (int)SDL_Scancode.SDL_SCANCODE_SLEEP | SDLK_SCANCODE_MASK
+		}
+	}
+
+}

+ 33 - 0
Attic/AtomicSharp/ScriptObject.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+
+namespace AtomicEngine
+{
+	public class ScriptObject : AObject
+	{
+		public ScriptObject ()
+		{
+			nativeInstance = NativeCore.RegisterNative (csb_Atomic_CSScriptObject_Constructor(), this);	
+		}
+
+		public void SendEvent(string eventType, Dictionary<string, object> eventData = null)
+		{
+			EventCore.SendEvent (this, eventType);
+		}
+
+		public void SubscribeToEvent(AObject sender, string eventType, AtomicEventDelegate function)
+		{
+			EventCore.SubscribeToEvent (this, sender, eventType, function);
+		}
+
+		public void SubscribeToEvent(string eventType, AtomicEventDelegate function)
+		{
+			EventCore.SubscribeToEvent (this, null, eventType, function);
+		}
+
+		[DllImport (Constants.LIBNAME, CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
+		private static extern IntPtr csb_Atomic_CSScriptObject_Constructor();
+	}
+}
+

+ 0 - 0
Bin/.gitkeep → Attic/NETNative/AtomicSharpAPI.cpp


+ 34 - 0
Attic/NETNative/AtomicSharpAPI.h

@@ -0,0 +1,34 @@
+//
+// 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 <AtomicNET/NETCore/CSComponent.h>
+
+namespace Atomic
+{
+
+extern "C"
+{
+
+CSComponent* CSComponentCreate(String name);
+
+void CSComponentCallMethod(unsigned id, CSComponentMethod methodID, float value = 0.0f);
+
+void CSBeginSendEvent(unsigned senderRefID, unsigned eventType, VariantMap* eventData);
+
+void CSEndSendEvent(unsigned senderRefID, unsigned eventType, VariantMap* eventData);
+
+}
+
+}

+ 295 - 0
Attic/NETNative/AtomicSharpApp.cpp

@@ -0,0 +1,295 @@
+//
+// Copyright (c) 2008-2014 the Urho3D project.
+// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
+//
+// 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 <Atomic/Atomic.h>
+#include <Atomic/Engine/Engine.h>
+#include <Atomic/IO/FileSystem.h>
+#include <Atomic/IO/Log.h>
+#include <Atomic/IO/IOEvents.h>
+#include <Atomic/Input/InputEvents.h>
+#include <Atomic/Input/Input.h>
+#include <Atomic/Core/Main.h>
+#include <Atomic/Core/ProcessUtils.h>
+#include <Atomic/Resource/ResourceCache.h>
+#include <Atomic/Resource/ResourceEvents.h>
+#include <Atomic/UI/UI.h>
+
+// Move me
+#include <Atomic/Environment/Environment.h>
+
+#include <AtomicJS/Javascript/Javascript.h>
+
+#include <AtomicPlayer/Player.h>
+
+#include <AtomicNET/NETCore/NETCore.h>
+#include "AtomicSharpApp.h"
+
+#include <Atomic/DebugNew.h>
+
+#ifdef __APPLE__
+#include <unistd.h>
+#endif
+
+DEFINE_APPLICATION_MAIN(AtomicPlayer::AtomicPlayerApp)
+
+namespace AtomicPlayer
+{
+
+    extern void jsapi_init_atomicplayer(JSVM* vm);
+
+    AtomicPlayerApp::AtomicPlayerApp(Context* context) :
+        Application(context)
+    {
+    }
+
+    void AtomicPlayerApp::Setup()
+    {
+
+#ifdef ATOMIC_3D
+        RegisterEnvironmentLibrary(context_);
+#endif
+
+        FileSystem* filesystem = GetSubsystem<FileSystem>();
+
+        engineParameters_["WindowTitle"] = "AtomicPlayer";
+
+#if (ATOMIC_PLATFORM_ANDROID)
+        engineParameters_["FullScreen"] = true;
+        engineParameters_["ResourcePaths"] = "CoreData;PlayerData;Cache;AtomicResources";
+#elif ATOMIC_PLATFORM_WEB
+        engineParameters_["FullScreen"] = false;
+        engineParameters_["ResourcePaths"] = "AtomicResources";
+        // engineParameters_["WindowWidth"] = 1280;
+        // engineParameters_["WindowHeight"] = 720;
+#elif ATOMIC_PLATFORM_IOS
+        engineParameters_["FullScreen"] = false;
+        engineParameters_["ResourcePaths"] = "AtomicResources";
+#else
+        engineParameters_["FullScreen"] = false;
+        engineParameters_["WindowWidth"] = 1280 * .55f;
+        engineParameters_["WindowHeight"] = 720 * .55f;
+        engineParameters_["ResourcePaths"] = "/Users/josh/Dev/atomic/AtomicGameEngineSharp/Resources/CoreData;/Users/josh/Dev/atomic/AtomicGameEngineSharp/Resources/PlayerData;/Users/josh/Dev/atomic/AtomicExamples/BunnyMark/Resources;/Users/josh/Dev/atomic/AtomicExamples/BunnyMark/";
+#endif
+
+#if ATOMIC_PLATFORM_WINDOWS
+        engineParameters_["WindowIcon"] = "Images/AtomicLogo32.png";
+        engineParameters_["ResourcePrefixPath"] = "AtomicPlayer_Resources";
+#elif ATOMIC_PLATFORM_ANDROID
+        //engineParameters_["ResourcePrefixPath"] = "assets";
+#elif ATOMIC_PLATFORM_OSX
+        engineParameters_["ResourcePrefixPath"] = "../Resources";
+#endif
+
+        const Vector<String>& arguments = GetArguments();
+
+        for (unsigned i = 0; i < arguments.Size(); ++i)
+        {
+            if (arguments[i].Length() > 1)
+            {
+                String argument = arguments[i].ToLower();
+                String value = i + 1 < arguments.Size() ? arguments[i + 1] : String::EMPTY;
+
+                if (argument == "--log-std")
+                {
+                    SubscribeToEvent(E_LOGMESSAGE, HANDLER(AtomicPlayerApp, HandleLogMessage));
+                }
+            }
+        }
+
+        // Use the script file name as the base name for the log file
+        engineParameters_["LogName"] = filesystem->GetAppPreferencesDir("AtomicPlayer", "Logs") + "AtomicPlayer.log";
+    }
+
+    void AtomicPlayerApp::Start()
+    {
+        Application::Start();
+
+        // Instantiate and register NETCore subsystem
+        context_->RegisterSubsystem(new NETCore(context_));
+
+        // Instantiate and register the Javascript subsystem
+        Javascript* javascript = new Javascript(context_);
+        context_->RegisterSubsystem(javascript);
+
+        vm_ = javascript->InstantiateVM("MainVM");
+        vm_->InitJSContext();
+
+        UI* ui = GetSubsystem<UI>();
+        ui->Initialize("DefaultUI/language/lng_en.tb.txt");
+        ui->LoadDefaultPlayerSkin();
+
+        vm_->SetModuleSearchPaths("Modules");
+
+        // Instantiate and register the Player subsystem
+        context_->RegisterSubsystem(new AtomicPlayer::Player(context_));
+        AtomicPlayer::jsapi_init_atomicplayer(vm_);
+
+        JSVM* vm = JSVM::GetJSVM(0);
+
+        if (!vm->ExecuteMain())
+        {
+            SendEvent(E_EXITREQUESTED);
+        }
+
+
+        return;
+    }
+
+    void AtomicPlayerApp::Stop()
+    {
+
+        vm_ = 0;
+        context_->RemoveSubsystem<Javascript>();
+        // make sure JSVM is really down and no outstanding refs
+        // as if not, will hold on engine subsystems, which is bad
+        assert(!JSVM::GetJSVM(0));
+
+        context_->RemoveSubsystem<NETCore>();
+
+        Application::Stop();
+
+    }
+
+    void AtomicPlayerApp::HandleScriptReloadStarted(StringHash eventType, VariantMap& eventData)
+    {
+    }
+
+    void AtomicPlayerApp::HandleScriptReloadFinished(StringHash eventType, VariantMap& eventData)
+    {
+    }
+
+    void AtomicPlayerApp::HandleScriptReloadFailed(StringHash eventType, VariantMap& eventData)
+    {
+        ErrorExit();
+    }
+
+    void AtomicPlayerApp::HandleLogMessage(StringHash eventType, VariantMap& eventData)
+    {
+        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)
+        {
+            if (level == LOG_ERROR)
+            {
+                fprintf(stderr, "%s\n", rows[i].CString());
+            }
+            else
+            {
+                fprintf(stdout, "%s\n", rows[i].CString());
+            }
+        }
+
+    }
+
+    int AtomicPlayerApp::Initialize()
+    {
+        try
+        {
+            Setup();
+            if (exitCode_)
+                return exitCode_;
+
+            if (!engine_->Initialize(engineParameters_))
+            {
+                ErrorExit();
+                return exitCode_;
+            }
+
+            Start();
+
+            return exitCode_;
+
+        }
+        catch (std::bad_alloc&)
+        {
+            ErrorDialog(GetTypeName(), "An out-of-memory error occurred. The application will now exit.");
+            return EXIT_FAILURE;
+        }
+    }
+
+    bool AtomicPlayerApp::RunFrame()
+    {
+        try
+        {
+            if (!engine_->IsExiting())
+            {
+                engine_->RunFrame();
+                return true;
+            }
+            else
+                return false;
+        }
+        catch (std::bad_alloc&)
+        {
+            ErrorDialog(GetTypeName(), "An out-of-memory error occurred. The application will now exit.");
+            return EXIT_FAILURE;
+        }
+    }
+
+    int AtomicPlayerApp::Shutdown()
+    {
+        Stop();
+
+        return exitCode_;
+    }
+
+}
+
+static SharedPtr<Atomic::Context> sContext;
+static SharedPtr<AtomicPlayer::AtomicPlayerApp> sApplication;
+
+extern "C" {
+
+#ifdef ATOMIC_PLATFORM_WINDOWS
+#pragma warning(disable: 4244) // possible loss of data
+#define ATOMIC_EXPORT_API __declspec(dllexport)
+#else
+#define ATOMIC_EXPORT_API
+#endif
+
+ATOMIC_EXPORT_API int atomicsharp_initialize()
+{
+    sContext = new Atomic::Context();
+    sApplication = new AtomicPlayer::AtomicPlayerApp(sContext);
+    return sApplication->Initialize();
+}
+
+ATOMIC_EXPORT_API bool atomicsharp_runframe()
+{
+    if (!sApplication->RunFrame())
+    {
+        sApplication->Shutdown();
+
+        sApplication = 0;
+        sContext = 0;
+        return false;
+    }
+
+    return true;
+}
+
+}

+ 72 - 0
Attic/NETNative/AtomicSharpApp.h

@@ -0,0 +1,72 @@
+//
+// Copyright (c) 2008-2014 the Urho3D project.
+// Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
+//
+// 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 <Atomic/Engine/Application.h>
+
+namespace Atomic
+{
+    class JSVM;
+}
+
+using namespace Atomic;
+
+namespace AtomicPlayer
+{
+
+class AtomicPlayerApp : public Application
+{
+    OBJECT(AtomicPlayerApp);
+
+public:
+    /// Construct.
+    AtomicPlayerApp(Context* context);
+
+    /// Setup before engine initialization. Verify that a script file has been specified.
+    virtual void Setup();
+    /// Setup after engine initialization. Load the script and execute its start function.
+    virtual void Start();
+    /// Cleanup after the main loop. Run the script's stop function if it exists.
+    virtual void Stop();
+
+    int Initialize();
+    bool RunFrame();
+    int Shutdown();
+
+private:
+
+    SharedPtr<JSVM> vm_;
+
+    /// Handle reload start of the script file.
+    void HandleScriptReloadStarted(StringHash eventType, VariantMap& eventData);
+    /// Handle reload success of the script file.
+    void HandleScriptReloadFinished(StringHash eventType, VariantMap& eventData);
+    /// Handle reload failure of the script file.
+    void HandleScriptReloadFailed(StringHash eventType, VariantMap& eventData);
+
+    void HandleLogMessage(StringHash eventType, VariantMap& eventData);
+
+};
+
+}

+ 27 - 0
Attic/NETNative/CMakeLists.txt

@@ -0,0 +1,27 @@
+
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}
+                    ${CMAKE_SOURCE_DIR}/Source/ThirdParty
+                    ${CMAKE_SOURCE_DIR}/Source/ThirdParty/rapidjson/include
+                    ${CMAKE_SOURCE_DIR}/Source/ThirdParty/kNet/include
+                    ${CMAKE_SOURCE_DIR}/Source/ThirdParty/FreeType/include
+                    ${CMAKE_SOURCE_DIR}/Source/ThirdParty/Box2D )
+
+
+file (GLOB CSHARP_SOURCES *.cpp *.h)
+
+if (NOT MSVC)
+    # for kNet
+    add_definitions (-DUNIX)
+endif()
+
+set (SOURCE_FILES ${CSHARP_SOURCES} ${CSHARP_BINDINGS_SOURCE} ${CSHARPATOMICPLAYER_BINDINGS_SOURCE})
+
+add_library(AtomicNETNative SHARED ${SOURCE_FILES})
+
+target_link_libraries(AtomicNETNative AtomicJS AtomicPlayerLib AtomicPlayerJS NETCore ${ATOMIC_LINK_LIBRARIES})
+
+if (APPLE)
+
+target_link_libraries(AtomicNETNative "-framework AudioUnit -framework Carbon -framework Cocoa -framework CoreAudio -framework ForceFeedback -framework IOKit -framework OpenGL -framework CoreServices -framework Security")
+
+endif()

+ 2 - 0
Build/CIScripts/Build.js

@@ -0,0 +1,2 @@
+
+var host = require("./Host");

+ 44 - 0
Build/CIScripts/BuildAndroid.js

@@ -0,0 +1,44 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var buildDir = bcommon.artifactsRoot + "Build/Android/";
+var playerBuildDir = buildDir + "AtomicPlayer/";
+
+namespace('build', function() {
+
+  task('android_player', {
+    async: true
+  }, function() {
+
+    bcommon.cleanCreateDir(playerBuildDir);
+    bcommon.cleanCreateDir(bcommon.getGenScriptRootDir("ANDROID"));
+
+    var atomicTool = host.getAtomicToolBinary();
+
+    process.chdir(playerBuildDir);
+
+    var cmds = [
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Atomic/ ANDROID",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicPlayer/ ANDROID"
+    ];
+
+    cmds.push("cmake -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=" + bcommon.atomicRoot + "Build//CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../../../");
+    cmds.push("make -j4");
+
+    jake.exec(cmds, function() {
+
+      var androidPlayerBinary = playerBuildDir + "Source/AtomicPlayer/Application/libAtomicPlayer.so";
+      fs.copySync(androidPlayerBinary, buildDir + "Bin/libAtomicPlayer.so");
+
+      console.log("Built Android Player");
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 67 - 0
Build/CIScripts/BuildCommon.js

@@ -0,0 +1,67 @@
+var os = require('os');
+var path = require('path');
+
+// get the root folder
+var atomicRoot = path.resolve(__dirname, "../..") + "/";
+
+// patch in our local node_modules
+process.env.NODE_PATH = atomicRoot + "Build/node_modules/";
+require('module').Module._initPaths();
+var fs = require('fs-extra');
+
+var artifactsRoot = atomicRoot + "Artifacts/";
+var jenkinsBuild = process.env.ATOMIC_JENKINS_BUILD == 1;
+var buildSHA = process.env.ATOMIC_BUILD_SHA;
+
+function cleanCreateDir(directory) {
+
+  testRemoveDir(directory);
+  testCreateDir(directory);
+
+}
+
+function testCreateDir(directory) {
+
+  if (fs.existsSync(directory)) {
+    fail("Path already exists: " + directory);
+  }
+
+  jake.mkdirP(directory);
+
+  if (!fs.existsSync(directory)) {
+    fail("Unable to create path: " + directory);
+  }
+}
+
+
+function testRemoveDir(path) {
+
+  if (fs.existsSync(path)) {
+    jake.rmRf(path);
+  }
+
+  if (fs.existsSync(path)) {
+    fail("Unable to remove path: " + path);
+  }
+}
+
+function getGenScriptRootDir(platform) {
+
+  return atomicRoot + "Artifacts/Build/Source/Generated/" + platform + "/";
+
+}
+
+
+function cloneRepo(repoUrl, destPath) {
+
+}
+
+exports.jenkinsBuild = jenkinsBuild;
+exports.buildSHA = buildSHA;
+exports.atomicRoot = atomicRoot;
+exports.artifactsRoot = artifactsRoot;
+exports.testRemoveDir = testRemoveDir;
+exports.testCreateDir = testCreateDir;
+exports.cloneRepo = cloneRepo;
+exports.cleanCreateDir = cleanCreateDir;
+exports.getGenScriptRootDir = getGenScriptRootDir;

+ 49 - 0
Build/CIScripts/BuildIOS.js

@@ -0,0 +1,49 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var buildDir = bcommon.artifactsRoot + "Build/IOS/";
+
+namespace('build', function() {
+
+  task('ios_player', {
+    async: true
+  }, function() {
+
+    var atomicTool = host.getAtomicToolBinary();
+
+    var playerBuildDir = buildDir + "AtomicPlayer/";
+
+    bcommon.cleanCreateDir(playerBuildDir);
+    bcommon.cleanCreateDir(bcommon.getGenScriptRootDir("IOS"));
+
+    process.chdir(playerBuildDir);
+
+    var cmds = [
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Atomic/ IOS",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicPlayer/ IOS",
+      "cmake -DIOS=1 -G Xcode ../../../../"
+    ];
+
+    if (bcommon.jenkinsBuild) {
+
+      cmds.push("security -v list-keychains -d system -s /Users/jenkins/Library/Keychains/codesign.keychain");
+      cmds.push("security -v unlock-keychain /Users/jenkins/Library/Keychains/codesign.keychain");
+
+    }
+
+    cmds.push("xcodebuild -configuration Release");
+
+    jake.exec(cmds, function() {
+      var iosPlayerBinary = playerBuildDir + "Source/AtomicPlayer/Application/Release-iphoneos/AtomicPlayer.app/AtomicPlayer";
+      fs.copySync(iosPlayerBinary, buildDir + "Bin/AtomicPlayer");
+      console.log("Built IOS Player");
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 0 - 0
Build/CIScripts/BuildLinux.js


+ 75 - 0
Build/CIScripts/BuildMac.js

@@ -0,0 +1,75 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var buildDir = bcommon.artifactsRoot + "Build/Mac/";
+
+namespace('build', function() {
+
+  task('mac_player', {
+    async: true
+  }, function() {
+
+    var atomicTool = host.getAtomicToolBinary();
+
+    var playerBuildDir = buildDir + "AtomicPlayer/";
+
+    bcommon.cleanCreateDir(playerBuildDir);
+    bcommon.cleanCreateDir(bcommon.getGenScriptRootDir("MACOSX"));
+
+    process.chdir(playerBuildDir);
+
+    var cmds = [
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Atomic/ MACOSX",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicPlayer/ MACOSX",
+      "cmake -DATOMIC_DEV_BUILD=0 -G Xcode ../../../../",
+      "xcodebuild -target AtomicPlayer -configuration Release"
+    ];
+
+    jake.exec(cmds, function() {
+      var macPlayerBinary = playerBuildDir + "Source/AtomicPlayer/Application/Release/AtomicPlayer.app/Contents/MacOS/AtomicPlayer";
+      fs.copySync(macPlayerBinary, buildDir + "Bin/AtomicPlayer");
+      console.log("Built Mac Player");
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+  task('mac_editor', {
+    async: true
+  }, function() {
+
+    var atomicTool = host.getAtomicToolBinary();
+
+    var editorBuildDir = buildDir + "AtomicEditor/";
+
+    bcommon.cleanCreateDir(editorBuildDir);
+
+    process.chdir(editorBuildDir);
+
+    var cmds = [
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Atomic/ MACOSX",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicPlayer/ MACOSX",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/ToolCore/ MACOSX",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Editor/ MACOSX",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicNET/ MACOSX",
+      "cmake -DATOMIC_DEV_BUILD=0 -G Xcode ../../../../",
+      "xcodebuild -target AtomicEditor -configuration Release"
+    ];
+
+    jake.exec(cmds, function() {
+      var macEditorBinary = editorBuildDir + "Source/AtomicEditor/Release/AtomicEditor.app/Contents/MacOS/AtomicEditor";
+      fs.copySync(macEditorBinary, buildDir + "Bin/AtomicEditor");
+      console.log("Built Mac Editor");
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 51 - 0
Build/CIScripts/BuildWeb.js

@@ -0,0 +1,51 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var buildDir = bcommon.artifactsRoot + "Build/Web/";
+
+namespace('build', function() {
+
+  task('web_player', {
+    async: true
+  }, function() {
+
+    var atomicTool = host.getAtomicToolBinary();
+
+    var playerBuildDir = buildDir + "AtomicPlayer/";
+
+    bcommon.cleanCreateDir(playerBuildDir);
+    bcommon.cleanCreateDir(bcommon.getGenScriptRootDir("WEB"));
+
+    process.chdir(playerBuildDir);
+
+    var cmds = [
+
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/Atomic/ WEB",
+      atomicTool + " bind " + bcommon.atomicRoot + " Script/Packages/AtomicPlayer/ WEB",
+      "cmake -DEMSCRIPTEN=1 -DATOMIC_BUILD_2D=1 -DCMAKE_TOOLCHAIN_FILE=" + bcommon.atomicRoot + "Build/CMake/Toolchains/emscripten.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../../../",
+      "make -j4",
+      "cd ./Source/AtomicPlayer/Application && mv ./AtomicPlayer ./AtomicPlayer.bc && " +
+      // -s ERROR_ON_UNDEFINED_SYMBOLS=1 (disabled for pthread errors currently on incoming)
+      "emcc -O3 -s USE_PTHREADS=0 -s ASM_JS=1 -s VERBOSE=0 -s USE_SDL=2 -s TOTAL_MEMORY=134217728 -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s NO_EXIT_RUNTIME=1 ./AtomicPlayer.bc -o  ./AtomicPlayer.html"
+
+    ]
+
+    jake.exec(cmds, function() {
+
+      var webPlayerBinary = playerBuildDir + "Source/AtomicPlayer/Application/AtomicPlayer.js";
+      var webPlayerMemFile = playerBuildDir + "Source/AtomicPlayer/Application/AtomicPlayer.html.mem";
+
+      fs.copySync(webPlayerBinary, buildDir + "Bin/AtomicPlayer.js");
+      fs.copySync(webPlayerMemFile, buildDir + "Bin/AtomicPlayer.html.mem");
+
+      console.log("Built Web Player");
+
+      complete();
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 53 - 0
Build/CIScripts/BuildWindows.js

@@ -0,0 +1,53 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var atomicRoot = bcommon.atomicRoot;
+var buildDir = bcommon.artifactsRoot + "Build/Windows/";
+var atomicToolBinary = buildDir + "Source/AtomicTool/Release/AtomicTool.exe";
+
+namespace('build', function() {
+
+  task('atomic', {
+    async: true
+  }, function() {
+
+    bcommon.cleanCreateDir(buildDir);
+    bcommon.cleanCreateDir(bcommon.getGenScriptRootDir("WINDOWS"));
+
+    process.chdir(buildDir);
+
+    var bindCmd = atomicToolBinary + " bind \"" + atomicRoot + "\" ";
+
+    var cmds = [
+      atomicRoot + "/Build/CIScripts/Windows/CompileAtomicTool.bat",
+      bindCmd + "Script/Packages/Atomic/ WINDOWS",
+      bindCmd + "Script/Packages/AtomicPlayer/ WINDOWS",
+      bindCmd + "Script/Packages/ToolCore/ WINDOWS",
+      bindCmd + "Script/Packages/Editor/ WINDOWS",
+      bindCmd + "Script/Packages/AtomicNET/ WINDOWS",
+      atomicRoot + "/Build/CIScripts/Windows/CompileAtomic.bat",
+    ]
+
+    jake.exec(cmds, function() {
+
+      var winEditorBinary = buildDir + "Source/AtomicEditor/Release/AtomicEditor.exe";
+      var winEditorD3DBinary = buildDir + "Source/AtomicEditor/Release/D3DCompiler_47.dll";
+      var winPlayerBinary = buildDir + "Source/AtomicPlayer/Application/Release/AtomicPlayer.exe";
+      var winPlayerD3DBinary = buildDir + "Source/AtomicPlayer/Application/Release/D3DCompiler_47.dll";
+
+      fs.copySync(winEditorBinary, buildDir + "Bin/AtomicEditor.exe");
+      fs.copySync(winEditorD3DBinary, buildDir + "Bin/D3DCompiler_47.dll");
+      fs.copySync(winPlayerBinary, buildDir + "Bin/AtomicPlayer.exe");
+
+      console.log("Built Windows AtomicEditor & Player");
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 194 - 0
Build/CIScripts/GenEditorData.js

@@ -0,0 +1,194 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var buildDir = bcommon.artifactsRoot + "Build/EditorData/";
+var jsDocFolder = bcommon.artifactsRoot + "Build/JSDoc/";
+var atomicRoot = bcommon.atomicRoot;
+var atomicTool = host.getAtomicToolBinary();
+
+namespace('build', function() {
+
+  task('genscriptbindings', {
+    async: true
+  }, function() {
+
+    bcommon.cleanCreateDir(buildDir);
+    bcommon.cleanCreateDir(jsDocFolder);
+
+    var bindCmd = atomicTool + " bind \"" + atomicRoot + "\" ";
+
+    var cmds = [
+      bindCmd + "Script/Packages/Atomic/ WINDOWS",
+      bindCmd + "Script/Packages/AtomicPlayer/ WINDOWS",
+      bindCmd + "Script/Packages/ToolCore/ WINDOWS",
+      bindCmd + "Script/Packages/Editor/ WINDOWS",
+      bindCmd + "Script/Packages/AtomicNET/ WINDOWS",
+    ];
+
+    jake.exec(cmds, function() {
+
+      console.log("Built Script Bindings");
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+  task('gendocs', ["build:genscriptbindings"], {
+    async: true
+  }, function() {
+
+    console.log("Generating Examples & JSDocs");
+
+    fs.copySync(atomicRoot + "Build/Docs/Readme.md", jsDocFolder + "/Readme.md");
+    fs.copySync(atomicRoot + "Build/Docs/jsdoc.conf", jsDocFolder + "/jsdoc.conf");
+
+    cmds = [
+      "git clone https://github.com/AtomicGameEngine/AtomicExamples " + buildDir + "AtomicExamples && rm -rf " + buildDir + "AtomicExamples/.git",
+      "cd " + jsDocFolder + " && npm install git+https://github.com/jsdoc3/jsdoc",
+      "cd " + jsDocFolder + " && git clone https://github.com/AtomicGameEngine/jaguarjs-jsdoc && cd jaguarjs-jsdoc && git checkout atomic_master",
+      "cd " + jsDocFolder + " && ./node_modules/.bin/jsdoc ./Atomic.js -t ./jaguarjs-jsdoc/ -c ./jsdoc.conf Readme.md",
+    ];
+
+    jake.exec(cmds, function() {
+
+      fs.copySync(jsDocFolder + "out", buildDir + "Docs");
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+
+  });
+
+  task('ios_deploy', {
+    async: true
+  }, function() {
+
+    var iosDeploybuildDir = bcommon.artifactsRoot + "Build/IOSDeploy/";
+
+    bcommon.cleanCreateDir(iosDeploybuildDir);
+
+    process.chdir(iosDeploybuildDir);
+
+    jake.exec("git clone https://github.com/AtomicGameEngine/ios-deploy && cd ios-deploy && make ios-deploy",
+      function() {
+
+        complete();
+      }, {
+        printStdout: true
+      });
+
+  });
+
+  task('compileeditorscripts', ["build:genscriptbindings"],{
+    async: true
+  }, function() {
+
+    console.log("Compiling Editor Scripts");
+
+    process.chdir(atomicRoot);
+
+    cmds = [
+      atomicRoot + "Build/Mac/node/node " + atomicRoot + "/Build/TypeScript/tsc.js -p ./Script"
+    ];
+
+    jake.exec(cmds, function() {
+
+      // will be copied when editor resources are copied
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+
+  });
+
+  task('geneditordata', ["build:compileeditorscripts", "build:ios_deploy", "build:gendocs"], {
+    async: true
+  }, function() {
+
+    // Mac App
+
+    fs.copySync(atomicRoot + "Build/CIScripts/Mac/EditorApp",
+      buildDir + "MacApps/EditorApp");
+
+    fs.copySync(atomicRoot + "Build/CIScripts/Mac/PlayerApp/",
+      buildDir + "MacApps/PlayerApp/");
+
+    // Editor Binaries
+
+    fs.copySync(bcommon.artifactsRoot + "Build/Mac/Bin/AtomicEditor",
+      buildDir + "EditorBinaries/Mac/AtomicEditor");
+
+    fs.copySync(bcommon.artifactsRoot + "Build/Windows/Bin/AtomicEditor.exe",
+      buildDir + "EditorBinaries/Windows/AtomicEditor.exe");
+
+    fs.copySync(bcommon.artifactsRoot + "Build/Windows/Bin/D3DCompiler_47.dll",
+      buildDir + "EditorBinaries/Windows/D3DCompiler_47.dll");
+
+    // Resources
+
+    fs.copySync(atomicRoot + "Resources/CoreData", buildDir + "Resources/CoreData");
+    fs.copySync(atomicRoot + "Resources/EditorData", buildDir + "Resources/EditorData");
+    fs.copySync(atomicRoot + "Resources/PlayerData", buildDir + "Resources/PlayerData");
+    fs.copySync(atomicRoot + "/Data/AtomicEditor", buildDir + "Resources/ToolData");
+
+    fs.copySync(atomicRoot + "Artifacts/Build/Resources/EditorData/AtomicEditor/EditorScripts",
+      buildDir + "Resources/EditorData/AtomicEditor/EditorScripts");
+
+    // root deployment
+    var deployRoot = buildDir + "Resources/ToolData/Deployment/";
+
+    fs.copySync(atomicRoot + "/Data/AtomicEditor/Deployment/", deployRoot);
+
+    // Android
+    fs.copySync(bcommon.artifactsRoot + "Build/Android/Bin/libAtomicPlayer.so",
+      deployRoot + "Android/libs/armeabi-v7a/libAtomicPlayer.so");
+
+    // Mac
+    fs.copySync(bcommon.artifactsRoot + "Build/Mac/Bin/AtomicPlayer",
+      deployRoot + "MacOS/AtomicPlayer.app/Contents/MacOS/AtomicPlayer");
+
+    // IOS
+    fs.copySync(bcommon.artifactsRoot + "Build/IOSDeploy/ios-deploy/ios-deploy",
+      deployRoot + "IOS/ios-deploy/ios-deploy");
+    fs.copySync(bcommon.artifactsRoot + "Build/IOS/Bin/AtomicPlayer",
+      deployRoot + "IOS/AtomicPlayer.app/AtomicPlayer");
+
+    // Web
+    fs.copySync(bcommon.artifactsRoot + "Build/Web/Bin/AtomicPlayer.js",
+      deployRoot + "Web/AtomicPlayer.js");
+    fs.copySync(bcommon.artifactsRoot + "Build/Web/Bin/AtomicPlayer.html.mem",
+      deployRoot + "Web/AtomicPlayer.html.mem");
+
+    // Windows
+    fs.copySync(bcommon.artifactsRoot + "Build/Windows/Bin/AtomicPlayer.exe",
+      deployRoot + "Windows/x64/AtomicPlayer.exe");
+    fs.copySync(bcommon.artifactsRoot + "Build/Windows/Bin/D3DCompiler_47.dll",
+      deployRoot + "Windows/x64/D3DCompiler_47.dll");
+
+
+    complete();
+
+    process.chdir(buildDir);
+
+    var cmds = ["zip -r -X ./EditorData.zip ./"];
+
+    jake.exec(cmds,
+      function() {
+        complete();
+      }, {
+        printStdout: true
+      });
+
+  });
+
+}); // end of build namespace

+ 86 - 0
Build/CIScripts/GenMacEditor.js

@@ -0,0 +1,86 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var atomicRoot = bcommon.atomicRoot;
+var srcDir = bcommon.artifactsRoot + "Build/EditorData/";
+var dstDir = bcommon.artifactsRoot + "Build/MacEditor/";
+
+namespace('build', function() {
+
+  task('genmaceditorinstaller', ["genmaceditor"], {
+    async: true
+  }, function() {
+
+      bcommon.cleanCreateDir(dstDir + "MacEditorInstaller");
+
+      var editorAppFolder = dstDir + "AtomicEditor.app";
+
+      cmds = [
+      "chmod +x " + editorAppFolder + "/Contents/MacOS/AtomicEditor",
+      "chmod +x " + editorAppFolder + "/Contents/Resources/ToolData/Deployment/MacOS/AtomicPlayer.app/Contents/MacOS/AtomicPlayer",
+      "security unlock-keychain -p \"jenkins\" /Users/jenkins/Library/Keychains/login.keychain",
+      "codesign -s \"THUNDERBEAST GAMES LLC\" -f -v " + editorAppFolder,
+      "cd " + dstDir + " && zip -r -X " + "./MacEditorInstaller/AtomicEditor_MacOSX_" + bcommon.buildSHA + ".zip ./AtomicEditor.app"
+    ];
+
+    jake.exec(cmds, function() {
+
+      console.log("Built Mac Editor");
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+
+  });
+
+  task('genmaceditor', {
+    async: true
+  }, function() {
+
+    bcommon.cleanCreateDir(dstDir);
+
+    cmds = ["unzip " + srcDir + "EditorData.zip -d " + srcDir];
+
+    jake.exec(cmds, function() {
+
+      console.log("Generating Mac App Bundle");
+
+      var editorAppFolder = dstDir + "AtomicEditor.app/Contents/";
+
+      fs.copySync(srcDir + "MacApps/EditorApp",
+        editorAppFolder);
+
+      fs.copySync(srcDir + "EditorBinaries/Mac/AtomicEditor",
+        editorAppFolder + "MacOS/AtomicEditor");
+
+      fs.copySync(srcDir + "Resources/CoreData",
+        editorAppFolder + "Resources/CoreData");
+
+      fs.copySync(srcDir + "Resources/EditorData",
+        editorAppFolder + "Resources/EditorData");
+
+      fs.copySync(srcDir + "Resources/PlayerData",
+        editorAppFolder + "Resources/PlayerData");
+
+      fs.copySync(srcDir + "Resources/ToolData",
+        editorAppFolder + "Resources/ToolData");
+
+      fs.copySync(srcDir + "AtomicExamples",
+        editorAppFolder + "Resources/ToolData/AtomicExamples");
+
+      fs.copySync(srcDir + "Docs",
+        editorAppFolder + "Resources/ToolData/Docs/JSDocs");
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 101 - 0
Build/CIScripts/GenWindowsEditor.js

@@ -0,0 +1,101 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+var host = require("./Host");
+
+var atomicRoot = bcommon.atomicRoot;
+var srcDir = bcommon.artifactsRoot + "Build/EditorData/";
+var dstDir = bcommon.artifactsRoot + "Build/WindowsEditor/";
+
+namespace('build', function() {
+
+  task('genwindowsinstaller', ["build:genwindowseditor"], {
+    async: true
+  }, function() {
+
+    console.log("Creating Windows Installer");
+
+    bcommon.cleanCreateDir(bcommon.artifactsRoot + "Build/WindowsInstaller");
+
+    var installerName = "AtomicEditorSetup_" + bcommon.buildSHA + ".exe";
+    var installerPath = bcommon.artifactsRoot + "Build/WindowsInstaller/" + installerName;
+
+    var nsisDefines = "/DATOMIC_ROOT=" + atomicRoot;
+    nsisDefines += " /DEDITOR_VERSION=1";
+    nsisDefines += " /DINSTALLER_NAME=" + installerName;
+
+    var makeNSISCmd = atomicRoot + "\\Build\\CIScripts\\Windows\\CreateInstaller.bat";
+
+    makeNSISCmd += " " + nsisDefines + " " + atomicRoot + "/Build/CIScripts/Windows/Installer/AtomicEditor.nsi";
+
+    var editorExe = dstDir + "AtomicEditor/AtomicEditor.exe";
+
+    var pfxFile = process.env.ATOMIC_PFX_FILE;
+    var pfxPW = process.env.ATOMIC_PFX_PW;
+
+    var signBaseCmd = "signtool.exe sign /f " + pfxFile;
+    signBaseCmd += " /p " + pfxPW;
+    signBaseCmd += " /t http://timestamp.verisign.com/scripts/timestamp.dll";
+    signBaseCmd += " /v ";
+
+    var signEditorCmd = signBaseCmd + editorExe;
+    var signInstallerCmd = signBaseCmd + installerPath;
+
+    var cmds = [signEditorCmd, makeNSISCmd, signInstallerCmd];
+
+    jake.exec(cmds, function() {
+      complete();
+    }, {
+      printStdout: true
+    });
+
+  });
+
+  task('genwindowseditor', {
+    async: true
+  }, function() {
+
+    bcommon.cleanCreateDir(dstDir);
+
+    process.chdir(srcDir);
+
+    cmds = [ atomicRoot + "Build/Windows/7z/7z.exe x -y EditorData.zip"];
+
+    jake.exec(cmds, function() {
+
+    console.log("Generating Windows Editor");
+
+    var editorAppFolder = dstDir + "AtomicEditor/";
+
+    fs.copySync(srcDir + "EditorBinaries/Windows/AtomicEditor.exe",
+      editorAppFolder + "AtomicEditor.exe");
+
+    fs.copySync(srcDir + "EditorBinaries/Windows/D3DCompiler_47.dll",
+      editorAppFolder + "D3DCompiler_47.dll");
+
+    fs.copySync(srcDir + "Resources/CoreData",
+      editorAppFolder + "Resources/CoreData");
+
+    fs.copySync(srcDir + "Resources/EditorData",
+      editorAppFolder + "Resources/EditorData");
+
+    fs.copySync(srcDir + "Resources/PlayerData",
+      editorAppFolder + "Resources/PlayerData");
+
+    fs.copySync(srcDir + "Resources/ToolData",
+      editorAppFolder + "Resources/ToolData");
+
+    fs.copySync(srcDir + "AtomicExamples",
+      editorAppFolder + "Resources/ToolData/AtomicExamples");
+
+    fs.copySync(srcDir + "Docs",
+      editorAppFolder + "Resources/ToolData/Docs/JSDocs");
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 17 - 0
Build/CIScripts/Host.js

@@ -0,0 +1,17 @@
+var os = require('os');
+
+if (os.platform() == "darwin") {
+
+  module.exports = require("./HostMac");
+  require("./BuildMac");
+  require("./BuildIOS");
+  require("./BuildWeb");
+  require("./BuildAndroid");
+  require("./GenEditorData");
+  require("./GenMacEditor");
+
+} else if (os.platform() == "win32") {
+  module.exports = require("./HostWindows");
+  require("./BuildWindows");
+  require("./GenWindowsEditor");
+}

+ 53 - 0
Build/CIScripts/HostMac.js

@@ -0,0 +1,53 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+
+var buildDir = bcommon.artifactsRoot + "Build/Mac/";
+var atomicToolBinary = buildDir + "Bin/AtomicTool";
+
+function clean() {
+
+  bcommon.testRemoveDir(buildDir);
+
+}
+
+function getAtomicToolBinary() {
+
+  return atomicToolBinary;
+
+}
+
+namespace('build', function() {
+
+  task('atomictool', {
+    async: true
+  }, function() {
+
+    var toolBuildDir = buildDir + "AtomicTool/";
+
+    bcommon.cleanCreateDir(toolBuildDir);
+
+    process.chdir(toolBuildDir);
+
+    var cmds = [
+      'cmake ../../../../ -DATOMICTOOL_NOGEN=1 -G Xcode',
+      'xcodebuild -target AtomicTool -configuration Release'
+    ]
+
+    jake.exec(cmds, function() {
+
+      var srcToolBinary = toolBuildDir + "Source/AtomicTool/Release/AtomicTool"
+      fs.copySync(srcToolBinary, atomicToolBinary);
+      console.log("Built MacOSX AtomicTool");
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace
+
+
+exports.clean = clean;
+exports.getAtomicToolBinary = getAtomicToolBinary;

+ 53 - 0
Build/CIScripts/HostWindows.js

@@ -0,0 +1,53 @@
+var fs = require('fs-extra');
+var bcommon = require("./BuildCommon");
+
+var buildDir = bcommon.artifactsRoot + "Build/Windows/";
+var atomicToolBinary = buildDir + "Bin/AtomicTool";
+
+function clean() {
+
+  bcommon.testRemoveDir(buildDir);
+
+}
+
+function getAtomicToolBinary() {
+
+  return atomicToolBinary;
+
+}
+
+namespace('build', function() {
+
+  task('atomictool', {
+    async: true
+  }, function() {
+
+    var toolBuildDir = buildDir + "AtomicTool/";
+
+    bcommon.cleanCreateDir(toolBuildDir);
+
+    process.chdir(toolBuildDir);
+
+    var cmds = [
+      'cmake ../../../../ -DATOMICTOOL_NOGEN=1 -G "Visual Studio "',
+      'xcodebuild -target AtomicTool -configuration Release'
+    ]
+
+    jake.exec(cmds, function() {
+
+      var srcToolBinary = toolBuildDir + "Source/AtomicTool/Release/AtomicTool"
+      fs.copySync(srcToolBinary, atomicToolBinary);
+      console.log("Built MacOSX AtomicTool");
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace
+
+
+exports.clean = clean;
+exports.getAtomicToolBinary = getAtomicToolBinary;

+ 53 - 0
Build/CIScripts/Mac/EditorApp/Info.plist

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildMachineOSBuild</key>
+	<string>15B42</string>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>AtomicEditor</string>
+	<key>CFBundleIconFile</key>
+	<string>Atomic.icns</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleLongVersionString</key>
+	<string></string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleSupportedPlatforms</key>
+	<array>
+		<string>MacOSX</string>
+	</array>
+	<key>CFBundleVersion</key>
+	<string></string>
+	<key>CSResourcesFileMapped</key>
+	<true/>
+	<key>DTCompiler</key>
+	<string>com.apple.compilers.llvm.clang.1_0</string>
+	<key>DTPlatformBuild</key>
+	<string>7A1001</string>
+	<key>DTPlatformVersion</key>
+	<string>GM</string>
+	<key>DTSDKBuild</key>
+	<string>15A278</string>
+	<key>DTSDKName</key>
+	<string>macosx10.11</string>
+	<key>DTXcode</key>
+	<string>0701</string>
+	<key>DTXcodeBuild</key>
+	<string>7A1001</string>
+	<key>LSEnvironment</key>
+	<dict>
+		<key>URHO3D_PREFIX_PATH</key>
+		<string>../Resources</string>
+	</dict>
+	<key>LSRequiresCarbon</key>
+	<true/>
+	<key>NSHumanReadableCopyright</key>
+	<string></string>
+</dict>
+</plist>

+ 1 - 0
Build/CIScripts/Mac/EditorApp/PkgInfo

@@ -0,0 +1 @@
+APPL????

+ 0 - 0
CMake/Modules/Atomic.icns → Build/CIScripts/Mac/EditorApp/Resources/Atomic.icns


+ 53 - 0
Build/CIScripts/Mac/PlayerApp/Info.plist

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildMachineOSBuild</key>
+	<string>15B42</string>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>English</string>
+	<key>CFBundleExecutable</key>
+	<string>AtomicPlayer</string>
+	<key>CFBundleIconFile</key>
+	<string>Atomic.icns</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleLongVersionString</key>
+	<string></string>
+	<key>CFBundlePackageType</key>
+	<string>APPL</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleSupportedPlatforms</key>
+	<array>
+		<string>MacOSX</string>
+	</array>
+	<key>CFBundleVersion</key>
+	<string></string>
+	<key>CSResourcesFileMapped</key>
+	<true/>
+	<key>DTCompiler</key>
+	<string>com.apple.compilers.llvm.clang.1_0</string>
+	<key>DTPlatformBuild</key>
+	<string>7A1001</string>
+	<key>DTPlatformVersion</key>
+	<string>GM</string>
+	<key>DTSDKBuild</key>
+	<string>15A278</string>
+	<key>DTSDKName</key>
+	<string>macosx10.11</string>
+	<key>DTXcode</key>
+	<string>0701</string>
+	<key>DTXcodeBuild</key>
+	<string>7A1001</string>
+	<key>LSEnvironment</key>
+	<dict>
+		<key>URHO3D_PREFIX_PATH</key>
+		<string>../Resources</string>
+	</dict>
+	<key>LSRequiresCarbon</key>
+	<true/>
+	<key>NSHumanReadableCopyright</key>
+	<string></string>
+</dict>
+</plist>

+ 1 - 0
Build/CIScripts/Mac/PlayerApp/PkgInfo

@@ -0,0 +1 @@
+APPL????

BIN
Build/CIScripts/Mac/PlayerApp/Resources/Atomic.icns


+ 3 - 0
Build/CIScripts/Windows/CompileAtomic.bat

@@ -0,0 +1,3 @@
+call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
+cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
+msbuild /m Atomic.sln /p:Configuration=Release /p:Platform=x64

+ 3 - 0
Build/CIScripts/Windows/CompileAtomicTool.bat

@@ -0,0 +1,3 @@
+call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
+cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
+msbuild /m Atomic.sln /t:AtomicTool /p:Configuration=Release /p:Platform=x64

+ 1 - 0
Build/CIScripts/Windows/CreateInstaller.bat

@@ -0,0 +1 @@
+"C:\Program Files (x86)\NSIS\makensis.exe" %1=%2 %3=%4 %5=%6 %7

+ 138 - 0
Build/CIScripts/Windows/Installer/AtomicEditor.nsi

@@ -0,0 +1,138 @@
+;--------------------------------
+;Atomic Editor NSIS Installation Script
+;--------------------------------
+
+!ifndef ATOMIC_ROOT
+!error "ATOMIC_ROOT NOT DEFINED"
+!endif
+
+!ifndef EDITOR_VERSION
+!error "EDITOR_VERSION NOT DEFINED"
+!endif
+
+!ifndef INSTALLER_NAME
+!error "INSTALLER_NAME NOT DEFINED"
+!endif
+
+!define prodname "Atomic Editor"
+!define coname "THUNDERBEAST GAMES LLC"
+!define outfile "${ATOMIC_ROOT}\Artifacts\Build\WindowsInstaller\${INSTALLER_NAME}"
+!define appexe "AtomicEditor.exe"
+!define produrl "http://www.atomicgameengine.com/"
+
+;--------------------------------
+;Include Modern UI
+;--------------------------------
+
+!include "MUI.nsh"
+
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_RIGHT
+!define MUI_HEADERIMAGE_BITMAP "Windows_Installer_Header.bmp"
+!define MUI_WELCOMEFINISHPAGE_BITMAP "Windows_Installer_LeftImage.bmp"
+!define MUI_HEADERIMAGE_UNBITMAP "Windows_Installer_Header.bmp"
+!define MUI_HEADER_TRANSPARENT_TEXT
+
+;--------------------------------
+;General
+;--------------------------------
+
+;Name and file
+Name "${prodname}"
+OutFile "${outfile}"
+RequestExecutionLevel admin
+
+;Default installation folder
+InstallDir "$PROGRAMFILES64\${prodname}"
+
+;Get installation folder from registry if available
+InstallDirRegKey HKLM "Software\${coname}\InstallDir" "${prodname}"
+
+;--------------------------------
+;Interface Settings
+;--------------------------------
+
+!define MUI_ABORTWARNING
+
+;--------------------------------
+;Pages
+;--------------------------------
+
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+	; These indented statements modify settings for MUI_PAGE_FINISH
+	!define MUI_FINISHPAGE_NOAUTOCLOSE
+	!define MUI_FINISHPAGE_RUN "$INSTDIR\AtomicEditor\${appexe}"
+	!define MUI_FINISHPAGE_RUN_CHECKED
+	!define MUI_FINISHPAGE_RUN_TEXT "Launch the Atomic Editor"
+!insertmacro MUI_PAGE_FINISH
+
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+;--------------------------------
+;Languages
+;--------------------------------
+
+!insertmacro MUI_LANGUAGE "English"
+
+;--------------------------------
+;Installer Sections
+;--------------------------------
+
+Section "${prodname}" SecMain
+
+	SetShellVarContext all
+
+	SetOutPath "$INSTDIR"
+
+  File /r "${ATOMIC_ROOT}\Artifacts\Build\WindowsEditor\*.*"
+
+	;Store installation folder
+	WriteRegStr HKLM "Software\${coname}\InstallDir" "${prodname}" $INSTDIR
+
+	; Create shortcut
+	CreateShortCut "$DESKTOP\${prodname}.lnk" "$INSTDIR\AtomicEditor\${appexe}"
+	CreateShortCut "$SMPROGRAMS\${prodname}.lnk" "$INSTDIR\AtomicEditor\${appexe}"
+
+	; Update Add/Remove Programs
+	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "DisplayName" "${prodname}"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "UninstallString" "$INSTDIR\Uninstall.exe"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "InstallLocation" "$INSTDIR"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "DisplayIcon" "$INSTDIR\AtomicEditor\${appexe},0"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "Publisher" "${coname}"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "URLInfoAbout" "${produrl}"
+	WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "NoRepair" 1
+	WriteRegDWord HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}" "NoModify" 1
+
+	;Create uninstaller
+	WriteUninstaller "$INSTDIR\Uninstall.exe"
+
+SectionEnd
+
+;--------------------------------
+;Uninstaller Section
+;--------------------------------
+
+Section "Uninstall"
+
+	SetShellVarContext all
+
+	; Remove short cut
+	Delete "$SMPROGRAMS\${prodname}.lnk"
+	Delete "$DESKTOP\${prodname}.lnk"
+
+	; Remove installation folder
+  RMDir /r $INSTDIR
+
+	; Remove from Add/Remove Programs
+	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}"
+
+	; Remove installation folder
+	DeleteRegValue HKLM "Software\${coname}\InstallDir" "${prodname}"
+	DeleteRegKey /ifempty HKLM "Software\${coname}\InstallDir"
+	DeleteRegKey /ifempty HKLM "Software\${coname}"
+
+SectionEnd

BIN
Build/CIScripts/Windows/Installer/Windows_Installer_Header.bmp


BIN
Build/CIScripts/Windows/Installer/Windows_Installer_LeftImage.bmp


BIN
Build/CMake/Modules/Atomic.icns


+ 0 - 0
CMake/Modules/Atomic.ico → Build/CMake/Modules/Atomic.ico


+ 0 - 0
CMake/Modules/Atomic.rc → Build/CMake/Modules/Atomic.rc


+ 1 - 1
CMake/Modules/AtomicAndroid.cmake → Build/CMake/Modules/AtomicAndroid.cmake

@@ -2,7 +2,7 @@
 set (JAVASCRIPT_BINDINGS_PLATFORM "ANDROID")
 set (JAVASCRIPT_BINDINGS_PLATFORM "ANDROID")
 
 
 add_definitions(-DATOMIC_PLATFORM_ANDROID)
 add_definitions(-DATOMIC_PLATFORM_ANDROID)
-add_definitions(-DATOMIC_OPENGL -DKNET_UNIX)
+add_definitions(-DATOMIC_OPENGL -DKNET_UNIX -DATOMIC_TBUI)
 
 
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
 set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector")
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x -fstack-protector")
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x -fstack-protector")

+ 3 - 2
CMake/Modules/AtomicDesktop.cmake → Build/CMake/Modules/AtomicDesktop.cmake

@@ -1,6 +1,7 @@
-
 include_directories(${CMAKE_SOURCE_DIR}/Source/ThirdParty/Poco/Foundation/include)
 include_directories(${CMAKE_SOURCE_DIR}/Source/ThirdParty/Poco/Foundation/include)
 
 
-add_definitions( -DATOMIC_TBUI -DATOMIC_FILEWATCHER -DPOCO_NO_AUTOMATIC_LIBS)
+add_definitions( -DATOMIC_TBUI -DATOMIC_FILEWATCHER -DPOCO_NO_AUTOMATIC_LIBS -DPOCO_STATIC )
 
 
 set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} LibCpuId SQLite)
 set (ATOMIC_LINK_LIBRARIES ${ATOMIC_LINK_LIBRARIES} LibCpuId SQLite)
+
+include(AtomicNET)

+ 10 - 1
CMake/Modules/AtomicIOS.cmake → Build/CMake/Modules/AtomicIOS.cmake

@@ -2,9 +2,18 @@ include (BundleUtilities)
 
 
 set (JAVASCRIPT_BINDINGS_PLATFORM "IOS")
 set (JAVASCRIPT_BINDINGS_PLATFORM "IOS")
 
 
-add_definitions (-DIOS -DATOMIC_PLATFORM_IOS -DATOMIC_OPENGL -DKNET_UNIX)
+add_definitions (-DIOS -DATOMIC_PLATFORM_IOS -DATOMIC_OPENGL -DKNET_UNIX -DATOMIC_TBUI)
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x")
 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -std=gnu++0x")
 
 
+# set the architecture for iOS
+#if (${IOS_PLATFORM} STREQUAL "OS")
+#    set (IOS_ARCH armv7 armv7s arm64)
+#elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR")
+#    set (IOS_ARCH i386)
+# elseif (${IOS_PLATFORM} STREQUAL "SIMULATOR64")
+#    set (IOS_ARCH x86_64)
+#endif (${IOS_PLATFORM} STREQUAL "OS")
+
 set (CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_INCLUDING_64_BIT))
 set (CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_INCLUDING_64_BIT))
 set (CMAKE_XCODE_EFFECTIVE_PLATFORMS -iphoneos -iphonesimulator)
 set (CMAKE_XCODE_EFFECTIVE_PLATFORMS -iphoneos -iphonesimulator)
 
 

+ 1 - 1
CMake/Modules/AtomicLinux.cmake → Build/CMake/Modules/AtomicLinux.cmake

@@ -14,5 +14,5 @@ pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
 list (APPEND ATOMIC_LINK_LIBRARIES pthread GLEW GL dl)
 list (APPEND ATOMIC_LINK_LIBRARIES pthread GLEW GL dl)
 
 
 
 
-add_definitions(-DATOMIC_PLATFORM_WEB)
+add_definitions(-DATOMIC_PLATFORM_LINUX)
 add_definitions(-DATOMIC_OPENGL -Wno-warn-absolute-paths -DATOMIC_TBUI)
 add_definitions(-DATOMIC_OPENGL -Wno-warn-absolute-paths -DATOMIC_TBUI)

+ 5 - 1
CMake/Modules/AtomicMac.cmake → Build/CMake/Modules/AtomicMac.cmake

@@ -1,8 +1,12 @@
 
 
+set (JAVASCRIPT_BINDINGS_PLATFORM "MACOSX")
+set (ATOMIC_NODE_JAKE Build/Mac/node/node Build/node_modules/jake/bin/cli.js  -f  Build/Scripts/Bootstrap.js)
+
 include (BundleUtilities)
 include (BundleUtilities)
 include(AtomicDesktop)
 include(AtomicDesktop)
 
 
-set (JAVASCRIPT_BINDINGS_PLATFORM "MACOSX")
+# only have 32 bit mono installed, fix this
+# set (CMAKE_OSX_ARCHITECTURES i386)
 
 
 add_definitions(-DATOMIC_PLATFORM_OSX -DATOMIC_OPENGL -DKNET_UNIX)
 add_definitions(-DATOMIC_PLATFORM_OSX -DATOMIC_OPENGL -DKNET_UNIX)
 
 

+ 12 - 0
Build/CMake/Modules/AtomicNET.cmake

@@ -0,0 +1,12 @@
+
+if (ATOMIC_DOTNET_DEV)
+add_definitions ( -DATOMIC_DOTNET )
+endif ()
+
+set (CSATOMICNATIVEDIR "${CMAKE_SOURCE_DIR}/Artifacts/Build/Source/Generated/${JAVASCRIPT_BINDINGS_PLATFORM}/CSharp/Packages/Atomic/Native")
+set (CSATOMICPLAYERNATIVEDIR "${CMAKE_SOURCE_DIR}/Artifacts/Build/Source/Generated/${JAVASCRIPT_BINDINGS_PLATFORM}/CSharp/Packages/AtomicPlayer/Native")
+set (CSATOMICNETNATIVEDIR "${CMAKE_SOURCE_DIR}/Artifacts/Build/Source/Generated/${JAVASCRIPT_BINDINGS_PLATFORM}/CSharp/Packages/AtomicNET/Native")
+
+file (GLOB CSHARP_BINDINGS_SOURCE ${CSATOMICNATIVEDIR}/*.cpp ${CSATOMICNATIVEDIR}/*.h)
+file (GLOB CSHARPATOMICPLAYER_BINDINGS_SOURCE ${CSATOMICPLAYERNATIVEDIR}/*.cpp ${CSATOMICPLAYERNATIVEDIR}/*.h)
+file (GLOB CSHARPATOMICNET_BINDINGS_SOURCE ${CSATOMICNETNATIVEDIR}/*.cpp ${CSATOMICNETNATIVEDIR}/*.h)

+ 0 - 0
CMake/Modules/AtomicUtils.cmake → Build/CMake/Modules/AtomicUtils.cmake


+ 0 - 0
CMake/Modules/AtomicWeb.cmake → Build/CMake/Modules/AtomicWeb.cmake


+ 4 - 3
CMake/Modules/AtomicWindows.cmake → Build/CMake/Modules/AtomicWindows.cmake

@@ -1,10 +1,11 @@
 
 
-include(AtomicDesktop)
-
 set (JAVASCRIPT_BINDINGS_PLATFORM "WINDOWS")
 set (JAVASCRIPT_BINDINGS_PLATFORM "WINDOWS")
 
 
+include(AtomicDesktop)
+
 #set (CMAKE_DEBUG_POSTFIX _d)
 #set (CMAKE_DEBUG_POSTFIX _d)
 
 
+set (ATOMIC_NODE_JAKE Build/Windows/node/node.exe Build/node_modules/jake/bin/cli.js  -f  Build\\Scripts\\Bootstrap.js)
 
 
 if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
 if( CMAKE_SIZEOF_VOID_P EQUAL 8 )
     set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x64/D3DCompiler_47.dll)
     set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x64/D3DCompiler_47.dll)
@@ -12,7 +13,7 @@ else()
     set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x86/D3DCompiler_47.dll)
     set (D3DCOMPILER_47_DLL ${CMAKE_SOURCE_DIR}/Build/Windows/Binaries/x86/D3DCompiler_47.dll)
 endif()
 endif()
 
 
-add_definitions(-DATOMIC_PLATFORM_WINDOWS -D_CRT_SECURE_NO_WARNINGS -DATOMIC_TBUI)
+add_definitions(-DATOMIC_PLATFORM_WINDOWS -D_CRT_SECURE_NO_WARNINGS -DATOMIC_TBUI )
 
 
 list (APPEND ATOMIC_LINK_LIBRARIES MojoShader user32 gdi32 winmm imm32 ole32 oleaut32 version uuid Ws2_32)
 list (APPEND ATOMIC_LINK_LIBRARIES MojoShader user32 gdi32 winmm imm32 ole32 oleaut32 version uuid Ws2_32)
 
 

+ 0 - 0
CMake/Modules/MacOSXBundleInfo.plist.template → Build/CMake/Modules/MacOSXBundleInfo.plist.template


+ 0 - 0
CMake/Modules/iOSBundleInfo.plist.template → Build/CMake/Modules/iOSBundleInfo.plist.template


+ 0 - 0
CMake/Toolchains/android.toolchain.cmake → Build/CMake/Toolchains/android.toolchain.cmake


+ 0 - 0
CMake/Toolchains/emscripten.toolchain.cmake → Build/CMake/Toolchains/emscripten.toolchain.cmake


+ 5 - 0
Build/Docs/Readme.md

@@ -0,0 +1,5 @@
+##Atomic Game Engine™ Javascript Reference
+
+##EARLY ACCESS DRAFT September 8th 2015
+
+Atomic Game Engine Core API Reference

+ 0 - 0
Docs/Setup_Notes.txt → Build/Docs/Setup_Notes.txt


+ 1 - 0
Build/Docs/gendocs.sh

@@ -0,0 +1 @@
+./node_modules/.bin/jsdoc ../Artifacts/JSDoc/Atomic.js -t ./jaguarjs-jsdoc/ -c ./jsdoc.conf Readme.md

+ 0 - 0
Docs/jsdoc.conf → Build/Docs/jsdoc.conf


+ 1 - 0
Build/Scripts/Bootstrap.js

@@ -0,0 +1 @@
+var host = require('./Host');

+ 55 - 0
Build/Scripts/BuildAndroid.js

@@ -0,0 +1,55 @@
+var fs = require('fs-extra');
+var path = require("path");
+var host = require("./Host");
+var os = require('os');
+var atomicRoot = host.atomicRoot;
+
+var buildDir = host.artifactsRoot + "Build/Android/";
+
+namespace('build', function() {
+
+  task('android_player', ["build:atomiceditor"], {
+    async: true
+  }, function() {
+
+    // Clean build
+    common.cleanCreateDir(buildDir);
+
+    process.chdir(buildDir);
+
+    var cmds = [];
+
+    var scriptModules = host.getScriptModules("ANDROID");
+    var bindCmd = host.atomicTool + " bind \"" + atomicRoot + "\" ";
+
+    // Generate bindings for each script package
+    for (var pkgName in scriptModules) {
+      cmds.push(bindCmd + "Script/Packages/" + pkgName + "/ ANDROID")
+    }
+
+    if (os.platform() == "win32") {
+      cmds.push(atomicRoot + "Build/Scripts/Windows/CompileAndroid.bat");
+    }
+    else {
+      cmds.push("cmake -G \"Unix Makefiles\" -DCMAKE_TOOLCHAIN_FILE=../../../Build/CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../../");
+      cmds.push("make -j4");
+    }
+
+    jake.exec(cmds, function() {
+
+      var editorAppFolder = host.artifactsRoot + (os.platform() == "win32" ? "AtomicEditor/" : "AtomicEditor/AtomicEditor.app/");
+
+      // Install Deployment
+      fs.copySync(buildDir + "Source/AtomicPlayer/Application/libAtomicPlayer.so",
+        editorAppFolder + "Resources/ToolData/Deployment/Android/libs/armeabi-v7a/libAtomicPlayer.so");
+
+      complete();
+
+    }, {
+      printStdout: true,
+      breakOnError : false
+    });
+
+  });
+
+}); // end of build namespace

+ 40 - 0
Build/Scripts/BuildCommon.js

@@ -0,0 +1,40 @@
+var fs = require('fs-extra');
+var os = require('os');
+var path = require("path");
+var host = require("./Host");
+var atomicRoot = host.atomicRoot;
+
+namespace('build', function() {
+
+  task('genscripts', {
+    async: true
+  }, function(platform) {
+
+        process.chdir(atomicRoot);
+
+        var modules = host.getScriptModules(platform);
+        var bindCmd = host.atomicTool + " bind \"" + atomicRoot + "\" ";
+
+        var cmds = [];
+        for (var pkgName in modules) {
+            cmds.push(bindCmd + "Script/Packages/" + pkgName + "/ " + platform);
+        }
+
+        // Compile the Editor Scripts
+        if (os.platform() == "win32")
+          cmds.push(atomicRoot + "Build/Windows/node/node.exe " + atomicRoot + "Build/TypeScript/tsc.js -p " + atomicRoot + "Script");
+        else if (os.platform() == "darwin")
+          cmds.push(atomicRoot + "Build/Mac/node/node " + atomicRoot + "Build/TypeScript/tsc.js -p " + atomicRoot + "Script");
+
+        jake.exec(cmds, function() {
+
+          complete();
+
+        }, {
+          printStdout: true
+        });
+
+  });
+
+
+}); // end of build namespace

+ 112 - 0
Build/Scripts/BuildMac.js

@@ -0,0 +1,112 @@
+var fs = require('fs-extra');
+var path = require("path");
+var host = require("./Host");
+var atomicRoot = host.atomicRoot;
+
+var buildDir = host.artifactsRoot + "Build/Mac/";
+var editorAppFolder = host.artifactsRoot + "/AtomicEditor/AtomicEditor.app/";
+
+namespace('build', function() {
+
+// Builds a standalone Atomic Editor, which can be distributed out of build tree
+task('atomiceditor', {
+  async: true
+}, function() {
+
+  // Clean build
+  var cleanBuild = true;
+  if (cleanBuild) {
+    common.cleanCreateDir(buildDir);
+    common.cleanCreateDir(editorAppFolder);
+    common.cleanCreateDir(host.getGenScriptRootDir("MACOSX"));
+  }
+
+  // create the generated script files, so they will be picked up by cmake
+  host.createGenScriptFiles("MACOSX");
+
+  process.chdir(buildDir);
+
+  var cmds = [];
+
+  cmds.push("cmake ../../../ -DATOMIC_DEV_BUILD=0 -G Xcode");
+  cmds.push("xcodebuild -target GenerateScriptBindings -configuration Release")
+  cmds.push("xcodebuild -target AtomicEditor -target AtomicPlayer -configuration Release")
+
+  jake.exec(cmds, function() {
+
+    fs.copySync(buildDir + "Source/AtomicEditor/Release/AtomicEditor.app", editorAppFolder);
+
+    var resourceDest = editorAppFolder + "/Contents/Resources/"
+
+    // We need some resources to run
+    fs.copySync(atomicRoot + "Resources/CoreData",
+      resourceDest + "CoreData");
+
+    fs.copySync(atomicRoot + "Resources/PlayerData",
+      resourceDest + "PlayerData");
+
+    fs.copySync(atomicRoot + "Data/AtomicEditor",
+      resourceDest + "ToolData");
+
+    fs.copySync(atomicRoot + "Resources/EditorData",
+      resourceDest + "EditorData");
+
+    fs.copySync(atomicRoot + "Artifacts/Build/Resources/EditorData/AtomicEditor/EditorScripts",
+      resourceDest + "EditorData/AtomicEditor/EditorScripts");
+
+    // copy the mac player binary to deployment
+    var playerBinary =  buildDir +  "Source/AtomicPlayer/Application/Release/AtomicPlayer.app/Contents/MacOS/AtomicPlayer";
+
+    fs.copySync(playerBinary,
+      resourceDest + "ToolData/Deployment/MacOS/AtomicPlayer.app/Contents/MacOS/AtomicPlayer");
+
+    console.log("\n\nAtomic Editor build to " + editorAppFolder + "\n\n");
+
+    complete();
+
+  }, {
+    printStdout: true
+  });
+
+});
+
+// Generate a XCode Workspace
+task('genxcode', {
+  async: true
+}, function() {
+
+  var xcodeRoot = path.resolve(atomicRoot, "") + "-XCode";
+
+  if (!fs.existsSync(xcodeRoot)) {
+      jake.mkdirP(xcodeRoot);
+  }
+
+  // create the generated script files, so they will be picked up by cmake
+  host.createGenScriptFiles("MACOSX");
+
+  process.chdir(xcodeRoot);
+
+  var cmds = [];
+
+  cmds.push("cmake ../AtomicGameEngine -DATOMIC_DEV_BUILD=1 -G Xcode");
+  cmds.push("xcodebuild -target GenerateScriptBindings -configuration Debug")
+
+  jake.exec(cmds, function() {
+
+    var task = jake.Task['build:genscripts']
+
+    task.addListener('complete', function () {
+        console.log("\n\nXCode workspace generated in " +  xcodeRoot + "\n\n");
+        complete();
+      });
+
+    task.invoke("MACOSX");
+
+  }, {
+    printStdout: true
+  });
+
+});
+
+
+});// end of build namespace

+ 111 - 0
Build/Scripts/BuildWindows.js

@@ -0,0 +1,111 @@
+var fs = require('fs-extra');
+var path = require("path");
+var host = require("./Host");
+var atomicRoot = host.atomicRoot;
+
+var buildDir = host.artifactsRoot + "Build/Windows/";
+var editorAppFolder = host.artifactsRoot + "AtomicEditor/";
+
+namespace('build', function() {
+
+  // Builds a standalone Atomic Editor, which can be distributed out of build tree
+  task('atomiceditor', {
+    async: true
+  }, function() {
+
+    // Clean build
+    var cleanBuild = true;
+    if (cleanBuild) {
+      common.cleanCreateDir(buildDir);
+      common.cleanCreateDir(editorAppFolder);
+      common.cleanCreateDir(host.getGenScriptRootDir("WINDOWS"));
+    }
+
+    // create the generated script files, so they will be picked up by cmake
+    host.createGenScriptFiles("WINDOWS");
+
+    process.chdir(buildDir);
+
+    var cmds = [];
+
+    // Build the AtomicEditor
+    cmds.push(atomicRoot + "Build/Scripts/Windows/CompileAtomicEditor.bat");
+
+    jake.exec(cmds, function() {
+
+      // Copy the Editor binaries
+      fs.copySync(buildDir + "Source/AtomicEditor/Release/AtomicEditor.exe",
+        host.artifactsRoot + "AtomicEditor/AtomicEditor.exe");
+      fs.copySync(buildDir + "Source/AtomicEditor/Release/D3DCompiler_47.dll",
+        host.artifactsRoot + "AtomicEditor/D3DCompiler_47.dll");
+
+      // We need some resources to run
+      fs.copySync(atomicRoot + "Resources/CoreData",
+        editorAppFolder + "Resources/CoreData");
+
+      fs.copySync(atomicRoot + "Resources/PlayerData",
+        editorAppFolder + "Resources/PlayerData");
+
+      fs.copySync(atomicRoot + "Data/AtomicEditor",
+        editorAppFolder + "Resources/ToolData");
+
+      fs.copySync(atomicRoot + "Resources/EditorData",
+        editorAppFolder + "Resources/EditorData");
+
+      fs.copySync(atomicRoot + "Artifacts/Build/Resources/EditorData/AtomicEditor/EditorScripts",
+        editorAppFolder + "Resources/EditorData/AtomicEditor/EditorScripts");
+
+      fs.copySync(buildDir +  "Source/AtomicPlayer/Application/Release/AtomicPlayer.exe",
+        editorAppFolder + "Resources/ToolData/Deployment/Windows/x64/AtomicPlayer.exe");
+
+      fs.copySync(buildDir +  "Source/AtomicPlayer/Application/Release/D3DCompiler_47.dll",
+        editorAppFolder + "Resources/ToolData/Deployment/Windows/x64/D3DCompiler_47.dll");
+
+      console.log("Atomic Editor build to ", editorAppFolder);
+
+      complete();
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+  // Generate a Visual Studio 2015 solution
+  task('genvs2015', {
+    async: true
+  }, function() {
+
+    var slnRoot = path.resolve(atomicRoot, "") + "-VS2015\\";
+
+    if (!fs.existsSync(slnRoot)) {
+        jake.mkdirP(slnRoot);
+    }
+
+    // create the generated script files, so they will be picked up by cmake
+    host.createGenScriptFiles("WINDOWS");
+
+    process.chdir(slnRoot);
+
+    var cmds = [];
+
+    cmds.push(atomicRoot + "Build/Scripts/Windows/GenerateVS2015.bat");
+
+    jake.exec(cmds, function() {
+
+      var task = jake.Task['build:genscripts']
+
+      task.addListener('complete', function () {
+          console.log("\n\nVisual Studio Solution generated in ", slnRoot);
+          complete();
+        });
+
+      task.invoke("WINDOWS");
+
+    }, {
+      printStdout: true
+    });
+
+  });
+
+}); // end of build namespace

+ 12 - 0
Build/Scripts/Host.js

@@ -0,0 +1,12 @@
+var os = require('os');
+
+if (os.platform() == "win32") {
+  module.exports = require("./HostWindows");
+  require("./BuildWindows");
+} else if (os.platform() == "darwin") {
+  module.exports = require("./HostMac");
+  require("./BuildMac");
+}
+
+require("./BuildCommon");
+require("./BuildAndroid");

+ 142 - 0
Build/Scripts/HostCommon.js

@@ -0,0 +1,142 @@
+var os = require('os');
+var path = require('path');
+
+// get the root folder
+var atomicRoot = path.resolve(__dirname, "../..") + "/";
+
+// patch in our local node_modules
+process.env.NODE_PATH = atomicRoot + "Build/node_modules/";
+require('module').Module._initPaths();
+var fs = require('fs-extra');
+
+/// Returns a list of all script packages, regardless of platform
+function getScriptPackages() {
+
+  var srcpath = atomicRoot + "Script/Packages/";
+
+  return fs.readdirSync(srcpath).filter(function(file) {
+    return fs.statSync(path.join(srcpath, file)).isDirectory() && fs.existsSync(srcpath + "/" + file + "/Package.json");
+  });
+
+}
+
+// return an object with package name keys and module name lists as values
+function getScriptModules(platform) {
+
+  modules = {};
+
+  var packages = getScriptPackages();
+
+  for (var i in packages) {
+
+    var pkg = JSON.parse(fs.readFileSync(atomicRoot + "Script/Packages/" + packages[i] + "/Package.json"));
+
+    if (pkg.platforms && pkg.platforms.indexOf(platform) == -1)
+      continue;
+
+    for (var j in pkg.modules) {
+
+      var moduleName = pkg.modules[j];
+
+      if (pkg.moduleExclude && pkg.moduleExclude[platform])
+        if (pkg.moduleExclude[platform].indexOf(moduleName) != -1)
+          continue;
+
+      if (!modules[pkg.name])
+        modules[pkg.name] = [];
+
+      modules[pkg.name].push(moduleName);
+    }
+
+  }
+
+  return modules;
+
+}
+
+function getGenScriptRootDir(platform) {
+
+  return atomicRoot + "Artifacts/Build/Source/Generated/" + platform + "/";
+
+}
+
+// Get a list of script source filenames for a given platform
+function getGenScriptFilenames(platform) {
+
+  var filenames = [];
+
+  var scriptGenRoot = getGenScriptRootDir(platform);
+
+  var modules = getScriptModules(platform);
+
+  for (var pkgName in modules) {
+
+    var jsPackageFolder = scriptGenRoot + "Javascript/Packages/" + pkgName + "/";
+
+    // the JS package sources
+    filenames.push(jsPackageFolder + "JSPackage" + pkgName + ".cpp");
+
+    for (var i in modules[pkgName]) {
+      filenames.push(jsPackageFolder + "JSModule" + modules[pkgName][i] + ".cpp");
+    }
+
+  }
+
+  return filenames;
+
+}
+
+function createGenScriptFiles(platform) {
+
+  var scriptFiles = getGenScriptFilenames(platform);
+
+  for (var i in scriptFiles) {
+
+    fs.ensureFileSync(scriptFiles[i]);
+
+  }
+
+}
+
+function cleanCreateDir(directory) {
+
+  testRemoveDir(directory);
+  testCreateDir(directory);
+
+}
+
+function testCreateDir(directory) {
+
+  if (fs.existsSync(directory)) {
+    fail("Path already exists: " + directory);
+  }
+
+  jake.mkdirP(directory);
+
+  if (!fs.existsSync(directory)) {
+    fail("Unable to create path: " + directory);
+  }
+}
+
+
+function testRemoveDir(path) {
+
+  if (fs.existsSync(path)) {
+    jake.rmRf(path);
+  }
+
+  if (fs.existsSync(path)) {
+    fail("Unable to remove path: " + path);
+  }
+}
+
+exports.atomicRoot = atomicRoot;
+exports.artifactsRoot = atomicRoot + "Artifacts/";
+exports.cleanCreateDir = cleanCreateDir;
+exports.testCreateDir = testCreateDir;
+exports.testRemoveDir = testRemoveDir;
+exports.getScriptPackages = getScriptPackages;
+exports.getScriptModules = getScriptModules;
+exports.getGenScriptFilenames = getGenScriptFilenames;
+exports.createGenScriptFiles = createGenScriptFiles;
+exports.getGenScriptRootDir = getGenScriptRootDir;

+ 6 - 0
Build/Scripts/HostMac.js

@@ -0,0 +1,6 @@
+
+common = require("./HostCommon");
+
+// forward exports
+exports = module.exports = common;
+exports.atomicTool = exports.artifactsRoot + "Build/AtomicTool/AtomicTool";

+ 5 - 0
Build/Scripts/HostWindows.js

@@ -0,0 +1,5 @@
+common = require("./HostCommon");
+
+// forward exports
+exports = module.exports = common;
+exports.atomicTool = exports.artifactsRoot + "Build/AtomicTool/AtomicTool.exe";

+ 3 - 0
Build/Scripts/Windows/CompileAndroid.bat

@@ -0,0 +1,3 @@
+SET PATH=%ANDROID_NDK%\prebuilt\windows\bin\;%PATH%
+cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../../Build/CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../../
+%ANDROID_NDK%\prebuilt\windows\bin\make.exe -j4

+ 4 - 0
Build/Scripts/Windows/CompileAtomicEditor.bat

@@ -0,0 +1,4 @@
+call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
+cmake ..\\..\\..\\ -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
+msbuild /m /p:Configuration=Release /p:Platform=x64 Source\AtomicTool\GenerateScriptBindings.vcxproj
+msbuild /m Atomic.sln /t:AtomicEditor /t:AtomicPlayer /p:Configuration=Release /p:Platform=x64

+ 3 - 0
Build/Scripts/Windows/GenerateVS2015.bat

@@ -0,0 +1,3 @@
+call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
+cmake ..\\AtomicGameEngine -DATOMIC_DEV_BUILD=1 -G "Visual Studio 14 2015 Win64"
+msbuild Atomic.sln /m /p:Configuration=Debug /p:Platform=x64 /t:AtomicTool

File diff suppressed because it is too large
+ 463 - 87
Build/TypeScript/lib.d.ts


File diff suppressed because it is too large
+ 310 - 183
Build/TypeScript/tsc.js


BIN
Build/Windows/7z/7z.dll


BIN
Build/Windows/7z/7z.exe


+ 3 - 3
Build/Windows/Compile.bat

@@ -1,3 +1,3 @@
-call "%VS140COMNTOOLS%..\..\VC\bin\vcvars32.bat"
-cmake ..\\..\\  -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015"
-msbuild /m Atomic.sln /p:Configuration=Release /p:Platform=Win32
+call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
+cmake ..\\..\\  -DATOMIC_DEV_BUILD=0 -G "Visual Studio 14 2015 Win64"
+msbuild /m Atomic.sln /p:Configuration=Release /p:Platform=x64

+ 2 - 0
Build/Windows/CompileAndroid.bat

@@ -0,0 +1,2 @@
+cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=../../CMake/Toolchains/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../
+ %ANDROID_NDK%\prebuilt\windows\bin\make.exe

+ 3 - 0
Build/Windows/CompileAtomicTool.bat

@@ -0,0 +1,3 @@
+call "%VS140COMNTOOLS%..\..\VC\bin\amd64\vcvars64.bat"
+cmake ..\\..\\  -DATOMIC_DEV_BUILD=1 -G "Visual Studio 14 2015 Win64"
+msbuild /m Atomic.sln /t:AtomicTool /p:Configuration=Release /p:Platform=x64

+ 8 - 0
Build/node_modules/fs-extra/.npmignore

@@ -0,0 +1,8 @@
+.nyc_output/
+coverage/
+test/
+.travis.yml
+appveyor.yml
+lib/**/__tests__/
+test/readme.md
+test.js

+ 261 - 0
Build/node_modules/fs-extra/CHANGELOG.md

@@ -0,0 +1,261 @@
+0.24.0 / 2015-08-28
+-------------------
+- removed alias `delete()` and `deleteSync()`. See: https://github.com/jprichardson/node-fs-extra/issues/171
+
+0.23.1 / 2015-08-07
+-------------------
+- Better handling of errors for `move()` when moving across devices. https://github.com/jprichardson/node-fs-extra/pull/170
+- `ensureSymlink()` and `ensureLink()` should not throw errors if link exists. https://github.com/jprichardson/node-fs-extra/pull/169
+
+0.23.0 / 2015-08-06
+-------------------
+- added `ensureLink{Sync}()` and `ensureSymlink{Sync}()`. See: https://github.com/jprichardson/node-fs-extra/pull/165
+
+0.22.1 / 2015-07-09
+-------------------
+- Prevent calling `hasMillisResSync()` on module load. See: https://github.com/jprichardson/node-fs-extra/issues/149.
+Fixes regression that was introduced in `0.21.0`.
+
+0.22.0 / 2015-07-09
+-------------------
+- preserve permissions / ownership in `copy()`. See: https://github.com/jprichardson/node-fs-extra/issues/54
+
+0.21.0 / 2015-07-04
+-------------------
+- add option to preserve timestamps in `copy()` and `copySync()`. See: https://github.com/jprichardson/node-fs-extra/pull/141
+- updated `[email protected]` to `4.x`. This brings in features from `amazing-graceful-fs` (much cleaner code / less hacks)
+
+0.20.1 / 2015-06-23
+-------------------
+- fixed regression caused by latest jsonfile update: See: https://github.com/jprichardson/node-jsonfile/issues/26
+
+0.20.0 / 2015-06-19
+-------------------
+- removed `jsonfile` aliases with `File` in the name, they weren't documented and probably weren't in use e.g.
+this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`.
+- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code.
+- started moving tests inline
+- upgraded to `[email protected]`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()`
+
+0.19.0 / 2015-06-08
+-------------------
+- `fs.copy()` had support for Node v0.8, dropped support
+
+0.18.4 / 2015-05-22
+-------------------
+- fixed license field according to this: https://github.com/jprichardson/node-fs-extra/pull/136 and https://github.com/npm/npm/releases/tag/v2.10.0
+
+0.18.3 / 2015-05-08
+-------------------
+- bugfix: handle `EEXIST` when clobbering on some Linux systems. https://github.com/jprichardson/node-fs-extra/pull/134
+
+0.18.2 / 2015-04-17
+-------------------
+- bugfix: allow `F_OK` (https://github.com/jprichardson/node-fs-extra/issues/120)
+
+0.18.1 / 2015-04-15
+-------------------
+- improved windows support for `move()` a bit. https://github.com/jprichardson/node-fs-extra/commit/92838980f25dc2ee4ec46b43ee14d3c4a1d30c1b
+- fixed a lot of tests for Windows (appveyor)
+
+0.18.0 / 2015-03-31
+-------------------
+- added `emptyDir()` and `emptyDirSync()`
+
+0.17.0 / 2015-03-28
+-------------------
+- `copySync` added `clobber` option (before always would clobber, now if `clobber` is `false` it throws an error if the destination exists).
+**Only works with files at the moment.**
+- `createOutputStream()` added. See: https://github.com/jprichardson/node-fs-extra/pull/118
+
+0.16.5 / 2015-03-08
+-------------------
+- fixed `fs.move` when `clobber` is `true` and destination is a directory, it should clobber. https://github.com/jprichardson/node-fs-extra/issues/114
+
+0.16.4 / 2015-03-01
+-------------------
+- `fs.mkdirs` fix infinite loop on Windows. See: See https://github.com/substack/node-mkdirp/pull/74 and https://github.com/substack/node-mkdirp/issues/66
+
+0.16.3 / 2015-01-28
+-------------------
+- reverted https://github.com/jprichardson/node-fs-extra/commit/1ee77c8a805eba5b99382a2591ff99667847c9c9
+
+
+0.16.2 / 2015-01-28
+-------------------
+- fixed `fs.copy` for Node v0.8 (support is temporary and will be removed in the near future)
+
+0.16.1 / 2015-01-28
+-------------------
+- if `setImmediate` is not available, fall back to `process.nextTick`
+
+0.16.0 / 2015-01-28
+-------------------
+- bugfix `fs.move()` into itself. Closes #104
+- bugfix `fs.move()` moving directory across device. Closes #108
+- added coveralls support
+- bugfix: nasty multiple callback `fs.copy()` bug. Closes #98
+- misc fs.copy code cleanups
+
+0.15.0 / 2015-01-21
+-------------------
+- dropped `ncp`, imported code in
+- because of previous, now supports `io.js`
+- `graceful-fs` is now a dependency
+
+0.14.0 / 2015-01-05
+-------------------
+- changed `copy`/`copySync` from `fs.copy(src, dest, [filters], callback)` to `fs.copy(src, dest, [options], callback)` https://github.com/jprichardson/node-fs-extra/pull/100
+- removed mockfs tests for mkdirp (this may be temporary, but was getting in the way of other tests)
+
+0.13.0 / 2014-12-10
+-------------------
+- removed `touch` and `touchSync` methods (they didn't handle permissions like UNIX touch)
+- updated `"ncp": "^0.6.0"` to `"ncp": "^1.0.1"`
+- imported `mkdirp` => `minimist` and `mkdirp` are no longer dependences, should now appease people who wanted `mkdirp` to be `--use_strict` safe. See [#59](https://github.com/jprichardson/node-fs-extra/issues/59)
+
+0.12.0 / 2014-09-22
+-------------------
+- copy symlinks in `copySync()` [#85](https://github.com/jprichardson/node-fs-extra/pull/85)
+
+0.11.1 / 2014-09-02
+-------------------
+- bugfix `copySync()` preserve file permissions [#80](https://github.com/jprichardson/node-fs-extra/pull/80)
+
+0.11.0 / 2014-08-11
+-------------------
+- upgraded `"ncp": "^0.5.1"` to `"ncp": "^0.6.0"`
+- upgrade `jsonfile": "^1.2.0"` to `jsonfile": "^2.0.0"` => on write, json files now have `\n` at end. Also adds `options.throws` to `readJsonSync()`
+see https://github.com/jprichardson/node-jsonfile#readfilesyncfilename-options for more details.
+
+0.10.0 / 2014-06-29
+------------------
+* bugfix: upgaded `"jsonfile": "~1.1.0"` to `"jsonfile": "^1.2.0"`, bumped minor because of `jsonfile` dep change
+from `~` to `^`. #67
+
+0.9.1 / 2014-05-22
+------------------
+* removed Node.js `0.8.x` support, `0.9.0` was published moments ago and should have been done there
+
+0.9.0 / 2014-05-22
+------------------
+* upgraded `ncp` from `~0.4.2` to `^0.5.1`, #58
+* upgraded `rimraf` from `~2.2.6` to `^2.2.8`
+* upgraded `mkdirp` from `0.3.x` to `^0.5.0`
+* added methods `ensureFile()`, `ensureFileSync()`
+* added methods `ensureDir()`, `ensureDirSync()` #31
+* added `move()` method. From: https://github.com/andrewrk/node-mv
+
+
+0.8.1 / 2013-10-24
+------------------
+* copy failed to return an error to the callback if a file doesn't exist (ulikoehler #38, #39)
+
+0.8.0 / 2013-10-14
+------------------
+* `filter` implemented on `copy()` and `copySync()`. (Srirangan / #36)
+
+0.7.1 / 2013-10-12
+------------------
+* `copySync()` implemented (Srirangan / #33)
+* updated to the latest `jsonfile` version `1.1.0` which gives `options` params for the JSON methods. Closes #32
+
+0.7.0 / 2013-10-07
+------------------
+* update readme conventions
+* `copy()` now works if destination directory does not exist. Closes #29
+
+0.6.4 / 2013-09-05
+------------------
+* changed `homepage` field in package.json to remove NPM warning
+
+0.6.3 / 2013-06-28
+------------------
+* changed JSON spacing default from `4` to `2` to follow Node conventions
+* updated `jsonfile` dep
+* updated `rimraf` dep
+
+0.6.2 / 2013-06-28
+------------------
+* added .npmignore, #25
+
+0.6.1 / 2013-05-14
+------------------
+* modified for `strict` mode, closes #24
+* added `outputJson()/outputJsonSync()`, closes #23
+
+0.6.0 / 2013-03-18
+------------------
+* removed node 0.6 support
+* added node 0.10 support
+* upgraded to latest `ncp` and `rimraf`.
+* optional `graceful-fs` support. Closes #17
+
+
+0.5.0 / 2013-02-03
+------------------
+* Removed `readTextFile`.
+* Renamed `readJSONFile` to `readJSON` and `readJson`, same with write.
+* Restructured documentation a bit. Added roadmap.
+
+0.4.0 / 2013-01-28
+------------------
+* Set default spaces in `jsonfile` from 4 to 2.
+* Updated `testutil` deps for tests.
+* Renamed `touch()` to `createFile()`
+* Added `outputFile()` and `outputFileSync()`
+* Changed creation of testing diretories so the /tmp dir is not littered.
+* Added `readTextFile()` and `readTextFileSync()`.
+
+0.3.2 / 2012-11-01
+------------------
+* Added `touch()` and `touchSync()` methods.
+
+0.3.1 / 2012-10-11
+------------------
+* Fixed some stray globals.
+
+0.3.0 / 2012-10-09
+------------------
+* Removed all CoffeeScript from tests.
+* Renamed `mkdir` to `mkdirs`/`mkdirp`.
+
+0.2.1 / 2012-09-11
+------------------
+* Updated `rimraf` dep.
+
+0.2.0 / 2012-09-10
+------------------
+* Rewrote module into JavaScript. (Must still rewrite tests into JavaScript)
+* Added all methods of [jsonfile][https://github.com/jprichardson/node-jsonfile]
+* Added Travis-CI.
+
+0.1.3 / 2012-08-13
+------------------
+* Added method `readJSONFile`.
+
+0.1.2 / 2012-06-15
+------------------
+* Bug fix: `deleteSync()` didn't exist.
+* Verified Node v0.8 compatibility.
+
+0.1.1 / 2012-06-15
+------------------
+* Fixed bug in `remove()`/`delete()` that wouldn't execute the function if a callback wasn't passed.
+
+0.1.0 / 2012-05-31
+------------------
+* Renamed `copyFile()` to `copy()`. `copy()` can now copy directories (recursively) too.
+* Renamed `rmrf()` to `remove()`.
+* `remove()` aliased with `delete()`.
+* Added `mkdirp` capabilities. Named: `mkdir()`. Hides Node.js native `mkdir()`.
+* Instead of exporting the native `fs` module with new functions, I now copy over the native methods to a new object and export that instead.
+
+0.0.4 / 2012-03-14
+------------------
+* Removed CoffeeScript dependency
+
+0.0.3 / 2012-01-11
+------------------
+* Added methods rmrf and rmrfSync
+* Moved tests from Jasmine to Mocha

+ 15 - 0
Build/node_modules/fs-extra/LICENSE

@@ -0,0 +1,15 @@
+(The MIT License)
+
+Copyright (c) 2011-2015 JP Richardson
+
+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.

+ 516 - 0
Build/node_modules/fs-extra/README.md

@@ -0,0 +1,516 @@
+Node.js: fs-extra
+=================
+
+[![build status](https://secure.travis-ci.org/jprichardson/node-fs-extra.svg)](http://travis-ci.org/jprichardson/node-fs-extra)
+[![windows Build status](https://img.shields.io/appveyor/ci/jprichardson/node-fs-extra/master.svg?label=windows%20build)](https://ci.appveyor.com/project/jprichardson/node-fs-extra/branch/master)
+[![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra)
+[![Coverage Status](https://img.shields.io/coveralls/jprichardson/node-fs-extra.svg)](https://coveralls.io/r/jprichardson/node-fs-extra)
+
+
+`fs-extra` adds file system methods that aren't included in the native `fs` module. It is a drop in replacement for `fs`.
+
+
+
+Why?
+----
+
+I got tired of including `mkdirp`, `rimraf`, and `cp -r` in most of my projects.
+
+
+
+
+Installation
+------------
+
+    npm install --save fs-extra
+
+
+
+Usage
+-----
+
+`fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are unmodified and attached to `fs-extra`.
+
+You don't ever need to include the original `fs` module again:
+
+```js
+var fs = require('fs') // this is no longer necessary
+```
+
+you can now do this:
+
+```js
+var fs = require('fs-extra')
+```
+
+or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want
+to name your `fs` variable `fse` like so:
+
+```js
+var fse = require('fs-extra')
+```
+
+you can also keep both, but it's redundant:
+
+```js
+var fs = require('fs')
+var fse = require('fs-extra')
+```
+
+
+Methods
+-------
+- [copy](#copy)
+- [copySync](#copy)
+- [createOutputStream](#createoutputstreamfile-options)
+- [emptyDir](#emptydirdir-callback)
+- [emptyDirSync](#emptydirdir-callback)
+- [ensureFile](#ensurefilefile-callback)
+- [ensureFileSync](#ensurefilefile-callback)
+- [ensureDir](#ensuredirdir-callback)
+- [ensureDirSync](#ensuredirdir-callback)
+- [ensureLink](#ensurelinksrcpath-dstpath-callback)
+- [ensureLinkSync](#ensurelinksrcpath-dstpath-callback)
+- [ensureSymlink](#ensuresymlinksrcpath-dstpath-type-callback)
+- [ensureSymlinkSync](#ensuresymlinksrcpath-dstpath-type-callback)
+- [mkdirs](#mkdirsdir-callback)
+- [mkdirsSync](#mkdirsdir-callback)
+- [move](#movesrc-dest-options-callback)
+- [outputFile](#outputfilefile-data-callback)
+- [outputFileSync](#outputfilefile-data-callback)
+- [outputJson](#outputjsonfile-data-callback)
+- [outputJsonSync](#outputjsonfile-data-callback)
+- [readJson](#readjsonfile-options-callback)
+- [readJsonSync](#readjsonfile-options-callback)
+- [remove](#removedir-callback)
+- [removeSync](#removedir-callback)
+- [writeJson](#writejsonfile-object-options-callback)
+- [writeJsonSync](#writejsonfile-object-options-callback)
+
+
+**NOTE:** You can still use the native Node.js methods. They are copied over to `fs-extra`.
+
+
+### copy()
+
+**copy(src, dest, [options], callback)**
+
+
+Copy a file or directory. The directory can have contents. Like `cp -r`.
+
+Options:
+clobber (boolean): overwrite existing file or directory
+preserveTimestamps (boolean): will set last modification and access times to the ones of the original source files, default is `false`.
+
+Sync: `copySync()`
+
+
+Examples:
+
+```js
+var fs = require('fs-extra')
+
+fs.copy('/tmp/myfile', '/tmp/mynewfile', function (err) {
+  if (err) return console.error(err)
+  console.log("success!")
+}) // copies file
+
+fs.copy('/tmp/mydir', '/tmp/mynewdir', function (err) {
+  if (err) return console.error(err)
+  console.log('success!')
+}) // copies directory, even if it has subdirectories or files
+```
+
+
+### createOutputStream(file, [options])
+
+Exactly like `createWriteStream`, but if the directory does not exist, it's created.
+
+Examples:
+
+```js
+var fs = require('fs-extra')
+
+// if /tmp/some does not exist, it is created
+var ws = fs.createOutputStream('/tmp/some/file.txt')
+ws.write('hello\n')
+```
+
+Note on naming: you'll notice that fs-extra has some methods like `fs.outputJson`, `fs.outputFile`, etc that use the
+word `output` to denote that if the containing directory does not exist, it should be created. If you can think of a
+better succinct nomenclature for these methods, please open an issue for discussion. Thanks.
+
+
+### emptyDir(dir, [callback])
+
+Ensures that a directory is empty. If the directory does not exist, it is created. The directory itself is not deleted.
+
+Alias: `emptydir()`
+
+Sync: `emptyDirSync()`, `emptydirSync()`
+
+Example:
+
+```js
+var fs = require('fs-extra')
+
+// assume this directory has a lot of files and folders
+fs.emptyDir('/tmp/some/dir', function (err) {
+  if (!err) console.log('success!')
+})
+```
+
+
+### ensureFile(file, callback)
+
+Ensures that the file exists. If the file that is requested to be created is in directories that do not exist, these directories are created. If the file already exists, it is **NOT MODIFIED**.
+
+Alias: `createFile()`
+
+Sync: `createFileSync()`,`ensureFileSync()`
+
+
+Example:
+
+```js
+var fs = require('fs-extra')
+
+var file = '/tmp/this/path/does/not/exist/file.txt'
+fs.ensureFile(file, function (err) {
+  console.log(err) // => null
+  // file has now been created, including the directory it is to be placed in
+})
+```
+
+
+### ensureDir(dir, callback)
+
+Ensures that the directory exists. If the directory structure does not exist, it is created.
+
+Sync: `ensureDirSync()`
+
+
+Example:
+
+```js
+var fs = require('fs-extra')
+
+var dir = '/tmp/this/path/does/not/exist'
+fs.ensureDir(dir, function (err) {
+  console.log(err) // => null
+  // dir has now been created, including the directory it is to be placed in
+})
+```
+
+
+### ensureLink(srcpath, dstpath, callback)
+
+Ensures that the link exists. If the directory structure does not exist, it is created.
+
+Sync: `ensureLinkSync()`
+
+
+Example:
+
+```js
+var fs = require('fs-extra')
+
+var srcpath = '/tmp/file.txt'
+var dstpath = '/tmp/this/path/does/not/exist/file.txt'
+fs.ensureLink(srcpath, dstpath, function (err) {
+  console.log(err) // => null
+  // link has now been created, including the directory it is to be placed in
+})
+```
+
+
+### ensureSymlink(srcpath, dstpath, [type], callback)
+
+Ensures that the symlink exists. If the directory structure does not exist, it is created.
+
+Sync: `ensureSymlinkSync()`
+
+
+Example:
+
+```js
+var fs = require('fs-extra')
+
+var srcpath = '/tmp/file.txt'
+var dstpath = '/tmp/this/path/does/not/exist/file.txt'
+fs.ensureSymlink(srcpath, dstpath, function (err) {
+  console.log(err) // => null
+  // symlink has now been created, including the directory it is to be placed in
+})
+```
+
+
+### mkdirs(dir, callback)
+
+Creates a directory. If the parent hierarchy doesn't exist, it's created. Like `mkdir -p`.
+
+Alias: `mkdirp()`
+
+Sync: `mkdirsSync()` / `mkdirpSync()`
+
+
+Examples:
+
+```js
+var fs = require('fs-extra')
+
+fs.mkdirs('/tmp/some/long/path/that/prob/doesnt/exist', function (err) {
+  if (err) return console.error(err)
+  console.log("success!")
+})
+
+fs.mkdirsSync('/tmp/another/path')
+```
+
+
+### move(src, dest, [options], callback)
+
+Moves a file or directory, even across devices.
+
+Options:
+clobber (boolean): overwrite existing file or directory
+limit (number): number of concurrent moves, see ncp for more information
+
+Example:
+
+```js
+var fs = require('fs-extra')
+
+fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', function (err) {
+  if (err) return console.error(err)
+  console.log("success!")
+})
+```
+
+
+### outputFile(file, data, callback)
+
+Almost the same as `writeFile` (i.e. it [overwrites](http://pages.citebite.com/v2o5n8l2f5reb)), except that if the parent directory does not exist, it's created.
+
+Sync: `outputFileSync()`
+
+
+Example:
+
+```js
+var fs = require('fs-extra')
+var file = '/tmp/this/path/does/not/exist/file.txt'
+
+fs.outputFile(file, 'hello!', function (err) {
+  console.log(err) // => null
+
+  fs.readFile(file, 'utf8', function (err, data) {
+    console.log(data) // => hello!
+  })
+})
+```
+
+
+
+### outputJson(file, data, [options], callback)
+
+Almost the same as `writeJson`, except that if the directory does not exist, it's created.
+`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback).
+
+Alias: `outputJSON()`
+
+Sync: `outputJsonSync()`, `outputJSONSync()`
+
+
+Example:
+
+```js
+var fs = require('fs-extra')
+var file = '/tmp/this/path/does/not/exist/file.txt'
+
+fs.outputJson(file, {name: 'JP'}, function (err) {
+  console.log(err) // => null
+
+  fs.readJson(file, function(err, data) {
+    console.log(data.name) // => JP
+  })
+})
+```
+
+
+
+### readJson(file, [options], callback)
+
+Reads a JSON file and then parses it into an object. `options` are the same
+that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback).
+
+Alias: `readJSON()`
+
+Sync: `readJsonSync()`, `readJSONSync()`
+
+
+Example:
+
+```js
+var fs = require('fs-extra')
+
+fs.readJson('./package.json', function (err, packageObj) {
+  console.log(packageObj.version) // => 0.1.3
+})
+```
+
+`readJsonSync()` can take a `throws` option set to `false` and it won't throw if the JSON is invalid. Example:
+
+```js
+var fs = require('fs-extra')
+var file = path.join('/tmp/some-invalid.json')
+var data = '{not valid JSON'
+fs.writeFileSync(file, data)
+
+var obj = fs.readJsonSync(file, {throws: false})
+console.log(obj) // => null
+```
+
+
+### remove(dir, callback)
+
+Removes a file or directory. The directory can have contents. Like `rm -rf`.
+
+Sync: `removeSync()`
+
+
+Examples:
+
+```js
+var fs = require('fs-extra')
+
+fs.remove('/tmp/myfile', function (err) {
+  if (err) return console.error(err)
+
+  console.log('success!')
+})
+
+fs.removeSync('/home/jprichardson') //I just deleted my entire HOME directory.
+```
+
+
+
+### writeJson(file, object, [options], callback)
+
+Writes an object to a JSON file. `options` are the same that
+you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback).
+
+Alias: `writeJSON()`
+
+Sync: `writeJsonSync()`, `writeJSONSync()`
+
+Example:
+
+```js
+var fs = require('fs-extra')
+fs.writeJson('./package.json', {name: 'fs-extra'}, function (err) {
+  console.log(err)
+})
+```
+
+
+Third Party
+-----------
+
+### Promises
+
+Use [Bluebird](https://github.com/petkaantonov/bluebird). See https://github.com/petkaantonov/bluebird/blob/master/API.md#promisification. `fs-extra` is
+explicitly listed as supported.
+
+```js
+var Promise = require('bluebird')
+var fs = Promise.promisifyAll(require('fs-extra'))
+```
+
+Or you can use the package [`fs-extra-promise`](https://github.com/overlookmotel/fs-extra-promise) that marries the two together.
+
+
+### TypeScript
+
+If you like TypeScript, you can use `fs-extra` with it: https://github.com/borisyankov/DefinitelyTyped/tree/master/fs-extra
+
+
+### File / Directory Watching
+
+If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar).
+
+
+### Misc.
+
+- [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls.
+
+
+
+Hacking on fs-extra
+-------------------
+
+Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project
+uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you,
+you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`.
+
+[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
+
+What's needed?
+- First, take a look at existing issues. Those are probably going to be where the priority lies.
+- More tests for edge cases. Specifically on different platforms. There can never be enough tests.
+- Really really help with the Windows tests. See appveyor outputs for more info.
+- Improve test coverage. See coveralls output for more info.
+- A directory walker. Probably this one: https://github.com/thlorenz/readdirp imported into `fs-extra`.
+- After the directory walker is integrated, any function that needs to traverse directories like
+`copy`, `remove`, or `mkdirs` should be built on top of it.
+- After the aforementioned functions are built on the directory walker, `fs-extra` should then explicitly
+support wildcards.
+
+Note: If you make any big changes, **you should definitely post an issue for discussion first.**
+
+
+Naming
+------
+
+I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here:
+
+* https://github.com/jprichardson/node-fs-extra/issues/2
+* https://github.com/flatiron/utile/issues/11
+* https://github.com/ryanmcgrath/wrench-js/issues/29
+* https://github.com/substack/node-mkdirp/issues/17
+
+First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes.
+
+For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc.
+
+We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`?
+
+My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too.
+
+So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`.
+
+
+Credit
+------
+
+`fs-extra` wouldn't be possible without using the modules from the following authors:
+
+- [Isaac Shlueter](https://github.com/isaacs)
+- [Charlie McConnel](https://github.com/avianflu)
+- [James Halliday](https://github.com/substack)
+- [Andrew Kelley](https://github.com/andrewrk)
+
+
+
+
+License
+-------
+
+Licensed under MIT
+
+Copyright (c) 2011-2015 [JP Richardson](https://github.com/jprichardson)
+
+[1]: http://nodejs.org/docs/latest/api/fs.html
+
+
+[jsonfile]: https://github.com/jprichardson/node-jsonfile

+ 34 - 0
Build/node_modules/fs-extra/lib/copy-sync/copy-file-sync.js

@@ -0,0 +1,34 @@
+var fs = require('graceful-fs')
+
+var BUF_LENGTH = 64 * 1024
+var _buff = new Buffer(BUF_LENGTH)
+
+function copyFileSync (srcFile, destFile, options) {
+  var clobber = options.clobber
+  var preserveTimestamps = options.preserveTimestamps
+
+  if (fs.existsSync(destFile) && !clobber) {
+    throw Error('EEXIST')
+  }
+
+  var fdr = fs.openSync(srcFile, 'r')
+  var stat = fs.fstatSync(fdr)
+  var fdw = fs.openSync(destFile, 'w', stat.mode)
+  var bytesRead = 1
+  var pos = 0
+
+  while (bytesRead > 0) {
+    bytesRead = fs.readSync(fdr, _buff, 0, BUF_LENGTH, pos)
+    fs.writeSync(fdw, _buff, 0, bytesRead)
+    pos += bytesRead
+  }
+
+  if (preserveTimestamps) {
+    fs.futimesSync(fdw, stat.atime, stat.mtime)
+  }
+
+  fs.closeSync(fdr)
+  fs.closeSync(fdw)
+}
+
+module.exports = copyFileSync

+ 47 - 0
Build/node_modules/fs-extra/lib/copy-sync/copy-sync.js

@@ -0,0 +1,47 @@
+var fs = require('graceful-fs')
+var path = require('path')
+var copyFileSync = require('./copy-file-sync')
+var mkdir = require('../mkdirs')
+
+function copySync (src, dest, options) {
+  if (typeof options === 'function' || options instanceof RegExp) {
+    options = {filter: options}
+  }
+
+  options = options || {}
+  options.recursive = !!options.recursive
+
+  // default to true for now
+  options.clobber = 'clobber' in options ? !!options.clobber : true
+  options.preserveTimestamps = 'preserveTimestamps' in options ? !!options.preserveTimestamps : true
+
+  options.filter = options.filter || function () { return true }
+
+  var stats = options.recursive ? fs.lstatSync(src) : fs.statSync(src)
+  var destFolder = path.dirname(dest)
+  var destFolderExists = fs.existsSync(destFolder)
+  var performCopy = false
+
+  if (stats.isFile()) {
+    if (options.filter instanceof RegExp) performCopy = options.filter.test(src)
+    else if (typeof options.filter === 'function') performCopy = options.filter(src)
+
+    if (performCopy) {
+      if (!destFolderExists) mkdir.mkdirsSync(destFolder)
+      copyFileSync(src, dest, {clobber: options.clobber, preserveTimestamps: options.preserveTimestamps})
+    }
+  } else if (stats.isDirectory()) {
+    if (!fs.existsSync(dest)) mkdir.mkdirsSync(dest)
+    var contents = fs.readdirSync(src)
+    contents.forEach(function (content) {
+      var opts = options
+      opts.recursive = true
+      copySync(path.join(src, content), path.join(dest, content), opts)
+    })
+  } else if (options.recursive && stats.isSymbolicLink()) {
+    var srcPath = fs.readlinkSync(src)
+    fs.symlinkSync(srcPath, dest)
+  }
+}
+
+module.exports = copySync

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