Added skip for pointer to functions, added int64_t compat type
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System.CodeDom;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -61,7 +62,7 @@ namespace CodeGenerator {
|
||||
bool referencePointer = false;
|
||||
|
||||
//Create a new type declaration
|
||||
var ctd = new CodeTypeDeclaration(type.Type); // { IsStruct = true };
|
||||
var ctd = new CodeTypeDeclaration(type.Type);
|
||||
|
||||
foreach (var field in type.Fields) {
|
||||
if (field.Name.Contains("*")) {
|
||||
@@ -88,7 +89,8 @@ namespace CodeGenerator {
|
||||
foreach (var field in type.Fields) {
|
||||
CodeMemberField cmf;
|
||||
string name = field.Name;
|
||||
if (field.Name.Contains("[")) {
|
||||
if (name.Contains("()")) continue;
|
||||
if (name.Contains("[")) {
|
||||
Log($"Generating array field {field.Name}");
|
||||
cmf = CreateArrayMemberField(field);
|
||||
}
|
||||
@@ -209,17 +211,16 @@ namespace CodeGenerator {
|
||||
return cc;
|
||||
}
|
||||
|
||||
private static void SetupCCU(out CodeGeneratorOptions codeGeneratorOptions, out CSharpCodeProvider provider,
|
||||
out CodeCompileUnit ccu) {
|
||||
codeGeneratorOptions = new CodeGeneratorOptions() {
|
||||
private static void SetupCCU(out CodeGeneratorOptions genOpts, out CSharpCodeProvider provider, out CodeCompileUnit ccu) {
|
||||
genOpts = new() {
|
||||
BlankLinesBetweenMembers = false,
|
||||
BracingStyle = "Block",
|
||||
ElseOnClosing = false,
|
||||
ElseOnClosing = true,
|
||||
IndentString = " ",
|
||||
VerbatimOrder = true
|
||||
};
|
||||
provider = new CSharpCodeProvider();
|
||||
var date = DateTime.Now.ToString();
|
||||
provider = new();
|
||||
var date = DateTime.Now.ToString(CultureInfo.InvariantCulture);
|
||||
|
||||
CodeNamespace globalNs = new CodeNamespace();
|
||||
CodeComment comment = new CodeComment("Automatically generated by BlenderSharp at " + date, false);
|
||||
@@ -228,7 +229,7 @@ namespace CodeGenerator {
|
||||
globalNs.Imports.Add(new("System"));
|
||||
globalNs.Imports.Add(new("BlendFile.CompatTypes"));
|
||||
|
||||
ccu = new CodeCompileUnit();
|
||||
ccu = new();
|
||||
ccu.Namespaces.Add(globalNs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user