Skip to content

Commit 92b8f48

Browse files
committed
Add back support for Godot 4.3
1 parent f4534fa commit 92b8f48

File tree

20 files changed

+304552
-23
lines changed

20 files changed

+304552
-23
lines changed

.github/workflows/ci-scons.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ jobs:
5151
godot-test-versions: "4.4-stable 4.5-stable"
5252
cache-name: linux-x86_64-godot44
5353

54+
- name: 🐧 Linux (GCC) for Godot 4.3
55+
os: ubuntu-22.04
56+
platform: linux
57+
artifact-name: godot-cpp-linux-glibc2.27-x86_64-release-godot43
58+
artifact-path: bin/libgodot-cpp.linux.template_release.x86_64.a
59+
run-tests: true
60+
api-version: 4.3
61+
godot-test-versions: "4.3-stable 4.4-stable 4.5-stable"
62+
cache-name: linux-x86_64-godot43
63+
5464
- name: 🏁 Windows (x86_64, MSVC)
5565
os: windows-2022
5666
platform: windows

binding_generator.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1135,9 +1135,11 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
11351135
if class_name == "Dictionary":
11361136
result.append("\tconst Variant &operator[](const Variant &p_key) const;")
11371137
result.append("\tVariant &operator[](const Variant &p_key);")
1138+
result.append("#if GODOT_VERSION_MINOR >= 4")
11381139
result.append(
11391140
"\tvoid set_typed(uint32_t p_key_type, const StringName &p_key_class_name, const Variant &p_key_script, uint32_t p_value_type, const StringName &p_value_class_name, const Variant &p_value_script);"
11401141
)
1142+
result.append("#endif")
11411143

11421144
result.append("};")
11431145

@@ -1888,7 +1890,9 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us
18881890
# condition returns false (in such cases it can't compile due to ambiguity).
18891891
f"\t\tif constexpr (!std::is_same_v<decltype(&B::{method_name}), decltype(&T::{method_name})>) {{"
18901892
)
1891-
result.append(f"\t\t\tBIND_VIRTUAL_METHOD(T, {method_name}, {method['hash']});")
1893+
# If using an `extension_api.json` from Godot 4.3 or earlier, there will be no hash for virtual functions.
1894+
method_hash = method.get("hash", 0)
1895+
result.append(f"\t\t\tBIND_VIRTUAL_METHOD(T, {method_name}, {method_hash});")
18921896
result.append("\t\t}")
18931897

18941898
result.append("\t}")

0 commit comments

Comments
 (0)