New IO structure, unexpexted error in C code

This commit is contained in:
Nitload
2023-06-22 03:33:24 +08:00
parent 50b4965e54
commit ee8132c149
172 changed files with 1344 additions and 4023 deletions
+6 -10
View File
@@ -1,22 +1,18 @@
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Text;
namespace StgSharp.Math
{
[StructLayout(LayoutKind.Explicit)]
public struct vec2d:IEquatable<vec2d>
public struct vec2d : IEquatable<vec2d>
{
[FieldOffset(0)]
public float X;
[FieldOffset(sizeof(float))]
public float Y;
public vec2d(float x,float y)
public vec2d(float x, float y)
{
X = x;
Y = y;
@@ -62,7 +58,7 @@ namespace StgSharp.Math
public static bool operator ==(vec2d vec1, vec2d vec2)
{
return vec1.X==vec2.X && vec1.Y==vec2.Y;
return vec1.X == vec2.X && vec1.Y == vec2.Y;
}
public static bool operator !=(vec2d vec1, vec2d vec2)
@@ -87,13 +83,13 @@ namespace StgSharp.Math
public static vec2d operator /(vec2d vec, float x)
{
return new vec2d(vec.X/x, vec.Y/x);
return new vec2d(vec.X / x, vec.Y / x);
}
public static implicit operator float[](vec2d vec)
{
return new float[2] {vec.X,vec.Y };
return new float[2] { vec.X, vec.Y };
}
}
}