try the thing
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
use strafesnet_graphics::graphics::GraphicsState;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum Error{
|
||||
File(strafesnet_snf::Error),
|
||||
Map(strafesnet_snf::map::Error),
|
||||
}
|
||||
|
||||
/// The graphics state, essentially a handle to all the information on the GPU.
|
||||
pub struct Graphics{
|
||||
graphics:strafesnet_graphics::graphics::GraphicsState,
|
||||
graphics:GraphicsState,
|
||||
}
|
||||
impl Graphics{
|
||||
pub fn new(data:&[u8])->Result<Self,()>{
|
||||
Err(())
|
||||
pub fn new(mut graphics:GraphicsState,data:&[u8],device:&wgpu::Device,queue:&wgpu::Queue)->Result<Self,Error>{
|
||||
let map=strafesnet_snf::read_map(std::io::Cursor::new(data))
|
||||
.map_err(Error::File)?
|
||||
.into_complete_map()
|
||||
.map_err(Error::Map)?;
|
||||
graphics.generate_models(device,queue,&map);
|
||||
Ok(Self{graphics})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ impl WindowContext<'_>{
|
||||
graphics.resize(&setup_context.device,&setup_context.config,glam::Vec2::ONE);
|
||||
let bot=include_bytes!("../../web-demo/bhop_marble_7cf33a64-7120-4514-b9fa-4fe29d9523d.qbot");
|
||||
let map=include_bytes!("../../web-demo/bhop_marble_5692093612.snfm");
|
||||
let graphics=strafesnet_roblox_bot_player::graphics::Graphics::new(map).unwrap();
|
||||
let graphics=strafesnet_roblox_bot_player::graphics::Graphics::new(graphics,map,&setup_context.device,&setup_context.queue).unwrap();
|
||||
let bot=strafesnet_roblox_bot_player::bot::Bot::new(bot).unwrap();
|
||||
let graphics_thread=crate::graphics::GraphicsWorker::new(graphics);//,setup_context.config,setup_context.surface,setup_context.device,setup_context.queue);
|
||||
WindowContext{
|
||||
|
||||
Reference in New Issue
Block a user