|
@@ -35,6 +35,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_ref
|
|
public ref struct godot_ref
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_ref* GetUnsafeAddress()
|
|
|
|
+ => (godot_ref*)Unsafe.AsPointer(ref Unsafe.AsRef(in _reference));
|
|
|
|
+
|
|
private IntPtr _reference;
|
|
private IntPtr _reference;
|
|
|
|
|
|
public void Dispose()
|
|
public void Dispose()
|
|
@@ -73,6 +77,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_variant_call_error
|
|
public ref struct godot_variant_call_error
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_variant_call_error* GetUnsafeAddress()
|
|
|
|
+ => (godot_variant_call_error*)Unsafe.AsPointer(ref Unsafe.AsRef(in error));
|
|
|
|
+
|
|
private godot_variant_call_error_error error;
|
|
private godot_variant_call_error_error error;
|
|
private int argument;
|
|
private int argument;
|
|
private int expected;
|
|
private int expected;
|
|
@@ -100,6 +108,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_variant
|
|
public ref struct godot_variant
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_variant* GetUnsafeAddress()
|
|
|
|
+ => (godot_variant*)Unsafe.AsPointer(ref Unsafe.AsRef(in _typeField));
|
|
|
|
+
|
|
// Variant.Type is generated as an enum of type long, so we can't use for the field as it must only take 32-bits.
|
|
// Variant.Type is generated as an enum of type long, so we can't use for the field as it must only take 32-bits.
|
|
[FieldOffset(0)] private int _typeField;
|
|
[FieldOffset(0)] private int _typeField;
|
|
|
|
|
|
@@ -147,7 +159,7 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public struct godot_variant_obj_data
|
|
public struct godot_variant_obj_data
|
|
{
|
|
{
|
|
- public UInt64 id;
|
|
|
|
|
|
+ public ulong id;
|
|
public IntPtr obj;
|
|
public IntPtr obj;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -431,6 +443,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_string
|
|
public ref struct godot_string
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_string* GetUnsafeAddress()
|
|
|
|
+ => (godot_string*)Unsafe.AsPointer(ref Unsafe.AsRef(in _ptr));
|
|
|
|
+
|
|
private IntPtr _ptr;
|
|
private IntPtr _ptr;
|
|
|
|
|
|
public void Dispose()
|
|
public void Dispose()
|
|
@@ -459,6 +475,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_string_name
|
|
public ref struct godot_string_name
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_string_name* GetUnsafeAddress()
|
|
|
|
+ => (godot_string_name*)Unsafe.AsPointer(ref Unsafe.AsRef(in _data));
|
|
|
|
+
|
|
private IntPtr _data;
|
|
private IntPtr _data;
|
|
|
|
|
|
public void Dispose()
|
|
public void Dispose()
|
|
@@ -528,6 +548,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_node_path
|
|
public ref struct godot_node_path
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_node_path* GetUnsafeAddress()
|
|
|
|
+ => (godot_node_path*)Unsafe.AsPointer(ref Unsafe.AsRef(in _data));
|
|
|
|
+
|
|
private IntPtr _data;
|
|
private IntPtr _data;
|
|
|
|
|
|
public void Dispose()
|
|
public void Dispose()
|
|
@@ -572,13 +596,19 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_signal
|
|
public ref struct godot_signal
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_signal* GetUnsafeAddress()
|
|
|
|
+ => (godot_signal*)Unsafe.AsPointer(ref Unsafe.AsRef(in _getUnsafeAddressHelper));
|
|
|
|
+
|
|
|
|
+ [FieldOffset(0)] private byte _getUnsafeAddressHelper;
|
|
|
|
+
|
|
[FieldOffset(0)] private godot_string_name _name;
|
|
[FieldOffset(0)] private godot_string_name _name;
|
|
|
|
|
|
// There's padding here on 32-bit
|
|
// There's padding here on 32-bit
|
|
|
|
|
|
- [FieldOffset(8)] private UInt64 _objectId;
|
|
|
|
|
|
+ [FieldOffset(8)] private ulong _objectId;
|
|
|
|
|
|
- public godot_signal(godot_string_name name, ulong objectId)
|
|
|
|
|
|
+ public godot_signal(godot_string_name name, ulong objectId) : this()
|
|
{
|
|
{
|
|
_name = name;
|
|
_name = name;
|
|
_objectId = objectId;
|
|
_objectId = objectId;
|
|
@@ -590,7 +620,7 @@ namespace Godot.NativeInterop
|
|
get => _name;
|
|
get => _name;
|
|
}
|
|
}
|
|
|
|
|
|
- public UInt64 ObjectId
|
|
|
|
|
|
+ public ulong ObjectId
|
|
{
|
|
{
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
get => _objectId;
|
|
get => _objectId;
|
|
@@ -609,12 +639,18 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_callable
|
|
public ref struct godot_callable
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_callable* GetUnsafeAddress()
|
|
|
|
+ => (godot_callable*)Unsafe.AsPointer(ref Unsafe.AsRef(in _getUnsafeAddressHelper));
|
|
|
|
+
|
|
|
|
+ [FieldOffset(0)] private byte _getUnsafeAddressHelper;
|
|
|
|
+
|
|
[FieldOffset(0)] private godot_string_name _method;
|
|
[FieldOffset(0)] private godot_string_name _method;
|
|
|
|
|
|
// There's padding here on 32-bit
|
|
// There's padding here on 32-bit
|
|
|
|
|
|
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
|
|
// ReSharper disable once PrivateFieldCanBeConvertedToLocalVariable
|
|
- [FieldOffset(8)] private UInt64 _objectId;
|
|
|
|
|
|
+ [FieldOffset(8)] private ulong _objectId;
|
|
[FieldOffset(8)] private IntPtr _custom;
|
|
[FieldOffset(8)] private IntPtr _custom;
|
|
|
|
|
|
public godot_callable(godot_string_name method, ulong objectId) : this()
|
|
public godot_callable(godot_string_name method, ulong objectId) : this()
|
|
@@ -637,11 +673,17 @@ namespace Godot.NativeInterop
|
|
// A correctly constructed value needs to call the native default constructor to allocate `_p`.
|
|
// A correctly constructed value needs to call the native default constructor to allocate `_p`.
|
|
// Don't pass a C# default constructed `godot_array` to native code, unless it's going to
|
|
// Don't pass a C# default constructed `godot_array` to native code, unless it's going to
|
|
// be re-assigned a new value (the copy constructor checks if `_p` is null so that's fine).
|
|
// be re-assigned a new value (the copy constructor checks if `_p` is null so that's fine).
|
|
- [StructLayout(LayoutKind.Sequential)]
|
|
|
|
|
|
+ [StructLayout(LayoutKind.Explicit)]
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_array
|
|
public ref struct godot_array
|
|
{
|
|
{
|
|
- private unsafe ArrayPrivate* _p;
|
|
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _getUnsafeAddressHelper));
|
|
|
|
+
|
|
|
|
+ [FieldOffset(0)] private byte _getUnsafeAddressHelper;
|
|
|
|
+
|
|
|
|
+ [FieldOffset(0)] private unsafe ArrayPrivate* _p;
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
private struct ArrayPrivate
|
|
private struct ArrayPrivate
|
|
@@ -722,6 +764,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_dictionary
|
|
public ref struct godot_dictionary
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_dictionary* GetUnsafeAddress()
|
|
|
|
+ => (godot_dictionary*)Unsafe.AsPointer(ref Unsafe.AsRef(in _p));
|
|
|
|
+
|
|
private IntPtr _p;
|
|
private IntPtr _p;
|
|
|
|
|
|
public readonly bool IsAllocated
|
|
public readonly bool IsAllocated
|
|
@@ -759,6 +805,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_byte_array
|
|
public ref struct godot_packed_byte_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_byte_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_byte_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe byte* _ptr;
|
|
private unsafe byte* _ptr;
|
|
|
|
|
|
@@ -787,6 +837,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_int32_array
|
|
public ref struct godot_packed_int32_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_int32_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_int32_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe int* _ptr;
|
|
private unsafe int* _ptr;
|
|
|
|
|
|
@@ -815,6 +869,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_int64_array
|
|
public ref struct godot_packed_int64_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_int64_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_int64_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe long* _ptr;
|
|
private unsafe long* _ptr;
|
|
|
|
|
|
@@ -843,6 +901,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_float32_array
|
|
public ref struct godot_packed_float32_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_float32_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_float32_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe float* _ptr;
|
|
private unsafe float* _ptr;
|
|
|
|
|
|
@@ -871,6 +933,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_float64_array
|
|
public ref struct godot_packed_float64_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_float64_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_float64_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe double* _ptr;
|
|
private unsafe double* _ptr;
|
|
|
|
|
|
@@ -899,6 +965,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_string_array
|
|
public ref struct godot_packed_string_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_string_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_string_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe godot_string* _ptr;
|
|
private unsafe godot_string* _ptr;
|
|
|
|
|
|
@@ -927,6 +997,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_vector2_array
|
|
public ref struct godot_packed_vector2_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_vector2_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_vector2_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe Vector2* _ptr;
|
|
private unsafe Vector2* _ptr;
|
|
|
|
|
|
@@ -955,6 +1029,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_vector3_array
|
|
public ref struct godot_packed_vector3_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_vector3_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_vector3_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe Vector3* _ptr;
|
|
private unsafe Vector3* _ptr;
|
|
|
|
|
|
@@ -983,6 +1061,10 @@ namespace Godot.NativeInterop
|
|
// ReSharper disable once InconsistentNaming
|
|
// ReSharper disable once InconsistentNaming
|
|
public ref struct godot_packed_color_array
|
|
public ref struct godot_packed_color_array
|
|
{
|
|
{
|
|
|
|
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
|
|
+ internal readonly unsafe godot_packed_color_array* GetUnsafeAddress()
|
|
|
|
+ => (godot_packed_color_array*)Unsafe.AsPointer(ref Unsafe.AsRef(in _writeProxy));
|
|
|
|
+
|
|
private IntPtr _writeProxy;
|
|
private IntPtr _writeProxy;
|
|
private unsafe Color* _ptr;
|
|
private unsafe Color* _ptr;
|
|
|
|
|