diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-07 12:20:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-07 12:20:41 +0100 |
commit | 2f785c9da14ea4f312798b2ef1f8fe6af8cbeb61 (patch) | |
tree | e00635c76b554440812150311237866420633d9b | |
parent | 3da6db4fe41b8f3d3aaeb0dc80f1556f83fd7fe6 (diff) | |
parent | 18eed144ca70dc7221a08393ced3081101338f0d (diff) | |
download | redot-cpp-2f785c9da14ea4f312798b2ef1f8fe6af8cbeb61.tar.gz |
Merge pull request #987 from bruvzg/fix_enum_size
Fix enum return value size.
-rw-r--r-- | binding_generator.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/binding_generator.py b/binding_generator.py index ad81d4d..529bf0d 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -1363,7 +1363,12 @@ def generate_engine_class_source(class_api, used_classes, fully_used_classes, us if has_return: return_type = method["return_value"]["type"] meta_type = method["return_value"]["meta"] if "meta" in method["return_value"] else None - if is_pod_type(return_type) or is_variant(return_type) or is_enum(return_type): + if is_enum(return_type): + if method["is_static"]: + method_call += f"return ({get_gdextension_type(correct_type(return_type, meta_type))})internal::_call_native_mb_ret<int64_t>(___method_bind, nullptr" + else: + method_call += f"return ({get_gdextension_type(correct_type(return_type, meta_type))})internal::_call_native_mb_ret<int64_t>(___method_bind, _owner" + elif is_pod_type(return_type) or is_variant(return_type): if method["is_static"]: method_call += f"return internal::_call_native_mb_ret<{get_gdextension_type(correct_type(return_type, meta_type))}>(___method_bind, nullptr" else: |