lol idk #1

Open
Quaternions wants to merge 838 commits from StrafesNET/strafe-project:master into master
Showing only changes of commit 8950bcbf02 - Show all commits

View File

@ -90,4 +90,23 @@ impl Runnable<'_>{
.set_name(name)
.exec().map_err(|error|Error::Lua{source,error})
}
pub fn has_scheduled_threads(&self)->Result<bool,mlua::Error>{
scheduler_mut(&self.lua,|scheduler|
Ok(scheduler.has_scheduled_threads())
)
}
pub fn game_tick(&self)->Result<(),mlua::Error>{
if let Some(threads)=scheduler_mut(&self.lua,|scheduler|Ok(scheduler.tick_threads()))?{
for thread in threads{
//TODO: return dt and total run time
let result=thread.resume::<mlua::MultiValue>((1.0/30.0,0.0))
.map_err(|error|Error::Lua{source:"source unavailable".to_owned(),error});
match result{
Ok(_)=>(),
Err(e)=>println!("game_tick Error: {e}"),
}
}
}
Ok(())
}
}