Generate constants in the bindings generator

pull/828/head
Aaron Franke 2022-09-02 21:32:38 -05:00
parent 862d1f1fdd
commit 76ad89fe0b
No known key found for this signature in database
GPG Key ID: 40A1750B977E56BF
1 changed files with 7 additions and 0 deletions

View File

@ -1005,6 +1005,13 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us
result.append("\t};") result.append("\t};")
result.append("") result.append("")
if "constants" in class_api:
for value in class_api["constants"]:
if "type" not in value:
value["type"] = "int"
result.append(f'\tconst {value["type"]} {value["name"]} = {value["value"]};')
result.append("")
if is_singleton: if is_singleton:
result.append(f"\tstatic {class_name} *get_singleton();") result.append(f"\tstatic {class_name} *get_singleton();")
result.append("") result.append("")