From 3a4c4ef9fe03f2a5124c4c0f4c271661af629416 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 25 Oct 2023 16:07:12 -0700 Subject: [PATCH] silence many compiler warnings --- src/load_roblox.rs | 8 -------- src/physics.rs | 16 ++++++++-------- src/setup.rs | 3 ++- src/window.rs | 2 +- src/worker.rs | 2 +- 5 files changed, 12 insertions(+), 19 deletions(-) diff --git a/src/load_roblox.rs b/src/load_roblox.rs index bc737f1b..0798cf00 100644 --- a/src/load_roblox.rs +++ b/src/load_roblox.rs @@ -23,14 +23,6 @@ fn recursive_collect_superclass(objects: &mut std::vec::Vec Vec{ - let mut objects = std::vec::Vec::new(); - recursive_collect_superclass(&mut objects, dom, dom.root(),"Decal"); - //get ids - //clear vec - //next class - objects -} fn planar64_affine3_from_roblox(cf:&rbx_dom_weak::types::CFrame,size:&rbx_dom_weak::types::Vector3)->Planar64Affine3{ Planar64Affine3::new( Planar64Mat3::from_cols( diff --git a/src/physics.rs b/src/physics.rs index 4f619a80..d0c25253 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1108,7 +1108,7 @@ impl PhysicsState { }, } //generate instruction - if let Some(face) = exit_face{ + if let Some(_face) = exit_face{ return Some(TimedInstruction { time: best_time, instruction: PhysicsInstruction::CollisionEnd(collision_data.clone()) @@ -1365,7 +1365,7 @@ impl crate::instruction::InstructionConsumer for PhysicsStat match booster{ &crate::model::GameMechanicBooster::Affine(transform)=>v=transform.transform_point3(v), &crate::model::GameMechanicBooster::Velocity(velocity)=>v+=velocity, - &crate::model::GameMechanicBooster::Energy{direction,energy}=>todo!(), + &crate::model::GameMechanicBooster::Energy{direction: _,energy: _}=>todo!(), } self.touching.constrain_velocity(&self.models,&mut v); }, @@ -1376,10 +1376,10 @@ impl crate::instruction::InstructionConsumer for PhysicsStat match trajectory{ crate::model::GameMechanicSetTrajectory::AirTime(_) => todo!(), crate::model::GameMechanicSetTrajectory::Height(_) => todo!(), - crate::model::GameMechanicSetTrajectory::TargetPointTime { target_point, time } => todo!(), - crate::model::GameMechanicSetTrajectory::TrajectoryTargetPoint { target_point, speed, trajectory_choice } => todo!(), + crate::model::GameMechanicSetTrajectory::TargetPointTime { target_point: _, time: _ } => todo!(), + crate::model::GameMechanicSetTrajectory::TrajectoryTargetPoint { target_point: _, speed: _, trajectory_choice: _ } => todo!(), &crate::model::GameMechanicSetTrajectory::Velocity(velocity)=>v=velocity, - crate::model::GameMechanicSetTrajectory::DotVelocity { direction, dot } => todo!(), + crate::model::GameMechanicSetTrajectory::DotVelocity { direction: _, dot: _ } => todo!(), } self.touching.constrain_velocity(&self.models,&mut v); }, @@ -1393,7 +1393,7 @@ impl crate::instruction::InstructionConsumer for PhysicsStat self.body.acceleration=a; } }, - PhysicsCollisionAttributes::Intersect{intersecting,general}=>{ + PhysicsCollisionAttributes::Intersect{intersecting: _,general}=>{ //I think that setting the velocity to 0 was preventing surface contacts from entering an infinite loop self.touching.insert_intersect(c.model,c); run_teleport_behaviour(&general.teleport_behaviour,&mut self.game,&self.models,&self.modes,&self.style,&mut self.touching,&mut self.body,model); @@ -1403,7 +1403,7 @@ impl crate::instruction::InstructionConsumer for PhysicsStat PhysicsInstruction::CollisionEnd(c) => { let model=c.model(&self.models).unwrap(); match &model.attributes{ - PhysicsCollisionAttributes::Contact{contacting,general}=>{ + PhysicsCollisionAttributes::Contact{contacting: _,general: _}=>{ self.touching.remove_contact(c.model);//remove contact before calling contact_constrain_acceleration let mut a=self.style.gravity; if let Some(rocket_force)=self.style.rocket_force{ @@ -1423,7 +1423,7 @@ impl crate::instruction::InstructionConsumer for PhysicsStat }, } }, - PhysicsCollisionAttributes::Intersect{intersecting,general}=>{ + PhysicsCollisionAttributes::Intersect{intersecting: _,general: _}=>{ self.touching.remove_intersect(c.model); }, } diff --git a/src/setup.rs b/src/setup.rs index 1c05ef49..cc8c3905 100644 --- a/src/setup.rs +++ b/src/setup.rs @@ -62,7 +62,8 @@ impl SetupContextPartial2{ fn pick_adapter(self)->SetupContextPartial3{ let adapter; - let optional_features=optional_features(); + //TODO: prefer adapter that implements optional features + //let optional_features=optional_features(); let required_features=required_features(); //no helper function smh gotta write it myself diff --git a/src/window.rs b/src/window.rs index f69d8ff8..c210de04 100644 --- a/src/window.rs +++ b/src/window.rs @@ -32,7 +32,7 @@ impl WindowContext<'_>{ self.physics_thread.send(TimedInstruction{time,instruction:crate::physics_worker::Instruction::GenerateModels(indexed_model_instances)}).unwrap(); } }, - winit::event::WindowEvent::Focused(state)=>{ + winit::event::WindowEvent::Focused(_state)=>{ //pause unpause //recalculate pressed keys on focus }, diff --git a/src/worker.rs b/src/worker.rs index a3346817..91253d5b 100644 --- a/src/worker.rs +++ b/src/worker.rs @@ -1,6 +1,6 @@ use std::thread; use std::sync::{mpsc,Arc}; -use parking_lot::{Mutex,Condvar}; +use parking_lot::Mutex; //WorkerPool struct Pool(u32);