Skip to content

Commit f145278

Browse files
committed
WIP: Add support for typed arrays
- Rename `Array` to `TypedArray<T>` - Check/set runtime type of the underlying Godot `Array` - Make all parameters and return values `T` instead of `Variant` - Add `Array` as an alias for `TypedArray<Variant>` - Add `array!` macro and use it in tests - Add `array!` and also `dict!` in the prelude
1 parent acb0696 commit f145278

File tree

10 files changed

+674
-436
lines changed

10 files changed

+674
-436
lines changed

godot-codegen/src/class_generator.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,17 @@ fn make_builtin_class(
297297
sys_ptr: sys::GDExtensionTypePtr,
298298
}
299299
impl<'a> #inner_class<'a> {
300-
pub fn from_outer(outer: &#outer_class) -> Self {
300+
pub fn from_sys_ptr(sys_ptr: sys::GDExtensionTypePtr) -> Self {
301301
Self {
302302
_outer_lifetime: std::marker::PhantomData,
303-
sys_ptr: outer.sys(),
303+
sys_ptr,
304304
}
305305
}
306306

307+
pub fn from_outer(outer: &#outer_class) -> Self {
308+
Self::from_sys_ptr(outer.sys())
309+
}
310+
307311
#methods
308312
}
309313

0 commit comments

Comments
 (0)