diff --git a/src/compat_worker.rs b/src/compat_worker.rs new file mode 100644 index 0000000..1a87005 --- /dev/null +++ b/src/compat_worker.rs @@ -0,0 +1,21 @@ +pub type QNWorker=CompatNWorker; +pub type INWorker=CompatNWorker; + +pub struct CompatNWorker{ + data:std::marker::PhantomData, + f:Box, +} + +impl CompatNWorker{ + pub fn new(f:impl FnMut(Task))->Self{ + Self{ + data:std::marker::PhantomData, + f:Box::new(f), + } + } + + pub fn send(&self,task:Task)->Result<(),()>{ + (self.f)(task); + Ok(()) + } +} diff --git a/src/main.rs b/src/main.rs index d36476b..ad920d4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,6 +12,7 @@ mod settings; mod primitives; mod instruction; mod load_roblox; +mod compat_worker; mod model_graphics; mod physics_worker; mod graphics_worker;