From b23792acd0101b396ba654e94981f9b066538bbc Mon Sep 17 00:00:00 2001
From: cosmonaut <evan@moonside.games>
Date: Mon, 20 Jun 2022 13:04:44 -0700
Subject: [PATCH] remove empty struct constructors for language compatibility

---
 src/Graphics/State/VertexInputState.cs |  8 ++++----
 src/Math/Fixed/Transform2D.cs          | 22 +++++++++++-----------
 src/Math/Float/Transform2D.cs          | 20 +++++++++++---------
 3 files changed, 26 insertions(+), 24 deletions(-)

diff --git a/src/Graphics/State/VertexInputState.cs b/src/Graphics/State/VertexInputState.cs
index 7ca93ef..9bf8dc1 100644
--- a/src/Graphics/State/VertexInputState.cs
+++ b/src/Graphics/State/VertexInputState.cs
@@ -8,11 +8,11 @@
 		public VertexBinding[] VertexBindings;
 		public VertexAttribute[] VertexAttributes;
 
-		public VertexInputState()
+		public static readonly VertexInputState Empty = new VertexInputState
 		{
-			VertexBindings = new VertexBinding[0];
-			VertexAttributes = new VertexAttribute[0];
-		}
+			VertexBindings = new VertexBinding[0],
+			VertexAttributes = new VertexAttribute[0]
+		};
 
 		public VertexInputState(
 			VertexBinding vertexBinding,
diff --git a/src/Math/Fixed/Transform2D.cs b/src/Math/Fixed/Transform2D.cs
index 9a61c35..a43081c 100644
--- a/src/Math/Fixed/Transform2D.cs
+++ b/src/Math/Fixed/Transform2D.cs
@@ -1,4 +1,4 @@
-namespace MoonWorks.Math.Fixed
+namespace MoonWorks.Math.Fixed
 {
 	public struct Transform2D : System.IEquatable<Transform2D>
 	{
@@ -6,8 +6,9 @@ namespace MoonWorks.Math.Fixed
 		public Fix64 Rotation { get; }
 		public Vector2 Scale { get; }
 
-		private bool transformMatrixCalculated = false;
-		private Matrix3x2 transformMatrix = Matrix3x2.Identity;
+		private bool transformMatrixCalculated;
+		private Matrix3x2 transformMatrix;
+
 		public Matrix3x2 TransformMatrix
 		{
 			get
@@ -25,20 +26,15 @@ namespace MoonWorks.Math.Fixed
 		public bool IsAxisAligned => Rotation % Fix64.PiOver2 == Fix64.Zero;
 		public bool IsUniformScale => Scale.X == Scale.Y;
 
-		public static Transform2D Identity = new Transform2D(Vector2.Zero, Fix64.Zero, Vector2.One);
-
-		public Transform2D()
-		{
-			Position = Vector2.Zero;
-			Rotation = Fix64.Zero;
-			Scale = Vector2.One;
-		}
+		public static readonly Transform2D Identity = new Transform2D(Vector2.Zero, Fix64.Zero, Vector2.One);
 
 		public Transform2D(Vector2 position)
 		{
 			Position = position;
 			Rotation = Fix64.Zero;
 			Scale = Vector2.One;
+			transformMatrixCalculated = false;
+			transformMatrix = Matrix3x2.Identity;
 		}
 
 		public Transform2D(Vector2 position, Fix64 rotation)
@@ -46,6 +42,8 @@ namespace MoonWorks.Math.Fixed
 			Position = position;
 			Rotation = rotation;
 			Scale = Vector2.One;
+			transformMatrixCalculated = false;
+			transformMatrix = Matrix3x2.Identity;
 		}
 
 		public Transform2D(Vector2 position, Fix64 rotation, Vector2 scale)
@@ -53,6 +51,8 @@ namespace MoonWorks.Math.Fixed
 			Position = position;
 			Rotation = rotation;
 			Scale = scale;
+			transformMatrixCalculated = false;
+			transformMatrix = Matrix3x2.Identity;
 		}
 
 		public Transform2D Compose(Transform2D other)
diff --git a/src/Math/Float/Transform2D.cs b/src/Math/Float/Transform2D.cs
index cdd73b4..1de4545 100644
--- a/src/Math/Float/Transform2D.cs
+++ b/src/Math/Float/Transform2D.cs
@@ -1,4 +1,4 @@
-namespace MoonWorks.Math.Float
+namespace MoonWorks.Math.Float
 {
 	public struct Transform2D : System.IEquatable<Transform2D>
 	{
@@ -6,8 +6,9 @@ namespace MoonWorks.Math.Float
 		public float Rotation { get; }
 		public Vector2 Scale { get; }
 
-		private bool transformMatrixCalculated = false;
-		private Matrix3x2 transformMatrix = Matrix3x2.Identity;
+		private bool transformMatrixCalculated;
+		private Matrix3x2 transformMatrix;
+
 		public Matrix3x2 TransformMatrix
 		{
 			get
@@ -25,18 +26,15 @@ namespace MoonWorks.Math.Float
 		public bool IsAxisAligned => Rotation % MathHelper.PiOver2 == 0;
 		public bool IsUniformScale => Scale.X == Scale.Y;
 
-		public Transform2D()
-		{
-			Position = Vector2.Zero;
-			Rotation = 0;
-			Scale = Vector2.One;
-		}
+		public static readonly Transform2D Identity = new Transform2D(Vector2.Zero, 0, Vector2.One);
 
 		public Transform2D(Vector2 position)
 		{
 			Position = position;
 			Rotation = 0;
 			Scale = Vector2.One;
+			transformMatrixCalculated = false;
+			transformMatrix = Matrix3x2.Identity;
 		}
 
 		public Transform2D(Vector2 position, float rotation)
@@ -44,6 +42,8 @@ namespace MoonWorks.Math.Float
 			Position = position;
 			Rotation = rotation;
 			Scale = Vector2.One;
+			transformMatrixCalculated = false;
+			transformMatrix = Matrix3x2.Identity;
 		}
 
 		public Transform2D(Vector2 position, float rotation, Vector2 scale)
@@ -51,6 +51,8 @@ namespace MoonWorks.Math.Float
 			Position = position;
 			Rotation = rotation;
 			Scale = scale;
+			transformMatrixCalculated = false;
+			transformMatrix = Matrix3x2.Identity;
 		}
 
 		public Transform2D Compose(Transform2D other)