Skip to content

Commit e106e58

Browse files
ecobiubiuBromeon
authored andcommitted
Remove outdated GDNative API checks (v1.3 used to mean "Godot 4" years ago)
1 parent df23a65 commit e106e58

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

gdnative-core/src/private.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,21 @@ unsafe fn check_api_compatibility(
5252
next,
5353
} = *api;
5454

55+
// Note: this code ensured that Godot 4 (which was back then GDNative 1.3) wasn't actually used.
56+
// Godot uses now GDExtension, so this no longer applies. Keep this around in case old Godot 4 versions still
57+
// need to be detected in the future. Now just check against minor version 1.
58+
// See also: gdnative-sys/build.rs:485
59+
// See also: https://github.com/godot-rust/godot-rust/issues/904
60+
5561
// Godot 4 is not yet supported
5662
if type_ as crate::sys::GDNATIVE_API_TYPES == crate::sys::GDNATIVE_API_TYPES_GDNATIVE_CORE
57-
&& version.major == 1
58-
&& version.minor == 3
63+
&& version.major != 1
64+
// && version.major == 1 && version.minor == 3 (old check)
5965
{
60-
return Err(sys::InitError::Generic{ message: "GodotEngine v4.* is not yet supported. See https://github.com/godot-rust/godot-rust/issues/396".into() });
66+
return Err(sys::InitError::Generic {
67+
message: "GDNative major version 1 expected".into(),
68+
});
69+
//return Err(sys::InitError::Generic{ message: "GodotEngine v4.* is not yet supported. See https://github.com/godot-rust/godot-rust/issues/396".into() });
6170
}
6271

6372
api = next;

gdnative-sys/build.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,21 @@ mod api_wrapper {
482482
let api_root: ApiRoot = miniserde::json::from_str(&api_json_file)
483483
.unwrap_or_else(|_| panic!("Could not parse ({:?}) into ApiRoot", from_json));
484484

485-
for api in api_root.all_apis() {
486-
// Currently don't support Godot 4.0
487-
assert!(
488-
!(api.version.major == 1 && api.version.minor == 3),
489-
"GodotEngine v4.* is not yet supported. See https://github.com/godot-rust/godot-rust/issues/396"
490-
);
491-
}
485+
// Note: this code ensured that Godot 4 (which was back then GDNative 1.3) wasn't actually used.
486+
// Godot uses now GDExtension, so this no longer applies. In fact, different module APIs all have different versions.
487+
// See also: https://github.com/godot-rust/godot-rust/issues/904
488+
489+
// Listed versions for Godot 3.5 RC:
490+
// * CORE 1.0
491+
// * CORE 1.1
492+
// * CORE 1.2
493+
// * NATIVESCRIPT 1.0
494+
// * NATIVESCRIPT 1.1
495+
// * PLUGINSCRIPT 1.0
496+
// * ARVR 1.1
497+
// * VIDEODECODER 0.1
498+
// * NET 3.1
499+
// * NET 3.2
492500

493501
let struct_fields = godot_api_functions(&api_root);
494502
let impl_constructor = api_constructor(&api_root);

0 commit comments

Comments
 (0)