forked from Misaki/GhostEngine
feat(nativegen)!: refactor to struct-based native wrappers
Major overhaul of native wrapper generation for ufbx and nvtt. Replaces all hand-written and class-based wrappers with auto-generated partial struct wrappers that directly expose native API methods via pointers. Introduces a new JSON-driven configuration system using "remaps" and "actions" for flexible parameter/return mapping and method routing. Removes legacy config sections and helper classes, focusing solely on method wrappers. Updates all usages and tests to use the new pointer-based API. Cleans up obsolete code and ensures resource management is handled via struct Dispose methods. The result is a thinner, more direct, and maintainable interop layer. BREAKING CHANGE: All managed wrapper classes and helpers are removed in favor of struct-based pointer wrappers. API usage and resource management patterns have changed.
This commit is contained in:
171
src/ThridParty/Ghost.Ufbx/Wrapper/ufbx_props.nativegen.cs
Normal file
171
src/ThridParty/Ghost.Ufbx/Wrapper/ufbx_props.nativegen.cs
Normal file
@@ -0,0 +1,171 @@
|
||||
// <auto-generated>
|
||||
// This file is generated by Ghost.NativeWrapperGen. Do not edit manually.
|
||||
// </auto-generated>
|
||||
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Ghost.Ufbx;
|
||||
|
||||
public unsafe partial struct ufbx_props
|
||||
{
|
||||
// From: ufbx_find_prop_len(ufbx_props*, sbyte*, nuint)
|
||||
public ufbx_prop* find_prop_len(ReadOnlySpan<byte> name)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
return Api.ufbx_find_prop_len(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(sbyte*)pname,
|
||||
(nuint)name.Length);
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_find_prop(ufbx_props*, sbyte*)
|
||||
public ufbx_prop* find_prop(sbyte* name)
|
||||
{
|
||||
return Api.ufbx_find_prop(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
name);
|
||||
}
|
||||
|
||||
// From: ufbx_find_real_len(ufbx_props*, sbyte*, nuint, float)
|
||||
public float find_real_len(ReadOnlySpan<byte> name, float def)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
return Api.ufbx_find_real_len(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(sbyte*)pname,
|
||||
(nuint)name.Length,
|
||||
def);
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_find_real(ufbx_props*, sbyte*, float)
|
||||
public float find_real(sbyte* name, float def)
|
||||
{
|
||||
return Api.ufbx_find_real(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
name,
|
||||
def);
|
||||
}
|
||||
|
||||
// From: ufbx_find_vec3_len(ufbx_props*, sbyte*, nuint, Misaki.HighPerformance.Mathematics.float3)
|
||||
public Misaki.HighPerformance.Mathematics.float3 find_vec3_len(ReadOnlySpan<byte> name, Misaki.HighPerformance.Mathematics.float3 def)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
return Api.ufbx_find_vec3_len(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(sbyte*)pname,
|
||||
(nuint)name.Length,
|
||||
def);
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_find_vec3(ufbx_props*, sbyte*, Misaki.HighPerformance.Mathematics.float3)
|
||||
public Misaki.HighPerformance.Mathematics.float3 find_vec3(sbyte* name, Misaki.HighPerformance.Mathematics.float3 def)
|
||||
{
|
||||
return Api.ufbx_find_vec3(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
name,
|
||||
def);
|
||||
}
|
||||
|
||||
// From: ufbx_find_int_len(ufbx_props*, sbyte*, nuint, long)
|
||||
public long find_int_len(ReadOnlySpan<byte> name, long def)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
return Api.ufbx_find_int_len(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(sbyte*)pname,
|
||||
(nuint)name.Length,
|
||||
def);
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_find_int(ufbx_props*, sbyte*, long)
|
||||
public long find_int(sbyte* name, long def)
|
||||
{
|
||||
return Api.ufbx_find_int(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
name,
|
||||
def);
|
||||
}
|
||||
|
||||
// From: ufbx_find_bool_len(ufbx_props*, sbyte*, nuint, bool)
|
||||
public bool find_bool_len(ReadOnlySpan<byte> name, bool def)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
return Api.ufbx_find_bool_len(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(sbyte*)pname,
|
||||
(nuint)name.Length,
|
||||
def);
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_find_bool(ufbx_props*, sbyte*, bool)
|
||||
public bool find_bool(sbyte* name, bool def)
|
||||
{
|
||||
return Api.ufbx_find_bool(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
name,
|
||||
def);
|
||||
}
|
||||
|
||||
// From: ufbx_find_string_len(ufbx_props*, sbyte*, nuint, ufbx_string)
|
||||
public ufbx_string find_string_len(ReadOnlySpan<byte> name, ufbx_string def)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
return Api.ufbx_find_string_len(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(sbyte*)pname,
|
||||
(nuint)name.Length,
|
||||
def);
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_find_string(ufbx_props*, sbyte*, ufbx_string)
|
||||
public ufbx_string find_string(sbyte* name, ufbx_string def)
|
||||
{
|
||||
return Api.ufbx_find_string(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
name,
|
||||
def);
|
||||
}
|
||||
|
||||
// From: ufbx_find_blob_len(ufbx_props*, sbyte*, nuint, ufbx_blob)
|
||||
public ufbx_blob find_blob_len(ReadOnlySpan<byte> name, ufbx_blob def)
|
||||
{
|
||||
fixed (byte* pname = name)
|
||||
{
|
||||
return Api.ufbx_find_blob_len(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
(sbyte*)pname,
|
||||
(nuint)name.Length,
|
||||
def);
|
||||
}
|
||||
}
|
||||
|
||||
// From: ufbx_find_blob(ufbx_props*, sbyte*, ufbx_blob)
|
||||
public ufbx_blob find_blob(sbyte* name, ufbx_blob def)
|
||||
{
|
||||
return Api.ufbx_find_blob(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
name,
|
||||
def);
|
||||
}
|
||||
|
||||
// From: ufbx_find_prop_concat(ufbx_props*, ufbx_string*, nuint)
|
||||
public ufbx_prop* find_prop_concat(ufbx_string* parts, nuint num_parts)
|
||||
{
|
||||
return Api.ufbx_find_prop_concat(
|
||||
(ufbx_props*)System.Runtime.CompilerServices.Unsafe.AsPointer(ref this),
|
||||
parts,
|
||||
num_parts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user