diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 04f78d71fa..6bae0d9213 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -84,9 +84,6 @@ vek = {version = "=0.14.1", features = ["serde"]} # Controller gilrs = {version = "0.8.0", features = ["serde-serialize"]} -# Mumble -mumble-link = "0.1.0" - # Singleplayer server = { package = "veloren-server", path = "../server", optional = true, default-features = false, features = ["worldgen"] } @@ -137,6 +134,10 @@ coreaudio-sys = { version = "=0.2.8", default-features = false } [target.'cfg(windows)'.build-dependencies] winres = "0.1" +# Mumble +[target.'cfg(not(target_os="macos"))'.dependencies] +mumble-link = "0.1.0" + [dev-dependencies] criterion = "0.3" world = {package = "veloren-world", path = "../world"} diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 224755203c..ccfa85b6eb 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -2,6 +2,7 @@ pub mod settings_change; use std::{cell::RefCell, collections::HashSet, rc::Rc, result::Result, sync::Arc, time::Duration}; +#[cfg(not(target_os = "macos"))] use mumble_link::SharedLink; use ordered_float::OrderedFloat; use specs::{Join, WorldExt}; @@ -78,6 +79,7 @@ pub struct SessionState { target_entity: Option, selected_entity: Option<(specs::Entity, std::time::Instant)>, interactable: Option, + #[cfg(not(target_os = "macos"))] mumble_link: SharedLink, hitboxes: HashMap, } @@ -97,6 +99,7 @@ impl SessionState { scene .camera_mut() .set_fov_deg(global_state.settings.graphics.fov); + #[cfg(not(target_os = "macos"))] let mut mumble_link = SharedLink::new("veloren", "veloren-voxygen"); { let mut client = client.borrow_mut(); @@ -104,6 +107,7 @@ impl SessionState { client.request_lossy_terrain_compression( global_state.settings.graphics.lossy_terrain_compression, ); + #[cfg(not(target_os = "macos"))] if let Some(uid) = client.uid() { let identiy = if let Some(info) = client.player_list().get(&uid) { format!("{}-{}", info.player_alias, uid.to_string()) @@ -136,6 +140,7 @@ impl SessionState { target_entity: None, selected_entity: None, interactable: None, + #[cfg(not(target_os = "macos"))] mumble_link, hitboxes: HashMap::new(), } @@ -160,22 +165,25 @@ impl SessionState { self.scene .maintain_debug_hitboxes(&client, &global_state.settings, &mut self.hitboxes); - // Update mumble positional audio - let pos = client.position().unwrap_or_default(); - let ori = client - .state() - .read_storage::() - .get(client.entity()) - .map_or_else(comp::Ori::default, |o| *o); - let front = ori.look_dir().to_vec(); - let top = ori.up().to_vec(); - // converting from veloren z = height axis, to mumble y = height axis - let player_pos = mumble_link::Position { - position: [pos.x, pos.z, pos.y], - front: [front.x, front.z, front.y], - top: [top.x, top.z, top.y], - }; - self.mumble_link.update(player_pos, player_pos); + #[cfg(not(target_os = "macos"))] + { + // Update mumble positional audio + let pos = client.position().unwrap_or_default(); + let ori = client + .state() + .read_storage::() + .get(client.entity()) + .map_or_else(comp::Ori::default, |o| *o); + let front = ori.look_dir().to_vec(); + let top = ori.up().to_vec(); + // converting from veloren z = height axis, to mumble y = height axis + let player_pos = mumble_link::Position { + position: [pos.x, pos.z, pos.y], + front: [front.x, front.z, front.y], + top: [top.x, top.z, top.y], + }; + self.mumble_link.update(player_pos, player_pos); + } for event in client.tick(self.inputs.clone(), dt, crate::ecs::sys::add_local_systems)? { match event {