tirbofish/dropbear · diff
fix: scripting, runtime/play mode works now :)
Signature present but could not be verified.
Unverified
@@ -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; +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; @@ -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