Fix hardcoded value in gdnative_builders.py.

This commit is contained in:
Relintai 2023-05-31 09:38:17 +02:00
parent 8bc9036e0c
commit 1dbb4ba7ee

View File

@ -95,6 +95,7 @@ def _build_gdnative_api_struct_header(api):
def generate_core_extension_struct(core): def generate_core_extension_struct(core):
ret_val = [] ret_val = []
if core["next"]: if core["next"]:
ret_val += generate_core_extension_struct(core["next"]) ret_val += generate_core_extension_struct(core["next"])
@ -254,7 +255,15 @@ def _build_gdnative_api_struct_source(api):
"extern const pandemonium_gdnative_core_api_struct api_struct = {", "extern const pandemonium_gdnative_core_api_struct api_struct = {",
"\tGDNATIVE_" + api["core"]["type"] + ",", "\tGDNATIVE_" + api["core"]["type"] + ",",
"\t{" + str(api["core"]["version"]["major"]) + ", " + str(api["core"]["version"]["minor"]) + "},", "\t{" + str(api["core"]["version"]["major"]) + ", " + str(api["core"]["version"]["minor"]) + "},",
"\t(const pandemonium_gdnative_api_struct *)&api_1_1,", "\t" + (
"NULL"
if not api["core"]["next"]
else (
"(const pandemonium_gdnative_api_struct *)& api_{0}_{1}".format(
api["core"]["next"]["version"]["major"], api["core"]["next"]["version"]["minor"]
)
)
) + ",",
"\t" + str(len(api["extensions"])) + ",", "\t" + str(len(api["extensions"])) + ",",
"\tgdnative_extensions_pointers,", "\tgdnative_extensions_pointers,",
] ]