mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
new toolchain lints helped us to find issues, backporting the bugfixes here.
NOTE: we havent had world enabled in server/agent, this MR now enables this, might have some (hopefully positive) effects on our agent code
This commit is contained in:
parent
b2d7a9291a
commit
b770665fb9
3
Cargo.lock
generated
3
Cargo.lock
generated
@ -6651,7 +6651,7 @@ version = "1.6.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
|
||||
dependencies = [
|
||||
"cfg-if 0.1.10",
|
||||
"cfg-if 1.0.0",
|
||||
"rand 0.8.5",
|
||||
"static_assertions",
|
||||
]
|
||||
@ -7203,6 +7203,7 @@ dependencies = [
|
||||
"veloren-common-base",
|
||||
"veloren-common-dynlib",
|
||||
"veloren-rtsim",
|
||||
"veloren-world",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
18
Cargo.toml
18
Cargo.toml
@ -123,22 +123,27 @@ rand_chacha = { version = "0.3" }
|
||||
bincode = { version = "1.3.3" }
|
||||
bitflags = { version = "2.2.1" }
|
||||
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"] }
|
||||
inline_tweak = { version = "1.0.8" }
|
||||
|
||||
tokio = { version = "1.28", default-features = false, features = ["rt"] }
|
||||
tracing = { version = "0.1" }
|
||||
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"
|
||||
|
||||
strum = { version = "0.24", features = ["derive"] }
|
||||
enum-map = { version = "2.4" }
|
||||
hashbrown = { version = "0.13", features = ["rayon", "serde", "nightly"] }
|
||||
fxhash = { version = "0.2.1" }
|
||||
crossbeam-utils = { version = "0.8.1"}
|
||||
crossbeam-channel = { version = "0.5"}
|
||||
crossbeam-utils = { version = "0.8.1" }
|
||||
crossbeam-channel = { version = "0.5" }
|
||||
ordered-float = { version = "3", default-features = true }
|
||||
num = { version = "0.4" }
|
||||
num-traits = { version = "0.2" }
|
||||
@ -147,13 +152,13 @@ itertools = { version = "0.10" }
|
||||
|
||||
serde = { version = "1.0.118", features = ["derive"] }
|
||||
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"] }
|
||||
image = { version = "0.24", default-features = false, features = ["png"] }
|
||||
rayon = { version = "1.5" }
|
||||
|
||||
clap = { version = "4.2", features = ["derive"]}
|
||||
clap = { version = "4.2", features = ["derive"] }
|
||||
async-trait = "0.1.42"
|
||||
sha2 = "0.10"
|
||||
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-types = { path = "../wgpu/wgpu-types" }
|
||||
# naga = { path = "../wgpu/naga" }
|
||||
|
||||
|
@ -17,7 +17,7 @@ impl Default for Ori {
|
||||
|
||||
impl Ori {
|
||||
pub fn new(quat: Quaternion<f32>) -> Self {
|
||||
#[cfg(debug_assert)]
|
||||
#[cfg(debug_assertions)]
|
||||
{
|
||||
let v4 = quat.into_vec4();
|
||||
debug_assert!(v4.map(f32::is_finite).reduce_and());
|
||||
|
@ -5,13 +5,15 @@ use crate::{
|
||||
};
|
||||
use common_base::span;
|
||||
use hashbrown::hash_map::DefaultHashBuilder;
|
||||
#[cfg(rrt_pathfinding)] use hashbrown::HashMap;
|
||||
#[cfg(rrt_pathfinding)]
|
||||
#[cfg(feature = "rrt_pathfinding")]
|
||||
use hashbrown::HashMap;
|
||||
#[cfg(feature = "rrt_pathfinding")]
|
||||
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::{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 vek::*;
|
||||
|
||||
@ -705,7 +707,7 @@ where
|
||||
}
|
||||
|
||||
// Enable when airbraking/sensible flight is a thing
|
||||
#[cfg(rrt_pathfinding)]
|
||||
#[cfg(feature = "rrt_pathfinding")]
|
||||
fn find_air_path<V>(
|
||||
vol: &V,
|
||||
startf: Vec3<f32>,
|
||||
@ -757,7 +759,7 @@ where
|
||||
/// with wider gaps, such as flying through a forest than for terrain
|
||||
/// with narrow gaps, such as navigating a maze.
|
||||
/// Returns a path and whether that path is complete or not.
|
||||
#[cfg(rrt_pathfinding)]
|
||||
#[cfg(feature = "rrt_pathfinding")]
|
||||
fn informed_rrt_connect(
|
||||
start: 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
|
||||
/// greater than zero. In order to increase the sample area, the
|
||||
/// search_parameter should be increased linearly as the search continues.
|
||||
#[cfg(rrt_pathfinding)]
|
||||
#[cfg(feature = "rrt_pathfinding")]
|
||||
pub fn point_on_prolate_spheroid(
|
||||
focus1: Vec3<f32>,
|
||||
focus2: Vec3<f32>,
|
||||
|
@ -766,48 +766,48 @@ impl ComponentRecipe {
|
||||
}
|
||||
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
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)]
|
||||
struct RawComponentRecipe {
|
||||
output: RawComponentOutput,
|
||||
|
@ -5,7 +5,7 @@ authors = ["Joshua Barretto <joshua.s.barretto@gmail.com>"]
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
worldgen = []
|
||||
worldgen = ["server-agent/worldgen"]
|
||||
simd = ["vek/platform_intrinsics"]
|
||||
plugins = ["common-state/plugins"]
|
||||
persistent_world = []
|
||||
@ -18,16 +18,22 @@ default = ["worldgen", "plugins", "persistent_world", "simd"]
|
||||
[dependencies]
|
||||
common = { package = "veloren-common", path = "../common" }
|
||||
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-state = { package = "veloren-common-state", path = "../common/state" }
|
||||
common-systems = { package = "veloren-common-systems", path = "../common/systems" }
|
||||
common-net = { package = "veloren-common-net", path = "../common/net" }
|
||||
world = { package = "veloren-world", path = "../world" }
|
||||
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"
|
||||
|
||||
@ -60,12 +66,17 @@ rayon = { workspace = true }
|
||||
crossbeam-channel = { workspace = true }
|
||||
prometheus = { workspace = true }
|
||||
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 }
|
||||
noise = { version = "0.7", default-features = false }
|
||||
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"] }
|
||||
|
||||
schnellru = "0.2.1"
|
||||
|
@ -5,13 +5,15 @@ edition = "2021"
|
||||
version = "0.1.0"
|
||||
|
||||
[features]
|
||||
worldgen = ["world"]
|
||||
use-dyn-lib = ["common-dynlib"]
|
||||
be-dyn-lib = []
|
||||
|
||||
[dependencies]
|
||||
common = { package = "veloren-common", path = "../../common"}
|
||||
common = { package = "veloren-common", path = "../../common" }
|
||||
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" }
|
||||
|
||||
specs = { workspace = true, features = ["shred-derive"] }
|
||||
|
@ -409,7 +409,7 @@ pub struct ReadData<'a> {
|
||||
pub time_of_day: Read<'a, TimeOfDay>,
|
||||
pub light_emitter: ReadStorage<'a, LightEmitter>,
|
||||
#[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 buffs: ReadStorage<'a, Buffs>,
|
||||
pub combos: ReadStorage<'a, Combo>,
|
||||
|
@ -1,5 +1,8 @@
|
||||
[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"
|
||||
edition = "2021"
|
||||
name = "veloren-voxygen"
|
||||
@ -26,7 +29,7 @@ hot-reloading = ["common/hot-reloading"]
|
||||
singleplayer = ["server"]
|
||||
simd = ["vek/platform_intrinsics"]
|
||||
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"]
|
||||
egui-ui = ["voxygen-egui", "egui", "egui_wgpu_backend", "egui_winit_platform"]
|
||||
shaderc-from-source = ["shaderc/build-from-source"]
|
||||
@ -34,32 +37,42 @@ discord = ["discord-sdk"]
|
||||
bin_img-export = ["common-assets"]
|
||||
|
||||
# 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
|
||||
default-no-egui = ["default-publish", "hot-reloading", "shaderc-from-source"]
|
||||
default = ["default-no-egui", "egui-ui"]
|
||||
|
||||
[dependencies]
|
||||
client = {package = "veloren-client", path = "../client"}
|
||||
common = {package = "veloren-common", path = "../common"}
|
||||
common-assets = {package = "veloren-common-assets", path = "../common/assets", optional = true} # img-export
|
||||
common-base = {package = "veloren-common-base", path = "../common/base"}
|
||||
common-ecs = {package = "veloren-common-ecs", path = "../common/ecs"}
|
||||
common-frontend = {package = "veloren-common-frontend", path = "../common/frontend"}
|
||||
common-net = {package = "veloren-common-net", path = "../common/net"}
|
||||
common-state = {package = "veloren-common-state", path = "../common/state"}
|
||||
common-systems = {package = "veloren-common-systems", path = "../common/systems"}
|
||||
client = { package = "veloren-client", path = "../client" }
|
||||
common = { package = "veloren-common", path = "../common" }
|
||||
common-assets = { package = "veloren-common-assets", path = "../common/assets", optional = true } # img-export
|
||||
common-base = { package = "veloren-common-base", path = "../common/base" }
|
||||
common-ecs = { package = "veloren-common-ecs", path = "../common/ecs" }
|
||||
common-frontend = { package = "veloren-common-frontend", path = "../common/frontend" }
|
||||
common-net = { package = "veloren-common-net", path = "../common/net" }
|
||||
common-state = { package = "veloren-common-state", path = "../common/state" }
|
||||
common-systems = { package = "veloren-common-systems", path = "../common/systems" }
|
||||
|
||||
anim = {package = "veloren-voxygen-anim", path = "anim"}
|
||||
i18n = {package = "veloren-client-i18n", path = "../client/i18n"}
|
||||
i18n-helpers = {package = "veloren-voxygen-i18n-helpers", path = "i18n-helpers"}
|
||||
voxygen-egui = {package = "veloren-voxygen-egui", path = "egui", optional = true }
|
||||
anim = { package = "veloren-voxygen-anim", path = "anim" }
|
||||
i18n = { package = "veloren-client-i18n", path = "../client/i18n" }
|
||||
i18n-helpers = { package = "veloren-voxygen-i18n-helpers", path = "i18n-helpers" }
|
||||
voxygen-egui = { package = "veloren-voxygen-egui", path = "egui", optional = true }
|
||||
|
||||
# Graphics
|
||||
winit = {version = "0.28.6", features = ["serde"]}
|
||||
wgpu = { version = "0.18.0", default-features = false, features = ["trace", "spirv", "glsl"] }
|
||||
winit = { version = "0.28.6", features = ["serde"] }
|
||||
wgpu = { version = "0.18.0", default-features = false, features = [
|
||||
"trace",
|
||||
"spirv",
|
||||
"glsl",
|
||||
] }
|
||||
wgpu-profiler = "0.15.0"
|
||||
bytemuck = { version="1.7", features=["derive"] }
|
||||
bytemuck = { version = "1.7", features = ["derive"] }
|
||||
# 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
|
||||
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"
|
||||
|
||||
# Ui
|
||||
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_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" }
|
||||
euc = "0.5.0"
|
||||
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 = { 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" }
|
||||
glyph_brush = "0.7.0"
|
||||
# https://gitlab.com/Frinksy/keyboard-keynames/-/merge_requests/8
|
||||
keyboard-keynames = { git = "https://gitlab.com/Imbris/keyboard-keynames.git", tag = "veloren-winit-0.28" }
|
||||
# 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_winit_platform = { version = "0.20", optional = true }
|
||||
|
||||
@ -89,16 +102,18 @@ vek = { workspace = true }
|
||||
levenshtein = "1.0.5"
|
||||
|
||||
# Controller
|
||||
gilrs = {version = "0.10.0", features = ["serde-serialize"]}
|
||||
gilrs = { version = "0.10.0", features = ["serde-serialize"] }
|
||||
|
||||
# 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
|
||||
clap = { workspace = true }
|
||||
|
||||
# Utility
|
||||
assets_manager = {version = "0.11", features = ["ab_glyph"]}
|
||||
assets_manager = { version = "0.11", features = ["ab_glyph"] }
|
||||
backtrace = "0.3.40"
|
||||
chrono = { workspace = true }
|
||||
chumsky = "0.9"
|
||||
@ -108,7 +123,7 @@ directories-next = "2.0"
|
||||
dot_vox = "5.1"
|
||||
guillotiere = "0.6.2"
|
||||
hashbrown = { workspace = true }
|
||||
image = { workspace = true, features = ["ico"]}
|
||||
image = { workspace = true, features = ["ico"] }
|
||||
lazy_static = { workspace = true }
|
||||
native-dialog = { version = "0.6.3", optional = true }
|
||||
num = { workspace = true }
|
||||
@ -116,9 +131,9 @@ ordered-float = { workspace = true }
|
||||
rand = { workspace = true }
|
||||
rand_chacha = { 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 }
|
||||
serde = { workspace = true, features = [ "rc" ]}
|
||||
serde = { workspace = true, features = ["rc"] }
|
||||
slab = { workspace = true }
|
||||
strum = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
@ -137,10 +152,10 @@ enum-map = { workspace = true }
|
||||
[target.'cfg(target_os = "macos")'.dependencies]
|
||||
dispatch = "0.1.4"
|
||||
|
||||
[target.'cfg(windows)'.build-dependencies]
|
||||
[target.'cfg(target_family = "windows")'.build-dependencies]
|
||||
winres = "0.1"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
[target.'cfg(target_family = "windows")'.dependencies]
|
||||
mimalloc = "0.1.29"
|
||||
|
||||
# Mumble
|
||||
@ -148,8 +163,11 @@ mimalloc = "0.1.29"
|
||||
mumble-link = "0.2.0"
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = { version = "0.5.1", default-features=false, features=["rayon", "cargo_bench_support"]}
|
||||
world = {package = "veloren-world", path = "../world"}
|
||||
criterion = { version = "0.5.1", default-features = false, features = [
|
||||
"rayon",
|
||||
"cargo_bench_support",
|
||||
] }
|
||||
world = { package = "veloren-world", path = "../world" }
|
||||
rayon = { workspace = true }
|
||||
|
||||
[[bench]]
|
||||
|
@ -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> {
|
||||
type Event = Vec<Event>;
|
||||
type State = State;
|
||||
@ -353,21 +369,6 @@ impl<'a> Widget for Map<'a> {
|
||||
let max_drag = player_pos_chunks;
|
||||
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 {
|
||||
Pos(Vec2<f32>),
|
||||
ClickPos,
|
||||
|
@ -244,7 +244,7 @@ impl KeyMouse {
|
||||
Key(PrevTrack) => "Prev Track",
|
||||
Key(NextTrack) => "Next Track",
|
||||
Key(LAlt) => {
|
||||
if cfg!(macos) {
|
||||
if cfg!(target_os = "macos") {
|
||||
"Left Option ⌥"
|
||||
} else {
|
||||
// Assume Windows, Linux, BSD, etc.
|
||||
@ -252,7 +252,7 @@ impl KeyMouse {
|
||||
}
|
||||
},
|
||||
Key(RAlt) => {
|
||||
if cfg!(macos) {
|
||||
if cfg!(target_os = "macos") {
|
||||
"Right Option ⌥"
|
||||
} else {
|
||||
// Assume Windows, Linux, BSD, etc.
|
||||
@ -260,7 +260,7 @@ impl KeyMouse {
|
||||
}
|
||||
},
|
||||
Key(LControl) => {
|
||||
if cfg!(macos) {
|
||||
if cfg!(target_os = "macos") {
|
||||
"Left Cmd ⌘"
|
||||
} else {
|
||||
// Assume Windows, Linux, BSD, etc.
|
||||
@ -268,7 +268,7 @@ impl KeyMouse {
|
||||
}
|
||||
},
|
||||
Key(RControl) => {
|
||||
if cfg!(macos) {
|
||||
if cfg!(target_os = "macos") {
|
||||
"Right Cmd ⌘"
|
||||
} else {
|
||||
// Assume Windows, Linux, BSD, etc.
|
||||
@ -281,9 +281,9 @@ impl KeyMouse {
|
||||
// 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.
|
||||
Key(LWin) => {
|
||||
if cfg!(windows) {
|
||||
if cfg!(target_family = "windows") {
|
||||
"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
|
||||
} else {
|
||||
// Assume Linux, BSD, etc.
|
||||
@ -292,9 +292,9 @@ impl KeyMouse {
|
||||
},
|
||||
// Most keyboards don't have this key, so throw in all the qualifiers
|
||||
Key(RWin) => {
|
||||
if cfg!(windows) {
|
||||
if cfg!(target_family = "windows") {
|
||||
"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
|
||||
} else {
|
||||
// Assume Linux, BSD, etc.
|
||||
@ -427,7 +427,7 @@ impl Window {
|
||||
|
||||
// Avoid cpal / winit OleInitialize conflict
|
||||
// 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(
|
||||
win_builder,
|
||||
false,
|
||||
|
@ -8,16 +8,25 @@ edition = "2021"
|
||||
use-dyn-lib = ["common-dynlib"]
|
||||
be-dyn-lib = []
|
||||
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"]
|
||||
|
||||
default = ["simd"]
|
||||
|
||||
[dependencies]
|
||||
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-dynlib = {package = "veloren-common-dynlib", path = "../common/dynlib", optional = true}
|
||||
common-dynlib = { package = "veloren-common-dynlib", path = "../common/dynlib", optional = true }
|
||||
|
||||
bincode = { workspace = true }
|
||||
bitvec = "1.0.1"
|
||||
@ -58,11 +67,25 @@ indicatif = { version = "0.17.8", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
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"
|
||||
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"
|
||||
rusqlite = { version = "0.30.0", features = ["array", "vtab", "bundled", "trace"] }
|
||||
rusqlite = { version = "0.30.0", features = [
|
||||
"array",
|
||||
"vtab",
|
||||
"bundled",
|
||||
"trace",
|
||||
] }
|
||||
svg_fmt = "0.4"
|
||||
|
||||
[[bench]]
|
||||
|
Loading…
Reference in New Issue
Block a user