Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions binding_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,7 +1524,15 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
expanded_format = native_struct["format"].replace("(", " ").replace(")", ";").replace(",", ";")
for field in expanded_format.split(";"):
field_type = field.strip().split(" ")[0].split("::")[0]
if field_type != "" and not is_included_type(field_type) and not is_pod_type(field_type):
if (
field_type != ""
and field_type != "{"
and field_type != "}"
and field_type != "union"
and field_type != "struct"
and not is_included_type(field_type)
and not is_pod_type(field_type)
):
if field_type not in used_classes:
used_classes.append(field_type)

Expand All @@ -1548,9 +1556,18 @@ def generate_engine_classes_bindings(api, output_dir, use_template_get_node):
result.append("")

result.append(f"struct {struct_name} {{")
indent = 1
for field in native_struct["format"].split(";"):
if field != "":
result.append(f"\t{field};")
if "}" in field:
indent -= 1
if "{" in field:
parts = field.split("{")
result.append("\t" * indent + parts[0] + "{")
indent += 1
result.append("\t" * indent + parts[1] + ";")
else:
result.append("\t" * indent + field + ";")
result.append("};")

result.append("")
Expand Down
Loading