Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 34 additions & 61 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ version = "0.1.0"
edition = "2021"

[workspace.dependencies]
godot = { version = "0.2", features = ["experimental-threads"] }
godot-cell = "0.2"
godot-bindings = "0.2"
godot = { version = "0.3", features = ["experimental-threads"] }
godot-cell = "0.3"
godot-bindings = "0.3"
itertools = "0.10"
rand = "0.8"
darling = { version = "0.20" }
Expand Down
6 changes: 3 additions & 3 deletions derive/src/impl_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ pub fn godot_script_impl(
let arg_rust_type = arg.ty.as_ref();
let arg_type = rust_to_variant_type(arg.ty.as_ref()).unwrap();

is_context_type(arg.ty.as_ref()).then(|| {
if is_context_type(arg.ty.as_ref()) {
(
quote!(),

quote_spanned!(arg.span() => ctx,)
)
}).unwrap_or_else(|| {
} else {
(
quote_spanned! {
arg.span() =>
Expand All @@ -91,7 +91,7 @@ pub fn godot_script_impl(
})?,
}
)
})
}
})
.collect();

Expand Down
4 changes: 2 additions & 2 deletions derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ fn rust_to_variant_type(ty: &syn::Type) -> Result<TokenStream, TokenStream> {
use #godot_types::sys::GodotFfi;
use #godot_types::meta::GodotType;

<<#path as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::variant_type()
<<#path as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::VARIANT_TYPE
}
}),
T::Verbatim(_) => Err(syn::Error::new(
Expand All @@ -206,7 +206,7 @@ fn rust_to_variant_type(ty: &syn::Type) -> Result<TokenStream, TokenStream> {
use #godot_types::sys::GodotFfi;
use #godot_types::meta::GodotType;

<<#tuple as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::variant_type()
<<#tuple as #godot_types::meta::GodotConvert>::Via as GodotType>::Ffi::VARIANT_TYPE
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion rust-script/src/interface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ macro_rules! define_script_root {
use $crate::godot::obj::EngineEnum;
use $crate::private_export::*;

let lock = $crate::private_export::__godot_rust_plugin_SCRIPT_REGISTRY
let lock = $crate::private_export::SCRIPT_REGISTRY
.lock()
.expect("unable to aquire mutex lock");

Expand Down
2 changes: 1 addition & 1 deletion rust-script/src/interface/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ where

impl<T: ArrayElement + GodotScriptExport + GodotType> GodotScriptExport for Array<T> {
fn hint_string(custom_hint: Option<PropertyHint>, custom_string: Option<String>) -> String {
let element_type = <<T as GodotType>::Ffi as GodotFfi>::variant_type().ord();
let element_type = <<T as GodotType>::Ffi as GodotFfi>::VARIANT_TYPE.ord();
let element_hint = <T as GodotScriptExport>::hint(custom_hint).ord();
let element_hint_string = <T as GodotScriptExport>::hint_string(custom_hint, custom_string);

Expand Down
2 changes: 1 addition & 1 deletion rust-script/src/interface/signals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ macro_rules! signal_argument_desc {
($name:literal, $type:ty) => {
RustScriptPropDesc {
name: $name,
ty: <<<$type as GodotConvert>::Via as GodotType>::Ffi as godot::sys::GodotFfi>::variant_type(),
ty: <<<$type as GodotConvert>::Via as GodotType>::Ffi as godot::sys::GodotFfi>::VARIANT_TYPE,
class_name: <<$type as GodotConvert>::Via as GodotType>::class_name(),
exported: false,
hint: PropertyHint::NONE,
Expand Down
6 changes: 3 additions & 3 deletions rust-script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ pub use runtime::RustScriptExtensionLayer;
#[doc(hidden)]
pub mod private_export {
pub use crate::static_script_registry::{
RustScriptMetaData, __godot_rust_plugin_SCRIPT_REGISTRY, assemble_metadata,
create_default_data_struct, RegistryItem, RustScriptEntry, RustScriptEntryMethods,
RustScriptMethodDesc, RustScriptPropDesc, RustScriptSignalDesc,
assemble_metadata, create_default_data_struct, RegistryItem, RustScriptEntry,
RustScriptEntryMethods, RustScriptMetaData, RustScriptMethodDesc, RustScriptPropDesc,
RustScriptSignalDesc, SCRIPT_REGISTRY,
};
pub use const_str::{concat, replace, strip_prefix, unwrap};
pub use godot::sys::{plugin_add, plugin_registry};
Expand Down
6 changes: 3 additions & 3 deletions rust-script/src/runtime/rust_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use godot::classes::{
use godot::global::{godot_error, godot_print, godot_warn, PropertyUsageFlags};
use godot::meta::{MethodInfo, PropertyInfo, ToGodot};
use godot::obj::script::create_script_instance;
use godot::obj::{EngineBitfield, EngineEnum, InstanceId, WithBaseField};
use godot::obj::{EngineBitfield, InstanceId, WithBaseField};
use godot::prelude::{
godot_api, Array, Base, Callable, Dictionary, GString, Gd, GodotClass, StringName, Variant,
VariantArray,
Expand Down Expand Up @@ -183,7 +183,7 @@ impl IScriptExtension for RustScript {
false
}

unsafe fn instance_create(&self, mut for_object: Gd<Object>) -> *mut c_void {
unsafe fn instance_create_rawptr(&self, mut for_object: Gd<Object>) -> *mut c_void {
self.owners.borrow_mut().insert(for_object.instance_id());

let data = self.create_remote_instance(for_object.clone());
Expand All @@ -203,7 +203,7 @@ impl IScriptExtension for RustScript {
create_script_instance(instance, for_object)
}

unsafe fn placeholder_instance_create(&self, for_object: Gd<Object>) -> *mut c_void {
unsafe fn placeholder_instance_create_rawptr(&self, for_object: Gd<Object>) -> *mut c_void {
self.owners.borrow_mut().insert(for_object.instance_id());

let placeholder = RustScriptPlaceholder::new(self.to_gd());
Expand Down
6 changes: 3 additions & 3 deletions rust-script/src/runtime/rust_script_language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ impl IScriptLanguageExtension for RustScriptLanguage {
}

#[expect(unused_variables)]
unsafe fn debug_get_stack_level_instance(&mut self, level: i32) -> *mut c_void {
unsafe fn debug_get_stack_level_instance_rawptr(&mut self, level: i32) -> *mut c_void {
unimplemented!("debugging is not implemented!");
}

Expand Down Expand Up @@ -391,7 +391,7 @@ impl IScriptLanguageExtension for RustScriptLanguage {
fn profiling_set_save_native_calls(&mut self, enable: bool) {}

#[expect(unused_variables)]
unsafe fn profiling_get_accumulated_data(
unsafe fn profiling_get_accumulated_data_rawptr(
&mut self,
info_array: *mut ScriptLanguageExtensionProfilingInfo,
info_max: i32,
Expand All @@ -400,7 +400,7 @@ impl IScriptLanguageExtension for RustScriptLanguage {
}

#[expect(unused_variables)]
unsafe fn profiling_get_frame_data(
unsafe fn profiling_get_frame_data_rawptr(
&mut self,
info_array: *mut ScriptLanguageExtensionProfilingInfo,
info_max: i32,
Expand Down
Loading
Loading