Browse Source

Atomic2D module building

Josh Engebretson 10 years ago
parent
commit
c8ec368a01

+ 3 - 0
Build/AtomicSharp/AtomicSharp.csproj

@@ -65,6 +65,9 @@
       <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>
   </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
 </Project>

+ 12 - 0
Build/AtomicSharp/Math.cs

@@ -83,6 +83,18 @@ namespace AtomicEngine
 	[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)]

+ 2 - 2
Source/Atomic/Atomic2D/TmxFile2D.h

@@ -40,7 +40,7 @@ class TmxLayer2D : public RefCounted
     REFCOUNTED(TmxLayer2D)
 
 public:
-    TmxLayer2D(TmxFile2D* tmxFile, TileMapLayerType2D type);
+    TmxLayer2D(TmxFile2D* tmxFile = 0, TileMapLayerType2D type = LT_TILE_LAYER);
     virtual ~TmxLayer2D();
 
     /// Return tmx file.
@@ -95,7 +95,7 @@ class TmxTileLayer2D : public TmxLayer2D
     REFCOUNTED(TmxTileLayer2D)
 
 public:
-    TmxTileLayer2D(TmxFile2D* tmxFile);
+    TmxTileLayer2D(TmxFile2D* tmxFile = 0);
 
     /// Load from XML element.
     bool Load(const XMLElement& element, const TileMapInfo2D& info);

+ 7 - 1
Source/ToolCore/JSBind/CSharp/CSFunctionWriter.cpp

@@ -831,7 +831,13 @@ String CSFunctionWriter::MapDefaultParameter(JSBFunctionType* parameter)
     }
 
     if (init == "IntVector2::ZERO")
-        return "IntVector2.Zero";
+    {
+        dparm.type = "IntVector2";
+        dparm.assignment = "IntVector2.Zero";
+        defaultStructParameters_.Push(dparm);
+        return "default(IntVector2)";
+    }
+
 
     if (init == "Quaternion::IDENTITY")
         return "Quaternion.Identity";

+ 4 - 0
Source/ToolCore/JSBind/CSharp/CSModuleWriter.cpp

@@ -256,6 +256,10 @@ void CSModuleWriter::GenerateManagedEnumsAndConstants(String& source)
             String managedType = GetManagedPrimitiveType(constant.type);
 
             String value = constant.value;
+
+            if (!value.Length())
+                continue;
+
             //static const unsigned M_MIN_UNSIGNED = 0x00000000;
 //            /static const unsigned M_MAX_UNSIGNED = 0xffffffff;