From a614f61015ebb8640dc2ab026a658d93deed6709 Mon Sep 17 00:00:00 2001 From: Daylily-Zeleen Date: Thu, 2 Feb 2023 16:38:34 +0800 Subject: [PATCH] Fix global enum cast and add Varint::Type cast. --- binding_generator.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/binding_generator.py b/binding_generator.py index d3c7261d..7634942b 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -1621,7 +1621,13 @@ def generate_global_constant_binds(api, output_dir): if enum_def["name"].startswith("Variant."): continue - header.append(f'VARIANT_ENUM_CAST(godot::{enum_def["name"]});') + if enum_def["is_bitfield"]: + header.append(f'VARIANT_BITFIELD_CAST(godot::{enum_def["name"]});') + else: + header.append(f'VARIANT_ENUM_CAST(godot::{enum_def["name"]});') + + # Variant::Type is not a global enum, but only one line, it is worth to place in this file instead of creating new file. + header.append(f"VARIANT_ENUM_CAST(godot::Variant::Type);") header.append("")