From c0a8422a439a86e792304892c15f328317501ec1 Mon Sep 17 00:00:00 2001 From: Imbris Date: Tue, 24 Nov 2020 23:55:44 -0500 Subject: [PATCH 1/2] Fix turning off worldgen feature --- server/src/lib.rs | 4 ++++ server/src/rtsim/mod.rs | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/src/lib.rs b/server/src/lib.rs index 0e7d529931..cdc808259b 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -362,7 +362,10 @@ impl Server { let connection_handler = ConnectionHandler::new(network); // Initiate real-time world simulation + #[cfg(feature = "worldgen")] rtsim::init(&mut state, &world); + #[cfg(not(feature = "worldgen"))] + rtsim::init(&mut state); let this = Self { state, @@ -503,6 +506,7 @@ impl Server { dt, |dispatcher_builder| { sys::add_server_systems(dispatcher_builder); + #[cfg(feature = "worldgen")] rtsim::add_server_systems(dispatcher_builder); }, false, diff --git a/server/src/rtsim/mod.rs b/server/src/rtsim/mod.rs index 0e9665f99e..0aab0f6704 100644 --- a/server/src/rtsim/mod.rs +++ b/server/src/rtsim/mod.rs @@ -82,8 +82,11 @@ pub fn add_server_systems(dispatch_builder: &mut DispatcherBuilder) { dispatch_builder.add(tick::Sys, TICK_SYS, &[LOAD_CHUNK_SYS, UNLOAD_CHUNK_SYS]); } -pub fn init(state: &mut State, world: &world::World) { +pub fn init(state: &mut State, #[cfg(feature = "worldgen")] world: &world::World) { + #[cfg(feature = "worldgen")] let mut rtsim = RtSim::new(world.sim().get_size()); + #[cfg(not(feature = "worldgen"))] + let mut rtsim = RtSim::new(Vec2::new(40, 40)); for _ in 0..2500 { let pos = rtsim From a545d099a28566f67572abb55c6ee0a7d28356a2 Mon Sep 17 00:00:00 2001 From: Imbris Date: Wed, 25 Nov 2020 00:29:28 -0500 Subject: [PATCH 2/2] Restore fix for dragging on windows platforms --- voxygen/src/hud/mod.rs | 3 +++ voxygen/src/window.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 4ee016ee6e..519007da7a 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -2628,6 +2628,9 @@ impl Hud { WinEvent::Moved(_) => { // Prevent the cursor from being grabbed while the window is being moved as this // causes the window to move erratically + // TODO: this creates an issue where if you move the window then you need to + // close a menu to re-grab the mouse (and if one isn't already + // open you need to open and close a menu) self.show.want_grab = false; true }, diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index d271ca5b95..b898254864 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -941,6 +941,10 @@ impl Window { self.scale_factor = scale_factor; self.events.push(Event::ScaleFactorChanged(scale_factor)); }, + WindowEvent::Moved(winit::dpi::PhysicalPosition { x, y }) => { + self.events + .push(Event::Moved(Vec2::new(x as u32, y as u32))); + }, WindowEvent::ReceivedCharacter(c) => self.events.push(Event::Char(c)), WindowEvent::MouseInput { button, state, .. } => { if let (true, Some(game_inputs)) =