kitgit

tirbofish/dropbear · commit

481ea184b272ab0d614c99b38e45308c441674eb

fix: scripting, runtime/play mode works now :)

Unverified

Thribhu K <4tkbytes@pm.me> · 2026-02-18 08:01

view full diff

diff --git a/crates/eucalyptus-core/src/ptr.rs b/crates/eucalyptus-core/src/ptr.rs
index 1bf3a60..87a9860 100644
--- a/crates/eucalyptus-core/src/ptr.rs
+++ b/crates/eucalyptus-core/src/ptr.rs
@@ -1,6 +1,7 @@
 //! Helper pointers and typedef definitions.
 
 use std::sync::Arc;
+use std::ffi::c_void;
 use crate::input::InputState;
 use crate::command::CommandBuffer;
 use crossbeam_channel::Sender;
@@ -52,4 +53,9 @@ pub type SceneLoaderUnwrapped = Mutex<SceneLoader>;
 /// A mutable pointer to a [`PhysicsState`].
 ///
 /// Defined in `dropbear_common.h` as `PhysicsEngine`
-pub type PhysicsStatePtr = *mut PhysicsState;
\ No newline at end of file
+pub type PhysicsStatePtr = *mut PhysicsState;
+
+/// A mutable pointer to the UI command buffer/state.
+///
+/// This is treated as an opaque pointer by scripting layers.
+pub type UiBufferPtr = *mut c_void;
\ No newline at end of file
diff --git a/crates/eucalyptus-core/src/scripting.rs b/crates/eucalyptus-core/src/scripting.rs
index 5c9590f..d48bcac 100644
--- a/crates/eucalyptus-core/src/scripting.rs
+++ b/crates/eucalyptus-core/src/scripting.rs
@@ -12,7 +12,7 @@ pub static JVM_ARGS: OnceLock<String> = OnceLock::new();
 pub static AWAIT_JDB: OnceLock<bool> = OnceLock::new();
 
 use std::sync::OnceLock;
-use crate::ptr::{AssetRegistryPtr, CommandBufferPtr, GraphicsContextPtr, InputStatePtr, PhysicsStatePtr, SceneLoaderPtr, WorldPtr};
+use crate::ptr::{AssetRegistryPtr, CommandBufferPtr, GraphicsContextPtr, InputStatePtr, PhysicsStatePtr, SceneLoaderPtr, UiBufferPtr, WorldPtr};
 use crate::scripting::jni::JavaContext;
 use crate::scripting::native::NativeLibrary;
 use crate::states::{Script};
@@ -221,6 +221,7 @@ impl ScriptManager {
         graphics: CommandBufferPtr,
         graphics_context: GraphicsContextPtr,
         physics_state: PhysicsStatePtr,
+        ui_buffer: UiBufferPtr,
     ) -> anyhow::Result<()> {
         let assets = &raw const *ASSET_REGISTRY;
         let scene_loader = &raw const *SCENE_LOADER;
@@ -233,6 +234,7 @@ impl ScriptManager {
             assets,
             scene_loader,
             physics_state,

Large diffs are not rendered by default. Showing the first 50 of 497 lines. Show full diff