From a0a4c0c0a22c0c7c872f010049a65ce634959b83 Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Wed, 7 Sep 2022 17:53:36 +0200 Subject: [PATCH 1/2] Changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eb1a748e..ce266b095 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.10.2] - unreleased + +Last maintenance release for Godot 3.4. + +# Added + +- `globalscope::load` method ([#940](https://github.com/godot-rust/godot-rust/pull/940), [#941](https://github.com/godot-rust/godot-rust/pull/941)) +- `Color` constructors from HTML string and integers ([#939](https://github.com/godot-rust/godot-rust/pull/939)) +- Version check to warn if Godot is not 3.4 ([#942](https://github.com/godot-rust/godot-rust/pull/942)) + ## [0.10.1] - 2022-09-03 This is a backwards-compatible release; thus no removals or breaking changes. From 7999e6a7a0f1dd4ebddb1fe9d166fafe013f62ed Mon Sep 17 00:00:00 2001 From: Jan Haller Date: Wed, 7 Sep 2022 19:05:30 +0200 Subject: [PATCH 2/2] Add compatibility version check on startup --- gdnative-core/src/init/macros.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gdnative-core/src/init/macros.rs b/gdnative-core/src/init/macros.rs index 9b001e3d4..18dbca3eb 100644 --- a/gdnative-core/src/init/macros.rs +++ b/gdnative-core/src/init/macros.rs @@ -35,6 +35,24 @@ macro_rules! godot_nativescript_init { return; } + // Compatibility warning if using in-house Godot version (not applicable for custom ones) + #[cfg(not(feature = "custom-godot"))] + { + let engine = gdnative::api::Engine::godot_singleton(); + let info = engine.get_version_info(); + + if info.get("major").expect("major version") != Variant::new(3) + || info.get("minor").expect("minor version") != Variant::new(4) { + let string = info.get("string").expect("version str").to::().expect("version str type"); + gdnative::log::godot_warn!( + "This godot-rust version is only compatible with Godot 3.4.x; detected version {}.\n\ + GDNative mismatches may lead to subtle bugs, undefined behavior or crashes at runtime.\n\ + Apply the 'custom-godot' feature if you want to use current godot-rust with another Godot engine version.", + string + ); + } + } + let __result = ::std::panic::catch_unwind(|| { $callback($crate::init::InitHandle::new(handle)); });