Skip to content

Commit 90103c4

Browse files
committed
Merge branch 'master' into fork/TitanNano/jovan/eliminate_param_type
Rename duplicate class SignalObject -> SignalDisc # Conflicts: # godot-core/src/builtin/collections/array.rs # godot-core/src/meta/traits.rs
2 parents 7fa6f07 + 46f275a commit 90103c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1148
-283
lines changed

.github/workflows/full-ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ jobs:
246246
os: macos-13
247247
artifact-name: macos-x86-nightly
248248
godot-binary: godot.macos.editor.dev.x86_64
249-
with-hot-reload: true
249+
hot-reload: stable
250250

251251
- name: macos-double-x86
252252
os: macos-13
@@ -264,7 +264,7 @@ jobs:
264264
os: macos-latest
265265
artifact-name: macos-arm-nightly
266266
godot-binary: godot.macos.editor.dev.arm64
267-
with-hot-reload: true
267+
hot-reload: stable
268268

269269
# api-custom on macOS arm64 not working, due to clang linker issues.
270270
# - name: macos-double-arm
@@ -285,7 +285,7 @@ jobs:
285285
os: windows-latest
286286
artifact-name: windows-nightly
287287
godot-binary: godot.windows.editor.dev.x86_64.exe
288-
with-hot-reload: true
288+
hot-reload: stable
289289

290290
- name: windows-double
291291
os: windows-latest
@@ -317,7 +317,7 @@ jobs:
317317
artifact-name: linux-nightly
318318
godot-binary: godot.linuxbsd.editor.dev.x86_64
319319
rust-extra-args: --features itest/codegen-full
320-
with-hot-reload: true
320+
hot-reload: api-custom
321321

322322
# Combines now a lot of features, but should be OK. lazy-function-tables doesn't work with experimental-threads.
323323
- name: linux-double-lazy
@@ -352,12 +352,14 @@ jobs:
352352
rust-cache-key: release
353353

354354
# Linux compat (4.1 disabled, already covered by memcheck)
355+
# No hot-reload before 4.4, as the Godot project is 4.4+.
355356

356357
- name: linux-4.4
357358
os: ubuntu-22.04
358359
artifact-name: linux-4.4
359360
godot-binary: godot.linuxbsd.editor.dev.x86_64
360361
godot-prebuilt-patch: '4.4'
362+
hot-reload: stable
361363

362364
- name: linux-4.3
363365
os: ubuntu-22.04
@@ -418,10 +420,11 @@ jobs:
418420
godot-indirect-json: ${{ matrix.godot-indirect-json }}
419421

420422
- name: "Build and test hot-reload"
421-
if: ${{ matrix.with-hot-reload }}
423+
if: ${{ matrix.hot-reload }}
422424
working-directory: itest/hot-reload/godot
423425
# Repeat a few times, our hot reload integration test can sometimes be a bit flaky.
424-
run: $RETRY ./run-test.sh
426+
# Don't pass in rust-extra-args as environment; they're intended for itest.
427+
run: $RETRY ./run-test.sh ${{ matrix.hot-reload }}
425428
shell: bash
426429

427430

.github/workflows/minimal-ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ jobs:
159159
artifact-name: linux-nightly
160160
godot-binary: godot.linuxbsd.editor.dev.x86_64
161161
rust-extra-args: --features itest/codegen-full
162-
with-hot-reload: true
162+
hot-reload: stable
163163

164164
- name: linux-custom-api-json
165165
os: ubuntu-22.04
@@ -173,6 +173,7 @@ jobs:
173173
artifact-name: linux-nightly
174174
godot-binary: godot.linuxbsd.editor.dev.x86_64
175175
rust-extra-args: --features itest/experimental-threads,itest/codegen-full-experimental,godot/api-custom,godot/serde,itest/register-docs
176+
hot-reload: api-custom
176177

177178
- name: linux-release
178179
os: ubuntu-22.04
@@ -240,9 +241,9 @@ jobs:
240241
godot-indirect-json: ${{ matrix.godot-indirect-json }}
241242

242243
- name: "Build and test hot-reload"
243-
if: ${{ matrix.with-hot-reload }}
244+
if: ${{ matrix.hot-reload }}
244245
working-directory: itest/hot-reload/godot
245-
run: ./run-test.sh
246+
run: ./run-test.sh ${{ matrix.hot-reload }}
246247
shell: bash
247248

248249

godot-core/src/builtin/aabb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
use godot_ffi as sys;
9-
use sys::{ffi_methods, GodotFfi};
9+
use sys::{ffi_methods, ExtVariantType, GodotFfi};
1010

1111
use crate::builtin::math::ApproxEq;
1212
use crate::builtin::{real, Plane, Vector3, Vector3Axis};
@@ -448,7 +448,7 @@ impl std::fmt::Display for Aabb {
448448
// SAFETY:
449449
// This type is represented as `Self` in Godot, so `*mut Self` is sound.
450450
unsafe impl GodotFfi for Aabb {
451-
const VARIANT_TYPE: sys::VariantType = sys::VariantType::AABB;
451+
const VARIANT_TYPE: ExtVariantType = ExtVariantType::Concrete(sys::VariantType::AABB);
452452

453453
ffi_methods! { type sys::GDExtensionTypePtr = *mut Self; .. }
454454
}

godot-core/src/builtin/basis.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
use godot_ffi as sys;
9-
use sys::{ffi_methods, GodotFfi};
9+
use sys::{ffi_methods, ExtVariantType, GodotFfi};
1010

1111
use crate::builtin::math::{ApproxEq, FloatExt, GlamConv, GlamType, XformInv};
1212
use crate::builtin::real_consts::FRAC_PI_2;
@@ -631,7 +631,7 @@ impl XformInv<Vector3> for Basis {
631631
// SAFETY:
632632
// This type is represented as `Self` in Godot, so `*mut Self` is sound.
633633
unsafe impl GodotFfi for Basis {
634-
const VARIANT_TYPE: sys::VariantType = sys::VariantType::BASIS;
634+
const VARIANT_TYPE: ExtVariantType = ExtVariantType::Concrete(sys::VariantType::BASIS);
635635

636636
ffi_methods! { type sys::GDExtensionTypePtr = *mut Self; .. }
637637
}

godot-core/src/builtin/callable.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::obj::bounds::DynMemory;
1414
use crate::obj::Bounds;
1515
use crate::obj::{Gd, GodotClass, InstanceId};
1616
use std::{fmt, ptr};
17-
use sys::{ffi_methods, GodotFfi};
17+
use sys::{ffi_methods, ExtVariantType, GodotFfi};
1818

1919
#[cfg(all(since_api = "4.2", before_api = "4.3"))]
2020
type CallableCustomInfo = sys::GDExtensionCallableCustomInfo;
@@ -441,7 +441,7 @@ impl_builtin_traits! {
441441
// The `opaque` in `Callable` is just a pair of pointers, and requires no special initialization or cleanup
442442
// beyond what is done in `from_opaque` and `drop`. So using `*mut Opaque` is safe.
443443
unsafe impl GodotFfi for Callable {
444-
const VARIANT_TYPE: sys::VariantType = sys::VariantType::CALLABLE;
444+
const VARIANT_TYPE: ExtVariantType = ExtVariantType::Concrete(sys::VariantType::CALLABLE);
445445

446446
ffi_methods! { type sys::GDExtensionTypePtr = *mut Opaque;
447447
fn new_from_sys;

godot-core/src/builtin/collections/array.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ use crate::meta;
1313
use crate::meta::error::{ConvertError, FromGodotError, FromVariantError};
1414
use crate::meta::{
1515
element_godot_type_name, element_variant_type, ArrayElement, ArrayTypeInfo, AsArg, ByRef,
16-
ClassName, FromGodot, GodotConvert, GodotFfiVariant, GodotType, ParamType, PropertyHintInfo,
17-
RefArg, ToGodot,
16+
ClassName, ExtVariantType, FromGodot, GodotConvert, GodotFfiVariant, GodotType, ParamType,
17+
PropertyHintInfo, RefArg, ToGodot,
1818
};
1919
use crate::obj::{bounds, Bounds, DynGd, Gd, GodotClass};
2020
use crate::registry::property::{BuiltinExport, Export, Var};
@@ -1110,7 +1110,7 @@ impl VariantArray {
11101110
// Arrays are properly initialized through a `from_sys` call, but the ref-count should be incremented
11111111
// as that is the callee's responsibility. Which we do by calling `std::mem::forget(array.clone())`.
11121112
unsafe impl<T: ArrayElement> GodotFfi for Array<T> {
1113-
const VARIANT_TYPE: VariantType = VariantType::ARRAY;
1113+
const VARIANT_TYPE: ExtVariantType = ExtVariantType::Concrete(VariantType::ARRAY);
11141114

11151115
ffi_methods! { type sys::GDExtensionTypePtr = *mut Opaque; .. }
11161116
}
@@ -1350,9 +1350,9 @@ impl<T: ArrayElement> GodotFfiVariant for Array<T> {
13501350

13511351
fn ffi_from_variant(variant: &Variant) -> Result<Self, ConvertError> {
13521352
// First check if the variant is an array. The array conversion shouldn't be called otherwise.
1353-
if variant.get_type() != Self::VARIANT_TYPE {
1353+
if variant.get_type() != Self::VARIANT_TYPE.variant_as_nil() {
13541354
return Err(FromVariantError::BadType {
1355-
expected: Self::VARIANT_TYPE,
1355+
expected: Self::VARIANT_TYPE.variant_as_nil(),
13561356
actual: variant.get_type(),
13571357
}
13581358
.into_error(variant.clone()));

godot-core/src/builtin/collections/dictionary.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use godot_ffi as sys;
99

1010
use crate::builtin::{inner, Variant, VariantArray};
11-
use crate::meta::{FromGodot, ToGodot};
11+
use crate::meta::{ExtVariantType, FromGodot, ToGodot};
1212
use sys::types::OpaqueDictionary;
1313
use sys::{ffi_methods, interface_fn, GodotFfi};
1414

@@ -394,7 +394,7 @@ impl Dictionary {
394394
// incremented as that is the callee's responsibility. Which we do by calling
395395
// `std::mem::forget(dictionary.clone())`.
396396
unsafe impl GodotFfi for Dictionary {
397-
const VARIANT_TYPE: sys::VariantType = sys::VariantType::DICTIONARY;
397+
const VARIANT_TYPE: ExtVariantType = ExtVariantType::Concrete(sys::VariantType::DICTIONARY);
398398

399399
ffi_methods! { type sys::GDExtensionTypePtr = *mut Opaque; .. }
400400
}

godot-core/src/builtin/collections/packed_array.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use crate::meta::{AsArg, ToGodot};
1717
use std::mem::size_of;
1818
use std::{fmt, ops, ptr};
1919
use sys::types::*;
20-
use sys::{ffi_methods, interface_fn, GodotFfi};
20+
use sys::{ffi_methods, interface_fn, ExtVariantType, GodotFfi};
2121

2222
use crate::classes::file_access::CompressionMode;
2323
use crate::meta;
@@ -625,7 +625,7 @@ macro_rules! impl_packed_array {
625625
}
626626

627627
unsafe impl GodotFfi for $PackedArray {
628-
const VARIANT_TYPE: sys::VariantType = sys::VariantType::$VariantType;
628+
const VARIANT_TYPE: ExtVariantType = ExtVariantType::Concrete(sys::VariantType::$VariantType);
629629

630630
ffi_methods! { type sys::GDExtensionTypePtr = *mut Opaque; .. }
631631
}

godot-core/src/builtin/color.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::builtin::{ColorHsv, GString};
1313
use crate::meta::{arg_into_ref, AsArg};
1414
use godot_ffi as sys;
1515
use std::ops;
16-
use sys::{ffi_methods, GodotFfi};
16+
use sys::{ffi_methods, ExtVariantType, GodotFfi};
1717

1818
/// Color built-in type, in floating-point RGBA format.
1919
///
@@ -358,7 +358,7 @@ impl Color {
358358
// SAFETY:
359359
// This type is represented as `Self` in Godot, so `*mut Self` is sound.
360360
unsafe impl GodotFfi for Color {
361-
const VARIANT_TYPE: sys::VariantType = sys::VariantType::COLOR;
361+
const VARIANT_TYPE: ExtVariantType = ExtVariantType::Concrete(sys::VariantType::COLOR);
362362

363363
ffi_methods! { type sys::GDExtensionTypePtr = *mut Self; .. }
364364
}

0 commit comments

Comments
 (0)