Merge branch 'xMAC/smol-fixes' into 'master'

backporting lints from newer toolchain, activating world in server/agent

See merge request veloren/veloren!4462
This commit is contained in:
Marcel 2024-05-17 08:36:03 +00:00
commit e63b42645f
12 changed files with 189 additions and 127 deletions

3
Cargo.lock generated
View File

@ -6651,7 +6651,7 @@ version = "1.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
dependencies = [ dependencies = [
"cfg-if 0.1.10", "cfg-if 1.0.0",
"rand 0.8.5", "rand 0.8.5",
"static_assertions", "static_assertions",
] ]
@ -7203,6 +7203,7 @@ dependencies = [
"veloren-common-base", "veloren-common-base",
"veloren-common-dynlib", "veloren-common-dynlib",
"veloren-rtsim", "veloren-rtsim",
"veloren-world",
] ]
[[package]] [[package]]

View File

@ -123,22 +123,27 @@ rand_chacha = { version = "0.3" }
bincode = { version = "1.3.3" } bincode = { version = "1.3.3" }
bitflags = { version = "2.2.1" } bitflags = { version = "2.2.1" }
slab = { version = "0.4.2" } slab = { version = "0.4.2" }
chrono = { version = "0.4.24", default-features=false, features = ["clock", "std", "wasmbind", "serde"] } chrono = { version = "0.4.24", default-features = false, features = [
"clock",
"std",
"wasmbind",
"serde",
] }
chrono-tz = { version = "0.8", features = ["serde"] } chrono-tz = { version = "0.8", features = ["serde"] }
inline_tweak = { version = "1.0.8" } inline_tweak = { version = "1.0.8" }
tokio = { version = "1.28", default-features = false, features = ["rt"] } tokio = { version = "1.28", default-features = false, features = ["rt"] }
tracing = { version = "0.1" } tracing = { version = "0.1" }
futures-util = { version = "0.3.7", default-features = false } futures-util = { version = "0.3.7", default-features = false }
prometheus = { version = "0.13", default-features = false} prometheus = { version = "0.13", default-features = false }
prometheus-hyper = "0.1.4" prometheus-hyper = "0.1.4"
strum = { version = "0.24", features = ["derive"] } strum = { version = "0.24", features = ["derive"] }
enum-map = { version = "2.4" } enum-map = { version = "2.4" }
hashbrown = { version = "0.13", features = ["rayon", "serde", "nightly"] } hashbrown = { version = "0.13", features = ["rayon", "serde", "nightly"] }
fxhash = { version = "0.2.1" } fxhash = { version = "0.2.1" }
crossbeam-utils = { version = "0.8.1"} crossbeam-utils = { version = "0.8.1" }
crossbeam-channel = { version = "0.5"} crossbeam-channel = { version = "0.5" }
ordered-float = { version = "3", default-features = true } ordered-float = { version = "3", default-features = true }
num = { version = "0.4" } num = { version = "0.4" }
num-traits = { version = "0.2" } num-traits = { version = "0.2" }
@ -147,13 +152,13 @@ itertools = { version = "0.10" }
serde = { version = "1.0.118", features = ["derive"] } serde = { version = "1.0.118", features = ["derive"] }
serde_json = { version = "1.0.50" } serde_json = { version = "1.0.50" }
ron = { version = "0.8", default-features = false} ron = { version = "0.8", default-features = false }
specs = { version = "0.20", features = ["nightly"] } specs = { version = "0.20", features = ["nightly"] }
image = { version = "0.24", default-features = false, features = ["png"] } image = { version = "0.24", default-features = false, features = ["png"] }
rayon = { version = "1.5" } rayon = { version = "1.5" }
clap = { version = "4.2", features = ["derive"]} clap = { version = "4.2", features = ["derive"] }
async-trait = "0.1.42" async-trait = "0.1.42"
sha2 = "0.10" sha2 = "0.10"
hex = "0.4.3" hex = "0.4.3"
@ -179,4 +184,3 @@ wgpu = { git = "https://github.com/Imberflur/wgpu.git", tag = "0.18-with-fixes-f
# wgpu-core = { path = "../wgpu/wgpu-core" } # wgpu-core = { path = "../wgpu/wgpu-core" }
# wgpu-types = { path = "../wgpu/wgpu-types" } # wgpu-types = { path = "../wgpu/wgpu-types" }
# naga = { path = "../wgpu/naga" } # naga = { path = "../wgpu/naga" }

View File

@ -17,7 +17,7 @@ impl Default for Ori {
impl Ori { impl Ori {
pub fn new(quat: Quaternion<f32>) -> Self { pub fn new(quat: Quaternion<f32>) -> Self {
#[cfg(debug_assert)] #[cfg(debug_assertions)]
{ {
let v4 = quat.into_vec4(); let v4 = quat.into_vec4();
debug_assert!(v4.map(f32::is_finite).reduce_and()); debug_assert!(v4.map(f32::is_finite).reduce_and());

View File

@ -5,13 +5,15 @@ use crate::{
}; };
use common_base::span; use common_base::span;
use hashbrown::hash_map::DefaultHashBuilder; use hashbrown::hash_map::DefaultHashBuilder;
#[cfg(rrt_pathfinding)] use hashbrown::HashMap; #[cfg(feature = "rrt_pathfinding")]
#[cfg(rrt_pathfinding)] use hashbrown::HashMap;
#[cfg(feature = "rrt_pathfinding")]
use kiddo::{distance::squared_euclidean, KdTree}; // For RRT paths (disabled for now) use kiddo::{distance::squared_euclidean, KdTree}; // For RRT paths (disabled for now)
#[cfg(rrt_pathfinding)] #[cfg(feature = "rrt_pathfinding")]
use rand::distributions::Uniform; use rand::distributions::Uniform;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
#[cfg(rrt_pathfinding)] use std::f32::consts::PI; #[cfg(feature = "rrt_pathfinding")]
use std::f32::consts::PI;
use std::iter::FromIterator; use std::iter::FromIterator;
use vek::*; use vek::*;
@ -705,7 +707,7 @@ where
} }
// Enable when airbraking/sensible flight is a thing // Enable when airbraking/sensible flight is a thing
#[cfg(rrt_pathfinding)] #[cfg(feature = "rrt_pathfinding")]
fn find_air_path<V>( fn find_air_path<V>(
vol: &V, vol: &V,
startf: Vec3<f32>, startf: Vec3<f32>,
@ -757,7 +759,7 @@ where
/// with wider gaps, such as flying through a forest than for terrain /// with wider gaps, such as flying through a forest than for terrain
/// with narrow gaps, such as navigating a maze. /// with narrow gaps, such as navigating a maze.
/// Returns a path and whether that path is complete or not. /// Returns a path and whether that path is complete or not.
#[cfg(rrt_pathfinding)] #[cfg(feature = "rrt_pathfinding")]
fn informed_rrt_connect( fn informed_rrt_connect(
start: Vec3<f32>, start: Vec3<f32>,
end: Vec3<f32>, end: Vec3<f32>,
@ -983,7 +985,7 @@ fn informed_rrt_connect(
/// along the axis between the foci. The value of the search parameter must be /// along the axis between the foci. The value of the search parameter must be
/// greater than zero. In order to increase the sample area, the /// greater than zero. In order to increase the sample area, the
/// search_parameter should be increased linearly as the search continues. /// search_parameter should be increased linearly as the search continues.
#[cfg(rrt_pathfinding)] #[cfg(feature = "rrt_pathfinding")]
pub fn point_on_prolate_spheroid( pub fn point_on_prolate_spheroid(
focus1: Vec3<f32>, focus1: Vec3<f32>,
focus2: Vec3<f32>, focus2: Vec3<f32>,

View File

@ -766,48 +766,48 @@ impl ComponentRecipe {
} }
pub fn inputs(&self) -> impl ExactSizeIterator<Item = (&RecipeInput, u32)> { pub fn inputs(&self) -> impl ExactSizeIterator<Item = (&RecipeInput, u32)> {
pub struct ComponentRecipeInputsIterator<'a> {
material: Option<&'a (RecipeInput, u32)>,
modifier: Option<&'a (RecipeInput, u32)>,
additional_inputs: std::slice::Iter<'a, (RecipeInput, u32)>,
}
impl<'a> Iterator for ComponentRecipeInputsIterator<'a> {
type Item = &'a (RecipeInput, u32);
fn next(&mut self) -> Option<&'a (RecipeInput, u32)> {
self.material
.take()
.or_else(|| self.modifier.take())
.or_else(|| self.additional_inputs.next())
}
}
impl<'a> IntoIterator for &'a ComponentRecipe {
type IntoIter = ComponentRecipeInputsIterator<'a>;
type Item = &'a (RecipeInput, u32);
fn into_iter(self) -> Self::IntoIter {
ComponentRecipeInputsIterator {
material: Some(&self.material),
modifier: self.modifier.as_ref(),
additional_inputs: self.additional_inputs.as_slice().iter(),
}
}
}
impl<'a> ExactSizeIterator for ComponentRecipeInputsIterator<'a> {
fn len(&self) -> usize {
self.material.is_some() as usize
+ self.modifier.is_some() as usize
+ self.additional_inputs.len()
}
}
self.into_iter().map(|(recipe, amount)| (recipe, *amount)) self.into_iter().map(|(recipe, amount)| (recipe, *amount))
} }
} }
pub struct ComponentRecipeInputsIterator<'a> {
material: Option<&'a (RecipeInput, u32)>,
modifier: Option<&'a (RecipeInput, u32)>,
additional_inputs: std::slice::Iter<'a, (RecipeInput, u32)>,
}
impl<'a> Iterator for ComponentRecipeInputsIterator<'a> {
type Item = &'a (RecipeInput, u32);
fn next(&mut self) -> Option<&'a (RecipeInput, u32)> {
self.material
.take()
.or_else(|| self.modifier.take())
.or_else(|| self.additional_inputs.next())
}
}
impl<'a> IntoIterator for &'a ComponentRecipe {
type IntoIter = ComponentRecipeInputsIterator<'a>;
type Item = &'a (RecipeInput, u32);
fn into_iter(self) -> Self::IntoIter {
ComponentRecipeInputsIterator {
material: Some(&self.material),
modifier: self.modifier.as_ref(),
additional_inputs: self.additional_inputs.as_slice().iter(),
}
}
}
impl<'a> ExactSizeIterator for ComponentRecipeInputsIterator<'a> {
fn len(&self) -> usize {
self.material.is_some() as usize
+ self.modifier.is_some() as usize
+ self.additional_inputs.len()
}
}
#[derive(Clone, Deserialize)] #[derive(Clone, Deserialize)]
struct RawComponentRecipe { struct RawComponentRecipe {
output: RawComponentOutput, output: RawComponentOutput,

View File

@ -5,7 +5,7 @@ authors = ["Joshua Barretto <joshua.s.barretto@gmail.com>"]
edition = "2021" edition = "2021"
[features] [features]
worldgen = [] worldgen = ["server-agent/worldgen"]
simd = ["vek/platform_intrinsics"] simd = ["vek/platform_intrinsics"]
plugins = ["common-state/plugins"] plugins = ["common-state/plugins"]
persistent_world = [] persistent_world = []
@ -18,16 +18,22 @@ default = ["worldgen", "plugins", "persistent_world", "simd"]
[dependencies] [dependencies]
common = { package = "veloren-common", path = "../common" } common = { package = "veloren-common", path = "../common" }
common-base = { package = "veloren-common-base", path = "../common/base" } common-base = { package = "veloren-common-base", path = "../common/base" }
veloren-query-server = { package = "veloren-query-server", path = "../common/query_server", default-features = false, features = ["server"] } veloren-query-server = { package = "veloren-query-server", path = "../common/query_server", default-features = false, features = [
"server",
] }
common-ecs = { package = "veloren-common-ecs", path = "../common/ecs" } common-ecs = { package = "veloren-common-ecs", path = "../common/ecs" }
common-state = { package = "veloren-common-state", path = "../common/state" } common-state = { package = "veloren-common-state", path = "../common/state" }
common-systems = { package = "veloren-common-systems", path = "../common/systems" } common-systems = { package = "veloren-common-systems", path = "../common/systems" }
common-net = { package = "veloren-common-net", path = "../common/net" } common-net = { package = "veloren-common-net", path = "../common/net" }
world = { package = "veloren-world", path = "../world" } world = { package = "veloren-world", path = "../world" }
rtsim = { package = "veloren-rtsim", path = "../rtsim" } rtsim = { package = "veloren-rtsim", path = "../rtsim" }
network = { package = "veloren-network", path = "../network", features = ["metrics", "compression", "quic"], default-features = false } network = { package = "veloren-network", path = "../network", features = [
"metrics",
"compression",
"quic",
], default-features = false }
server-agent = {package = "veloren-server-agent", path = "agent"} server-agent = { package = "veloren-server-agent", path = "agent" }
#inline_tweak = "1.0.8" #inline_tweak = "1.0.8"
@ -60,12 +66,17 @@ rayon = { workspace = true }
crossbeam-channel = { workspace = true } crossbeam-channel = { workspace = true }
prometheus = { workspace = true } prometheus = { workspace = true }
portpicker = { git = "https://github.com/xMAC94x/portpicker-rs", rev = "df6b37872f3586ac3b21d08b56c8ec7cd92fb172" } portpicker = { git = "https://github.com/xMAC94x/portpicker-rs", rev = "df6b37872f3586ac3b21d08b56c8ec7cd92fb172" }
authc = { git = "https://gitlab.com/veloren/auth.git", rev = "abb1a705827984e11706d7bb97fb7a459e1e6533" } # xMAC94x/current_master_till_refactored branch authc = { git = "https://gitlab.com/veloren/auth.git", rev = "abb1a705827984e11706d7bb97fb7a459e1e6533" } # xMAC94x/current_master_till_refactored branch
enum-map = { workspace = true } enum-map = { workspace = true }
noise = { version = "0.7", default-features = false } noise = { version = "0.7", default-features = false }
censor = "0.3" censor = "0.3"
rusqlite = { version = "0.30.0", features = ["array", "vtab", "bundled", "trace"] } rusqlite = { version = "0.30.0", features = [
"array",
"vtab",
"bundled",
"trace",
] }
refinery = { version = "0.8.12", features = ["rusqlite"] } refinery = { version = "0.8.12", features = ["rusqlite"] }
schnellru = "0.2.1" schnellru = "0.2.1"

View File

@ -5,13 +5,15 @@ edition = "2021"
version = "0.1.0" version = "0.1.0"
[features] [features]
worldgen = ["world"]
use-dyn-lib = ["common-dynlib"] use-dyn-lib = ["common-dynlib"]
be-dyn-lib = [] be-dyn-lib = []
[dependencies] [dependencies]
common = { package = "veloren-common", path = "../../common"} common = { package = "veloren-common", path = "../../common" }
common-base = { package = "veloren-common-base", path = "../../common/base" } common-base = { package = "veloren-common-base", path = "../../common/base" }
common-dynlib = { package = "veloren-common-dynlib", path = "../../common/dynlib", optional = true} common-dynlib = { package = "veloren-common-dynlib", path = "../../common/dynlib", optional = true }
world = { package = "veloren-world", path = "../../world", optional = true }
rtsim = { package = "veloren-rtsim", path = "../../rtsim" } rtsim = { package = "veloren-rtsim", path = "../../rtsim" }
specs = { workspace = true, features = ["shred-derive"] } specs = { workspace = true, features = ["shred-derive"] }

View File

@ -409,7 +409,7 @@ pub struct ReadData<'a> {
pub time_of_day: Read<'a, TimeOfDay>, pub time_of_day: Read<'a, TimeOfDay>,
pub light_emitter: ReadStorage<'a, LightEmitter>, pub light_emitter: ReadStorage<'a, LightEmitter>,
#[cfg(feature = "worldgen")] #[cfg(feature = "worldgen")]
pub world: ReadExpect<'a, Arc<world::World>>, pub world: ReadExpect<'a, std::sync::Arc<world::World>>,
pub rtsim_entities: ReadStorage<'a, RtSimEntity>, pub rtsim_entities: ReadStorage<'a, RtSimEntity>,
pub buffs: ReadStorage<'a, Buffs>, pub buffs: ReadStorage<'a, Buffs>,
pub combos: ReadStorage<'a, Combo>, pub combos: ReadStorage<'a, Combo>,

View File

@ -1,5 +1,8 @@
[package] [package]
authors = ["Joshua Barretto <joshua.s.barretto@gmail.com>", "Imbris <imbrisf@gmail.com>"] authors = [
"Joshua Barretto <joshua.s.barretto@gmail.com>",
"Imbris <imbrisf@gmail.com>",
]
default-run = "veloren-voxygen" default-run = "veloren-voxygen"
edition = "2021" edition = "2021"
name = "veloren-voxygen" name = "veloren-voxygen"
@ -26,7 +29,7 @@ hot-reloading = ["common/hot-reloading"]
singleplayer = ["server"] singleplayer = ["server"]
simd = ["vek/platform_intrinsics"] simd = ["vek/platform_intrinsics"]
tracy = ["common-frontend/tracy", "client/tracy"] tracy = ["common-frontend/tracy", "client/tracy"]
tracy-memory = ["tracy"] # enables heap profiling with tracy tracy-memory = ["tracy"] # enables heap profiling with tracy
plugins = ["client/plugins", "common-assets/plugins", "server/plugins"] plugins = ["client/plugins", "common-assets/plugins", "server/plugins"]
egui-ui = ["voxygen-egui", "egui", "egui_wgpu_backend", "egui_winit_platform"] egui-ui = ["voxygen-egui", "egui", "egui_wgpu_backend", "egui_winit_platform"]
shaderc-from-source = ["shaderc/build-from-source"] shaderc-from-source = ["shaderc/build-from-source"]
@ -34,32 +37,42 @@ discord = ["discord-sdk"]
bin_img-export = ["common-assets"] bin_img-export = ["common-assets"]
# We don't ship egui with published release builds so a separate feature is required that excludes it. # We don't ship egui with published release builds so a separate feature is required that excludes it.
default-publish = ["singleplayer", "native-dialog", "plugins", "discord", "simd"] default-publish = [
"singleplayer",
"native-dialog",
"plugins",
"discord",
"simd",
]
# Temp for bug on current wgpu version that has access violation in vulkan when constructing egui pipeline # Temp for bug on current wgpu version that has access violation in vulkan when constructing egui pipeline
default-no-egui = ["default-publish", "hot-reloading", "shaderc-from-source"] default-no-egui = ["default-publish", "hot-reloading", "shaderc-from-source"]
default = ["default-no-egui", "egui-ui"] default = ["default-no-egui", "egui-ui"]
[dependencies] [dependencies]
client = {package = "veloren-client", path = "../client"} client = { package = "veloren-client", path = "../client" }
common = {package = "veloren-common", path = "../common"} common = { package = "veloren-common", path = "../common" }
common-assets = {package = "veloren-common-assets", path = "../common/assets", optional = true} # img-export common-assets = { package = "veloren-common-assets", path = "../common/assets", optional = true } # img-export
common-base = {package = "veloren-common-base", path = "../common/base"} common-base = { package = "veloren-common-base", path = "../common/base" }
common-ecs = {package = "veloren-common-ecs", path = "../common/ecs"} common-ecs = { package = "veloren-common-ecs", path = "../common/ecs" }
common-frontend = {package = "veloren-common-frontend", path = "../common/frontend"} common-frontend = { package = "veloren-common-frontend", path = "../common/frontend" }
common-net = {package = "veloren-common-net", path = "../common/net"} common-net = { package = "veloren-common-net", path = "../common/net" }
common-state = {package = "veloren-common-state", path = "../common/state"} common-state = { package = "veloren-common-state", path = "../common/state" }
common-systems = {package = "veloren-common-systems", path = "../common/systems"} common-systems = { package = "veloren-common-systems", path = "../common/systems" }
anim = {package = "veloren-voxygen-anim", path = "anim"} anim = { package = "veloren-voxygen-anim", path = "anim" }
i18n = {package = "veloren-client-i18n", path = "../client/i18n"} i18n = { package = "veloren-client-i18n", path = "../client/i18n" }
i18n-helpers = {package = "veloren-voxygen-i18n-helpers", path = "i18n-helpers"} i18n-helpers = { package = "veloren-voxygen-i18n-helpers", path = "i18n-helpers" }
voxygen-egui = {package = "veloren-voxygen-egui", path = "egui", optional = true } voxygen-egui = { package = "veloren-voxygen-egui", path = "egui", optional = true }
# Graphics # Graphics
winit = {version = "0.28.6", features = ["serde"]} winit = { version = "0.28.6", features = ["serde"] }
wgpu = { version = "0.18.0", default-features = false, features = ["trace", "spirv", "glsl"] } wgpu = { version = "0.18.0", default-features = false, features = [
"trace",
"spirv",
"glsl",
] }
wgpu-profiler = "0.15.0" wgpu-profiler = "0.15.0"
bytemuck = { version="1.7", features=["derive"] } bytemuck = { version = "1.7", features = ["derive"] }
# shaderc = "0.8.0" # shaderc = "0.8.0"
# Working around a current bug in shaderc that causes it to use the system installation even if we specify compile from source # Working around a current bug in shaderc that causes it to use the system installation even if we specify compile from source
shaderc = { git = "https://github.com/pythonesque/shaderc-rs", rev = "f2605a02062834019bedff911aee2fd2998c49f9" } shaderc = { git = "https://github.com/pythonesque/shaderc-rs", rev = "f2605a02062834019bedff911aee2fd2998c49f9" }
@ -68,16 +81,16 @@ shaderc = { git = "https://github.com/pythonesque/shaderc-rs", rev = "f2605a0206
cmake = "=0.1.45" cmake = "=0.1.45"
# Ui # Ui
conrod_core = {git = "https://gitlab.com/veloren/conrod.git", branch="copypasta_0.7"} conrod_core = { git = "https://gitlab.com/veloren/conrod.git", branch = "copypasta_0.7" }
conrod_winit = {git = "https://gitlab.com/veloren/conrod.git", branch="copypasta_0.7"} conrod_winit = { git = "https://gitlab.com/veloren/conrod.git", branch = "copypasta_0.7" }
euc = "0.5.0" euc = "0.5.0"
iced = {package = "iced_native", git = "https://github.com/Imberflur/iced", tag = "veloren-winit-0.28"} iced = { package = "iced_native", git = "https://github.com/Imberflur/iced", tag = "veloren-winit-0.28" }
iced_winit = {git = "https://github.com/Imberflur/iced", tag = "veloren-winit-0.28"} iced_winit = { git = "https://github.com/Imberflur/iced", tag = "veloren-winit-0.28" }
glyph_brush = "0.7.0" glyph_brush = "0.7.0"
# https://gitlab.com/Frinksy/keyboard-keynames/-/merge_requests/8 # https://gitlab.com/Frinksy/keyboard-keynames/-/merge_requests/8
keyboard-keynames = { git = "https://gitlab.com/Imbris/keyboard-keynames.git", tag = "veloren-winit-0.28" } keyboard-keynames = { git = "https://gitlab.com/Imbris/keyboard-keynames.git", tag = "veloren-winit-0.28" }
# EGUI # EGUI
egui = {version = "0.23", optional = true } egui = { version = "0.23", optional = true }
egui_wgpu_backend = { git = "https://github.com/hasenbanck/egui_wgpu_backend.git", rev = "34691d4e9149deb9cd0bb8cbb5a56bffebf47588", optional = true } egui_wgpu_backend = { git = "https://github.com/hasenbanck/egui_wgpu_backend.git", rev = "34691d4e9149deb9cd0bb8cbb5a56bffebf47588", optional = true }
egui_winit_platform = { version = "0.20", optional = true } egui_winit_platform = { version = "0.20", optional = true }
@ -89,16 +102,18 @@ vek = { workspace = true }
levenshtein = "1.0.5" levenshtein = "1.0.5"
# Controller # Controller
gilrs = {version = "0.10.0", features = ["serde-serialize"]} gilrs = { version = "0.10.0", features = ["serde-serialize"] }
# Singleplayer # Singleplayer
server = { package = "veloren-server", path = "../server", optional = true, default-features = false, features = ["worldgen"] } server = { package = "veloren-server", path = "../server", optional = true, default-features = false, features = [
"worldgen",
] }
# CLI # CLI
clap = { workspace = true } clap = { workspace = true }
# Utility # Utility
assets_manager = {version = "0.11", features = ["ab_glyph"]} assets_manager = { version = "0.11", features = ["ab_glyph"] }
backtrace = "0.3.40" backtrace = "0.3.40"
chrono = { workspace = true } chrono = { workspace = true }
chumsky = "0.9" chumsky = "0.9"
@ -108,7 +123,7 @@ directories-next = "2.0"
dot_vox = "5.1" dot_vox = "5.1"
guillotiere = "0.6.2" guillotiere = "0.6.2"
hashbrown = { workspace = true } hashbrown = { workspace = true }
image = { workspace = true, features = ["ico"]} image = { workspace = true, features = ["ico"] }
lazy_static = { workspace = true } lazy_static = { workspace = true }
native-dialog = { version = "0.6.3", optional = true } native-dialog = { version = "0.6.3", optional = true }
num = { workspace = true } num = { workspace = true }
@ -116,9 +131,9 @@ ordered-float = { workspace = true }
rand = { workspace = true } rand = { workspace = true }
rand_chacha = { workspace = true } rand_chacha = { workspace = true }
rayon = { workspace = true } rayon = { workspace = true }
rodio = {version = "0.17", default-features = false, features = ["vorbis"]} rodio = { version = "0.17", default-features = false, features = ["vorbis"] }
ron = { workspace = true } ron = { workspace = true }
serde = { workspace = true, features = [ "rc" ]} serde = { workspace = true, features = ["rc"] }
slab = { workspace = true } slab = { workspace = true }
strum = { workspace = true } strum = { workspace = true }
tracing = { workspace = true } tracing = { workspace = true }
@ -137,10 +152,10 @@ enum-map = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]
dispatch = "0.1.4" dispatch = "0.1.4"
[target.'cfg(windows)'.build-dependencies] [target.'cfg(target_family = "windows")'.build-dependencies]
winres = "0.1" winres = "0.1"
[target.'cfg(windows)'.dependencies] [target.'cfg(target_family = "windows")'.dependencies]
mimalloc = "0.1.29" mimalloc = "0.1.29"
# Mumble # Mumble
@ -148,8 +163,11 @@ mimalloc = "0.1.29"
mumble-link = "0.2.0" mumble-link = "0.2.0"
[dev-dependencies] [dev-dependencies]
criterion = { version = "0.5.1", default-features=false, features=["rayon", "cargo_bench_support"]} criterion = { version = "0.5.1", default-features = false, features = [
world = {package = "veloren-world", path = "../world"} "rayon",
"cargo_bench_support",
] }
world = { package = "veloren-world", path = "../world" }
rayon = { workspace = true } rayon = { workspace = true }
[[bench]] [[bench]]

View File

@ -203,6 +203,22 @@ fn get_site_economy(site_rich: &SiteInfoRich) -> String {
} }
} }
impl From<KeyMouse> for ConrodMouseButton {
fn from(key: KeyMouse) -> Self {
match key {
KeyMouse::Mouse(MouseButton::Left) => ConrodMouseButton::Left,
KeyMouse::Mouse(MouseButton::Right) => ConrodMouseButton::Right,
KeyMouse::Mouse(MouseButton::Middle) => ConrodMouseButton::Middle,
KeyMouse::Mouse(MouseButton::Other(0)) => ConrodMouseButton::X1,
KeyMouse::Mouse(MouseButton::Other(1)) => ConrodMouseButton::X2,
KeyMouse::Mouse(MouseButton::Other(2)) => ConrodMouseButton::Button6,
KeyMouse::Mouse(MouseButton::Other(3)) => ConrodMouseButton::Button7,
KeyMouse::Mouse(MouseButton::Other(4)) => ConrodMouseButton::Button8,
_ => conrod_core::input::MouseButton::Unknown,
}
}
}
impl<'a> Widget for Map<'a> { impl<'a> Widget for Map<'a> {
type Event = Vec<Event>; type Event = Vec<Event>;
type State = State; type State = State;
@ -353,21 +369,6 @@ impl<'a> Widget for Map<'a> {
let max_drag = player_pos_chunks; let max_drag = player_pos_chunks;
let drag = self.map_drag.clamped(min_drag, max_drag); let drag = self.map_drag.clamped(min_drag, max_drag);
impl From<KeyMouse> for ConrodMouseButton {
fn from(key: KeyMouse) -> Self {
match key {
KeyMouse::Mouse(MouseButton::Left) => ConrodMouseButton::Left,
KeyMouse::Mouse(MouseButton::Right) => ConrodMouseButton::Right,
KeyMouse::Mouse(MouseButton::Middle) => ConrodMouseButton::Middle,
KeyMouse::Mouse(MouseButton::Other(0)) => ConrodMouseButton::X1,
KeyMouse::Mouse(MouseButton::Other(1)) => ConrodMouseButton::X2,
KeyMouse::Mouse(MouseButton::Other(2)) => ConrodMouseButton::Button6,
KeyMouse::Mouse(MouseButton::Other(3)) => ConrodMouseButton::Button7,
KeyMouse::Mouse(MouseButton::Other(4)) => ConrodMouseButton::Button8,
_ => conrod_core::input::MouseButton::Unknown,
}
}
}
enum MarkerChange { enum MarkerChange {
Pos(Vec2<f32>), Pos(Vec2<f32>),
ClickPos, ClickPos,

View File

@ -244,7 +244,7 @@ impl KeyMouse {
Key(PrevTrack) => "Prev Track", Key(PrevTrack) => "Prev Track",
Key(NextTrack) => "Next Track", Key(NextTrack) => "Next Track",
Key(LAlt) => { Key(LAlt) => {
if cfg!(macos) { if cfg!(target_os = "macos") {
"Left Option ⌥" "Left Option ⌥"
} else { } else {
// Assume Windows, Linux, BSD, etc. // Assume Windows, Linux, BSD, etc.
@ -252,7 +252,7 @@ impl KeyMouse {
} }
}, },
Key(RAlt) => { Key(RAlt) => {
if cfg!(macos) { if cfg!(target_os = "macos") {
"Right Option ⌥" "Right Option ⌥"
} else { } else {
// Assume Windows, Linux, BSD, etc. // Assume Windows, Linux, BSD, etc.
@ -260,7 +260,7 @@ impl KeyMouse {
} }
}, },
Key(LControl) => { Key(LControl) => {
if cfg!(macos) { if cfg!(target_os = "macos") {
"Left Cmd ⌘" "Left Cmd ⌘"
} else { } else {
// Assume Windows, Linux, BSD, etc. // Assume Windows, Linux, BSD, etc.
@ -268,7 +268,7 @@ impl KeyMouse {
} }
}, },
Key(RControl) => { Key(RControl) => {
if cfg!(macos) { if cfg!(target_os = "macos") {
"Right Cmd ⌘" "Right Cmd ⌘"
} else { } else {
// Assume Windows, Linux, BSD, etc. // Assume Windows, Linux, BSD, etc.
@ -281,9 +281,9 @@ impl KeyMouse {
// qualifier. The exception to this is Mac OS which doesn't usually have // qualifier. The exception to this is Mac OS which doesn't usually have
// this key at all, so we keep the qualifier to minimise ambiguity. // this key at all, so we keep the qualifier to minimise ambiguity.
Key(LWin) => { Key(LWin) => {
if cfg!(windows) { if cfg!(target_family = "windows") {
"Win ⊞" "Win ⊞"
} else if cfg!(macos) { } else if cfg!(target_os = "macos") {
"Left Cmd ⌘ (Super)" // Extra qualifier because both Ctrl and Win map to Cmd on Mac "Left Cmd ⌘ (Super)" // Extra qualifier because both Ctrl and Win map to Cmd on Mac
} else { } else {
// Assume Linux, BSD, etc. // Assume Linux, BSD, etc.
@ -292,9 +292,9 @@ impl KeyMouse {
}, },
// Most keyboards don't have this key, so throw in all the qualifiers // Most keyboards don't have this key, so throw in all the qualifiers
Key(RWin) => { Key(RWin) => {
if cfg!(windows) { if cfg!(target_family = "windows") {
"Right Win ⊞" "Right Win ⊞"
} else if cfg!(macos) { } else if cfg!(target_os = "macos") {
"Right Cmd ⌘ (Super)" // Extra qualifier because both Ctrl and Win map to Cmd on Mac "Right Cmd ⌘ (Super)" // Extra qualifier because both Ctrl and Win map to Cmd on Mac
} else { } else {
// Assume Linux, BSD, etc. // Assume Linux, BSD, etc.
@ -427,7 +427,7 @@ impl Window {
// Avoid cpal / winit OleInitialize conflict // Avoid cpal / winit OleInitialize conflict
// See: https://github.com/rust-windowing/winit/pull/1524 // See: https://github.com/rust-windowing/winit/pull/1524
#[cfg(target_os = "windows")] #[cfg(target_family = "windows")]
let win_builder = winit::platform::windows::WindowBuilderExtWindows::with_drag_and_drop( let win_builder = winit::platform::windows::WindowBuilderExtWindows::with_drag_and_drop(
win_builder, win_builder,
false, false,

View File

@ -8,16 +8,25 @@ edition = "2021"
use-dyn-lib = ["common-dynlib"] use-dyn-lib = ["common-dynlib"]
be-dyn-lib = [] be-dyn-lib = []
simd = ["vek/platform_intrinsics", "packed_simd"] simd = ["vek/platform_intrinsics", "packed_simd"]
bin_compression = ["lz-fear", "deflate", "flate2", "image/jpeg", "num-traits", "fallible-iterator", "rstar", "cli"] bin_compression = [
"lz-fear",
"deflate",
"flate2",
"image/jpeg",
"num-traits",
"fallible-iterator",
"rstar",
"cli",
]
cli = ["clap", "signal-hook", "indicatif"] cli = ["clap", "signal-hook", "indicatif"]
default = ["simd"] default = ["simd"]
[dependencies] [dependencies]
common = { package = "veloren-common", path = "../common" } common = { package = "veloren-common", path = "../common" }
common_base = { package = "veloren-common-base", path = "../common/base"} common_base = { package = "veloren-common-base", path = "../common/base" }
common-net = { package = "veloren-common-net", path = "../common/net" } common-net = { package = "veloren-common-net", path = "../common/net" }
common-dynlib = {package = "veloren-common-dynlib", path = "../common/dynlib", optional = true} common-dynlib = { package = "veloren-common-dynlib", path = "../common/dynlib", optional = true }
bincode = { workspace = true } bincode = { workspace = true }
bitvec = "1.0.1" bitvec = "1.0.1"
@ -58,11 +67,25 @@ indicatif = { version = "0.17.8", optional = true }
[dev-dependencies] [dev-dependencies]
common-frontend = { package = "veloren-common-frontend", path = "../common/frontend" } common-frontend = { package = "veloren-common-frontend", path = "../common/frontend" }
criterion = { version = "0.5.1", default-features=false, features=["rayon", "cargo_bench_support"]} criterion = { version = "0.5.1", default-features = false, features = [
"rayon",
"cargo_bench_support",
] }
csv = "1.1.3" csv = "1.1.3"
tracing-subscriber = { version = "0.3.7", default-features = false, features = ["fmt", "time", "ansi", "smallvec", "env-filter"] } tracing-subscriber = { version = "0.3.7", default-features = false, features = [
"fmt",
"time",
"ansi",
"smallvec",
"env-filter",
] }
minifb = "0.25" minifb = "0.25"
rusqlite = { version = "0.30.0", features = ["array", "vtab", "bundled", "trace"] } rusqlite = { version = "0.30.0", features = [
"array",
"vtab",
"bundled",
"trace",
] }
svg_fmt = "0.4" svg_fmt = "0.4"
[[bench]] [[bench]]