feat(bindings): update C# wrappers for meshopt, nvtt, ufbx
Refactor and regenerate native C# bindings for Ghost.MeshOptimizer, Ghost.Nvtt, and Ghost.Ufbx to match updated native APIs and improve usability. - Replace meshoptimizer.dll with newer version. - Move meshoptimizer functions to static methods in partial class; add new meshlet, simplification, quantization features. - Remove enum wrappers in favor of constants; delete meshopt_Allocator.cs. - Regenerate native wrappers with PascalCase naming, XML doc comments, and aggressive inlining. - Implement IDisposable for resource structs; update configs for naming, documentation, and method mapping. - Update user code to use new wrapper classes and method names. - Improve documentation and comments for clarity. BREAKING CHANGE: API surface changes, wrapper class and method names updated, enum wrappers removed, custom allocator deleted.
This commit is contained in:
@@ -63,6 +63,45 @@ public sealed class NamingConventions
|
||||
name = TrimUnderscores(name);
|
||||
}
|
||||
|
||||
var style = nameOpts.style as string;
|
||||
if (!string.IsNullOrEmpty(style))
|
||||
{
|
||||
if (string.Equals(style, "PascalCase", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
int counter = 0;
|
||||
Span<char> nameSpan = stackalloc char[name.Length];
|
||||
|
||||
for (int i = 0; i < name.Length; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
nameSpan[counter] = char.ToUpperInvariant(name[i]);
|
||||
counter++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (name[i] == '_')
|
||||
{
|
||||
while (name[i] == '_' && i < name.Length)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
||||
nameSpan[counter] = char.ToUpperInvariant(name[i]);
|
||||
counter++;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
nameSpan[counter] = name[i];
|
||||
counter++;
|
||||
}
|
||||
|
||||
name = nameSpan[..counter].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user