From 606d2624af00d58da1c3dff0e25c55099459a973 Mon Sep 17 00:00:00 2001 From: Karroffel Date: Sun, 23 Jul 2017 17:14:50 +0200 Subject: [PATCH] new ptrcall number sizes (int64_t and double) --- binding_generator.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/binding_generator.py b/binding_generator.py index 22c27890..310efb03 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -50,6 +50,10 @@ def make_gdnative_type(t): else: return strip_name(t) + " *" else: + if t == "int": + return "int64_t " + if t == "float" or t == "real": + return "double " return strip_name(t) + " " def generate_class_header(used_classes, c): @@ -73,6 +77,7 @@ def generate_class_header(used_classes, c): source.append("") source.append("#include ") + source.append("#include ") source.append("") @@ -427,7 +432,7 @@ def generate_icall_header(icalls): source.append("") source.append("#include ") - source.append("") + source.append("#include ") source.append("") source.append("#include ") @@ -477,7 +482,7 @@ def generate_icall_implementation(icalls): source.append("") source.append("#include ") - source.append("") + source.append("#include ") source.append("") source.append("#include ") @@ -513,7 +518,7 @@ def generate_icall_implementation(icalls): source.append(method_signature + " {") if ret_type != "void": - source.append("\t" + strip_name(ret_type) + (" *" if is_class_type(ret_type) else " ") + "ret;") + source.append("\t" + return_type(ret_type) + "ret;") if is_class_type(ret_type): source.append("\tret = nullptr;") @@ -567,6 +572,10 @@ def generate_icall_implementation(icalls): def return_type(t): if is_class_type(t): return "Object *" + if t == "int": + return "int64_t " + if t == "float" or t == "real": + return "double " return t + " "