From d51008903dc77be6bf7ed1eebcf592f587b3f448 Mon Sep 17 00:00:00 2001 From: rezural Date: Thu, 31 Dec 2020 12:14:38 +1100 Subject: remove plugin callback related code from testbed --- src_testbed/testbed.rs | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'src_testbed') diff --git a/src_testbed/testbed.rs b/src_testbed/testbed.rs index c169a85..db9f32d 100644 --- a/src_testbed/testbed.rs +++ b/src_testbed/testbed.rs @@ -123,7 +123,6 @@ pub struct Testbed { graphics: GraphicsManager, nsteps: usize, camera_locked: bool, // Used so that the camera can remain the same before and after we change backend or press the restart button. - callbacks: Callbacks, plugins: Vec>, hide_counters: bool, // persistant_contacts: HashMap, @@ -140,10 +139,6 @@ pub struct Testbed { nphysics: Option, } -type Callbacks = Vec< - Box, ->; - impl Testbed { pub fn new_empty() -> Testbed { let graphics = GraphicsManager::new(); @@ -185,7 +180,6 @@ impl Testbed { Testbed { builders: Vec::new(), - callbacks: Vec::new(), plugins: Vec::new(), graphics, nsteps: 1, @@ -382,8 +376,6 @@ impl Testbed { } fn clear(&mut self, window: &mut Window) { - //FIXME: do we need to do this still, after moving to harness code? - self.callbacks.clear(); // self.persistant_contacts.clear(); // self.state.grabbed_object = None; // self.state.grabbed_object_constraint = None; @@ -401,16 +393,6 @@ impl Testbed { self.plugins.push(Box::new(plugin)); } - pub fn add_callback< - F: FnMut(&mut Window, &mut PhysicsState, &PhysicsEvents, &mut GraphicsManager, &RunState) - + 'static, - >( - &mut self, - callback: F, - ) { - self.callbacks.push(Box::new(callback)); - } - pub fn run(mut self) { let mut args = env::args(); let mut benchmark_mode = false; @@ -1029,8 +1011,6 @@ impl State for Testbed { ); } - // let physics = &self.harness.physics; - // Handle UI actions. { let backend_changed = self @@ -1291,11 +1271,7 @@ impl State for Testbed { } for plugin in &mut self.plugins { - plugin.run_callbacks( - window, - &mut self.harness.physics, - &self.harness.state, - ); + plugin.run_callbacks(window, &mut self.harness.physics, &self.harness.state); } // if true { -- cgit