From 272ca41b9eb9e9b93985a46f78cf59dc482378d3 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 15 Dec 2020 22:49:23 +0000 Subject: [PATCH 01/87] Reduced bridge artifacts --- world/src/column/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 04aa0231fa..64bb8bafc0 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -436,7 +436,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { .unwrap_or(CONFIG.sea_level); let river_gouge = 0.5; - let (_in_water, water_dist, alt_, water_level, riverless_alt, warp_factor) = if let Some( + let (_in_water, water_dist, alt_, water_level, _riverless_alt, warp_factor) = if let Some( (max_border_river_pos, river_chunk, max_border_river, max_border_river_dist), ) = max_river @@ -706,8 +706,8 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { // let warp_factor = 0.0; let riverless_alt_delta = Lerp::lerp(0.0, riverless_alt_delta, warp_factor); + let riverless_alt = alt + riverless_alt_delta; //riverless_alt + riverless_alt_delta; let alt = alt_ + riverless_alt_delta; - let riverless_alt = riverless_alt + riverless_alt_delta; let basement = alt + sim.get_interpolated_monotone(wpos, |chunk| chunk.basement.sub(chunk.alt))?; From 23f0dfb078d406e6ac79038780fda595020684c3 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 26 Dec 2020 15:53:06 +0000 Subject: [PATCH 02/87] Began work on new sites --- common/src/store.rs | 156 +++++++++++++++++++++++++++++++++------- world/examples/site.rs | 3 + world/src/lib.rs | 1 + world/src/sim2/mod.rs | 3 +- world/src/site2/mod.rs | 15 ++++ world/src/site2/plot.rs | 12 ++++ world/src/site2/tile.rs | 49 +++++++++++++ 7 files changed, 213 insertions(+), 26 deletions(-) create mode 100644 world/examples/site.rs create mode 100644 world/src/site2/mod.rs create mode 100644 world/src/site2/plot.rs create mode 100644 world/src/site2/tile.rs diff --git a/common/src/store.rs b/common/src/store.rs index e3ededbd25..49ed00e8c4 100644 --- a/common/src/store.rs +++ b/common/src/store.rs @@ -5,69 +5,175 @@ use std::{ ops::{Index, IndexMut}, }; -// NOTE: We use u64 to make sure we are consistent across all machines. We -// assume that usize fits into 8 bytes. -pub struct Id(u64, PhantomData); +pub struct Id { + idx: u32, + gen: u32, + phantom: PhantomData, +} impl Id { - pub fn id(&self) -> u64 { self.0 } + pub fn id(&self) -> u64 { self.idx as u64 | ((self.gen as u64) << 32) } } impl Copy for Id {} impl Clone for Id { - fn clone(&self) -> Self { Self(self.0, PhantomData) } + fn clone(&self) -> Self { + Self { + idx: self.idx, + gen: self.gen, + phantom: PhantomData, + } + } } impl Eq for Id {} impl PartialEq for Id { - fn eq(&self, other: &Self) -> bool { self.0 == other.0 } + fn eq(&self, other: &Self) -> bool { self.idx == other.idx && self.gen == other.gen } } impl fmt::Debug for Id { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Id<{}>({})", std::any::type_name::(), self.0) + write!(f, "Id<{}>({}, {})", std::any::type_name::(), self.idx, self.gen) } } impl hash::Hash for Id { - fn hash(&self, h: &mut H) { self.0.hash(h); } + fn hash(&self, h: &mut H) { + self.idx.hash(h); + self.gen.hash(h); + } +} + +struct Entry { + gen: u32, + item: Option, } pub struct Store { - items: Vec, + entries: Vec>, + len: usize, } impl Default for Store { - fn default() -> Self { Self { items: Vec::new() } } + fn default() -> Self { + Self { + entries: Vec::new(), + len: 0, + } + } } impl Store { + pub fn contains(&self, id: Id) -> bool { + self.entries + .get(id.idx as usize) + .map(|e| e.gen == id.gen) + .unwrap_or(false) + } + pub fn get(&self, id: Id) -> &T { - // NOTE: Safe conversion, because it came from usize. - self.items.get(id.0 as usize).unwrap() + let entry = self.entries + .get(id.idx as usize) + .unwrap(); + if entry.gen == id.gen { + entry.item.as_ref().unwrap() + } else { + panic!("Stale ID used to access store entry"); + } } pub fn get_mut(&mut self, id: Id) -> &mut T { - // NOTE: Safe conversion, because it came from usize. - self.items.get_mut(id.0 as usize).unwrap() + let entry = self.entries + .get_mut(id.idx as usize) + .unwrap(); + if entry.gen == id.gen { + entry.item.as_mut().unwrap() + } else { + panic!("Stale ID used to access store entry"); + } } - pub fn ids(&self) -> impl Iterator> { - (0..self.items.len()).map(|i| Id(i as u64, PhantomData)) + pub fn ids(&self) -> impl Iterator> + '_ { + self.iter().map(|(id, _)| id) } - pub fn values(&self) -> impl Iterator { self.items.iter() } + pub fn values(&self) -> impl Iterator + '_ { + self.iter().map(|(_, item)| item) + } - pub fn values_mut(&mut self) -> impl Iterator { self.items.iter_mut() } + pub fn values_mut(&mut self) -> impl Iterator + '_ { + self.iter_mut().map(|(_, item)| item) + } - pub fn iter(&self) -> impl Iterator, &T)> { self.ids().zip(self.values()) } + pub fn iter(&self) -> impl Iterator, &T)> + '_ { + self.entries + .iter() + .enumerate() + .filter_map(move |(idx, entry)| { + Some(Id { + idx: idx as u32, + gen: entry.gen, + phantom: PhantomData, + }).zip(entry.item.as_ref()) + }) + } - pub fn iter_mut(&mut self) -> impl Iterator, &mut T)> { - self.ids().zip(self.values_mut()) + pub fn iter_mut(&mut self) -> impl Iterator, &mut T)> + '_ { + self.entries + .iter_mut() + .enumerate() + .filter_map(move |(idx, entry)| { + Some(Id { + idx: idx as u32, + gen: entry.gen, + phantom: PhantomData, + }).zip(entry.item.as_mut()) + }) } pub fn insert(&mut self, item: T) -> Id { - // NOTE: Assumes usize fits into 8 bytes. - let id = Id(self.items.len() as u64, PhantomData); - self.items.push(item); - id + if self.len < self.entries.len() { + // TODO: Make this more efficient with a lookahead system + let (idx, entry) = self.entries + .iter_mut() + .enumerate() + .find(|(_, e)| e.item.is_none()) + .unwrap(); + entry.item = Some(item); + assert!(entry.gen < u32::MAX); + entry.gen += 1; + Id { + idx: idx as u32, + gen: entry.gen, + phantom: PhantomData, + } + } else { + assert!(self.entries.len() < (u32::MAX - 1) as usize); + let id = Id { + idx: self.entries.len() as u32, + gen: 0, + phantom: PhantomData, + }; + self.entries.push(Entry { + gen: 0, + item: Some(item), + }); + self.len += 1; + id + } + } + + pub fn remove(&mut self, id: Id) -> Option { + if let Some(item) = self.entries + .get_mut(id.idx as usize) + .and_then(|e| if e.gen == id.gen { + e.item.take() + } else { + None + }) + { + self.len -= 1; + Some(item) + } else { + None + } } } diff --git a/world/examples/site.rs b/world/examples/site.rs new file mode 100644 index 0000000000..c89b901b25 --- /dev/null +++ b/world/examples/site.rs @@ -0,0 +1,3 @@ +fn main() { + todo!(); +} diff --git a/world/src/lib.rs b/world/src/lib.rs index 859f829d82..b5ca5fad03 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -24,6 +24,7 @@ pub mod pathfinding; pub mod sim; pub mod sim2; pub mod site; +pub mod site2; pub mod util; // Reexports diff --git a/world/src/sim2/mod.rs b/world/src/sim2/mod.rs index a89d327d0c..2216286ed2 100644 --- a/world/src/sim2/mod.rs +++ b/world/src/sim2/mod.rs @@ -88,7 +88,8 @@ pub fn simulate(index: &mut Index, world: &mut WorldSim) { } pub fn tick(index: &mut Index, _world: &mut WorldSim, dt: f32) { - for site in index.sites.ids() { + let site_ids = index.sites.ids().collect::>(); + for site in site_ids { tick_site_economy(index, site, dt); } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs new file mode 100644 index 0000000000..9bf80a75b3 --- /dev/null +++ b/world/src/site2/mod.rs @@ -0,0 +1,15 @@ +mod tile; +mod plot; + +use vek::*; +use common::store::{Store, Id}; +use crate::util::Grid; +use self::{ + tile::TileGrid, + plot::Plot, +}; + +pub struct Site { + grid: TileGrid, + plot: Store, +} diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs new file mode 100644 index 0000000000..9c2b8c658e --- /dev/null +++ b/world/src/site2/plot.rs @@ -0,0 +1,12 @@ +use vek::*; + +pub struct Plot { + kind: PlotKind, + center_tpos: Vec2, + units: Vec2>, +} + +pub enum PlotKind { + Path, + House { height: i32 }, +} diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs new file mode 100644 index 0000000000..b4006c436b --- /dev/null +++ b/world/src/site2/tile.rs @@ -0,0 +1,49 @@ +use super::*; + +const TILE_SIZE: u32 = 7; +const ZONE_SIZE: u32 = 16; +const ZONE_RADIUS: u32 = 16; +const TILE_RADIUS: u32 = ZONE_SIZE * ZONE_RADIUS; +const MAX_BLOCK_RADIUS: u32 = TILE_SIZE * TILE_RADIUS; + +pub struct TileGrid { + zones: Grid>>>, +} + +impl TileGrid { + pub fn new() -> Self { + Self { + zones: Grid::populate_from(Vec2::broadcast(ZONE_RADIUS as i32 * 2 + 1), |_| None), + } + } + + pub fn get(&self, tpos: Vec2) -> Option<&Tile> { + let tpos = tpos + TILE_RADIUS as i32; + self.zones + .get(tpos) + .and_then(|zone| zone.as_ref()?.get(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32)))) + .and_then(|tile| tile.as_ref()) + } + + pub fn get_mut(&mut self, tpos: Vec2) -> Option<&mut Tile> { + let tpos = tpos + TILE_RADIUS as i32; + self.zones + .get_mut(tpos) + .and_then(|zone| zone + .get_or_insert_with(|| Grid::populate_from(Vec2::broadcast(ZONE_RADIUS as i32 * 2 + 1), |_| None)) + .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) + .map(|tile| tile.get_or_insert_with(|| Tile::empty()))) + } +} + +pub struct Tile { + plot: Option>, +} + +impl Tile { + pub fn empty() -> Self { + Self { + plot: None, + } + } +} From 82a25e49efdc1a43a742d804a55adc60e4ffd160 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 3 Jan 2021 20:43:07 +0000 Subject: [PATCH 03/87] Began integrating procgen trees --- Cargo.lock | 3092 ++++++++++++++++++++++---------------- world/Cargo.toml | 1 + world/src/layer/tree.rs | 144 +- world/src/util/random.rs | 4 +- 4 files changed, 1975 insertions(+), 1266 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9dcba0ffc..5232d5ff14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,27 +2,27 @@ # It is not intended for manual editing. [[package]] name = "ab_glyph" -version = "0.2.9" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b1f87418ab9d7e1ee2a783aa167767ebeb316d0a9fb10c347aec28a5008acb" +checksum = "26a685fe66654266f321a8b572660953f4df36a2135706503a4c89981d76e1a2" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser 0.11.0", + "owned_ttf_parser 0.8.0", ] [[package]] name = "ab_glyph_rasterizer" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" +checksum = "2692800d602527d2b8fea50036119c37df74ab565b10e285706a3dcec0ec3e16" [[package]] name = "addr2line" -version = "0.14.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" dependencies = [ - "gimli 0.23.0", + "gimli", ] [[package]] @@ -42,6 +42,9 @@ name = "ahash" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" +dependencies = [ + "const-random", +] [[package]] name = "ahash" @@ -51,53 +54,54 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "ahash" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "796540673305a66d127804eef19ad696f1f204b8c1025aaca4958c17eab32877" +checksum = "a75b7e6a93ecd6dbd2c225154d0fa7f86205574ecaa6c87429fb5f66ee677c44" dependencies = [ - "getrandom 0.2.2", - "once_cell", + "getrandom 0.2.0", + "lazy_static", "version_check 0.9.2", ] [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" dependencies = [ "memchr", ] [[package]] name = "alsa" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb213f6b3e4b1480a60931ca2035794aa67b73103d254715b1db7b70dcb3c934" +checksum = "44581add1add74ade32aca327b550342359ec00191672c23c1caa3d492b85930" dependencies = [ "alsa-sys", "bitflags", - "libc", + "libc 0.2.77", "nix 0.15.0", ] [[package]] name = "alsa-sys" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" +checksum = "d5a0559bcd3f7a482690d98be41c08a43e92f669b179433e95ddf5e8b8fd36a3" dependencies = [ - "libc", + "libc 0.2.77", "pkg-config", ] [[package]] name = "andrew" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" +checksum = "5e1ea80a5089cac999ffd4a91888154076a961d27387b0f7a6cd2d4dddb636b9" dependencies = [ "bitflags", + "line_drawing", "rusttype 0.9.2", "walkdir 2.3.1", "xdg", @@ -150,7 +154,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" dependencies = [ - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -159,9 +163,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" dependencies = [ - "num-traits", + "num-traits 0.2.14", ] +[[package]] +name = "arc-swap" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" + [[package]] name = "arr_macro" version = "0.1.3" @@ -179,8 +189,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0609c78bd572f4edc74310dfb63a01f5609d53fa8b4dd7c4d98aef3b3e8d72d1" dependencies = [ "proc-macro-hack", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -191,8 +201,8 @@ checksum = "5a1ae06b5f52588295bfd019b837b6fb1a6914d58ece30b0c43ae439ef08e562" dependencies = [ "proc-macro-error", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -203,9 +213,9 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.5.2" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" [[package]] name = "as-slice" @@ -226,49 +236,69 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" [[package]] -name = "assets_manager" -version = "0.4.3" +name = "ascii" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac94eeee6ebd1165959e440836a452109f9f839d6cfde12974d75a5b4222406" +checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" + +[[package]] +name = "assets_manager" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3593b8ddb9708251c7a57b07c917c77ecc685e804b697366d26fb4af64c9b960" dependencies = [ - "ahash 0.6.3", + "ahash 0.6.2", "bincode", - "crossbeam-channel", + "crossbeam-channel 0.5.0", "log", "notify 4.0.15", - "parking_lot 0.11.1", + "parking_lot 0.11.0", "ron", "serde", "serde_json", ] [[package]] -name = "async-channel" -version = "1.5.1" +name = "async-std" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59740d83946db6a5af71ae25ddf9562c2b176b2ca42cf99a455f09f4a220d6b9" +checksum = "538ecb01eb64eecd772087e5b6f7540cbc917f047727339a472dafed2185b267" dependencies = [ - "concurrent-queue", - "event-listener", + "async-task", + "broadcaster", + "crossbeam-channel 0.4.4", + "crossbeam-deque 0.7.3", + "crossbeam-utils 0.7.2", "futures-core", + "futures-io", + "futures-timer 2.0.2", + "kv-log-macro", + "log", + "memchr", + "mio 0.6.22", + "mio-uds", + "num_cpus", + "once_cell", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] -name = "async-trait" -version = "0.1.42" +name = "async-task" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" +checksum = "0ac2c016b079e771204030951c366db398864f5026f84a44dafb0ff20f02085d" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "libc 0.2.77", + "winapi 0.3.9", ] [[package]] name = "atom" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ff149ed9780025acfdb36862d35b28856bb693ceb451259a7164442f22fdc3" +checksum = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" [[package]] name = "atty" @@ -277,7 +307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", - "libc", + "libc 0.2.77", "winapi 0.3.9", ] @@ -302,10 +332,16 @@ dependencies = [ "reqwest", "rust-argon2", "serde", - "url", + "url 2.1.1", "uuid", ] +[[package]] +name = "autocfg" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" + [[package]] name = "autocfg" version = "1.0.1" @@ -314,23 +350,38 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.56" +version = "0.3.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" +checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" dependencies = [ "addr2line", - "cfg-if 1.0.0", - "libc", - "miniz_oxide 0.4.3", - "object 0.23.0", + "cfg-if 0.1.10", + "libc 0.2.77", + "miniz_oxide 0.4.2", + "object 0.20.0", "rustc-demangle", ] [[package]] name = "base-x" -version = "0.2.8" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" +checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" + +[[package]] +name = "base64" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" +dependencies = [ + "byteorder", +] + +[[package]] +name = "base64" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" [[package]] name = "base64" @@ -338,12 +389,6 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - [[package]] name = "bincode" version = "1.3.1" @@ -368,7 +413,7 @@ dependencies = [ "lazycell", "peeking_take_while", "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "regex", "rustc-hash", "shlex", @@ -382,9 +427,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bitvec" -version = "0.21.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35a2e31dce162f8f238c3c35a6600f1df4cb30f8929a6c464b0a8118d17c2502" +checksum = "f5011ffc90248764d7005b0e10c7294f5aa1bd87d9dd7248f4ad475b347c294d" dependencies = [ "funty", "radium", @@ -394,9 +439,9 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "0.5.11" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" +checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" dependencies = [ "arrayref", "arrayvec", @@ -410,10 +455,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] -name = "bstr" -version = "0.2.15" +name = "broadcaster" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" +checksum = "d9c972e21e0d055a36cf73e4daae870941fe7a8abcd5ac3396aab9e4c126bd87" +dependencies = [ + "futures-channel", + "futures-core", + "futures-sink", + "futures-util", + "parking_lot 0.10.2", + "slab", +] + +[[package]] +name = "bstr" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" dependencies = [ "lazy_static", "memchr", @@ -423,15 +482,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.6.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099e596ef14349721d9016f6b80dd3419ea1bf289ab9b44df8e4dfd3a005d5d9" +checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" [[package]] name = "bytemuck" -version = "1.5.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a4bad0c5981acc24bc09e532f35160f952e35422603f0563cd7a73c2c2e65a0" +checksum = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac" dependencies = [ "bytemuck_derive", ] @@ -443,15 +502,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "byteorder" -version = "1.4.2" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" +checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "either", + "iovec", +] [[package]] name = "bytes" @@ -459,23 +529,11 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" -[[package]] -name = "bytes" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" - -[[package]] -name = "cache-padded" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - [[package]] name = "calloop" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" +checksum = "59561a8b3968ba4bda0c46f42e0568507c5d26e94c3b6f2a0c730cbecd83ff3a" dependencies = [ "log", "nix 0.18.0", @@ -498,9 +556,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.66" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" +checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" dependencies = [ "jobserver", ] @@ -538,27 +596,27 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "d021fddb7bd3e734370acfa4a83f34095571d8570c039f1420d77540f68d5772" dependencies = [ - "libc", + "libc 0.2.77", "num-integer", - "num-traits", - "time 0.1.43", + "num-traits 0.2.14", + "time", "winapi 0.3.9", ] [[package]] name = "chunked_transfer" -version = "1.4.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" +checksum = "1d29eb15132782371f71da8f947dba48b3717bdb6fa771b9b434d645e40a7193" [[package]] name = "clang-sys" @@ -567,7 +625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" dependencies = [ "glob", - "libc", + "libc 0.2.77", "libloading 0.5.2", ] @@ -620,21 +678,20 @@ dependencies = [ [[package]] name = "clipboard_wayland" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61bcb8cde0387fde807b9b7af66ce8bd1665ef736e46e6e47fda82ea003e6ade" +checksum = "926d872adca0fc88173f8b7532c651e29ce67dc97323f4546c1c8af6610937fb" dependencies = [ - "smithay-clipboard", + "smithay-clipboard 0.5.2", ] [[package]] name = "clipboard_x11" -version = "0.2.0" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40403aa5220e5cd303d32dc4248cac8aa92bf47e3ae31e0e2481081755a63ff1" +checksum = "137cbd60c42327a8d63e710cee5a4d6a1ac41cdc90449ea2c2c63bd5e186290a" dependencies = [ - "thiserror", - "x11rb", + "xcb", ] [[package]] @@ -647,12 +704,12 @@ dependencies = [ ] [[package]] -name = "cmake" -version = "0.1.45" +name = "cloudabi" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" +checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" dependencies = [ - "cc", + "bitflags", ] [[package]] @@ -665,9 +722,9 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation 0.9.1", - "core-graphics 0.22.2", + "core-graphics 0.22.1", "foreign-types", - "libc", + "libc 0.2.77", "objc", ] @@ -681,7 +738,7 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation 0.9.1", - "core-graphics 0.22.2", + "core-graphics 0.22.1", "foreign-types", "libc", "objc", @@ -698,7 +755,7 @@ dependencies = [ "core-foundation 0.9.1", "core-graphics-types", "foreign-types", - "libc", + "libc 0.2.77", "objc", ] @@ -714,7 +771,7 @@ version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" dependencies = [ - "ascii", + "ascii 0.9.3", "byteorder", "either", "memchr", @@ -723,21 +780,13 @@ dependencies = [ [[package]] name = "combine" -version = "4.5.2" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4369b5e4c0cddf64ad8981c0111e7df4f7078f4d6ba98fb31f2e17c4c57b7e" +checksum = "2809f67365382d65fd2b6d9c22577231b954ed27400efeafbe687bda75abcc0b" dependencies = [ - "bytes 1.0.1", + "bytes 0.5.6", "memchr", -] - -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", + "pin-project-lite", ] [[package]] @@ -771,10 +820,58 @@ version = "0.63.0" source = "git+https://gitlab.com/veloren/conrod.git?branch=copypasta_0.7#1ae5193588fb662a7189d81edd9f2d653c7f1da0" [[package]] -name = "const_fn" -version = "0.4.5" +name = "const-random" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" +checksum = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" +dependencies = [ + "getrandom 0.1.15", + "proc-macro-hack", +] + +[[package]] +name = "const-tweaker" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297be2ecc39b6e680c7bb03d8d053a483c32a61d95bd758fca76e9b95ce7e276" +dependencies = [ + "async-std", + "const-tweaker-attribute", + "ctor", + "dashmap", + "horrorshow", + "lazy_static", + "serde", + "tide", +] + +[[package]] +name = "const-tweaker-attribute" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d709e38f0f6100c0c8c0b3aefb0aa1f83af865d7b6b267e8402820513a0c0d8" +dependencies = [ + "darling", + "proc-macro2 1.0.24", + "quote 1.0.7", + "syn 1.0.54", +] + +[[package]] +name = "const_fn" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" [[package]] name = "constant_time_eq" @@ -784,29 +881,12 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cookie" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784ad0fbab4f3e9cef09f20e0aea6000ae08d2cb98ac4c0abc53df18803d702f" -dependencies = [ - "percent-encoding", - "time 0.2.25", - "version_check 0.9.2", -] - -[[package]] -name = "cookie_store" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3" +checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" dependencies = [ - "cookie", - "idna", - "log", - "publicsuffix", - "serde", - "serde_json", - "time 0.2.25", - "url", + "time", + "url 1.7.2", ] [[package]] @@ -828,7 +908,7 @@ dependencies = [ "objc", "objc-foundation", "objc_id", - "smithay-clipboard", + "smithay-clipboard 0.6.1", "x11-clipboard", ] @@ -839,7 +919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" dependencies = [ "core-foundation-sys 0.6.2", - "libc", + "libc 0.2.77", ] [[package]] @@ -849,7 +929,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ "core-foundation-sys 0.7.0", - "libc", + "libc 0.2.77", ] [[package]] @@ -858,8 +938,8 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ - "core-foundation-sys 0.8.2", - "libc", + "core-foundation-sys 0.8.1", + "libc 0.2.77", ] [[package]] @@ -876,9 +956,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "c0af3b5e4601de3837c9332e29e0aae47a0d46ebfa246d12b82f564bac233393" [[package]] name = "core-graphics" @@ -889,20 +969,20 @@ dependencies = [ "bitflags", "core-foundation 0.7.0", "foreign-types", - "libc", + "libc 0.2.77", ] [[package]] name = "core-graphics" -version = "0.22.2" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" +checksum = "fc239bba52bab96649441699533a68de294a101533b0270b2d65aa402b29a7f9" dependencies = [ "bitflags", "core-foundation 0.9.1", "core-graphics-types", "foreign-types", - "libc", + "libc 0.2.77", ] [[package]] @@ -914,7 +994,7 @@ dependencies = [ "bitflags", "core-foundation 0.9.1", "foreign-types", - "libc", + "libc 0.2.77", ] [[package]] @@ -926,7 +1006,7 @@ dependencies = [ "cfg-if 0.1.10", "core-foundation-sys 0.7.0", "core-graphics 0.19.2", - "libc", + "libc 0.2.77", "objc", ] @@ -951,9 +1031,9 @@ dependencies = [ [[package]] name = "cpal" -version = "0.13.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05631e2089dfa5d3b6ea1cfbbfd092e2ee5deeb69698911bc976b28b746d3657" +checksum = "4919d30839e3924b45b84319997a554db1a56918bc5b2a08a6c29886e65e2dca" dependencies = [ "alsa", "core-foundation-sys 0.6.2", @@ -961,13 +1041,13 @@ dependencies = [ "jni 0.17.0", "js-sys", "lazy_static", - "libc", + "libc 0.2.77", "mach 0.3.2", "ndk", "ndk-glue", "nix 0.15.0", "oboe", - "parking_lot 0.11.1", + "parking_lot 0.9.0", "stdweb 0.1.3", "thiserror", "web-sys", @@ -994,10 +1074,10 @@ dependencies = [ "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli 0.22.0", + "gimli", "log", "regalloc", - "smallvec", + "smallvec 1.5.1", "target-lexicon", "thiserror", ] @@ -1035,34 +1115,33 @@ checksum = "b608bb7656c554d0a4cf8f50c7a10b857e80306f6ff829ad6d468a7e2323c8d8" dependencies = [ "cranelift-codegen", "log", - "smallvec", + "smallvec 1.5.1", "target-lexicon", ] [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", ] [[package]] name = "criterion" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23" +checksum = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" dependencies = [ "atty", "cast", "clap", "criterion-plot", "csv", - "futures", - "itertools 0.10.0", + "itertools 0.9.0", "lazy_static", - "num-traits", + "num-traits 0.2.14", "oorandom", "plotters", "rayon", @@ -1072,7 +1151,6 @@ dependencies = [ "serde_derive", "serde_json", "tinytemplate", - "tokio 1.2.0", "walkdir 2.3.1", ] @@ -1093,13 +1171,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd01a6eb3daaafa260f6fc94c3a6c36390abc2080e38e3e34ced87393fb77d80" dependencies = [ "cfg-if 1.0.0", - "crossbeam-channel", + "crossbeam-channel 0.5.0", "crossbeam-deque 0.8.0", - "crossbeam-epoch 0.9.1", - "crossbeam-queue", + "crossbeam-epoch 0.9.0", + "crossbeam-queue 0.3.1", "crossbeam-utils 0.8.1", ] +[[package]] +name = "crossbeam-channel" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" +dependencies = [ + "crossbeam-utils 0.6.6", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + [[package]] name = "crossbeam-channel" version = "0.5.0" @@ -1128,7 +1225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", + "crossbeam-epoch 0.9.0", "crossbeam-utils 0.8.1", ] @@ -1138,7 +1235,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg", + "autocfg 1.0.1", "cfg-if 0.1.10", "crossbeam-utils 0.7.2", "lazy_static", @@ -1149,18 +1246,29 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" +checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" dependencies = [ "cfg-if 1.0.0", "const_fn", "crossbeam-utils 0.8.1", "lazy_static", - "memoffset 0.6.1", + "memoffset 0.5.6", "scopeguard", ] +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + [[package]] name = "crossbeam-queue" version = "0.3.1" @@ -1171,13 +1279,23 @@ dependencies = [ "crossbeam-utils 0.8.1", ] +[[package]] +name = "crossbeam-utils" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" +dependencies = [ + "cfg-if 0.1.10", + "lazy_static", +] + [[package]] name = "crossbeam-utils" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg", + "autocfg 1.0.1", "cfg-if 0.1.10", "lazy_static", ] @@ -1188,7 +1306,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" dependencies = [ - "autocfg", + "autocfg 1.0.1", "cfg-if 1.0.0", "lazy_static", ] @@ -1202,10 +1320,10 @@ dependencies = [ "bitflags", "crossterm_winapi", "lazy_static", - "libc", - "mio 0.7.7", + "libc 0.2.77", + "mio 0.7.0", "parking_lot 0.10.2", - "signal-hook 0.1.17", + "signal-hook 0.1.16", "winapi 0.3.9", ] @@ -1218,10 +1336,10 @@ dependencies = [ "bitflags", "crossterm_winapi", "lazy_static", - "libc", - "mio 0.7.7", - "parking_lot 0.11.1", - "signal-hook 0.1.17", + "libc 0.2.77", + "mio 0.7.0", + "parking_lot 0.11.0", + "signal-hook 0.1.16", "winapi 0.3.9", ] @@ -1236,9 +1354,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.1.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d58633299b24b515ac72a3f869f8b91306a3cec616a602843a383acd6f9e97" +checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" dependencies = [ "bstr", "csv-core", @@ -1256,6 +1374,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "ctor" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484" +dependencies = [ + "quote 1.0.7", + "syn 1.0.54", +] + [[package]] name = "daggy" version = "0.5.0" @@ -1284,9 +1412,9 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "strsim 0.9.3", - "syn 1.0.60", + "syn 1.0.54", ] [[package]] @@ -1296,10 +1424,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ "darling_core", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] +[[package]] +name = "dashmap" +version = "3.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f260e2fc850179ef410018660006951c1b55b79e8087e87111a2c388994b9b5" +dependencies = [ + "ahash 0.3.8", + "cfg-if 0.1.10", + "num_cpus", +] + +[[package]] +name = "data-encoding" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" + [[package]] name = "deflate" version = "0.8.6" @@ -1312,13 +1457,13 @@ dependencies = [ [[package]] name = "derivative" -version = "2.2.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -1345,8 +1490,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -1369,6 +1514,16 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys", +] + [[package]] name = "dirs" version = "3.0.1" @@ -1378,35 +1533,25 @@ dependencies = [ "dirs-sys", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - [[package]] name = "dirs-sys" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ - "libc", - "redox_users 0.3.5", + "libc 0.2.77", + "redox_users", "winapi 0.3.9", ] [[package]] name = "dirs-sys-next" -version = "0.1.2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "9c60f7b8a8953926148223260454befb50c751d3c50e1c178c4fd1ace4083c9a" dependencies = [ - "libc", - "redox_users 0.4.0", + "libc 0.2.77", + "redox_users", "winapi 0.3.9", ] @@ -1434,7 +1579,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" dependencies = [ - "libloading 0.6.7", + "libloading 0.6.3", ] [[package]] @@ -1470,6 +1615,12 @@ dependencies = [ "bitflags", ] +[[package]] +name = "dtoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d7ed2934d741c6b37e33e3832298e8850b53fd2d2bea03873375596c7cea4e" + [[package]] name = "either" version = "1.6.1" @@ -1478,9 +1629,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.28" +version = "0.8.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" +checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" dependencies = [ "cfg-if 1.0.0", ] @@ -1501,29 +1652,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "enumset" -version = "1.0.4" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf6167d1be7a76696cadccfbdb89e5cb519244a42bab7da5577994579217dcff" +checksum = "959a80a2062fedd66ed41d99736212de987b3a8c83a4c2cef243968075256bd1" dependencies = [ "enumset_derive", + "num-traits 0.2.14", + "errno-dragonfly", + "libc 0.2.77", + "winapi 0.3.9", ] [[package]] name = "enumset_derive" -version = "0.5.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8a79bce471eb6165aa8ac86ebc8d788543b741eaa15e8b8486591696207d6c" +checksum = "74bef436ac71820c5cf768d7af9ba33121246b09a00e09a55d94ef8095a875ac" dependencies = [ "darling", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", + "gcc", + "libc 0.2.77", ] [[package]] @@ -1542,17 +1699,16 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b49c94f66f2d2c5ee8685039e458b4e6c9f13af7c28736baf10ce42966a5ab52" dependencies = [ - "libc", + "libc 0.2.77", "str-buf", ] [[package]] name = "euc" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed019c07d54f49d3efd699f68c47ced2958b9917fca7c48092c489792732faa5" +version = "0.5.1" +source = "git+https://github.com/zesterer/euc.git#c9a7c17a03d45fce00caeeca09afa1e1558cd183" dependencies = [ - "vek 0.10.4", + "vek 0.11.2", ] [[package]] @@ -1561,15 +1717,9 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5337024b8293bdce5265dc9570ef6e608a34bfacbbc87fe1a5dcb5f1dac2f4e2" dependencies = [ - "num-traits", + "num-traits 0.2.14", ] -[[package]] -name = "event-listener" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" - [[package]] name = "fallible-iterator" version = "0.2.0" @@ -1592,15 +1742,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb5acb1045ebbfa222e2c50679e392a71dd77030b78fb0189f2d9c5974400f9" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "fetch_unroll" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d44807d562d137f063cbfe209da1c3f9f2fa8375e11166ef495daab7b847f9" +checksum = "b5c55005e95bbe15f5f72a73b6597d0dc82ddc97ffe2ca097a99dcd591fefbca" dependencies = [ "libflate", "tar", @@ -1609,13 +1759,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.14" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" +checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall 0.2.5", + "cfg-if 0.1.10", + "libc 0.2.77", + "redox_syscall", "winapi 0.3.9", ] @@ -1631,18 +1781,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" -[[package]] -name = "flate2" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" -dependencies = [ - "cfg-if 1.0.0", - "crc32fast", - "libc", - "miniz_oxide 0.4.3", -] - [[package]] name = "fnv" version = "1.0.7" @@ -1664,16 +1802,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" -[[package]] -name = "form_urlencoded" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" -dependencies = [ - "matches", - "percent-encoding", -] - [[package]] name = "fsevent" version = "0.4.0" @@ -1700,7 +1828,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -1709,9 +1837,15 @@ version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a29c77f1ca394c3e73a9a5d24cfcabb734682d9634fc398f2204a63c994120" dependencies = [ - "libc", + "libc 0.2.77", ] +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -1730,15 +1864,21 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "funty" -version = "1.2.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" +checksum = "0ba62103ce691c2fd80fbae2213dfdda9ce60804973ac6b6e97de818ea7f52c8" [[package]] name = "futures" -version = "0.3.12" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" +checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" + +[[package]] +name = "futures" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" dependencies = [ "futures-channel", "futures-core", @@ -1751,9 +1891,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.12" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" +checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" dependencies = [ "futures-core", "futures-sink", @@ -1761,15 +1901,25 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.12" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" +checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +dependencies = [ + "futures 0.1.29", + "num_cpus", +] [[package]] name = "futures-executor" -version = "0.3.12" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" +checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" dependencies = [ "futures-core", "futures-task", @@ -1779,43 +1929,56 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.12" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" +checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" [[package]] name = "futures-macro" -version = "0.3.12" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" +checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" dependencies = [ "proc-macro-hack", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "futures-sink" -version = "0.3.12" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" +checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" [[package]] name = "futures-task" -version = "0.3.12" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" +checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" dependencies = [ "once_cell", ] [[package]] -name = "futures-util" -version = "0.3.12" +name = "futures-timer" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" +checksum = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" + +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + +[[package]] +name = "futures-util" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" dependencies = [ + "futures 0.1.29", "futures-channel", "futures-core", "futures-io", @@ -1823,11 +1986,12 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.4", + "pin-project 1.0.2", "pin-utils", "proc-macro-hack", "proc-macro-nested", "slab", + "tokio-io", ] [[package]] @@ -1867,36 +2031,26 @@ dependencies = [ "version_check 0.9.2", ] -[[package]] -name = "gethostname" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028" -dependencies = [ - "libc", - "winapi 0.3.9", -] - [[package]] name = "getrandom" -version = "0.1.16" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ - "cfg-if 1.0.0", - "libc", + "cfg-if 0.1.10", + "libc 0.2.77", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.2.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "cfg-if 0.1.10", + "libc 0.2.77", + "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] @@ -1943,9 +2097,9 @@ dependencies = [ [[package]] name = "gilrs" -version = "0.8.0" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b64ac678e1174eb012be1cfd409ff2483f23cb79bc880ce4737147245b0fbff" +checksum = "122bb249f904e5f4ac73fc514b9b2ce6cce3af511f5df00ffc8000e47de6b290" dependencies = [ "fnv", "gilrs-core", @@ -1958,18 +2112,17 @@ dependencies = [ [[package]] name = "gilrs-core" -version = "0.3.0" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1024d4046c5c67d2adb8c90f6ed235163b58e05d35a63bf699b53f0cceeba2c6" +checksum = "43c758daf46af26d6872fe55507e3b2339779a160a06ad7a9b2a082f221209cd" dependencies = [ "core-foundation 0.6.4", "io-kit-sys", - "libc", + "libc 0.2.77", "libudev-sys", "log", - "nix 0.18.0", + "nix 0.15.0", "rusty-xinput", - "serde", "stdweb 0.4.20", "uuid", "vec_map", @@ -1987,25 +2140,19 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "gimli" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" - [[package]] name = "git2" -version = "0.13.17" +version = "0.13.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d250f5f82326884bd39c2853577e70a121775db76818ffa452ed1e80de12986" +checksum = "1e094214efbc7fdbbdee952147e493b00e99a4e52817492277e98967ae918165" dependencies = [ "bitflags", - "libc", + "libc 0.2.77", "libgit2-sys", "log", "openssl-probe", "openssl-sys", - "url", + "url 2.1.1", ] [[package]] @@ -2060,12 +2207,12 @@ dependencies = [ "glutin_glx_sys", "glutin_wgl_sys", "lazy_static", - "libloading 0.6.7", + "libloading 0.6.3", "log", "objc", "osmesa-sys", - "parking_lot 0.11.1", - "wayland-client 0.28.3", + "parking_lot 0.11.0", + "wayland-client 0.28.1", "wayland-egl", "winapi 0.3.9", "winit", @@ -2118,26 +2265,26 @@ dependencies = [ [[package]] name = "glyph_brush" -version = "0.7.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3f00b8574a76fb6c50890c48da03946ca50e4372a2778737922666a2238221" +checksum = "afd3e2cfd503a5218dd56172a8bf7c8655a4a7cf745737c606a6edfeea1b343f" dependencies = [ "glyph_brush_draw_cache", "glyph_brush_layout", "log", - "ordered-float 2.1.1", + "ordered-float 1.1.0", "rustc-hash", "twox-hash", ] [[package]] name = "glyph_brush_draw_cache" -version = "0.1.4" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2c82074cafb68b9e459c50c655f7eedcb92d6ee7166813802934bc6fc29fa3" +checksum = "8cef969a091be5565c2c10b31fd2f115cbeed9f783a27c96ae240ff8ceee067c" dependencies = [ "ab_glyph", - "crossbeam-channel", + "crossbeam-channel 0.5.0", "crossbeam-deque 0.8.0", "linked-hash-map", "rayon", @@ -2165,6 +2312,24 @@ dependencies = [ "svg_fmt", ] +[[package]] +name = "h2" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +dependencies = [ + "byteorder", + "bytes 0.4.12", + "fnv", + "futures 0.1.29", + "http 0.1.21", + "indexmap", + "log", + "slab", + "string", + "tokio-io", +] + [[package]] name = "h2" version = "0.2.7" @@ -2176,10 +2341,10 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.2", "indexmap", "slab", - "tokio 0.2.25", + "tokio 0.2.24", "tokio-util", "tracing", "tracing-futures", @@ -2187,9 +2352,9 @@ dependencies = [ [[package]] name = "half" -version = "1.7.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" +checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" [[package]] name = "hash32" @@ -2207,7 +2372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf" dependencies = [ "ahash 0.3.8", - "autocfg", + "autocfg 1.0.1", ] [[package]] @@ -2235,20 +2400,20 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.18" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" +checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -2267,6 +2432,12 @@ dependencies = [ "rayon", ] +[[package]] +name = "horrorshow" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ce7e0a1bc8e4489896abc94e5664e811a502a151bebfe113b3214fa181d3fb" + [[package]] name = "hound" version = "3.4.0" @@ -2275,15 +2446,38 @@ checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" [[package]] name = "http" -version = "0.2.3" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" +checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" dependencies = [ - "bytes 1.0.1", + "bytes 0.4.12", "fnv", "itoa", ] +[[package]] +name = "http" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +dependencies = [ + "bytes 0.5.6", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "http 0.1.21", + "tokio-buf", +] + [[package]] name = "http-body" version = "0.3.1" @@ -2291,24 +2485,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http", + "http 0.2.2", ] [[package]] -name = "http-body" +name = "http-service" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" +checksum = "9625f605ddfaf894bf78a544a7b8e31f562dc843654723a49892d9c7e75ac708" dependencies = [ - "bytes 1.0.1", - "http", + "async-std", + "bytes 0.4.12", + "futures 0.3.5", + "http 0.1.21", + "pin-project-lite", +] + +[[package]] +name = "http-service-hyper" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d5dae94e0fdb82f9524ea2f2b98458b3d8448526d8cc8beccb3d3fded8aff" +dependencies = [ + "futures 0.3.5", + "http 0.1.21", + "http-service", + "hyper 0.12.35", ] [[package]] name = "httparse" -version = "1.3.5" +version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" +checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" [[package]] name = "httpdate" @@ -2318,49 +2527,56 @@ checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] name = "hyper" -version = "0.13.10" +version = "0.12.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" +checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "futures-cpupool", + "h2 0.1.26", + "http 0.1.21", + "http-body 0.1.0", + "httparse", + "iovec", + "itoa", + "log", + "net2", + "rustc_version", + "time", + "tokio 0.1.22", + "tokio-buf", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-tcp", + "tokio-threadpool", + "tokio-timer", + "want 0.2.0", +] + +[[package]] +name = "hyper" +version = "0.13.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" dependencies = [ "bytes 0.5.6", "futures-channel", "futures-core", "futures-util", - "h2", - "http", + "h2 0.2.7", + "http 0.2.2", "http-body 0.3.1", "httparse", "httpdate", "itoa", - "pin-project 1.0.5", + "pin-project 1.0.2", "socket2", - "tokio 0.2.25", + "tokio 0.2.24", "tower-service", "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e946c2b1349055e0b72ae281b238baf1a3ea7307c7e9f9d64673bdd9c26ac7" -dependencies = [ - "bytes 1.0.1", - "futures-channel", - "futures-core", - "futures-util", - "http", - "http-body 0.4.0", - "httparse", - "httpdate", - "itoa", - "pin-project 1.0.5", - "socket2", - "tokio 1.2.0", - "tower-service", - "tracing", - "want", + "want 0.3.0", ] [[package]] @@ -2371,10 +2587,10 @@ checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6" dependencies = [ "bytes 0.5.6", "futures-util", - "hyper 0.13.10", + "hyper 0.13.9", "log", "rustls 0.18.1", - "tokio 0.2.25", + "tokio 0.2.24", "tokio-rustls", "webpki", ] @@ -2389,7 +2605,7 @@ name = "iced_futures" version = "0.2.0" source = "git+https://github.com/hecrj/iced?rev=8d882d787e6b7fd7c2435f42f82933e2ed904edf#8d882d787e6b7fd7c2435f42f82933e2ed904edf" dependencies = [ - "futures", + "futures 0.3.5", "log", "wasm-bindgen-futures", ] @@ -2414,7 +2630,7 @@ source = "git+https://github.com/hecrj/iced?rev=8d882d787e6b7fd7c2435f42f82933e2 dependencies = [ "iced_core", "iced_futures", - "num-traits", + "num-traits 0.2.14", "twox-hash", "unicode-segmentation", ] @@ -2450,9 +2666,20 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.2.1" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de910d521f7cc3135c4de8db1cb910e0b5ed1dc6f57c381cd07e8e661ce10094" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "idna" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" dependencies = [ "matches", "unicode-bidi", @@ -2461,26 +2688,26 @@ dependencies = [ [[package]] name = "image" -version = "0.23.13" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "293f07a1875fa7e9c5897b51aa68b2d8ed8271b87e1a44cb64b9c3d98aabbc0d" +checksum = "7ce04077ead78e39ae8610ad26216aed811996b043d47beed5090db674f9e9b5" dependencies = [ "bytemuck", "byteorder", "color_quant", "num-iter", "num-rational 0.3.2", - "num-traits", + "num-traits 0.2.14", "png", ] [[package]] name = "indexmap" -version = "1.6.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" +checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" dependencies = [ - "autocfg", + "autocfg 1.0.1", "hashbrown 0.9.1", "serde", ] @@ -2502,36 +2729,36 @@ checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" dependencies = [ "bitflags", "inotify-sys", - "libc", + "libc 0.2.77", ] [[package]] name = "inotify" -version = "0.9.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19f57db1baad9d09e43a3cd76dcf82ebdafd37d75c9498b87762dba77c93f15" +checksum = "46dd0a94b393c730779ccfd2a872b67b1eb67be3fc33082e733bdb38b5fde4d4" dependencies = [ "bitflags", "inotify-sys", - "libc", + "libc 0.2.77", ] [[package]] name = "inotify-sys" -version = "0.1.5" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" +checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] name = "instant" -version = "0.1.9" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", ] [[package]] @@ -2550,7 +2777,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -2579,9 +2806,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" [[package]] name = "jni" @@ -2604,7 +2831,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36bcc950632e48b86da402c5c077590583da5ac0d480103611d5374e7c967a3c" dependencies = [ "cesu8", - "combine 4.5.2", + "combine 4.3.2", "error-chain", "jni-sys", "log", @@ -2623,14 +2850,14 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] name = "js-sys" -version = "0.3.47" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65" +checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" dependencies = [ "wasm-bindgen", ] @@ -2651,6 +2878,15 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" +[[package]] +name = "kv-log-macro" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" +dependencies = [ + "log", +] + [[package]] name = "lazy-bytes-cast" version = "5.0.1" @@ -2677,9 +2913,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "lewton" -version = "0.10.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" +checksum = "be42bea7971f4ba0ea1e215730c29bc1ff9bd2a9c10013912f42a8dcf8d77c0d" dependencies = [ "byteorder", "ogg", @@ -2688,36 +2924,36 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.86" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" +checksum = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" + +[[package]] +name = "libc" +version = "0.2.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" [[package]] name = "libflate" -version = "1.0.3" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389de7875e06476365974da3e7ff85d55f1972188ccd9f6020dd7c8156e17914" +checksum = "d9135df43b1f5d0e333385cb6e7897ecd1a43d7d11b91ac003f4d2c2d2401fdd" dependencies = [ "adler32", "crc32fast", - "libflate_lz77", "rle-decode-fast", + "take_mut", ] -[[package]] -name = "libflate_lz77" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3286f09f7d4926fc486334f28d8d2e6ebe4f7f9994494b6dab27ddfad2c9b11b" - [[package]] name = "libgit2-sys" -version = "0.12.18+1.1.0" +version = "0.12.13+1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3da6a42da88fc37ee1ecda212ffa254c25713532980005d5f7c0b0fbe7e6e885" +checksum = "069eea34f76ec15f2822ccf78fe0cdb8c9016764d0a12865278585a74dbdeae5" dependencies = [ "cc", - "libc", + "libc 0.2.77", "libssh2-sys", "libz-sys", "openssl-sys", @@ -2736,11 +2972,11 @@ dependencies = [ [[package]] name = "libloading" -version = "0.6.7" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" +checksum = "2443d8f0478b16759158b2f66d525991a05491138bc05814ef52a250148ef4f9" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "winapi 0.3.9", ] @@ -2763,12 +2999,12 @@ dependencies = [ [[package]] name = "libssh2-sys" -version = "0.2.21" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0186af0d8f171ae6b9c4c90ec51898bad5d08a2d5e470903a50d9ad8959cbee" +checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" dependencies = [ "cc", - "libc", + "libc 0.2.77", "libz-sys", "openssl-sys", "pkg-config", @@ -2781,7 +3017,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" dependencies = [ - "libc", + "libc 0.2.77", "pkg-config", ] @@ -2792,16 +3028,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ "cc", - "libc", + "libc 0.2.77", "pkg-config", "vcpkg", ] [[package]] -name = "linked-hash-map" -version = "0.5.4" +name = "line_drawing" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" +checksum = "f81902e542483002b103c6424d23e765c2e5a65f732923299053a601bce50ab2" +dependencies = [ + "num-traits 0.1.43", +] + +[[package]] +name = "linked-hash-map" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" [[package]] name = "lock_api" @@ -2814,20 +3059,20 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.2" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" +checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", ] [[package]] @@ -2849,7 +3094,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -2858,7 +3103,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -2867,7 +3112,7 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -2893,24 +3138,25 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.4" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" [[package]] -name = "memmap2" -version = "0.1.0" +name = "memmap" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" dependencies = [ - "libc", + "libc 0.2.77", + "winapi 0.3.9", ] [[package]] name = "memmap2" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" +checksum = "e73be3b7d04a0123e933fea1d50d126cc7196bbc0362c0ce426694f777194eee" dependencies = [ "libc", ] @@ -2921,7 +3167,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg", + "autocfg 1.0.1", ] [[package]] @@ -2930,7 +3176,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" dependencies = [ - "autocfg", + "autocfg 1.0.1", ] [[package]] @@ -2950,8 +3196,8 @@ checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c" dependencies = [ "migrations_internals", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -3000,28 +3246,28 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" +checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9" dependencies = [ "adler", - "autocfg", + "autocfg 1.0.1", ] [[package]] name = "mio" -version = "0.6.23" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", "kernel32-sys", - "libc", + "libc 0.2.77", "log", - "miow 0.2.2", + "miow 0.2.1", "net2", "slab", "winapi 0.2.8", @@ -3029,13 +3275,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.7" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" +checksum = "6e9971bc8349a361217a8f2a41f5d011274686bd4436465ba51730921039d7fb" dependencies = [ - "libc", + "lazy_static", + "libc 0.2.77", "log", - "miow 0.3.6", + "miow 0.3.5", "ntapi", "winapi 0.3.9", ] @@ -3048,15 +3295,26 @@ checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", "log", - "mio 0.6.23", + "mio 0.6.22", "slab", ] [[package]] -name = "miow" -version = "0.2.2" +name = "mio-uds" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" +checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" +dependencies = [ + "iovec", + "libc 0.2.77", + "mio 0.6.22", +] + +[[package]] +name = "miow" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" dependencies = [ "kernel32-sys", "net2", @@ -3066,9 +3324,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.6" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" +checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" dependencies = [ "socket2", "winapi 0.3.9", @@ -3088,17 +3346,16 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" [[package]] name = "native-dialog" -version = "0.5.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b797805fe732ea368a288e73c313952309287b8b775a13530d858b77cfe5c1cd" +checksum = "9f491dab19c26687b897fcb4ecaa984fc87a7dd5a21d69f48eab41e254116981" dependencies = [ "cocoa 0.24.0", - "dirs", + "dirs 3.0.1", "objc", "objc-foundation", "objc_id", "once_cell", - "raw-window-handle", "thiserror", "wfd", "which", @@ -3107,9 +3364,9 @@ dependencies = [ [[package]] name = "ndk" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eb167c1febed0a496639034d0c76b3b74263636045db5489eee52143c246e73" +checksum = "94dc511dd67c2cf232264be20fb98ad0ea93666727d3f6f75429d53e696d6366" dependencies = [ "jni-sys", "ndk-sys", @@ -3119,12 +3376,12 @@ dependencies = [ [[package]] name = "ndk-glue" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" +checksum = "0b6c938c36cd15ea13d0972fdceb3a03982d49967e5fd7508cf129c5300b66cc" dependencies = [ "lazy_static", - "libc", + "libc 0.2.77", "log", "ndk", "ndk-macro", @@ -3140,24 +3397,24 @@ dependencies = [ "darling", "proc-macro-crate", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "ndk-sys" -version = "0.2.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" +checksum = "de01535c8fca086732bb66c9bc7779d336c44088d42782cd11d5f2a7ace52f7e" [[package]] name = "net2" -version = "0.2.37" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ "cfg-if 0.1.10", - "libc", + "libc 0.2.77", "winapi 0.3.9", ] @@ -3170,7 +3427,7 @@ dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", - "libc", + "libc 0.2.77", "void", ] @@ -3183,7 +3440,7 @@ dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", - "libc", + "libc 0.2.77", "void", ] @@ -3196,19 +3453,7 @@ dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", - "libc", -] - -[[package]] -name = "nix" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", + "libc 0.2.77", ] [[package]] @@ -3218,7 +3463,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82051dd6745d5184c6efb7bc8be14892a7f6d4f3ad6dbf754d1c7d7d5fe24b43" dependencies = [ "rand 0.7.3", - "rand_xorshift", + "rand_xorshift 0.2.0", ] [[package]] @@ -3241,16 +3486,6 @@ dependencies = [ "version_check 0.9.2", ] -[[package]] -name = "nom" -version = "6.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" -dependencies = [ - "memchr", - "version_check 0.9.2", -] - [[package]] name = "notify" version = "4.0.15" @@ -3262,8 +3497,8 @@ dependencies = [ "fsevent 0.4.0", "fsevent-sys 2.0.1", "inotify 0.7.1", - "libc", - "mio 0.6.23", + "libc 0.2.77", + "mio 0.6.22", "mio-extras", "walkdir 2.3.1", "winapi 0.3.9", @@ -3271,32 +3506,47 @@ dependencies = [ [[package]] name = "notify" -version = "5.0.0-pre.5" +version = "5.0.0-pre.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e54552360d7b89a698eca6de3927205a8e03e8080dc13d779de5c7876e098b" +checksum = "77d03607cf88b4b160ba0e9ed425fff3cee3b55ac813f0c685b3a3772da37d0e" dependencies = [ "anymap", "bitflags", - "crossbeam-channel", + "crossbeam-channel 0.4.4", "filetime", "fsevent 2.0.2", "fsevent-sys 3.0.2", - "inotify 0.9.2", - "libc", - "mio 0.7.7", + "inotify 0.8.3", + "libc 0.2.77", + "mio 0.6.22", + "mio-extras", "walkdir 2.3.1", "winapi 0.3.9", ] [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2" dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "num" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" +dependencies = [ + "num-bigint 0.1.44", + "num-complex 0.1.43", + "num-integer", + "num-iter", + "num-rational 0.1.42", + "num-traits 0.2.14", +] + [[package]] name = "num" version = "0.2.1" @@ -3308,7 +3558,7 @@ dependencies = [ "num-integer", "num-iter", "num-rational 0.2.4", - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -3322,7 +3572,19 @@ dependencies = [ "num-integer", "num-iter", "num-rational 0.3.2", - "num-traits", + "num-traits 0.2.14", +] + +[[package]] +name = "num-bigint" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" +dependencies = [ + "num-integer", + "num-traits 0.2.14", + "rand 0.4.6", + "rustc-serialize", ] [[package]] @@ -3331,9 +3593,9 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg", + "autocfg 1.0.1", "num-integer", - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -3342,9 +3604,19 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e9a41747ae4633fce5adffb4d2e81ffc5e89593cb19917f8fb2cc5ff76507bf" dependencies = [ - "autocfg", + "autocfg 1.0.1", "num-integer", - "num-traits", + "num-traits 0.2.14", +] + +[[package]] +name = "num-complex" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" +dependencies = [ + "num-traits 0.2.14", + "rustc-serialize", ] [[package]] @@ -3353,8 +3625,8 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ - "autocfg", - "num-traits", + "autocfg 1.0.1", + "num-traits 0.2.14", ] [[package]] @@ -3363,18 +3635,18 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" dependencies = [ - "num-traits", + "num-traits 0.2.14", ] [[package]] name = "num-derive" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "6f09b9841adb6b5e1f89ef7087ea636e0fd94b2851f887c1e3eb5d5f8228fab3" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -3383,8 +3655,8 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg", - "num-traits", + "autocfg 1.0.1", + "num-traits 0.2.14", ] [[package]] @@ -3393,9 +3665,21 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ - "autocfg", + "autocfg 1.0.1", "num-integer", - "num-traits", + "num-traits 0.2.14", +] + +[[package]] +name = "num-rational" +version = "0.1.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" +dependencies = [ + "num-bigint 0.1.44", + "num-integer", + "num-traits 0.2.14", + "rustc-serialize", ] [[package]] @@ -3404,10 +3688,10 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ - "autocfg", + "autocfg 1.0.1", "num-bigint 0.2.6", "num-integer", - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -3416,10 +3700,19 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ - "autocfg", + "autocfg 1.0.1", "num-bigint 0.3.1", "num-integer", - "num-traits", + "num-traits 0.2.14", +] + +[[package]] +name = "num-traits" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +dependencies = [ + "num-traits 0.2.14", ] [[package]] @@ -3428,7 +3721,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg", + "autocfg 1.0.1", ] [[package]] @@ -3438,7 +3731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" dependencies = [ "hermit-abi", - "libc", + "libc 0.2.77", ] [[package]] @@ -3459,8 +3752,8 @@ checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -3492,6 +3785,12 @@ dependencies = [ "objc", ] +[[package]] +name = "object" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" + [[package]] name = "object" version = "0.22.0" @@ -3502,23 +3801,17 @@ dependencies = [ "indexmap", ] -[[package]] -name = "object" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" - [[package]] name = "oboe" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aadc2b0867bdbb9a81c4d99b9b682958f49dbea1295a81d2f646cca2afdd9fc" +checksum = "d6a13c9fe73346ff3cee5530b8dd9da1ce3e13cb663be210af3938a2a1dd3eab" dependencies = [ "jni 0.14.0", "ndk", "ndk-glue", "num-derive", - "num-traits", + "num-traits 0.2.14", "oboe-sys", ] @@ -3533,9 +3826,9 @@ dependencies = [ [[package]] name = "ogg" -version = "0.8.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" +checksum = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" dependencies = [ "byteorder", ] @@ -3553,15 +3846,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.5.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" +checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" [[package]] name = "oorandom" -version = "11.1.3" +version = "11.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" +checksum = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" [[package]] name = "openssl-probe" @@ -3571,46 +3864,43 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" -version = "0.9.60" +version = "0.9.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6" +checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" dependencies = [ - "autocfg", + "autocfg 1.0.1", "cc", - "libc", + "libc 0.2.77", "pkg-config", "vcpkg", ] [[package]] name = "orbclient" -version = "0.3.30" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee68c3c79e81d82127e0870f94479675774d34c7ad5b55eecb9c320ef9701187" +checksum = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" dependencies = [ - "libc", - "raw-window-handle", - "redox_syscall 0.2.5", + "redox_syscall", "sdl2", - "sdl2-sys", ] [[package]] name = "ordered-float" -version = "1.1.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" +checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" dependencies = [ - "num-traits", + "num-traits 0.2.14", ] [[package]] name = "ordered-float" -version = "2.1.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "766f840da25490628d8e63e529cd21c014f6600c6b8517add12a6fa6167a6218" +checksum = "dacdec97876ef3ede8c50efc429220641a0b11ba0048b4b0c357bccbc47c5204" dependencies = [ - "num-traits", + "num-traits 0.2.14", ] [[package]] @@ -3633,11 +3923,11 @@ dependencies = [ [[package]] name = "owned_ttf_parser" -version = "0.11.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "948b27637ba56144c62d3415929ef18986b3a383137ebcbe97d9362a968bf997" +checksum = "fb477c7fd2a3a6e04e1dc6ca2e4e9b04f2df702021dc5a5d1cf078c587dc59f7" dependencies = [ - "ttf-parser 0.11.0", + "ttf-parser 0.8.2", ] [[package]] @@ -3650,6 +3940,27 @@ dependencies = [ "libm", ] +[[package]] +name = "page_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" +dependencies = [ + "libc 0.2.77", + "winapi 0.3.9", +] + +[[package]] +name = "parking_lot" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" +dependencies = [ + "lock_api 0.3.4", + "parking_lot_core 0.6.2", + "rustc_version", +] + [[package]] name = "parking_lot" version = "0.10.2" @@ -3662,13 +3973,28 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" dependencies = [ "instant", - "lock_api 0.4.2", - "parking_lot_core 0.8.3", + "lock_api 0.4.1", + "parking_lot_core 0.8.0", +] + +[[package]] +name = "parking_lot_core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi 0.0.3", + "libc 0.2.77", + "redox_syscall", + "rustc_version", + "smallvec 0.6.13", + "winapi 0.3.9", ] [[package]] @@ -3678,24 +4004,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ "cfg-if 0.1.10", - "cloudabi", - "libc", - "redox_syscall 0.1.57", - "smallvec", + "cloudabi 0.0.3", + "libc 0.2.77", + "redox_syscall", + "smallvec 1.5.1", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", + "cloudabi 0.1.0", "instant", - "libc", - "redox_syscall 0.2.5", - "smallvec", + "libc 0.2.77", + "redox_syscall", + "smallvec 1.5.1", "winapi 0.3.9", ] @@ -3705,6 +4032,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -3722,55 +4055,49 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.27" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" +checksum = "f48fad7cfbff853437be7cf54d7b993af21f53be7f0988cbfe4a51535aa77205" dependencies = [ - "pin-project-internal 0.4.27", + "pin-project-internal 0.4.24", ] [[package]] name = "pin-project" -version = "1.0.5" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" +checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" dependencies = [ - "pin-project-internal 1.0.5", + "pin-project-internal 1.0.2", ] [[package]] name = "pin-project-internal" -version = "0.4.27" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" +checksum = "24c6d293bdd3ca5a1697997854c6cf7855e43fb6a0ba1c47af57a5bcafd158ae" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "pin-project-internal" -version = "1.0.5" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" +checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "pin-project-lite" -version = "0.1.11" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" - -[[package]] -name = "pin-project-lite" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" +checksum = "4fe74897791e156a0cd8cce0db31b9b2198e67877316bf3086c3acd187f719f0" [[package]] name = "pin-utils" @@ -3807,43 +4134,27 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" [[package]] name = "plotters" -version = "0.3.0" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ca0ae5f169d0917a7c7f5a9c1a3d3d9598f18f529dd2b8373ed988efea307a" +checksum = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" dependencies = [ - "num-traits", - "plotters-backend", - "plotters-svg", + "js-sys", + "num-traits 0.2.14", "wasm-bindgen", "web-sys", ] -[[package]] -name = "plotters-backend" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07fffcddc1cb3a1de753caa4e4df03b79922ba43cf882acc1bdd7e8df9f4590" - -[[package]] -name = "plotters-svg" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b38a02e23bd9604b842a812063aec4ef702b57989c37b655254bb61c471ad211" -dependencies = [ - "plotters-backend", -] - [[package]] name = "png" -version = "0.16.8" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" +checksum = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970" dependencies = [ "bitflags", "crc32fast", @@ -3861,9 +4172,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" [[package]] name = "proc-macro-crate" @@ -3882,8 +4193,8 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", "version_check 0.9.2", ] @@ -3894,7 +4205,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "version_check 0.9.2", ] @@ -3906,9 +4217,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.7" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" +checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" [[package]] name = "proc-macro2" @@ -3937,43 +4248,18 @@ dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", - "parking_lot 0.11.1", + "parking_lot 0.11.0", "regex", "thiserror", ] -[[package]] -name = "prometheus-hyper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc47fa532a12d544229015dd3fae32394949af098b8fe9a327b8c1e4c911d1c8" -dependencies = [ - "hyper 0.14.4", - "prometheus", - "tokio 1.2.0", - "tracing", -] - -[[package]] -name = "publicsuffix" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" -dependencies = [ - "error-chain", - "idna", - "lazy_static", - "regex", - "url", -] - [[package]] name = "qstring" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" dependencies = [ - "percent-encoding", + "percent-encoding 2.1.0", ] [[package]] @@ -3987,18 +4273,73 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ "proc-macro2 1.0.24", ] [[package]] name = "radium" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" +checksum = "e9e006811e1fdd12672b0820a7f44c18dde429f367d50cec003d22aa9b3c8ddc" + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +dependencies = [ + "libc 0.2.77", + "rand 0.4.6", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc 0.2.77", + "rand_core 0.3.1", + "rdrand", + "winapi 0.3.9", +] + +[[package]] +name = "rand" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +dependencies = [ + "cloudabi 0.0.3", + "fuchsia-cprng", + "libc 0.2.77", + "rand_core 0.3.1", + "winapi 0.3.9", +] + +[[package]] +name = "rand" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" +dependencies = [ + "autocfg 0.1.7", + "libc 0.2.77", + "rand_chacha 0.1.1", + "rand_core 0.4.2", + "rand_hc 0.1.0", + "rand_isaac", + "rand_jitter", + "rand_os", + "rand_pcg", + "rand_xorshift 0.1.1", + "winapi 0.3.9", +] [[package]] name = "rand" @@ -4006,8 +4347,8 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.16", - "libc", + "getrandom 0.1.15", + "libc 0.2.77", "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc 0.2.0", @@ -4021,10 +4362,20 @@ checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ "libc", "rand_chacha 0.3.0", - "rand_core 0.6.2", + "rand_core 0.6.1", "rand_hc 0.3.0", ] +[[package]] +name = "rand_chacha" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.3.1", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -4042,25 +4393,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ "ppv-lite86", - "rand_core 0.6.2", + "rand_core 0.6.1", ] +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.16", + "getrandom 0.1.15", ] [[package]] name = "rand_core" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" +checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" dependencies = [ - "getrandom 0.2.2", + "getrandom 0.2.0", +] + +[[package]] +name = "rand_hc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +dependencies = [ + "rand_core 0.3.1", ] [[package]] @@ -4078,7 +4453,60 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ - "rand_core 0.6.2", + "rand_core 0.6.1", +] + +[[package]] +name = "rand_isaac" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "rand_jitter" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" +dependencies = [ + "libc 0.2.77", + "rand_core 0.4.2", + "winapi 0.3.9", +] + +[[package]] +name = "rand_os" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" +dependencies = [ + "cloudabi 0.0.3", + "fuchsia-cprng", + "libc 0.2.77", + "rand_core 0.4.2", + "rdrand", + "winapi 0.3.9", +] + +[[package]] +name = "rand_pcg" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" +dependencies = [ + "autocfg 0.1.7", + "rand_core 0.4.2", +] + +[[package]] +name = "rand_xorshift" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" +dependencies = [ + "rand_core 0.3.1", ] [[package]] @@ -4090,13 +4518,24 @@ dependencies = [ "rand_core 0.5.1", ] +[[package]] +name = "raw-cpuid" +version = "7.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" +dependencies = [ + "bitflags", + "cc", + "rustc_version", +] + [[package]] name = "raw-window-handle" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -4105,7 +4544,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" dependencies = [ - "autocfg", + "autocfg 1.0.1", "crossbeam-deque 0.8.0", "either", "rayon-core", @@ -4117,49 +4556,39 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ - "crossbeam-channel", + "crossbeam-channel 0.5.0", "crossbeam-deque 0.8.0", "crossbeam-utils 0.8.1", "lazy_static", "num_cpus", ] +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + [[package]] name = "redox_syscall" version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" -[[package]] -name = "redox_syscall" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" -dependencies = [ - "bitflags", -] - [[package]] name = "redox_users" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom 0.1.16", - "redox_syscall 0.1.57", + "getrandom 0.1.15", + "redox_syscall", "rust-argon2", ] -[[package]] -name = "redox_users" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" -dependencies = [ - "getrandom 0.2.2", - "redox_syscall 0.2.5", -] - [[package]] name = "regalloc" version = "0.0.31" @@ -4168,14 +4597,14 @@ checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", - "smallvec", + "smallvec 1.5.1", ] [[package]] name = "regex" -version = "1.4.3" +version = "1.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" +checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" dependencies = [ "aho-corasick", "memchr", @@ -4195,9 +4624,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.22" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" +checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" [[package]] name = "region" @@ -4222,18 +4651,18 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.10.10" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" +checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" dependencies = [ - "base64 0.13.0", + "base64 0.12.3", "bytes 0.5.6", "encoding_rs", "futures-core", "futures-util", - "http", + "http 0.2.2", "http-body 0.3.1", - "hyper 0.13.10", + "hyper 0.13.9", "hyper-rustls", "ipnet", "js-sys", @@ -4241,30 +4670,30 @@ dependencies = [ "log", "mime", "mime_guess", - "percent-encoding", - "pin-project-lite 0.2.4", + "percent-encoding 2.1.0", + "pin-project-lite", "rustls 0.18.1", "serde", "serde_json", "serde_urlencoded", - "tokio 0.2.25", + "tokio 0.2.24", "tokio-rustls", - "url", + "url 2.1.1", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.20.0", + "webpki-roots 0.19.0", "winreg", ] [[package]] name = "ring" -version = "0.16.20" +version = "0.16.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" dependencies = [ "cc", - "libc", + "libc 0.2.77", "once_cell", "spin", "untrusted", @@ -4291,11 +4720,11 @@ dependencies = [ [[package]] name = "ron" -version = "0.6.4" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064ea8613fb712a19faf920022ec8ddf134984f100090764a4e1d768f3827f1f" +checksum = "f8a58080b7bb83b2ea28c3b7a9a994fd5e310330b7c8ca5258d99b98128ecfe4" dependencies = [ - "base64 0.13.0", + "base64 0.12.3", "bitflags", "serde", ] @@ -4307,22 +4736,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84348444bd7ad45729d0c49a4240d7cdc11c9d512c06c5ad1835c1ad4acda6db" [[package]] -name = "rust-argon2" -version = "0.8.3" +name = "route-recognizer" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" +checksum = "ea509065eb0b3c446acdd0102f0d46567dc30902dc0be91d6552035d92b0f4f8" + +[[package]] +name = "rust-argon2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" dependencies = [ - "base64 0.13.0", + "base64 0.12.3", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.8.1", + "crossbeam-utils 0.7.2", ] [[package]] name = "rustc-demangle" -version = "0.1.18" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" +checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] name = "rustc-hash" @@ -4330,6 +4765,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-serialize" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" + [[package]] name = "rustc_version" version = "0.2.3" @@ -4341,11 +4782,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.18.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" +checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" dependencies = [ - "base64 0.12.3", + "base64 0.10.1", "log", "ring", "sct", @@ -4354,11 +4795,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" dependencies = [ - "base64 0.13.0", + "base64 0.12.3", "log", "ring", "sct", @@ -4385,7 +4826,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "linked-hash-map", "num_cpus", - "ordered-float 1.1.1", + "ordered-float 1.1.0", "rustc-hash", "stb_truetype", ] @@ -4458,30 +4899,26 @@ dependencies = [ [[package]] name = "sdl2" -version = "0.34.3" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcbb85f4211627a7291c83434d6bbfa723e28dcaa53c7606087e3c61929e4b9c" +checksum = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" dependencies = [ "bitflags", "lazy_static", - "libc", - "raw-window-handle", + "libc 0.2.77", + "num 0.1.42", + "rand 0.6.5", "sdl2-sys", ] [[package]] name = "sdl2-sys" -version = "0.34.3" +version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d81feded049b9c14eceb4a4f6d596a98cebbd59abdba949c5552a015466d33" +checksum = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" dependencies = [ "cfg-if 0.1.10", - "cmake", - "flate2", - "libc", - "tar", - "unidiff", - "version-compare", + "libc 0.2.77", ] [[package]] @@ -4501,9 +4938,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.123" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" dependencies = [ "serde_derive", ] @@ -4529,26 +4966,38 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.123" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "serde_json" -version = "1.0.62" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" +checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_qs" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d43eef44996bbe16e99ac720e1577eefa16f7b76b5172165c98ced20ae9903e1" +dependencies = [ + "data-encoding", + "error-chain", + "percent-encoding 1.0.1", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.6" @@ -4556,20 +5005,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "serde_urlencoded" -version = "0.7.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" dependencies = [ - "form_urlencoded", + "dtoa", "itoa", - "ryu", "serde", + "url 2.1.1", ] [[package]] @@ -4580,9 +5029,9 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sharded-slab" -version = "0.1.1" +version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" +checksum = "06d5a3f5166fb5b42a5439f2eee8b9de149e235961e3eb21c5808fc3ea17ff3e" dependencies = [ "lazy_static", ] @@ -4594,16 +5043,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" dependencies = [ "lazy_static", - "libc", + "libc 0.2.77", ] [[package]] name = "shellexpand" -version = "2.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdb7831b2d85ddf4a7b148aa19d0587eddbe8671a436b7bd1182eaad0f2829" +checksum = "9a2b22262a9aaf9464d356f656fea420634f78c881c5eebd5ef5e66d8b9bc603" dependencies = [ - "dirs-next", + "dirs 2.0.2", ] [[package]] @@ -4623,19 +5072,19 @@ dependencies = [ "mopa", "rayon", "shred-derive", - "smallvec", + "smallvec 1.5.1", "tynm", ] [[package]] name = "shred-derive" -version = "0.6.3" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5404c36bd155e41a54276ab6aafedad2fb627e5e5849d36ec439c9ddc044a2f" +checksum = "a1f37080f2751fbf091dbdebaa95bd6cf9dbf74ad1d50396b1908518a1747fdf" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -4646,32 +5095,45 @@ checksum = "b5752e017e03af9d735b4b069f53b7a7fd90fefafa04d8bd0c25581b0bff437f" [[package]] name = "signal-hook" -version = "0.1.17" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e31d442c16f047a671b5a71e2161d6e68814012b7f5379d269ebd915fac2729" +checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" dependencies = [ - "libc", - "mio 0.7.7", + "libc 0.2.77", + "mio 0.7.0", "signal-hook-registry", ] [[package]] name = "signal-hook" -version = "0.2.3" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "844024c8913df6bfbfeee3061075ccc47216a897ac0b54a683dea3dfe16d19af" +checksum = "8133fd06d2c721d4168f9b76a9a7fd3a0bfc96df58cf7316c7fb9f23bd677f4e" dependencies = [ - "libc", + "libc 0.2.77", "signal-hook-registry", ] [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" dependencies = [ - "libc", + "arc-swap", + "libc 0.2.77", +] + +[[package]] +name = "simple" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa821f780dcfc349088d15d40eec3de34e1dc6923b1e39c83041d5ca6c686087" +dependencies = [ + "libc 0.1.12", + "num 0.1.42", + "rand 0.3.23", + "sdl2", ] [[package]] @@ -4692,47 +5154,86 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.6.1" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "smallvec" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" [[package]] name = "smithay-client-toolkit" -version = "0.12.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "316e13a3eb853ce7bf72ad3530dc186cb2005c57c521ef5f4ada5ee4eed74de6" +checksum = "562da6f2f0836e144f2e92118b35add58368280556af94f399666ebfd7d1e731" +dependencies = [ + "bitflags", + "byteorder", + "dlib", + "lazy_static", + "log", + "memmap", + "nix 0.18.0", + "wayland-client 0.27.0", + "wayland-cursor 0.27.0", + "wayland-protocols 0.27.0", +] + +[[package]] +name = "smithay-client-toolkit" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ec5c077def8af49f9b5aeeb5fcf8079c638c6615c3a8f9305e2dea601de57f7" dependencies = [ "andrew", "bitflags", + "byteorder", "calloop", "dlib", "lazy_static", "log", - "memmap2 0.1.0", + "memmap", "nix 0.18.0", - "wayland-client 0.28.3", - "wayland-cursor 0.28.3", - "wayland-protocols 0.28.3", + "wayland-client 0.28.1", + "wayland-cursor 0.28.1", + "wayland-protocols 0.28.1", ] [[package]] name = "smithay-clipboard" -version = "0.6.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06384dfaf645908220d976ae24ed39f6cf92efecb0225ea0a948e403014de527" +checksum = "b9e9db50a9b272938b767b731a1291f22f407315def4049db93871e8828034d5" dependencies = [ - "smithay-client-toolkit", - "wayland-client 0.28.3", + "smithay-client-toolkit 0.11.0", + "wayland-client 0.27.0", +] + +[[package]] +name = "smithay-clipboard" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e0eec3480d929e276b38424c8849575ee1e50003eae1cbdc93ee653147acc42" +dependencies = [ + "smithay-client-toolkit 0.12.0", + "wayland-client 0.28.1", ] [[package]] name = "socket2" -version = "0.3.19" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" +checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" dependencies = [ - "cfg-if 1.0.0", - "libc", + "cfg-if 0.1.10", + "libc 0.2.77", + "redox_syscall", "winapi 0.3.9", ] @@ -4741,7 +5242,7 @@ name = "specs" version = "0.16.1" source = "git+https://github.com/amethyst/specs.git?rev=d4435bdf496cf322c74886ca09dd8795984919b4#d4435bdf496cf322c74886ca09dd8795984919b4" dependencies = [ - "crossbeam-queue", + "crossbeam-queue 0.3.1", "hashbrown 0.9.1", "hibitset", "log", @@ -4793,15 +5294,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "standback" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8" -dependencies = [ - "version_check 0.9.2", -] - [[package]] name = "static_assertions" version = "1.1.0" @@ -4846,10 +5338,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "serde", "serde_derive", - "syn 1.0.60", + "syn 1.0.54", ] [[package]] @@ -4860,12 +5352,12 @@ checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "serde", "serde_derive", "serde_json", "sha1", - "syn 1.0.60", + "syn 1.0.54", ] [[package]] @@ -4880,6 +5372,15 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d44a3643b4ff9caf57abcee9c2c621d6c03d9135e0d8b589bd9afb5992cb176a" +[[package]] +name = "string" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" +dependencies = [ + "bytes 0.4.12", +] + [[package]] name = "strsim" version = "0.8.0" @@ -4894,9 +5395,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "structopt" -version = "0.3.21" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" +checksum = "a33f6461027d7f08a13715659b2948e1602c31a3756aeae9378bfe7518c72e82" dependencies = [ "clap", "lazy_static", @@ -4905,15 +5406,15 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.14" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" +checksum = "c92e775028122a4b3dd55d58f14fc5120289c69bee99df1d117ae30f84b225c9" dependencies = [ "heck", "proc-macro-error", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -4941,29 +5442,36 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.60" +version = "1.0.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "unicode-xid 0.2.1", ] [[package]] -name = "tap" -version = "1.0.1" +name = "take_mut" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" + +[[package]] +name = "tap" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e" [[package]] name = "tar" -version = "0.4.32" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0313546c01d59e29be4f09687bcb4fb6690cec931cc3607b6aec7a0e417f4cc6" +checksum = "489997b7557e9a43e192c527face4feacc78bfbe6eed67fd55c4c9e381cba290" dependencies = [ "filetime", - "libc", + "libc 0.2.77", + "redox_syscall", "xattr", ] @@ -4975,14 +5483,14 @@ checksum = "4ee5a98e506fb7231a304c3a1bd7c132a55016cf65001e0282480665870dfcb9" [[package]] name = "tempfile" -version = "3.2.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ - "cfg-if 1.0.0", - "libc", - "rand 0.8.3", - "redox_syscall 0.2.5", + "cfg-if 0.1.10", + "libc 0.2.77", + "rand 0.7.3", + "redox_syscall", "remove_dir_all", "winapi 0.3.9", ] @@ -5007,86 +5515,83 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.23" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" +checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.23" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" +checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "thread_local" -version = "1.1.3" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" +checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" dependencies = [ - "once_cell", + "lazy_static", +] + +[[package]] +name = "tide" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e619c99048ae107912703d0efeec4ff4fbff704f064e51d3eee614b28ea7b739" +dependencies = [ + "async-std", + "cookie", + "futures 0.3.5", + "http 0.1.21", + "http-service", + "http-service-hyper", + "log", + "mime", + "pin-project-lite", + "route-recognizer", + "serde", + "serde_json", + "serde_qs", ] [[package]] name = "time" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ - "libc", + "libc 0.2.77", + "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] [[package]] -name = "time" -version = "0.2.25" +name = "tiny_http" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1195b046942c221454c2539395f85413b33383a067449d78aab2b7b052a142f7" +checksum = "15ce4fc3c4cdea1a4399bb1819a539195fb69db4bbe0bde5b7c7f18fed412e02" dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb 0.4.20", - "time-macros", - "version_check 0.9.2", - "winapi 0.3.9", -] - -[[package]] -name = "time-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - -[[package]] -name = "time-macros-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" -dependencies = [ - "proc-macro-hack", - "proc-macro2 1.0.24", - "quote 1.0.9", - "standback", - "syn 1.0.60", + "ascii 1.0.0", + "chrono", + "chunked_transfer", + "log", + "url 2.1.1", ] [[package]] name = "tinytemplate" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ada8616fad06a2d0c455adc530de4ef57605a8120cc65da9653e0e9623ca74" +checksum = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" dependencies = [ "serde", "serde_json", @@ -5094,24 +5599,33 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" [[package]] name = "tokio" -version = "0.2.25" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" +checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "mio 0.6.22", + "num_cpus", + "tokio-current-thread", + "tokio-executor", + "tokio-io", + "tokio-reactor", + "tokio-threadpool", + "tokio-timer", +] + +[[package]] +name = "tokio" +version = "0.2.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" dependencies = [ "bytes 0.5.6", "fnv", @@ -5119,40 +5633,71 @@ dependencies = [ "iovec", "lazy_static", "memchr", - "mio 0.6.23", + "mio 0.6.22", "num_cpus", - "pin-project-lite 0.1.11", + "pin-project-lite", "slab", ] [[package]] -name = "tokio" -version = "1.2.0" +name = "tokio-buf" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a" +checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" dependencies = [ - "autocfg", - "bytes 1.0.1", - "libc", - "memchr", - "mio 0.7.7", - "num_cpus", - "once_cell", - "pin-project-lite 0.2.4", - "signal-hook-registry", - "tokio-macros", - "winapi 0.3.9", + "bytes 0.4.12", + "either", + "futures 0.1.29", ] [[package]] -name = "tokio-macros" -version = "1.1.0" +name = "tokio-current-thread" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "futures 0.1.29", + "tokio-executor", +] + +[[package]] +name = "tokio-executor" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +dependencies = [ + "crossbeam-utils 0.7.2", + "futures 0.1.29", +] + +[[package]] +name = "tokio-io" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "log", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" +dependencies = [ + "crossbeam-utils 0.7.2", + "futures 0.1.29", + "lazy_static", + "log", + "mio 0.6.22", + "num_cpus", + "parking_lot 0.9.0", + "slab", + "tokio-executor", + "tokio-io", + "tokio-sync", ] [[package]] @@ -5163,19 +5708,61 @@ checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" dependencies = [ "futures-core", "rustls 0.18.1", - "tokio 0.2.25", + "tokio 0.2.24", "webpki", ] [[package]] -name = "tokio-stream" -version = "0.1.3" +name = "tokio-sync" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1981ad97df782ab506a1f43bf82c967326960d278acf3bf8279809648c3ff3ea" +checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" dependencies = [ - "futures-core", - "pin-project-lite 0.2.4", - "tokio 1.2.0", + "fnv", + "futures 0.1.29", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" +dependencies = [ + "bytes 0.4.12", + "futures 0.1.29", + "iovec", + "mio 0.6.22", + "tokio-io", + "tokio-reactor", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" +dependencies = [ + "crossbeam-deque 0.7.3", + "crossbeam-queue 0.2.3", + "crossbeam-utils 0.7.2", + "futures 0.1.29", + "lazy_static", + "log", + "num_cpus", + "slab", + "tokio-executor", +] + +[[package]] +name = "tokio-timer" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +dependencies = [ + "crossbeam-utils 0.7.2", + "futures 0.1.29", + "slab", + "tokio-executor", ] [[package]] @@ -5188,58 +5775,58 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite 0.1.11", - "tokio 0.2.25", + "pin-project-lite", + "tokio 0.2.24", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" dependencies = [ "serde", ] [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] name = "tracing" -version = "0.1.23" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d40a22fd029e33300d8d89a5cc8ffce18bb7c587662f54629e94c9de5487f3" +checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "log", - "pin-project-lite 0.2.4", + "pin-project-lite", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-appender" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9965507e507f12c8901432a33e31131222abac31edd90cabbcf85cf544b7127a" +checksum = "7aa52d56cc0d79ab604e8a022a1cebc4de33cf09dc9933c94353bea2e00d6e88" dependencies = [ "chrono", - "crossbeam-channel", + "crossbeam-channel 0.4.4", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f080ea7e4107844ef4766459426fa2d5c1ada2e47edba05dc7fa99d9629f47" +checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -5257,7 +5844,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" dependencies = [ - "pin-project 0.4.27", + "pin-project 0.4.24", "tracing", ] @@ -5274,9 +5861,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.15" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1fa8f0c8f4c594e4fc9debc1990deab13238077271ba84dd853d54902ee3401" +checksum = "82bb5079aa76438620837198db8a5c529fb9878c730bc2b28179b0241cf04c10" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -5284,9 +5871,8 @@ dependencies = [ "matchers", "regex", "sharded-slab", - "smallvec", + "smallvec 1.5.1", "thread_local", - "tracing", "tracing-core", "tracing-log", ] @@ -5326,7 +5912,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa14b9f5cd7d513bab5accebe8f403df8b1ac22302cac549a6ac99c0a007c84a" dependencies = [ - "num-traits", + "num-traits 0.2.14", "vek 0.11.2", ] @@ -5344,9 +5930,9 @@ checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" [[package]] name = "ttf-parser" -version = "0.11.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e7994fc4aed0ee366a4b0d01562c8a7cd5a5017088bceb6921b0c8c538f34e" +checksum = "d973cfa0e6124166b50a1105a67c85de40bbc625082f35c0f56f84cb1fb0a827" [[package]] name = "tui" @@ -5368,20 +5954,18 @@ checksum = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" [[package]] name = "twox-hash" -version = "1.6.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" +checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" dependencies = [ - "cfg-if 0.1.10", "rand 0.7.3", - "static_assertions", ] [[package]] name = "tynm" -version = "0.1.6" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4df2caa2dc9c3d1f7641ba981f4cd40ab229775aa7aeb834c9ab2850d50623d" +checksum = "367fb781963961b4a90a3362c54b1871caaecb081f011005778242230f39d34e" dependencies = [ "nom 5.1.2", ] @@ -5412,18 +5996,18 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.17" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" +checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" +checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" [[package]] name = "unicode-width" @@ -5443,17 +6027,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" -[[package]] -name = "unidiff" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a62719acf1933bfdbeb73a657ecd9ecece70b405125267dd549e2e2edc232c" -dependencies = [ - "encoding_rs", - "lazy_static", - "regex", -] - [[package]] name = "unreachable" version = "1.0.0" @@ -5471,50 +6044,80 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "1.5.4" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "294b85ef5dbc3670a72e82a89971608a1fcc4ed5c7c5a2895230d31a95f0569b" +checksum = "801125e6d1ba6864cf3a5a92cfb2f0b0a3ee73e40602a0cd206ad2f3c040aa96" dependencies = [ - "base64 0.13.0", + "base64 0.11.0", "chunked_transfer", "cookie", - "cookie_store", - "log", - "once_cell", + "lazy_static", "qstring", - "rustls 0.19.0", - "url", + "rustls 0.16.0", + "url 2.1.1", "webpki", - "webpki-roots 0.21.0", + "webpki-roots 0.18.0", ] [[package]] name = "url" -version = "2.2.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" dependencies = [ - "form_urlencoded", - "idna", + "idna 0.1.5", "matches", - "percent-encoding", + "percent-encoding 1.0.1", +] + +[[package]] +name = "url" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" +dependencies = [ + "idna 0.2.0", + "matches", + "percent-encoding 2.1.0", ] [[package]] name = "uuid" -version = "0.8.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ - "getrandom 0.2.2", + "rand 0.7.3", "serde", ] [[package]] -name = "vcpkg" -version = "0.2.11" +name = "uvth" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf" +dependencies = [ + "crossbeam-channel 0.3.9", + "log", + "num_cpus", +] + +[[package]] +name = "uvth" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e5910f9106b96334c6cae1f1d77a764bda66ac4ca9f507f73259f184fe1bb6b" +dependencies = [ + "crossbeam-channel 0.3.9", + "log", + "num_cpus", +] + +[[package]] +name = "vcpkg" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" [[package]] name = "vec_map" @@ -5524,13 +6127,13 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vek" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e44defd4e0c629bdc842e5d180dda428b3abd2c6b0c7e1fced8c718f65d5f77" +checksum = "2657d8704e5e0be82b60157c8dbc71a269273ad766984508fdc54030a0690c4d" dependencies = [ "approx 0.3.2", "num-integer", - "num-traits", + "num-traits 0.2.14", "rustc_version", "serde", "static_assertions", @@ -5538,25 +6141,12 @@ dependencies = [ [[package]] name = "vek" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2657d8704e5e0be82b60157c8dbc71a269273ad766984508fdc54030a0690c4d" +version = "0.12.0" +source = "git+https://gitlab.com/veloren/vek.git?branch=fix_intrinsics#237a78528b505f34f6dde5dc77db3b642388fe4a" dependencies = [ "approx 0.3.2", "num-integer", - "num-traits", - "rustc_version", - "static_assertions", -] - -[[package]] -name = "vek" -version = "0.14.1" -source = "git+https://gitlab.com/veloren/vek.git?branch=fix_intrinsics2#df6842cc874a697dec8896c66851817e744af7e8" -dependencies = [ - "approx 0.4.0", - "num-integer", - "num-traits", + "num-traits 0.2.14", "rustc_version", "serde", "static_assertions", @@ -5568,31 +6158,33 @@ version = "0.8.0" dependencies = [ "authc", "byteorder", + "futures-executor", + "futures-timer 3.0.2", "futures-util", "hashbrown 0.9.1", "image", "num 0.3.1", + "num_cpus", "rayon", "specs", - "tokio 1.2.0", "tracing", "tracing-subscriber", - "vek 0.14.1", + "uvth 3.1.1", + "vek 0.12.0", "veloren-common", "veloren-common-net", "veloren-common-sys", - "veloren-network", + "veloren_network", ] [[package]] name = "veloren-common" version = "0.8.0" dependencies = [ - "approx 0.4.0", "arraygen", "assets_manager", "criterion", - "crossbeam-channel", + "crossbeam-channel 0.5.0", "crossbeam-utils 0.8.1", "csv", "directories-next", @@ -5603,8 +6195,8 @@ dependencies = [ "indexmap", "lazy_static", "num-derive", - "num-traits", - "ordered-float 2.1.1", + "num-traits 0.2.14", + "ordered-float 2.0.1", "rand 0.8.3", "rayon", "ron", @@ -5621,7 +6213,7 @@ dependencies = [ "tracing", "tracy-client", "uuid", - "vek 0.14.1", + "vek 0.12.0", ] [[package]] @@ -5635,7 +6227,7 @@ dependencies = [ "sum_type", "tracing", "tracy-client", - "vek 0.14.1", + "vek 0.12.0", "veloren-common", ] @@ -5656,56 +6248,13 @@ dependencies = [ "toml", "tracing", "tracy-client", - "vek 0.14.1", + "vek 0.12.0", "veloren-common", "veloren-common-net", "veloren-plugin-api", "wasmer", ] -[[package]] -name = "veloren-network" -version = "0.3.0" -dependencies = [ - "async-channel", - "async-trait", - "bincode", - "bitflags", - "bytes 1.0.1", - "clap", - "criterion", - "crossbeam-channel", - "futures-core", - "futures-util", - "lazy_static", - "lz-fear", - "prometheus", - "prometheus-hyper", - "rand 0.8.3", - "serde", - "shellexpand", - "tokio 1.2.0", - "tokio-stream", - "tracing", - "tracing-subscriber", - "veloren-network-protocol", -] - -[[package]] -name = "veloren-network-protocol" -version = "0.6.0" -dependencies = [ - "async-channel", - "async-trait", - "bitflags", - "bytes 1.0.1", - "criterion", - "prometheus", - "rand 0.8.3", - "tokio 1.2.0", - "tracing", -] - [[package]] name = "veloren-plugin-api" version = "0.1.0" @@ -5720,8 +6269,8 @@ name = "veloren-plugin-derive" version = "0.1.0" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -5740,10 +6289,14 @@ version = "0.8.0" dependencies = [ "authc", "chrono", - "crossbeam-channel", + "const-tweaker", + "crossbeam-channel 0.5.0", "diesel", "diesel_migrations", "dotenv", + "futures-channel", + "futures-executor", + "futures-timer 3.0.2", "futures-util", "hashbrown 0.9.1", "itertools 0.9.0", @@ -5751,7 +6304,6 @@ dependencies = [ "libsqlite3-sys", "portpicker", "prometheus", - "prometheus-hyper", "rand 0.8.3", "rayon", "ron", @@ -5761,15 +6313,16 @@ dependencies = [ "slab", "specs", "specs-idvs", - "tokio 1.2.0", + "tiny_http", "tracing", - "vek 0.14.1", + "uvth 3.1.1", + "vek 0.12.0", "veloren-common", "veloren-common-net", "veloren-common-sys", - "veloren-network", "veloren-plugin-api", "veloren-world", + "veloren_network", ] [[package]] @@ -5782,9 +6335,8 @@ dependencies = [ "lazy_static", "ron", "serde", - "signal-hook 0.2.3", + "signal-hook 0.2.2", "termcolor", - "tokio 1.2.0", "tracing", "tracing-subscriber", "tracing-tracy", @@ -5803,8 +6355,8 @@ dependencies = [ "chrono", "conrod_core", "conrod_winit", + "const-tweaker", "copy_dir", - "coreaudio-sys", "cpal", "criterion", "crossbeam", @@ -5832,9 +6384,8 @@ dependencies = [ "lazy_static", "native-dialog", "num 0.3.1", - "num_cpus", "old_school_gfx_glutin_ext", - "ordered-float 2.1.1", + "ordered-float 2.0.1", "rand 0.8.3", "rodio", "ron", @@ -5842,14 +6393,14 @@ dependencies = [ "specs", "specs-idvs", "termcolor", - "tokio 1.2.0", "tracing", "tracing-appender", "tracing-log", "tracing-subscriber", "tracing-tracy", "treeculler", - "vek 0.14.1", + "uvth 3.1.1", + "vek 0.12.0", "veloren-client", "veloren-common", "veloren-common-net", @@ -5869,10 +6420,10 @@ dependencies = [ "find_folder", "inline_tweak", "lazy_static", - "libloading 0.6.7", - "notify 5.0.0-pre.5", + "libloading 0.6.3", + "notify 5.0.0-pre.3", "tracing", - "vek 0.14.1", + "vek 0.12.0", "veloren-common", ] @@ -5892,25 +6443,43 @@ dependencies = [ "minifb", "noise", "num 0.3.1", - "ordered-float 2.1.1", + "ordered-float 2.0.1", "packed_simd_2", "rand 0.8.3", "rand_chacha 0.3.0", "rayon", "ron", "serde", + "simple", "tracing", "tracing-subscriber", - "vek 0.14.1", + "vek 0.12.0", "veloren-common", "veloren-common-net", ] [[package]] -name = "version-compare" -version = "0.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" +name = "veloren_network" +version = "0.2.0" +dependencies = [ + "async-std", + "bincode", + "bitflags", + "clap", + "crossbeam-channel 0.5.0", + "futures 0.3.5", + "lazy_static", + "lz-fear", + "prometheus", + "rand 0.8.3", + "serde", + "shellexpand", + "tiny_http", + "tracing", + "tracing-futures", + "tracing-subscriber", + "uvth 4.0.1", +] [[package]] name = "version_check" @@ -5951,6 +6520,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +dependencies = [ + "futures 0.1.29", + "log", + "try-lock", +] + [[package]] name = "want" version = "0.3.0" @@ -5969,17 +6549,17 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.10.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" [[package]] name = "wasm-bindgen" -version = "0.2.70" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be" +checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "serde", "serde_json", "wasm-bindgen-macro", @@ -5987,26 +6567,26 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.70" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7" +checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" dependencies = [ "bumpalo", "lazy_static", "log", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.20" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de431a2910c86679c34283a33f66f4e4abd7e0aec27b6669060148872aadf94" +checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "js-sys", "wasm-bindgen", "web-sys", @@ -6014,38 +6594,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.70" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c" +checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" dependencies = [ - "quote 1.0.9", + "quote 1.0.7", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.70" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385" +checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.70" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64" +checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" [[package]] name = "wasmer" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a70cfae554988d904d64ca17ab0e7cd652ee5c8a0807094819c1ea93eb9d6866" +checksum = "94b1ece7c894857344ae93506686ae36ccd867b4ed55819c06d2316d009098d4" dependencies = [ "cfg-if 0.1.10", "indexmap", @@ -6066,14 +6646,22 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7732a9cab472bd921d5a0c422f45b3d03f62fa2c40a89e0770cef6d47e383e" +checksum = "fc85134b257e5fba5870693441e300b601d08f18833ac4fa6934f0b72afc56d2" dependencies = [ "enumset", + "raw-cpuid", + "byteorder", + "cranelift-codegen", + "cranelift-entity", + "cranelift-native", + "libc 0.2.77", + "nix 0.15.0", + "rayon", "serde", "serde_bytes", - "smallvec", + "smallvec 1.5.1", "target-lexicon", "thiserror", "wasmer-types", @@ -6083,17 +6671,17 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48cb9395f094e1d81534f4c5e330ed4cdb424e8df870d29ad585620284f5fddb" +checksum = "60d68fb05dbe908724901b680070560944d99d04c52c763e98124aa988ac6dd0" dependencies = [ "cranelift-codegen", "cranelift-frontend", - "gimli 0.22.0", + "gimli", "more-asserts", "rayon", "serde", - "smallvec", + "smallvec 1.5.1", "tracing", "wasmer-compiler", "wasmer-types", @@ -6102,26 +6690,26 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b86dcd2c3efdb8390728a2b56f762db07789aaa5aa872a9dc776ba3a7912ed" +checksum = "ca24205ffdf2d3b1a9c01219f4f3f0a1382658680abe73bc5b146f941adeeb8e" dependencies = [ "proc-macro-error", "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] name = "wasmer-engine" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efe4667d6bd888f26ae8062a63a9379fa697415b4b4e380f33832e8418fd71b5" +checksum = "d91ed16436a9813d92f434e1d40fdf91b45ca30f351a799f793015359acca86b" dependencies = [ "backtrace", "bincode", "lazy_static", - "memmap2 0.2.1", + "memmap2", "more-asserts", "rustc-demangle", "serde", @@ -6135,13 +6723,25 @@ dependencies = [ [[package]] name = "wasmer-engine-jit" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26770be802888011b4a3072f2a282fc2faa68aa48c71b3db6252a3937a85f3da" +checksum = "df1e3ca5e34eacd4ab6d9d32edd41b51d2e39cf3d75453611c9c57cee3a64691" dependencies = [ "bincode", "cfg-if 0.1.10", "region", + "blake3", + "cc", + "digest 0.8.1", + "errno", + "hex 0.4.2", + "indexmap", + "lazy_static", + "libc 0.2.77", + "nix 0.15.0", + "page_size", + "parking_lot 0.10.2", + "rustc_version", "serde", "serde_bytes", "wasmer-compiler", @@ -6153,14 +6753,14 @@ dependencies = [ [[package]] name = "wasmer-engine-native" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb4083a6c69f2cd4b000b82a80717f37c6cc2e536aee3a8ffe9af3edc276a8b" +checksum = "6a21d6c5ae0c384ba2f01f598c95b01d4da2eaec3376fb96de2ded38c54143a0" dependencies = [ "bincode", "cfg-if 0.1.10", "leb128", - "libloading 0.6.7", + "libloading 0.6.3", "serde", "tempfile", "tracing", @@ -6174,9 +6774,9 @@ dependencies = [ [[package]] name = "wasmer-object" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf8e0c12b82ff81ebecd30d7e118be5fec871d6de885a90eeb105df0a769a7b" +checksum = "06e007e73ec7775aecc61045092dabfcff1e9f228129cd129e76a3e6aae26454" dependencies = [ "object 0.22.0", "thiserror", @@ -6186,9 +6786,9 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f4ac28c2951cd792c18332f03da523ed06b170f5cf6bb5b1bdd7e36c2a8218" +checksum = "2dbba7a95edb61b40daa43079979fc3212234e1645a15b8c527c36decad59fc6" dependencies = [ "cranelift-entity", "serde", @@ -6197,9 +6797,9 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "1.0.2" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7635ba0b6d2fd325f588d69a950ad9fa04dddbf6ad08b6b2a183146319bf6ae" +checksum = "9cd9acd4d53c004a11fcaff17f2a2528ae8f1748c6d5c4aea7d8bed2d9236f0f" dependencies = [ "backtrace", "cc", @@ -6212,6 +6812,8 @@ dependencies = [ "serde", "thiserror", "wasmer-types", + "libc 0.2.77", + "wasmer-runtime-core", "winapi 0.3.9", ] @@ -6223,18 +6825,18 @@ checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" [[package]] name = "wast" -version = "33.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d04fe175c7f78214971293e7d8875673804e736092206a3a4544dbc12811c1b" +checksum = "9b79907b22f740634810e882d8d1d9d0f9563095a8ab94e786e370242bff5cd2" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.34" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec9c6ee01ae07a26adadcdfed22c7a97e0b8cbee9c06e0e96076ece5aeb5cfe" +checksum = "a8279a02835bf12e61ed2b3c3cbc6ecf9918762fd97e036917c11a09ec20ca44" dependencies = [ "wast", ] @@ -6247,8 +6849,9 @@ checksum = "ab702fefbcd6d6f67fb5816e3a89a3b5a42a94290abbc015311c9a30d1068ae4" dependencies = [ "bitflags", "downcast-rs", - "libc", + "libc 0.2.77", "nix 0.17.0", + "scoped-tls", "wayland-commons 0.27.0", "wayland-scanner 0.27.0", "wayland-sys 0.27.0", @@ -6256,18 +6859,18 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.28.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbdbe01d03b2267809f3ed99495b37395387fde789e0f2ebb78e8b43f75b6d7" +checksum = "80c54f9b90b2c044784f91fe22c5619a8a9c681db38492f2fd78ff968cf3f184" dependencies = [ "bitflags", "downcast-rs", - "libc", + "libc 0.2.77", "nix 0.18.0", "scoped-tls", - "wayland-commons 0.28.3", - "wayland-scanner 0.28.3", - "wayland-sys 0.28.3", + "wayland-commons 0.28.1", + "wayland-scanner 0.28.1", + "wayland-sys 0.28.1", ] [[package]] @@ -6278,20 +6881,20 @@ checksum = "e972e9336ad5a9dd861b4e21ff35ad71d3e5c6b4803d65c39913612f851b95f1" dependencies = [ "nix 0.17.0", "once_cell", - "smallvec", + "smallvec 1.5.1", "wayland-sys 0.27.0", ] [[package]] name = "wayland-commons" -version = "0.28.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "480450f76717edd64ad04a4426280d737fc3d10a236b982df7b1aee19f0e2d56" +checksum = "7602d75560fe6f02cac723609cce658042fe60541b5107999818d29d4dab7cfa" dependencies = [ "nix 0.18.0", "once_cell", - "smallvec", - "wayland-sys 0.28.3", + "smallvec 1.5.1", + "wayland-sys 0.28.1", ] [[package]] @@ -6307,23 +6910,23 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6eb122c160223a7660feeaf949d0100281d1279acaaed3720eb3c9894496e5f" +checksum = "0446b959c5b5b4b2c11f63112fc7cbeb50ecd9f2c340d2b0ea632875685baf04" dependencies = [ "nix 0.18.0", - "wayland-client 0.28.3", + "wayland-client 0.28.1", "xcursor", ] [[package]] name = "wayland-egl" -version = "0.28.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c653507447113c967a1aeee413699acb42d96d6302ec967c6d51930eae8aa7f5" +checksum = "e7ca6190c84bcdc58beccc619bf4866709db32d653255e89da38867f97f90d61" dependencies = [ - "wayland-client 0.28.3", - "wayland-sys 0.28.3", + "wayland-client 0.28.1", + "wayland-sys 0.28.1", ] [[package]] @@ -6340,14 +6943,14 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.28.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "319a82b4d3054dd25acc32d9aee0f84fa95b63bc983fffe4703b6b8d47e01a30" +checksum = "0d419585bbdb150fb541579cff205c6095a86cd874530e41838d1f18a9569a08" dependencies = [ "bitflags", - "wayland-client 0.28.3", - "wayland-commons 0.28.3", - "wayland-scanner 0.28.3", + "wayland-client 0.28.1", + "wayland-commons 0.28.1", + "wayland-scanner 0.28.1", ] [[package]] @@ -6357,18 +6960,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "030f56009d932bd9400bb472764fea8109be1b0fc482d9cd75496c943ac30328" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "xml-rs", ] [[package]] name = "wayland-scanner" -version = "0.28.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7010ba5767b3fcd350decc59055390b4ebe6bd1b9279a9feb1f1888987f1133d" +checksum = "e1cc091af4b05a435312f7cefe3a26824d2017966a58362ca913f72c3d68e5e2" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", + "quote 1.0.7", "xml-rs", ] @@ -6378,14 +6981,16 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bdeffbbb474477dfa2acb45ac7479e5fe8f741c64ab032c5d11b94d07edc269" dependencies = [ + "dlib", + "lazy_static", "pkg-config", ] [[package]] name = "wayland-sys" -version = "0.28.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6793834e0c35d11fd96a97297abe03d37be627e1847da52e17d7e0e3b51cc099" +checksum = "e5640f53d1fe6eaaa2e77b9ff015fe9a556173ce8388607f941aecfd9b05c73e" dependencies = [ "dlib", "lazy_static", @@ -6394,9 +6999,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.47" +version = "0.3.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3" +checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" dependencies = [ "js-sys", "wasm-bindgen", @@ -6404,9 +7009,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.4" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" dependencies = [ "ring", "untrusted", @@ -6414,18 +7019,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.20.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" +checksum = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" dependencies = [ "webpki", ] [[package]] name = "webpki-roots" -version = "0.21.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" +checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739" dependencies = [ "webpki", ] @@ -6436,7 +7041,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e713040b67aae5bf1a0ae3e1ebba8cc29ab2b90da9aa1bff6e09031a8a41d7a8" dependencies = [ - "libc", + "libc 0.2.77", "winapi 0.3.9", ] @@ -6446,7 +7051,7 @@ version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" dependencies = [ - "libc", + "libc 0.2.77", "thiserror", ] @@ -6487,15 +7092,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "winapi-wsapoll" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" -dependencies = [ - "winapi 0.3.9", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -6504,9 +7100,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" -version = "0.1.4" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37cf16659e398a96f4ab8deff2b9db2ca0c3c5d6c1b59b1d577b7f888f0f03c6" +checksum = "b849e24b344ea3535bcda7320b8b7f3560bd2c3692de73153d3c64acc84203e5" dependencies = [ "clipboard-win 4.0.3", "clipboard_macos", @@ -6523,25 +7119,25 @@ dependencies = [ "bitflags", "cocoa 0.24.0", "core-foundation 0.9.1", - "core-graphics 0.22.2", + "core-graphics 0.22.1", "core-video-sys", "dispatch 0.2.0", "instant", "lazy_static", - "libc", + "libc 0.2.77", "log", - "mio 0.6.23", + "mio 0.6.22", "mio-extras", "ndk", "ndk-glue", "ndk-sys", "objc", - "parking_lot 0.11.1", - "percent-encoding", + "parking_lot 0.11.0", + "percent-encoding 2.1.0", "raw-window-handle", "serde", - "smithay-client-toolkit", - "wayland-client 0.28.3", + "smithay-client-toolkit 0.12.0", + "wayland-client 0.28.1", "winapi 0.3.9", "x11-dl", ] @@ -6596,30 +7192,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" dependencies = [ "lazy_static", - "libc", + "libc 0.2.77", "maybe-uninit", "pkg-config", ] -[[package]] -name = "x11rb" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4122702a684f01cf35cf8e00d0ba513f7c4c7d46f9881d9a699f3de787e61e4" -dependencies = [ - "gethostname", - "nix 0.19.1", - "winapi 0.3.9", - "winapi-wsapoll", -] - [[package]] name = "xattr" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" dependencies = [ - "libc", + "libc 0.2.77", ] [[package]] @@ -6628,17 +7212,17 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6" dependencies = [ - "libc", + "libc 0.2.77", "log", ] [[package]] name = "xcursor" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" +checksum = "d3a481cfdefd35e1c50073ae33a8000d695c98039544659f5dc5dd71311b0d01" dependencies = [ - "nom 6.1.2", + "nom 5.1.2", ] [[package]] @@ -6660,7 +7244,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aec02bc5de902aa579f3d2f2c522edaf40fa42963cbaffe645b058ddcc68fdb2" dependencies = [ "bitflags", - "libc", + "libc 0.2.77", "xkbcommon-sys", ] @@ -6670,7 +7254,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa434980dca02ebf28795d71e570dbb78316d095a228707efd6117bf8246d78b" dependencies = [ - "libc", + "libc 0.2.77", "pkg-config", ] diff --git a/world/Cargo.toml b/world/Cargo.toml index 1ebf3f4866..a7d447e0b6 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -36,3 +36,4 @@ ron = { version = "0.6", default-features = false } criterion = "0.3" tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] } minifb = "0.19.1" +simple = "0.3" diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index ee1e9ba8f3..c91388a7f0 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -7,13 +7,14 @@ use crate::{ }; use common::{ assets::AssetHandle, - terrain::{Block, BlockKind, Structure, StructuresGroup}, + terrain::{Block, BlockKind, structure::{Structure, StructureBlock, StructuresGroup}}, vol::ReadVol, }; use hashbrown::HashMap; use lazy_static::lazy_static; use std::f32; use vek::*; +use rand::prelude::*; lazy_static! { static ref OAKS: AssetHandle = Structure::load_group("oaks"); @@ -37,9 +38,15 @@ static QUIRKY_RAND: RandomPerm = RandomPerm::new(0xA634460F); #[allow(clippy::if_same_then_else)] pub fn apply_trees_to(canvas: &mut Canvas) { + // TODO: Get rid of this + enum TreeModel { + Structure(Structure), + Procedural(ProceduralTree), + } + struct Tree { pos: Vec3, - model: Structure, + model: TreeModel, seed: u32, units: (Vec2, Vec2), } @@ -73,7 +80,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { Some(Tree { pos: Vec3::new(tree_wpos.x, tree_wpos.y, col.alt as i32), - model: { + model: 'model: { let models: AssetHandle<_> = if is_quirky { if col.temp > CONFIG.desert_temp { *QUIRKY_DRY @@ -91,7 +98,11 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Palm => *PALMS, ForestKind::Acacia => *ACACIAS, ForestKind::Baobab => *BAOBABS, - ForestKind::Oak => *OAKS, + // ForestKind::Oak => *OAKS, + ForestKind::Oak => { + let mut rng = RandomPerm::new(seed); + break 'model TreeModel::Procedural(ProceduralTree::generate(&mut rng)); + }, ForestKind::Pine => *PINES, ForestKind::Birch => *BIRCHES, ForestKind::Mangrove => *MANGROVE_TREES, @@ -100,8 +111,8 @@ pub fn apply_trees_to(canvas: &mut Canvas) { }; let models = models.read(); - models[(MODEL_RAND.get(seed.wrapping_mul(17)) / 13) as usize % models.len()] - .clone() + TreeModel::Structure(models[(MODEL_RAND.get(seed.wrapping_mul(17)) / 13) as usize % models.len()] + .clone()) }, seed, units: UNIT_CHOOSER.get(seed), @@ -112,7 +123,19 @@ pub fn apply_trees_to(canvas: &mut Canvas) { continue; }; - let bounds = tree.model.get_bounds(); + let bounds = match &tree.model { + TreeModel::Structure(s) => s.get_bounds(), + TreeModel::Procedural(t) => t.get_bounds().map(|e| e as i32), + }; + + tracing::info!("{:?}", bounds); + + // if !Aabr::from(bounds).contains_point(wpos2d - tree.pos.xy()) { + if bounds.min.x + tree.pos.x < wpos2d.x || bounds.min.y + tree.pos.y < wpos2d.y || bounds.max.x + tree.pos.x > wpos2d.x || bounds.max.y + tree.pos.y > wpos2d.y { + // Skip this column + break; + } + let mut is_top = true; let mut is_leaf_top = true; for z in (bounds.min.z..bounds.max.z).rev() { @@ -127,12 +150,20 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ) + Vec3::unit_z() * (wpos.z - tree.pos.z); block_from_structure( info.index(), - if let Some(block) = tree.model.get(model_pos).ok().copied() { + if let Some(block) = match &tree.model { + TreeModel::Structure(s) => s.get(model_pos).ok().copied(), + TreeModel::Procedural(t) => if t.is_branch_at(model_pos.map(|e| e as f32 + 0.5)) { + Some(StructureBlock::Normal(Rgb::new(60, 30, 0))) + } else if t.is_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { + Some(StructureBlock::TemperateLeaves) + } else { + Some(StructureBlock::None) + }, + } { block } else { - // If we hit an inaccessible block, we're probably outside the model bounds. - // Skip this column. - break; + //break; + StructureBlock::None }, wpos, tree.pos.xy(), @@ -162,3 +193,94 @@ pub fn apply_trees_to(canvas: &mut Canvas) { } }); } + +// TODO: Rename this to `Tree` when the name conflict is gone +struct ProceduralTree { + branches: Vec, +} + +impl ProceduralTree { + pub fn generate(rng: &mut impl Rng) -> Self { + let mut branches = Vec::new(); + + fn add_branches(branches: &mut Vec, rng: &mut impl Rng, start: Vec3, dir: Vec3, depth: usize) { + let branch_dir = (dir + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)) * 0.65).normalized(); // I wish `vek` had a `Vec3::from_fn` + let branch_len = 15.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess + + let end = start + branch_dir * branch_len; + + branches.push(Branch { + line: LineSegment3 { start, end }, + radius: 0.3 + 3.5 / (depth + 1) as f32, + health: if depth > 2 { + 1.5 + } else { + 0.0 + }, + }); + + if depth < 4 { + for _ in 0..3 { + add_branches(branches, rng, end, branch_dir, depth + 1); + } + } + } + + add_branches(&mut branches, rng, Vec3::zero(), Vec3::unit_z(), 0); + + Self { + branches, + } + } + + pub fn get_bounds(&self) -> Aabb { + self.branches + .iter() + .fold( + Aabb { + min: Vec3::broadcast(f32::MAX), + max: Vec3::broadcast(f32::MIN), + }, + |Aabb { min, max }, branch| Aabb { + min: Vec3::partial_min(min, Vec3::partial_min(branch.line.start, branch.line.end) - branch.radius - 8.0), + max: Vec3::partial_max(max, Vec3::partial_max(branch.line.start, branch.line.end) + branch.radius + 8.0), + }, + ) + // Aabb { + // min: Vec3::new(-32.0, -32.0, 0.0), + // max: Vec3::new(32.0, 32.0, 64.0), + // } + } + + pub fn is_branch_at(&self, pos: Vec3) -> bool { + // TODO: Something visually nicer than this + self.branches.iter().any(|branch| { + branch.line.projected_point(pos).distance_squared(pos) < branch.radius.powi(2) + // let mut a = branch.line.start; + // let mut b = branch.line.end; + // for _ in 0..10 { + // if a.distance_squared(pos) < b.distance_squared(pos) { + // b = (a + b) / 2.0; + // } else { + // a = (a + b) / 2.0; + // } + // } + // let near = (a + b) / 2.0; + // near.distance(pos) < branch.radius + }) + } + + pub fn is_leaves_at(&self, pos: Vec3) -> bool { + self.branches.iter() + .map(|branch| { + branch.health / (branch.line.projected_point(pos).distance_squared(pos) + 0.001) + }) + .sum::() > 1.0 + } +} + +struct Branch { + line: LineSegment3, + radius: f32, + health: f32, +} diff --git a/world/src/util/random.rs b/world/src/util/random.rs index 09c7a815cb..c82f8f79b6 100644 --- a/world/src/util/random.rs +++ b/world/src/util/random.rs @@ -64,7 +64,9 @@ impl Sampler<'static> for RandomPerm { // `RandomPerm` is not high-quality but it is at least fast and deterministic. impl RngCore for RandomPerm { fn next_u32(&mut self) -> u32 { - self.seed = self.get(self.seed); + self.seed = self.get(self.seed) ^ 0xA7537839; + self.seed = self.get(self.seed) ^ 0x12314112; + self.seed = self.get(self.seed) ^ 0x78892832; self.seed } From 6dd0f73c2d94ed02326630b32875bad502404533 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 4 Jan 2021 00:28:04 +0000 Subject: [PATCH 04/87] Fixed clipping issues, faster generation --- common/src/terrain/structure.rs | 6 ++- world/src/layer/tree.rs | 96 ++++++++++++++------------------- 2 files changed, 44 insertions(+), 58 deletions(-) diff --git a/common/src/terrain/structure.rs b/common/src/terrain/structure.rs index 57235240c5..bde3411439 100644 --- a/common/src/terrain/structure.rs +++ b/common/src/terrain/structure.rs @@ -34,7 +34,9 @@ make_case_elim!( ); #[derive(Debug)] -pub enum StructureError {} +pub enum StructureError { + OutOfBounds, +} #[derive(Clone)] pub struct Structure { @@ -109,7 +111,7 @@ impl ReadVol for Structure { fn get(&self, pos: Vec3) -> Result<&Self::Vox, StructureError> { match self.base.vol.get(pos + self.center) { Ok(block) => Ok(block), - Err(DynaError::OutOfBounds) => Ok(&self.base.empty), + Err(DynaError::OutOfBounds) => Err(StructureError::OutOfBounds), } } } diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index c91388a7f0..d5fe681e97 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -128,12 +128,14 @@ pub fn apply_trees_to(canvas: &mut Canvas) { TreeModel::Procedural(t) => t.get_bounds().map(|e| e as i32), }; - tracing::info!("{:?}", bounds); - - // if !Aabr::from(bounds).contains_point(wpos2d - tree.pos.xy()) { - if bounds.min.x + tree.pos.x < wpos2d.x || bounds.min.y + tree.pos.y < wpos2d.y || bounds.max.x + tree.pos.x > wpos2d.x || bounds.max.y + tree.pos.y > wpos2d.y { + let rpos2d = (wpos2d - tree.pos.xy()) + .map2(Vec2::new(tree.units.0, tree.units.1), |p, unit| { + unit * p + }) + .sum(); + if !Aabr::from(bounds).contains_point(rpos2d) { // Skip this column - break; + continue; } let mut is_top = true; @@ -152,18 +154,15 @@ pub fn apply_trees_to(canvas: &mut Canvas) { info.index(), if let Some(block) = match &tree.model { TreeModel::Structure(s) => s.get(model_pos).ok().copied(), - TreeModel::Procedural(t) => if t.is_branch_at(model_pos.map(|e| e as f32 + 0.5)) { - Some(StructureBlock::Normal(Rgb::new(60, 30, 0))) - } else if t.is_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { - Some(StructureBlock::TemperateLeaves) - } else { - Some(StructureBlock::None) - }, + TreeModel::Procedural(t) => Some(match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { + (true, _) => StructureBlock::Normal(Rgb::new(60, 30, 0)), + (_, true) => StructureBlock::TemperateLeaves, + (_, _) => StructureBlock::None, + }), } { block } else { - //break; - StructureBlock::None + break }, wpos, tree.pos.xy(), @@ -204,16 +203,16 @@ impl ProceduralTree { let mut branches = Vec::new(); fn add_branches(branches: &mut Vec, rng: &mut impl Rng, start: Vec3, dir: Vec3, depth: usize) { - let branch_dir = (dir + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)) * 0.65).normalized(); // I wish `vek` had a `Vec3::from_fn` - let branch_len = 15.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess + let branch_dir = (dir + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` + let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess let end = start + branch_dir * branch_len; branches.push(Branch { line: LineSegment3 { start, end }, - radius: 0.3 + 3.5 / (depth + 1) as f32, - health: if depth > 2 { - 1.5 + radius: 0.3 + 2.5 / (depth + 1) as f32, + health: if depth == 4 { + 2.0 } else { 0.0 }, @@ -234,48 +233,33 @@ impl ProceduralTree { } pub fn get_bounds(&self) -> Aabb { + let bounds = self.branches + .iter() + .fold(Aabb::default(), |Aabb { min, max }, branch| Aabb { + min: Vec3::partial_min(min, Vec3::partial_min(branch.line.start, branch.line.end) - branch.radius - 8.0), + max: Vec3::partial_max(max, Vec3::partial_max(branch.line.start, branch.line.end) + branch.radius + 8.0), + }); + self.branches .iter() - .fold( - Aabb { - min: Vec3::broadcast(f32::MAX), - max: Vec3::broadcast(f32::MIN), - }, - |Aabb { min, max }, branch| Aabb { - min: Vec3::partial_min(min, Vec3::partial_min(branch.line.start, branch.line.end) - branch.radius - 8.0), - max: Vec3::partial_max(max, Vec3::partial_max(branch.line.start, branch.line.end) + branch.radius + 8.0), - }, - ) - // Aabb { - // min: Vec3::new(-32.0, -32.0, 0.0), - // max: Vec3::new(32.0, 32.0, 64.0), - // } + .for_each(|branch| { + assert!(bounds.contains_point(branch.line.start)); + assert!(bounds.contains_point(branch.line.end)); + }); + + bounds } - pub fn is_branch_at(&self, pos: Vec3) -> bool { - // TODO: Something visually nicer than this - self.branches.iter().any(|branch| { - branch.line.projected_point(pos).distance_squared(pos) < branch.radius.powi(2) - // let mut a = branch.line.start; - // let mut b = branch.line.end; - // for _ in 0..10 { - // if a.distance_squared(pos) < b.distance_squared(pos) { - // b = (a + b) / 2.0; - // } else { - // a = (a + b) / 2.0; - // } - // } - // let near = (a + b) / 2.0; - // near.distance(pos) < branch.radius - }) - } + pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { + let mut is_branch = false; + let mut health = 0.0; + for branch in &self.branches { + let p_d2 = branch.line.projected_point(pos).distance_squared(pos); - pub fn is_leaves_at(&self, pos: Vec3) -> bool { - self.branches.iter() - .map(|branch| { - branch.health / (branch.line.projected_point(pos).distance_squared(pos) + 0.001) - }) - .sum::() > 1.0 + is_branch |= p_d2 < branch.radius.powi(2); + health += branch.health / (p_d2 + 0.001); + } + (is_branch, health > 1.0) } } From 4bcf9e7a63fa3fb543bfaad006172f4866b6e9fc Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 4 Jan 2021 01:27:24 +0000 Subject: [PATCH 05/87] More sparse, faster trees --- world/src/layer/tree.rs | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index d5fe681e97..5284dc4f27 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -212,14 +212,14 @@ impl ProceduralTree { line: LineSegment3 { start, end }, radius: 0.3 + 2.5 / (depth + 1) as f32, health: if depth == 4 { - 2.0 + rng.gen_range(3.0, 5.0) } else { 0.0 }, }); if depth < 4 { - for _ in 0..3 { + for _ in 0..rng.gen_range(2, 4) { add_branches(branches, rng, end, branch_dir, depth + 1); } } @@ -252,12 +252,29 @@ impl ProceduralTree { pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { let mut is_branch = false; - let mut health = 0.0; + let mut health = 0.0f32; for branch in &self.branches { let p_d2 = branch.line.projected_point(pos).distance_squared(pos); + #[allow(unsafe_code)] + fn finvsqrt(x: f32) -> f32 { + // Magic number based on Chris Lomont work: + // const MAGIC_U32: u32 = 0x5f375a86; + // The Original Magic Number: + // const MAGIC_32: u32 = 0x5f3759df; + const threehalfs: f32 = 1.5f32; + let x2: f32 = x * 0.5f32; + let mut i: u32 = unsafe { std::mem::transmute(x) };// evil floating point bit level hacking + i = 0x5f375a86 - (i >> 1); // what the fuck? + let y: f32 = unsafe { std::mem::transmute(i) }; + let y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration + // let y = y * (threehalfs - (x2 * y * y)); // 2nd iteration, this can be removed + + y + } + is_branch |= p_d2 < branch.radius.powi(2); - health += branch.health / (p_d2 + 0.001); + health = health.max(branch.health * finvsqrt(p_d2)); } (is_branch, health > 1.0) } From 0745514174ef49503ccdf871c111862f7eddd89f Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 4 Jan 2021 01:49:26 +0000 Subject: [PATCH 06/87] Prevented trees from being too sparse --- world/src/layer/tree.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 5284dc4f27..cd91952c1a 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -219,7 +219,8 @@ impl ProceduralTree { }); if depth < 4 { - for _ in 0..rng.gen_range(2, 4) { + let sub_branches = if depth == 0 { 3 } else { rng.gen_range(2, 4) }; + for _ in 0..sub_branches { add_branches(branches, rng, end, branch_dir, depth + 1); } } From 7f3ba0eacae7ee955f088cc0158bf8d42f4bb092 Mon Sep 17 00:00:00 2001 From: ccgauche Date: Mon, 4 Jan 2021 22:19:43 +0100 Subject: [PATCH 07/87] New generation for trees --- world/src/layer/tree.rs | 54 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index cd91952c1a..5359aa1cdd 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -203,7 +203,7 @@ impl ProceduralTree { let mut branches = Vec::new(); fn add_branches(branches: &mut Vec, rng: &mut impl Rng, start: Vec3, dir: Vec3, depth: usize) { - let branch_dir = (dir + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` + let branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(-0.3, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess let end = start + branch_dir * branch_len; @@ -226,7 +226,57 @@ impl ProceduralTree { } } - add_branches(&mut branches, rng, Vec3::zero(), Vec3::unit_z(), 0); + let height = rng.gen_range(13, 30) as f32; + let dx = rng.gen_range(-5, 5) as f32; + let dy = rng.gen_range(-5, 5) as f32; + + // Generate the trunk + branches.push(Branch { + line: LineSegment3 { start: Vec3::zero(), end: Vec3::new(dx, dy, height)}, + radius: 3.0, + health: 0.0, + }); + + // Generate branches + let branches_count = rng.gen_range(7, 10); + + let angle_division = 360.0 / branches_count as f32; + let angle_padding = rng.gen_range(0, 360) as f32; + + for i in 0..branches_count { + for _ in 0..2 { + let branch_size = height; + + let subdivision = rng.gen_range(1, 2); + + let branch_size = (0..subdivision).fold(branch_size, |x, _| x / 3.0 * 2.0); + + let radians = ((angle_padding + + angle_division * i as f32 + + rng.gen_range(15.0, angle_division - 15.0)) + % 360.0) + .to_radians(); + + let branchendx = dx + branch_size * radians.cos(); + let branchendy = dy + branch_size * radians.sin(); + + let height_dif = rng.gen_range(0.0, branch_size * 2.0); + + let trunk_margin = rng.gen_range(0.0, height / 3.0); + + add_branches( + &mut branches, + rng, + Vec3::new(dx, dy, height - trunk_margin), + Vec3::new(branchendx, branchendy, branch_size + height_dif).normalized(), + 1 + ); + + if rng.gen_range(0, 4) != 2 { + break; + } + } + } Self { branches, From 9d1a03504c1e7b42319fdb58438d170fa0ed4b21 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 4 Jan 2021 00:28:04 +0000 Subject: [PATCH 08/87] Fixed clipping issues, faster generation --- world/src/layer/tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 5359aa1cdd..688e9a7453 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -203,7 +203,7 @@ impl ProceduralTree { let mut branches = Vec::new(); fn add_branches(branches: &mut Vec, rng: &mut impl Rng, start: Vec3, dir: Vec3, depth: usize) { - let branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(-0.3, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` + let branch_dir = (dir + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess let end = start + branch_dir * branch_len; From bbc64b4ead9a1fbb0d7cd3b5cf445e32cdb7693d Mon Sep 17 00:00:00 2001 From: ccgauche Date: Mon, 4 Jan 2021 22:19:43 +0100 Subject: [PATCH 09/87] New generation for trees --- world/src/layer/tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 688e9a7453..5359aa1cdd 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -203,7 +203,7 @@ impl ProceduralTree { let mut branches = Vec::new(); fn add_branches(branches: &mut Vec, rng: &mut impl Rng, start: Vec3, dir: Vec3, depth: usize) { - let branch_dir = (dir + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` + let branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(-0.3, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess let end = start + branch_dir * branch_len; From 37f9fba0234e03db2cea4174ebc3a6936c92b58f Mon Sep 17 00:00:00 2001 From: ccgauche Date: Tue, 5 Jan 2021 16:51:49 +0100 Subject: [PATCH 10/87] Simplified generation and fixed some tree cliping issues --- world/src/layer/tree.rs | 54 +++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 5359aa1cdd..7b11ac0a27 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -202,8 +202,13 @@ impl ProceduralTree { pub fn generate(rng: &mut impl Rng) -> Self { let mut branches = Vec::new(); - fn add_branches(branches: &mut Vec, rng: &mut impl Rng, start: Vec3, dir: Vec3, depth: usize) { - let branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(-0.3, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` + fn add_branches(branches: &mut Vec, start: Vec3, dir: Vec3, depth: usize, rng: &mut impl Rng) { + let mut branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(0.25, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` + + if branch_dir.z < 0. { + branch_dir.z = (branch_dir.z) / 16. + } + let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess let end = start + branch_dir * branch_len; @@ -221,7 +226,7 @@ impl ProceduralTree { if depth < 4 { let sub_branches = if depth == 0 { 3 } else { rng.gen_range(2, 4) }; for _ in 0..sub_branches { - add_branches(branches, rng, end, branch_dir, depth + 1); + add_branches(branches, end, branch_dir, depth + 1, rng); } } } @@ -238,44 +243,25 @@ impl ProceduralTree { }); // Generate branches - let branches_count = rng.gen_range(7, 10); - let angle_division = 360.0 / branches_count as f32; - let angle_padding = rng.gen_range(0, 360) as f32; - - for i in 0..branches_count { - for _ in 0..2 { - let branch_size = height; - - let subdivision = rng.gen_range(1, 2); - - let branch_size = (0..subdivision).fold(branch_size, |x, _| x / 3.0 * 2.0); - - let radians = ((angle_padding - + angle_division * i as f32 - + rng.gen_range(15.0, angle_division - 15.0)) - % 360.0) - .to_radians(); - - let branchendx = dx + branch_size * radians.cos(); - let branchendy = dy + branch_size * radians.sin(); - - let height_dif = rng.gen_range(0.0, branch_size * 2.0); - - let trunk_margin = rng.gen_range(0.0, height / 3.0); + const TEN_DEGREES: f32 = f32::consts::TAU / 36.; + let mut current_angle = 0.; + while current_angle < f32::consts::TAU { + for i in 1..3 { + let current_angle = current_angle + rng.gen_range(-TEN_DEGREES / 2., TEN_DEGREES / 2.); add_branches( &mut branches, - rng, - Vec3::new(dx, dy, height - trunk_margin), - Vec3::new(branchendx, branchendy, branch_size + height_dif).normalized(), - 1 + Vec3::new(dx, dy, height - rng.gen_range(0.0, height / 3.0)), + Vec3::new(current_angle.cos(), current_angle.sin(), rng.gen_range(0.2 * i as f32, 0.7 * i as f32)).normalized(), + 1, + rng ); - if rng.gen_range(0, 4) != 2 { break; } } + current_angle += rng.gen_range(TEN_DEGREES, TEN_DEGREES * 5.); } Self { @@ -313,12 +299,12 @@ impl ProceduralTree { // const MAGIC_U32: u32 = 0x5f375a86; // The Original Magic Number: // const MAGIC_32: u32 = 0x5f3759df; - const threehalfs: f32 = 1.5f32; + const THREEHALFS: f32 = 1.5f32; let x2: f32 = x * 0.5f32; let mut i: u32 = unsafe { std::mem::transmute(x) };// evil floating point bit level hacking i = 0x5f375a86 - (i >> 1); // what the fuck? let y: f32 = unsafe { std::mem::transmute(i) }; - let y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration + let y = y * ( THREEHALFS - ( x2 * y * y ) ); // 1st iteration // let y = y * (threehalfs - (x2 * y * y)); // 2nd iteration, this can be removed y From 454d9d0b7590c86f0146100ac0c98353b5c11374 Mon Sep 17 00:00:00 2001 From: ccgauche Date: Tue, 5 Jan 2021 17:21:15 +0100 Subject: [PATCH 11/87] Quite a lot of optimisations --- world/src/layer/tree.rs | 72 +++++++++++++++++++++++------------------ 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 7b11ac0a27..194002e4ac 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -213,15 +213,11 @@ impl ProceduralTree { let end = start + branch_dir * branch_len; - branches.push(Branch { - line: LineSegment3 { start, end }, - radius: 0.3 + 2.5 / (depth + 1) as f32, - health: if depth == 4 { + branches.push(Branch::new(LineSegment3 { start, end },0.3 + 2.5 / (depth + 1) as f32,if depth == 4 { rng.gen_range(3.0, 5.0) } else { 0.0 - }, - }); + })); if depth < 4 { let sub_branches = if depth == 0 { 3 } else { rng.gen_range(2, 4) }; @@ -236,11 +232,7 @@ impl ProceduralTree { let dy = rng.gen_range(-5, 5) as f32; // Generate the trunk - branches.push(Branch { - line: LineSegment3 { start: Vec3::zero(), end: Vec3::new(dx, dy, height)}, - radius: 3.0, - health: 0.0, - }); + branches.push(Branch::new(LineSegment3 { start: Vec3::zero(), end: Vec3::new(dx, dy, height)},3.0,0.0)); // Generate branches @@ -288,37 +280,53 @@ impl ProceduralTree { } pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { - let mut is_branch = false; - let mut health = 0.0f32; + let mut is_leave = false; for branch in &self.branches { let p_d2 = branch.line.projected_point(pos).distance_squared(pos); - #[allow(unsafe_code)] - fn finvsqrt(x: f32) -> f32 { - // Magic number based on Chris Lomont work: - // const MAGIC_U32: u32 = 0x5f375a86; - // The Original Magic Number: - // const MAGIC_32: u32 = 0x5f3759df; - const THREEHALFS: f32 = 1.5f32; - let x2: f32 = x * 0.5f32; - let mut i: u32 = unsafe { std::mem::transmute(x) };// evil floating point bit level hacking - i = 0x5f375a86 - (i >> 1); // what the fuck? - let y: f32 = unsafe { std::mem::transmute(i) }; - let y = y * ( THREEHALFS - ( x2 * y * y ) ); // 1st iteration - // let y = y * (threehalfs - (x2 * y * y)); // 2nd iteration, this can be removed - - y + if !is_leave { + #[allow(unsafe_code)] + fn finvsqrt(x: f32) -> f32 { + // Magic number based on Chris Lomont work: + // const MAGIC_U32: u32 = 0x5f375a86; + // The Original Magic Number: + // const MAGIC_32: u32 = 0x5f3759df; + const THREEHALFS: f32 = 1.5f32; + let x2: f32 = x * 0.5f32; + let mut i: u32 = unsafe { std::mem::transmute(x) };// evil floating point bit level hacking + i = 0x5f375a86 - (i >> 1); // what the fuck? + let y: f32 = unsafe { std::mem::transmute(i) }; + let y = y * ( THREEHALFS - ( x2 * y * y ) ); // 1st iteration + // let y = y * (threehalfs - (x2 * y * y)); // 2nd iteration, this can be removed + + y + } + if branch.health * finvsqrt(p_d2) > 1.0 { + is_leave = true; + } + } + if p_d2 < branch.squared_radius { + return (true,false); } - - is_branch |= p_d2 < branch.radius.powi(2); - health = health.max(branch.health * finvsqrt(p_d2)); } - (is_branch, health > 1.0) + (false, is_leave) } } struct Branch { line: LineSegment3, radius: f32, + squared_radius: f32, health: f32, } + +impl Branch { + fn new(line: LineSegment3,radius: f32,health: f32) -> Self { + Self { + line, + squared_radius: radius.powi(2), + radius, + health, + } + } +} From 0eaf8492a5b5cda67b0af77323d15c9b23172581 Mon Sep 17 00:00:00 2001 From: ccgauche Date: Tue, 5 Jan 2021 17:50:09 +0100 Subject: [PATCH 12/87] Removed unsafe from finvsqrt --- world/src/layer/tree.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 194002e4ac..fefdf9a8c4 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -287,19 +287,8 @@ impl ProceduralTree { if !is_leave { #[allow(unsafe_code)] fn finvsqrt(x: f32) -> f32 { - // Magic number based on Chris Lomont work: - // const MAGIC_U32: u32 = 0x5f375a86; - // The Original Magic Number: - // const MAGIC_32: u32 = 0x5f3759df; - const THREEHALFS: f32 = 1.5f32; - let x2: f32 = x * 0.5f32; - let mut i: u32 = unsafe { std::mem::transmute(x) };// evil floating point bit level hacking - i = 0x5f375a86 - (i >> 1); // what the fuck? - let y: f32 = unsafe { std::mem::transmute(i) }; - let y = y * ( THREEHALFS - ( x2 * y * y ) ); // 1st iteration - // let y = y * (threehalfs - (x2 * y * y)); // 2nd iteration, this can be removed - - y + let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); + y * (1.5 - ( x * 0.5 * y * y )) } if branch.health * finvsqrt(p_d2) > 1.0 { is_leave = true; From cf91358f403dbf0f6ed2a152c67c8651ae14f12e Mon Sep 17 00:00:00 2001 From: ccgauche Date: Tue, 5 Jan 2021 18:24:14 +0100 Subject: [PATCH 13/87] Fixed canopy problem + Added iteration constant --- world/src/layer/tree.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index fefdf9a8c4..76ac0e46fe 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -202,6 +202,8 @@ impl ProceduralTree { pub fn generate(rng: &mut impl Rng) -> Self { let mut branches = Vec::new(); + const ITERATIONS: usize = 4; + fn add_branches(branches: &mut Vec, start: Vec3, dir: Vec3, depth: usize, rng: &mut impl Rng) { let mut branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(0.25, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` @@ -213,13 +215,13 @@ impl ProceduralTree { let end = start + branch_dir * branch_len; - branches.push(Branch::new(LineSegment3 { start, end },0.3 + 2.5 / (depth + 1) as f32,if depth == 4 { + branches.push(Branch::new(LineSegment3 { start, end },0.3 + 2.5 / (depth + 1) as f32,if depth == ITERATIONS { rng.gen_range(3.0, 5.0) } else { 0.0 })); - if depth < 4 { + if depth < ITERATIONS { let sub_branches = if depth == 0 { 3 } else { rng.gen_range(2, 4) }; for _ in 0..sub_branches { add_branches(branches, end, branch_dir, depth + 1, rng); @@ -256,6 +258,14 @@ impl ProceduralTree { current_angle += rng.gen_range(TEN_DEGREES, TEN_DEGREES * 5.); } + add_branches( + &mut branches, + Vec3::new(dx, dy, height - rng.gen_range(0.0, height / 3.0)), + Vec3::new(rng.gen_range(-0.2, 0.2), rng.gen_range(-0.2, 0.2), 1.).normalized(), + 2, + rng + ); + Self { branches, } @@ -285,7 +295,6 @@ impl ProceduralTree { let p_d2 = branch.line.projected_point(pos).distance_squared(pos); if !is_leave { - #[allow(unsafe_code)] fn finvsqrt(x: f32) -> f32 { let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); y * (1.5 - ( x * 0.5 * y * y )) From 2f68a565d4da816789fcded3d51e7f93411209a8 Mon Sep 17 00:00:00 2001 From: ccgauche Date: Tue, 5 Jan 2021 18:34:22 +0100 Subject: [PATCH 14/87] Fixed branch flattening --- world/src/layer/tree.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 76ac0e46fe..3a2be18920 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -208,7 +208,7 @@ impl ProceduralTree { let mut branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(0.25, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` if branch_dir.z < 0. { - branch_dir.z = (branch_dir.z) / 16. + branch_dir.z = (branch_dir.z) / 16. + 0.2 } let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess From 6f11c4c5c79780b61f40baf83a9d3c94e69e9aed Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 5 Jan 2021 19:04:16 +0000 Subject: [PATCH 15/87] Added tree benchmarks --- world/Cargo.toml | 4 ++++ world/benches/tree.rs | 34 ++++++++++++++++++++++++++++++++++ world/src/layer/tree.rs | 14 +++++++------- 3 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 world/benches/tree.rs diff --git a/world/Cargo.toml b/world/Cargo.toml index a7d447e0b6..4779c10316 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -37,3 +37,7 @@ criterion = "0.3" tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] } minifb = "0.19.1" simple = "0.3" + +[[bench]] +harness = false +name = "tree" diff --git a/world/benches/tree.rs b/world/benches/tree.rs new file mode 100644 index 0000000000..d785e59aca --- /dev/null +++ b/world/benches/tree.rs @@ -0,0 +1,34 @@ +use veloren_world::layer::tree::ProceduralTree; +use criterion::{black_box, criterion_group, criterion_main, Benchmark, Criterion, BatchSize}; + +fn tree(c: &mut Criterion) { + c.bench_function("generate", |b| { + let mut i = 0; + b.iter(|| { + i += 1; + black_box(ProceduralTree::generate(i)); + }); + }); + + c.bench_function("sample", |b| { + let mut i = 0; + b.iter_batched( + || { i += 1; ProceduralTree::generate(i) }, + |tree| { + let bounds = tree.get_bounds(); + for x in (bounds.min.x as i32..bounds.max.x as i32).step_by(3) { + for y in (bounds.min.y as i32..bounds.max.y as i32).step_by(3) { + for z in (bounds.min.z as i32..bounds.max.z as i32).step_by(3) { + let pos = (x as f32, y as f32, z as f32).into(); + black_box(tree.is_branch_or_leaves_at(pos)); + } + } + } + }, + BatchSize::SmallInput, + ); + }); +} + +criterion_group!(benches, tree); +criterion_main!(benches); diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 3a2be18920..229948c3be 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -100,8 +100,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Baobab => *BAOBABS, // ForestKind::Oak => *OAKS, ForestKind::Oak => { - let mut rng = RandomPerm::new(seed); - break 'model TreeModel::Procedural(ProceduralTree::generate(&mut rng)); + break 'model TreeModel::Procedural(ProceduralTree::generate(seed)); }, ForestKind::Pine => *PINES, ForestKind::Birch => *BIRCHES, @@ -194,23 +193,24 @@ pub fn apply_trees_to(canvas: &mut Canvas) { } // TODO: Rename this to `Tree` when the name conflict is gone -struct ProceduralTree { +pub struct ProceduralTree { branches: Vec, } impl ProceduralTree { - pub fn generate(rng: &mut impl Rng) -> Self { + pub fn generate(seed: u32) -> Self { + let mut rng = RandomPerm::new(seed); let mut branches = Vec::new(); const ITERATIONS: usize = 4; fn add_branches(branches: &mut Vec, start: Vec3, dir: Vec3, depth: usize, rng: &mut impl Rng) { let mut branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(0.25, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` - + if branch_dir.z < 0. { branch_dir.z = (branch_dir.z) / 16. + 0.2 } - + let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess let end = start + branch_dir * branch_len; @@ -249,7 +249,7 @@ impl ProceduralTree { Vec3::new(dx, dy, height - rng.gen_range(0.0, height / 3.0)), Vec3::new(current_angle.cos(), current_angle.sin(), rng.gen_range(0.2 * i as f32, 0.7 * i as f32)).normalized(), 1, - rng + &mut rng, ); if rng.gen_range(0, 4) != 2 { break; From 5e7c2317884b9111cbdb28f418f99949c514efca Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 6 Jan 2021 02:19:35 +0000 Subject: [PATCH 16/87] Switched to recursive tree generation and recursive culling algorithm for massive performance wins --- world/benches/tree.rs | 11 +- world/src/layer/tree.rs | 264 +++++++++++++++++++++++----------------- 2 files changed, 162 insertions(+), 113 deletions(-) diff --git a/world/benches/tree.rs b/world/benches/tree.rs index d785e59aca..ba91d76ae5 100644 --- a/world/benches/tree.rs +++ b/world/benches/tree.rs @@ -1,19 +1,22 @@ -use veloren_world::layer::tree::ProceduralTree; -use criterion::{black_box, criterion_group, criterion_main, Benchmark, Criterion, BatchSize}; +use criterion::{black_box, criterion_group, criterion_main, BatchSize, Benchmark, Criterion}; +use veloren_world::layer::tree::{ProceduralTree, TreeConfig}; fn tree(c: &mut Criterion) { c.bench_function("generate", |b| { let mut i = 0; b.iter(|| { i += 1; - black_box(ProceduralTree::generate(i)); + black_box(ProceduralTree::generate(TreeConfig::OAK, i)); }); }); c.bench_function("sample", |b| { let mut i = 0; b.iter_batched( - || { i += 1; ProceduralTree::generate(i) }, + || { + i += 1; + ProceduralTree::generate(TreeConfig::OAK, i) + }, |tree| { let bounds = tree.get_bounds(); for x in (bounds.min.x as i32..bounds.max.x as i32).step_by(3) { diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 229948c3be..000a566d5a 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -12,7 +12,7 @@ use common::{ }; use hashbrown::HashMap; use lazy_static::lazy_static; -use std::f32; +use std::{f32, ops::Range}; use vek::*; use rand::prelude::*; @@ -100,7 +100,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Baobab => *BAOBABS, // ForestKind::Oak => *OAKS, ForestKind::Oak => { - break 'model TreeModel::Procedural(ProceduralTree::generate(seed)); + break 'model TreeModel::Procedural(ProceduralTree::generate(TreeConfig::OAK, seed)); }, ForestKind::Pine => *PINES, ForestKind::Birch => *BIRCHES, @@ -192,139 +192,185 @@ pub fn apply_trees_to(canvas: &mut Canvas) { }); } +/// A type that specifies the generation properties of a tree. +pub struct TreeConfig { + /// Length of trunk, also scales other branches. + pub branch_scale: f32, + /// 0 - 1 (0 = chaotic, 1 = straight). + pub straightness: f32, + /// Maximum number of branch layers (not including trunk). + pub max_depth: usize, + /// The number of branches that form from each branch. + pub splits: usize, + /// The range of proportions along a branch at which a split into another branch might occur. + /// This value is clamped between 0 and 1, but a wider range may bias the results towards branch ends. + pub split_range: Range, +} + +impl TreeConfig { + pub const OAK: Self = Self { + branch_scale: 12.0, + straightness: 0.5, + max_depth: 4, + splits: 3, + split_range: 0.5..1.5, + }; +} + // TODO: Rename this to `Tree` when the name conflict is gone pub struct ProceduralTree { branches: Vec, + trunk_idx: usize, } impl ProceduralTree { - pub fn generate(seed: u32) -> Self { + /// Generate a new tree using the given configuration and seed. + pub fn generate(config: TreeConfig, seed: u32) -> Self { let mut rng = RandomPerm::new(seed); - let mut branches = Vec::new(); - const ITERATIONS: usize = 4; + let mut this = Self { + branches: Vec::new(), + trunk_idx: 0, // Gets replaced later + }; - fn add_branches(branches: &mut Vec, start: Vec3, dir: Vec3, depth: usize, rng: &mut impl Rng) { - let mut branch_dir = (dir + Vec3::::new(rng.gen_range(-1.0, 1.0),rng.gen_range(-1.0, 1.0),rng.gen_range(0.25, 1.0)).cross(dir).normalized() * 0.45 * (depth as f32 + 0.5)).normalized(); // I wish `vek` had a `Vec3::from_fn` - - if branch_dir.z < 0. { - branch_dir.z = (branch_dir.z) / 16. + 0.2 - } - - let branch_len = 12.0 / (depth as f32 * 0.25 + 1.0); // Zipf, I guess - - let end = start + branch_dir * branch_len; - - branches.push(Branch::new(LineSegment3 { start, end },0.3 + 2.5 / (depth + 1) as f32,if depth == ITERATIONS { - rng.gen_range(3.0, 5.0) - } else { - 0.0 - })); - - if depth < ITERATIONS { - let sub_branches = if depth == 0 { 3 } else { rng.gen_range(2, 4) }; - for _ in 0..sub_branches { - add_branches(branches, end, branch_dir, depth + 1, rng); - } - } - } - - let height = rng.gen_range(13, 30) as f32; - let dx = rng.gen_range(-5, 5) as f32; - let dy = rng.gen_range(-5, 5) as f32; - - // Generate the trunk - branches.push(Branch::new(LineSegment3 { start: Vec3::zero(), end: Vec3::new(dx, dy, height)},3.0,0.0)); - - // Generate branches - - const TEN_DEGREES: f32 = f32::consts::TAU / 36.; - - let mut current_angle = 0.; - while current_angle < f32::consts::TAU { - for i in 1..3 { - let current_angle = current_angle + rng.gen_range(-TEN_DEGREES / 2., TEN_DEGREES / 2.); - add_branches( - &mut branches, - Vec3::new(dx, dy, height - rng.gen_range(0.0, height / 3.0)), - Vec3::new(current_angle.cos(), current_angle.sin(), rng.gen_range(0.2 * i as f32, 0.7 * i as f32)).normalized(), - 1, - &mut rng, - ); - if rng.gen_range(0, 4) != 2 { - break; - } - } - current_angle += rng.gen_range(TEN_DEGREES, TEN_DEGREES * 5.); - } - - add_branches( - &mut branches, - Vec3::new(dx, dy, height - rng.gen_range(0.0, height / 3.0)), - Vec3::new(rng.gen_range(-0.2, 0.2), rng.gen_range(-0.2, 0.2), 1.).normalized(), - 2, - rng + // Add the tree trunk (and sub-branches) recursively + let (trunk_idx, _) = this.add_branch( + &config, + // Our trunk starts at the origin... + Vec3::zero(), + // ...and has a roughly upward direction + Vec3::new(rng.gen_range(-1.0, 1.0), rng.gen_range(-1.0, 1.0), 5.0).normalized(), + 0, + None, + &mut rng, ); + this.trunk_idx = trunk_idx; - Self { - branches, - } + this } + // Recursively add a branch (with sub-branches) to the tree's branch graph, returning the index and AABB of the + // branch. This AABB gets propagated down to the parent and is used later during sampling to cull the branches to + // be sampled. + fn add_branch( + &mut self, + config: &TreeConfig, + start: Vec3, + dir: Vec3, + depth: usize, + sibling_idx: Option, + rng: &mut impl Rng, + ) -> (usize, Aabb) { + let len = config.branch_scale / (depth as f32 * 0.25 + 1.0); // Zipf, I guess + let end = start + dir * len; + let line = LineSegment3 { start, end }; + let wood_radius = 0.3 + 2.5 / (depth + 1) as f32; + let leaf_radius = if depth == config.max_depth { rng.gen_range(3.0, 5.0) } else { 0.0 }; + + // The AABB that covers this branch, along with wood and leaves that eminate from it + let mut aabb = Aabb { + min: Vec3::partial_min(start, end) - wood_radius.max(leaf_radius), + max: Vec3::partial_max(start, end) + wood_radius.max(leaf_radius), + }; + + let mut child_idx = None; + // Don't add child branches if we're already enough layers into the tree + if depth < config.max_depth { + for _ in 0..config.splits { + // Choose a point close to the branch to act as the target direction for the branch to grow in + let tgt = Lerp::lerp( + start, + end, + rng.gen_range(config.split_range.start, config.split_range.end).clamped(0.0, 1.0), + ) + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)); + // Start the branch at the closest point to the target + let branch_start = line.projected_point(tgt); + // Now, interpolate between the target direction and the parent branch's direction to find a direction + let branch_dir = Lerp::lerp(tgt - branch_start, dir, config.straightness).normalized(); + + let (branch_idx, branch_aabb) = self.add_branch(config, branch_start, branch_dir, depth + 1, child_idx, rng); + child_idx = Some(branch_idx); + // Parent branches AABBs include the AABBs of child branches to allow for culling during sampling + aabb.expand_to_contain(branch_aabb); + } + } + + let idx = self.branches.len(); // Compute the index that this branch is going to have + self.branches.push(Branch { + line, + wood_radius, + leaf_radius, + aabb, + sibling_idx, + child_idx, + }); + + (idx, aabb) + } + + /// Get the bounding box that covers the tree (all branches and leaves) pub fn get_bounds(&self) -> Aabb { - let bounds = self.branches - .iter() - .fold(Aabb::default(), |Aabb { min, max }, branch| Aabb { - min: Vec3::partial_min(min, Vec3::partial_min(branch.line.start, branch.line.end) - branch.radius - 8.0), - max: Vec3::partial_max(max, Vec3::partial_max(branch.line.start, branch.line.end) + branch.radius + 8.0), - }); - - self.branches - .iter() - .for_each(|branch| { - assert!(bounds.contains_point(branch.line.start)); - assert!(bounds.contains_point(branch.line.end)); - }); - - bounds + self.branches[self.trunk_idx].aabb } - pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { - let mut is_leave = false; - for branch in &self.branches { - let p_d2 = branch.line.projected_point(pos).distance_squared(pos); + // Recursively search for branches or leaves by walking the tree's branch graph. + fn is_branch_or_leaves_at_inner(&self, pos: Vec3, branch_idx: usize) -> (bool, bool) { + let branch = &self.branches[branch_idx]; + // Always probe the sibling branch, since our AABB doesn't include its bounds (it's not one of our children) + let branch_or_leaves = branch.sibling_idx + .map(|idx| Vec2::from(self.is_branch_or_leaves_at_inner(pos, idx))) + .unwrap_or_default(); - if !is_leave { - fn finvsqrt(x: f32) -> f32 { - let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); - y * (1.5 - ( x * 0.5 * y * y )) - } - if branch.health * finvsqrt(p_d2) > 1.0 { - is_leave = true; - } - } - if p_d2 < branch.squared_radius { - return (true,false); - } + // Only continue probing this sub-graph of the tree if the sample position falls within its AABB + if branch.aabb.contains_point(pos) { + (branch_or_leaves + // Probe this branch + | Vec2::from(branch.is_branch_or_leaves_at(pos)) + // Probe the children of this branch + | branch.child_idx + .map(|idx| Vec2::from(self.is_branch_or_leaves_at_inner(pos, idx))) + .unwrap_or_default()) + .into_tuple() + } else { + branch_or_leaves.into_tuple() } - (false, is_leave) + } + + /// Determine whether there are either branches or leaves at the given position in the tree. + #[inline(always)] + pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { + self.is_branch_or_leaves_at_inner(pos, self.trunk_idx) } } +// Branches are arranged in a graph shape. Each branch points to both its first child (if any) and also to the next +// branch in the list of child branches associated with the parent. This means that the entire tree is laid out in a +// walkable graph where each branch refers only to two other branches. As a result, walking the tree is simply a case +// of performing double recursion. struct Branch { line: LineSegment3, - radius: f32, - squared_radius: f32, - health: f32, + wood_radius: f32, + leaf_radius: f32, + aabb: Aabb, + + sibling_idx: Option, + child_idx: Option, } impl Branch { - fn new(line: LineSegment3,radius: f32,health: f32) -> Self { - Self { - line, - squared_radius: radius.powi(2), - radius, - health, + /// Determine whether there are either branches or leaves at the given position in the branch. + pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { + // fn finvsqrt(x: f32) -> f32 { + // let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); + // y * (1.5 - ( x * 0.5 * y * y )) + // } + + let p_d2 = self.line.projected_point(pos).distance_squared(pos); + + if p_d2 < self.wood_radius.powi(2) { + (true, false) + } else { + (false, p_d2 < self.leaf_radius.powi(2)) } } } From 24773afe76bda3fb49989d9c9a70cdff3dc6867f Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 6 Jan 2021 12:59:16 +0000 Subject: [PATCH 17/87] Better parameterisation of trees --- world/src/layer/tree.rs | 33 +++++++++++++++++++++++++++------ world/src/util/random.rs | 4 +--- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 000a566d5a..4dd5670b53 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -195,7 +195,13 @@ pub fn apply_trees_to(canvas: &mut Canvas) { /// A type that specifies the generation properties of a tree. pub struct TreeConfig { /// Length of trunk, also scales other branches. - pub branch_scale: f32, + pub trunk_len: f32, + /// Radius of trunk, also scales other branches. + pub trunk_radius: f32, + // The scale that child branch lengths should be compared to their parents + pub branch_child_len: f32, + // The scale that child branch radii should be compared to their parents + pub branch_child_radius: f32, /// 0 - 1 (0 = chaotic, 1 = straight). pub straightness: f32, /// Maximum number of branch layers (not including trunk). @@ -209,7 +215,10 @@ pub struct TreeConfig { impl TreeConfig { pub const OAK: Self = Self { - branch_scale: 12.0, + trunk_len: 12.0, + trunk_radius: 3.0, + branch_child_len: 0.8, + branch_child_radius: 0.6, straightness: 0.5, max_depth: 4, splits: 3, @@ -240,6 +249,8 @@ impl ProceduralTree { Vec3::zero(), // ...and has a roughly upward direction Vec3::new(rng.gen_range(-1.0, 1.0), rng.gen_range(-1.0, 1.0), 5.0).normalized(), + config.trunk_len, + config.trunk_radius, 0, None, &mut rng, @@ -257,14 +268,15 @@ impl ProceduralTree { config: &TreeConfig, start: Vec3, dir: Vec3, + branch_len: f32, + branch_radius: f32, depth: usize, sibling_idx: Option, rng: &mut impl Rng, ) -> (usize, Aabb) { - let len = config.branch_scale / (depth as f32 * 0.25 + 1.0); // Zipf, I guess - let end = start + dir * len; + let end = start + dir * branch_len; let line = LineSegment3 { start, end }; - let wood_radius = 0.3 + 2.5 / (depth + 1) as f32; + let wood_radius = branch_radius; let leaf_radius = if depth == config.max_depth { rng.gen_range(3.0, 5.0) } else { 0.0 }; // The AABB that covers this branch, along with wood and leaves that eminate from it @@ -288,7 +300,16 @@ impl ProceduralTree { // Now, interpolate between the target direction and the parent branch's direction to find a direction let branch_dir = Lerp::lerp(tgt - branch_start, dir, config.straightness).normalized(); - let (branch_idx, branch_aabb) = self.add_branch(config, branch_start, branch_dir, depth + 1, child_idx, rng); + let (branch_idx, branch_aabb) = self.add_branch( + config, + branch_start, + branch_dir, + branch_len * config.branch_child_len, + branch_radius * config.branch_child_radius, + depth + 1, + child_idx, + rng, + ); child_idx = Some(branch_idx); // Parent branches AABBs include the AABBs of child branches to allow for culling during sampling aabb.expand_to_contain(branch_aabb); diff --git a/world/src/util/random.rs b/world/src/util/random.rs index c82f8f79b6..2e85f2f978 100644 --- a/world/src/util/random.rs +++ b/world/src/util/random.rs @@ -64,9 +64,7 @@ impl Sampler<'static> for RandomPerm { // `RandomPerm` is not high-quality but it is at least fast and deterministic. impl RngCore for RandomPerm { fn next_u32(&mut self) -> u32 { - self.seed = self.get(self.seed) ^ 0xA7537839; - self.seed = self.get(self.seed) ^ 0x12314112; - self.seed = self.get(self.seed) ^ 0x78892832; + self.seed = self.get(self.seed) ^ 0xA7535839; self.seed } From 953d8841b484fd0778af3e878918ae7c16ec50bc Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 6 Jan 2021 14:51:01 +0000 Subject: [PATCH 18/87] Procedural pines (first attempt), more tree parameters --- world/src/layer/tree.rs | 60 ++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 4dd5670b53..d501dd44f3 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -41,7 +41,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { // TODO: Get rid of this enum TreeModel { Structure(Structure), - Procedural(ProceduralTree), + Procedural(ProceduralTree, StructureBlock), } struct Tree { @@ -99,10 +99,15 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Acacia => *ACACIAS, ForestKind::Baobab => *BAOBABS, // ForestKind::Oak => *OAKS, - ForestKind::Oak => { - break 'model TreeModel::Procedural(ProceduralTree::generate(TreeConfig::OAK, seed)); - }, - ForestKind::Pine => *PINES, + ForestKind::Oak => break 'model TreeModel::Procedural( + ProceduralTree::generate(TreeConfig::OAK, seed), + StructureBlock::TemperateLeaves, + ), + //ForestKind::Pine => *PINES, + ForestKind::Pine => break 'model TreeModel::Procedural( + ProceduralTree::generate(TreeConfig::PINE, seed), + StructureBlock::PineLeaves, + ), ForestKind::Birch => *BIRCHES, ForestKind::Mangrove => *MANGROVE_TREES, ForestKind::Swamp => *SWAMP_TREES, @@ -124,7 +129,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { let bounds = match &tree.model { TreeModel::Structure(s) => s.get_bounds(), - TreeModel::Procedural(t) => t.get_bounds().map(|e| e as i32), + TreeModel::Procedural(t, _) => t.get_bounds().map(|e| e as i32), }; let rpos2d = (wpos2d - tree.pos.xy()) @@ -153,9 +158,9 @@ pub fn apply_trees_to(canvas: &mut Canvas) { info.index(), if let Some(block) = match &tree.model { TreeModel::Structure(s) => s.get(model_pos).ok().copied(), - TreeModel::Procedural(t) => Some(match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { + TreeModel::Procedural(t, leaf_block) => Some(match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { (true, _) => StructureBlock::Normal(Rgb::new(60, 30, 0)), - (_, true) => StructureBlock::TemperateLeaves, + (_, true) => *leaf_block, (_, _) => StructureBlock::None, }), } { @@ -198,10 +203,12 @@ pub struct TreeConfig { pub trunk_len: f32, /// Radius of trunk, also scales other branches. pub trunk_radius: f32, - // The scale that child branch lengths should be compared to their parents + // The scale that child branch lengths should be compared to their parents. pub branch_child_len: f32, - // The scale that child branch radii should be compared to their parents + // The scale that child branch radii should be compared to their parents. pub branch_child_radius: f32, + /// The range of radii that leaf-emitting branches might have. + pub leaf_radius: Range, /// 0 - 1 (0 = chaotic, 1 = straight). pub straightness: f32, /// Maximum number of branch layers (not including trunk). @@ -211,6 +218,11 @@ pub struct TreeConfig { /// The range of proportions along a branch at which a split into another branch might occur. /// This value is clamped between 0 and 1, but a wider range may bias the results towards branch ends. pub split_range: Range, + /// The bias applied to the length of branches based on the proportion along their parent that they eminate from. + /// -1.0 = negative bias (branches at ends are longer, branches at the start are shorter) + /// 0.0 = no bias (branches do not change their length with regard to parent branch proportion) + /// 1.0 = positive bias (branches at ends are shorter, branches at the start are longer) + pub branch_len_bias: f32, } impl TreeConfig { @@ -219,10 +231,25 @@ impl TreeConfig { trunk_radius: 3.0, branch_child_len: 0.8, branch_child_radius: 0.6, + leaf_radius: 3.0..5.0, straightness: 0.5, max_depth: 4, splits: 3, split_range: 0.5..1.5, + branch_len_bias: 0.0, + }; + + pub const PINE: Self = Self { + trunk_len: 32.0, + trunk_radius: 1.5, + branch_child_len: 0.3, + branch_child_radius: 0.0, + leaf_radius: 1.0..1.25, + straightness: 0.0, + max_depth: 1, + splits: 128, + split_range: 0.2..1.1, + branch_len_bias: 0.8, }; } @@ -277,7 +304,11 @@ impl ProceduralTree { let end = start + dir * branch_len; let line = LineSegment3 { start, end }; let wood_radius = branch_radius; - let leaf_radius = if depth == config.max_depth { rng.gen_range(3.0, 5.0) } else { 0.0 }; + let leaf_radius = if depth == config.max_depth { + rng.gen_range(config.leaf_radius.start, config.leaf_radius.end) + } else { + 0.0 + }; // The AABB that covers this branch, along with wood and leaves that eminate from it let mut aabb = Aabb { @@ -290,10 +321,11 @@ impl ProceduralTree { if depth < config.max_depth { for _ in 0..config.splits { // Choose a point close to the branch to act as the target direction for the branch to grow in + let split_factor = rng.gen_range(config.split_range.start, config.split_range.end).clamped(0.0, 1.0); let tgt = Lerp::lerp( start, end, - rng.gen_range(config.split_range.start, config.split_range.end).clamped(0.0, 1.0), + split_factor, ) + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)); // Start the branch at the closest point to the target let branch_start = line.projected_point(tgt); @@ -304,7 +336,9 @@ impl ProceduralTree { config, branch_start, branch_dir, - branch_len * config.branch_child_len, + branch_len + * config.branch_child_len + * (1.0 - (split_factor - 0.5) * 2.0 * config.branch_len_bias.clamped(-1.0, 1.0)), branch_radius * config.branch_child_radius, depth + 1, child_idx, From 3766a77de12383469bfa5dec69c2cb431b47b231 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 6 Jan 2021 18:51:02 +0000 Subject: [PATCH 19/87] Better tree parameterisation, improved pines --- world/src/layer/tree.rs | 46 ++++++++++++++++++++++++++++++++--------- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index d501dd44f3..71e13880d8 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -223,6 +223,10 @@ pub struct TreeConfig { /// 0.0 = no bias (branches do not change their length with regard to parent branch proportion) /// 1.0 = positive bias (branches at ends are shorter, branches at the start are longer) pub branch_len_bias: f32, + /// The scale of leaves in the vertical plane. Less than 1.0 implies a flattening of the leaves. + pub leaf_vertical_scale: f32, + /// How evenly spaced (vs random) sub-branches are along their parent. + pub proportionality: f32, } impl TreeConfig { @@ -237,6 +241,8 @@ impl TreeConfig { splits: 3, split_range: 0.5..1.5, branch_len_bias: 0.0, + leaf_vertical_scale: 1.0, + proportionality: 0.0, }; pub const PINE: Self = Self { @@ -244,12 +250,14 @@ impl TreeConfig { trunk_radius: 1.5, branch_child_len: 0.3, branch_child_radius: 0.0, - leaf_radius: 1.0..1.25, + leaf_radius: 2.0..2.5, straightness: 0.0, max_depth: 1, - splits: 128, - split_range: 0.2..1.1, - branch_len_bias: 0.8, + splits: 56, + split_range: 0.2..1.2, + branch_len_bias: 0.75, + leaf_vertical_scale: 0.3, + proportionality: 1.0, }; } @@ -319,14 +327,27 @@ impl ProceduralTree { let mut child_idx = None; // Don't add child branches if we're already enough layers into the tree if depth < config.max_depth { - for _ in 0..config.splits { + let x_axis = dir.cross(Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0))).normalized(); + let y_axis = dir.cross(x_axis).normalized(); + let screw_shift = rng.gen_range(0.0, f32::consts::TAU); + + for i in 0..config.splits { + let dist = Lerp::lerp(i as f32 / (config.splits - 1) as f32, rng.gen_range(0.0, 1.0), config.proportionality); + + const PHI: f32 = 0.618; + const RAD_PER_BRANCH: f32 = f32::consts::TAU * PHI; + let screw = + (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).sin() * x_axis + + (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).cos() * y_axis; + // Choose a point close to the branch to act as the target direction for the branch to grow in - let split_factor = rng.gen_range(config.split_range.start, config.split_range.end).clamped(0.0, 1.0); - let tgt = Lerp::lerp( + // let split_factor = rng.gen_range(config.split_range.start, config.split_range.end).clamped(0.0, 1.0); + let split_factor = Lerp::lerp(config.split_range.start, config.split_range.end, dist); + let tgt = Lerp::lerp_unclamped( start, end, split_factor, - ) + Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)); + ) + Lerp::lerp(Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)), screw, config.proportionality); // Start the branch at the closest point to the target let branch_start = line.projected_point(tgt); // Now, interpolate between the target direction and the parent branch's direction to find a direction @@ -355,6 +376,7 @@ impl ProceduralTree { line, wood_radius, leaf_radius, + leaf_vertical_scale: config.leaf_vertical_scale, aabb, sibling_idx, child_idx, @@ -406,6 +428,7 @@ struct Branch { line: LineSegment3, wood_radius: f32, leaf_radius: f32, + leaf_vertical_scale: f32, aabb: Aabb, sibling_idx: Option, @@ -420,12 +443,15 @@ impl Branch { // y * (1.5 - ( x * 0.5 * y * y )) // } - let p_d2 = self.line.projected_point(pos).distance_squared(pos); + let p = self.line.projected_point(pos); + let p_d2 = p.distance_squared(pos); if p_d2 < self.wood_radius.powi(2) { (true, false) } else { - (false, p_d2 < self.leaf_radius.powi(2)) + let diff = (p - pos) / Vec3::new(1.0, 1.0, self.leaf_vertical_scale); + + (false, diff.magnitude_squared() < self.leaf_radius.powi(2)) } } } From 9cf13ac3b2602680935de043625ce156ae4b2d59 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 6 Jan 2021 20:57:33 +0000 Subject: [PATCH 20/87] Simple coral --- common/src/terrain/block.rs | 10 +++++ world/src/layer/mod.rs | 78 +++++++++++++++++++++++++++++++++++- world/src/lib.rs | 1 + world/src/util/fast_noise.rs | 65 ++++++++++++++++++++++++++++++ world/src/util/mod.rs | 2 +- 5 files changed, 153 insertions(+), 3 deletions(-) diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 5da34b509f..7c7a4e0168 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -193,6 +193,16 @@ impl Block { } } + #[inline] + pub fn get_max_sunlight(&self) -> Option { + match self.kind() { + BlockKind::Water => Some(2), + BlockKind::Leaves => Some(4), + _ if self.is_opaque() => Some(0), + _ => None, + } + } + #[inline] pub fn is_solid(&self) -> bool { self.get_sprite() diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index 486fe3bd9a..c0b0f42a64 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -6,7 +6,7 @@ pub use self::{scatter::apply_scatter_to, tree::apply_trees_to}; use crate::{ column::ColumnSample, - util::{RandomField, Sampler}, + util::{FastNoise, FastNoise2d, RandomField, Sampler}, Canvas, IndexRef, }; use common::{ @@ -22,7 +22,7 @@ use rand::prelude::*; use serde::Deserialize; use std::{ f32, - ops::{Mul, Sub}, + ops::{Mul, Range, Sub}, }; use vek::*; @@ -302,3 +302,77 @@ pub fn apply_caves_supplement<'a>( } } } + +pub fn apply_coral_to(canvas: &mut Canvas) { + let info = canvas.info(); + + if !info.chunk.river.near_water() { + return; // Don't bother with coral for a chunk nowhere near water + } + + canvas.foreach_col(|canvas, wpos2d, col| { + const CORAL_DEPTH: Range = 14.0..32.0; + const CORAL_HEIGHT: f32 = 14.0; + const CORAL_DEPTH_FADEOUT: f32 = 5.0; + const CORAL_SCALE: f32 = 10.0; + + let water_depth = col.water_level - col.alt; + + if !CORAL_DEPTH.contains(&water_depth) { + return; // Avoid coral entirely for this column if we're outside coral depths + } + + for z in col.alt.floor() as i32..(col.alt + CORAL_HEIGHT) as i32 { + let wpos = Vec3::new(wpos2d.x, wpos2d.y, z); + + let coral_factor = Lerp::lerp( + 1.0, + 0.0, + // Fade coral out due to incorrect depth + ((water_depth.clamped(CORAL_DEPTH.start, CORAL_DEPTH.end) - water_depth).abs() + / CORAL_DEPTH_FADEOUT) + .min(1.0), + ) * Lerp::lerp( + 1.0, + 0.0, + // Fade coral out due to incorrect altitude above the seabed + ((z as f32 - col.alt) / CORAL_HEIGHT).powi(2), + ) * FastNoise::new(info.index.seed + 7) + .get(wpos.map(|e| e as f64) / 32.0) + .sub(0.2) + .mul(100.0) + .clamped(0.0, 1.0); + + let nz = Vec3::iota().map(|e: u32| FastNoise::new(info.index.seed + e * 177)); + + let wpos_warped = wpos.map(|e| e as f32) + + nz.map(|nz| { + nz.get(wpos.map(|e| e as f64) / CORAL_SCALE as f64) * CORAL_SCALE * 0.3 + }); + + // let is_coral = FastNoise2d::new(info.index.seed + 17) + // .get(wpos_warped.xy().map(|e| e as f64) / CORAL_SCALE) + // .sub(1.0 - coral_factor) + // .max(0.0) + // .div(coral_factor) > 0.5; + + let is_coral = [ + FastNoise::new(info.index.seed), + FastNoise::new(info.index.seed + 177), + ] + .iter() + .all(|nz| { + nz.get(wpos_warped.map(|e| e as f64) / CORAL_SCALE as f64) + .abs() + < coral_factor * 0.3 + }); + + if is_coral { + let _ = canvas.set( + wpos, + Block::new(BlockKind::WeakRock, Rgb::new(170, 220, 210)), + ); + } + } + }); +} diff --git a/world/src/lib.rs b/world/src/lib.rs index b5ca5fad03..73dc97b95a 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -290,6 +290,7 @@ impl World { layer::apply_scatter_to(&mut canvas, &mut dynamic_rng); layer::apply_caves_to(&mut canvas, &mut dynamic_rng); layer::apply_paths_to(&mut canvas); + layer::apply_coral_to(&mut canvas); // Apply site generation sim_chunk.sites.iter().for_each(|site| { diff --git a/world/src/util/fast_noise.rs b/world/src/util/fast_noise.rs index 8caa007639..84ac0dc87a 100644 --- a/world/src/util/fast_noise.rs +++ b/world/src/util/fast_noise.rs @@ -24,6 +24,30 @@ impl Sampler<'static> for FastNoise { type Sample = f32; fn get(&self, pos: Self::Index) -> Self::Sample { + // let align_pos = pos.map(|e| e.floor()); + // let near_pos = align_pos.map(|e| e as i32); + + // let v000 = self.noise_at(near_pos + Vec3::new(0, 0, 0)); + // let v100 = self.noise_at(near_pos + Vec3::new(1, 0, 0)); + // let v010 = self.noise_at(near_pos + Vec3::new(0, 1, 0)); + // let v110 = self.noise_at(near_pos + Vec3::new(1, 1, 0)); + // let v001 = self.noise_at(near_pos + Vec3::new(0, 0, 1)); + // let v101 = self.noise_at(near_pos + Vec3::new(1, 0, 1)); + // let v011 = self.noise_at(near_pos + Vec3::new(0, 1, 1)); + // let v111 = self.noise_at(near_pos + Vec3::new(1, 1, 1)); + + // let factor = (pos - align_pos).map(|e| e as f32); + + // let v00 = v000 + factor.z * (v001 - v000); + // let v10 = v010 + factor.z * (v011 - v010); + // let v01 = v100 + factor.z * (v101 - v100); + // let v11 = v110 + factor.z * (v111 - v110); + + // let v0 = v00 + factor.y * (v01 - v00); + // let v1 = v10 + factor.y * (v11 - v10); + + // (v0 + factor.x * (v1 - v0)) * 2.0 - 1.0 + let near_pos = pos.map(|e| e.floor() as i32); let v000 = self.noise_at(near_pos + Vec3::new(0, 0, 0)); @@ -51,3 +75,44 @@ impl Sampler<'static> for FastNoise { (y0 + factor.z * (y1 - y0)) * 2.0 - 1.0 } } + +pub struct FastNoise2d { + noise: RandomField, +} + +impl FastNoise2d { + pub const fn new(seed: u32) -> Self { + Self { + noise: RandomField::new(seed), + } + } + + #[allow(clippy::excessive_precision)] // TODO: Pending review in #587 + fn noise_at(&self, pos: Vec2) -> f32 { + (self.noise.get(Vec3::new(pos.x, pos.y, 0)) & 4095) as f32 * 0.000244140625 + } +} + +impl Sampler<'static> for FastNoise2d { + type Index = Vec2; + type Sample = f32; + + fn get(&self, pos: Self::Index) -> Self::Sample { + let near_pos = pos.map(|e| e.floor() as i32); + + let v00 = self.noise_at(near_pos + Vec2::new(0, 0)); + let v10 = self.noise_at(near_pos + Vec2::new(1, 0)); + let v01 = self.noise_at(near_pos + Vec2::new(0, 1)); + let v11 = self.noise_at(near_pos + Vec2::new(1, 1)); + + let factor = pos.map(|e| { + let f = e.fract().add(1.0).fract() as f32; + f.powi(2) * (3.0 - 2.0 * f) + }); + + let v0 = v00 + factor.y * (v10 - v00); + let v1 = v01 + factor.y * (v11 - v01); + + (v0 + factor.x * (v1 - v0)) * 2.0 - 1.0 + } +} diff --git a/world/src/util/mod.rs b/world/src/util/mod.rs index 8d20dc2216..a04a8d2bb3 100644 --- a/world/src/util/mod.rs +++ b/world/src/util/mod.rs @@ -9,7 +9,7 @@ pub mod unit_chooser; // Reexports pub use self::{ - fast_noise::FastNoise, + fast_noise::{FastNoise, FastNoise2d}, map_vec::MapVec, random::{RandomField, RandomPerm}, sampler::{Sampler, SamplerMut}, From 68b0aa5c5075f4252e929e301ddb38b2f65d66e4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 31 Jan 2021 14:09:50 +0000 Subject: [PATCH 21/87] sync --- common/src/terrain/structure.rs | 3 --- world/src/layer/mod.rs | 2 +- world/src/layer/tree.rs | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/common/src/terrain/structure.rs b/common/src/terrain/structure.rs index bde3411439..4a9867474a 100644 --- a/common/src/terrain/structure.rs +++ b/common/src/terrain/structure.rs @@ -46,7 +46,6 @@ pub struct Structure { struct BaseStructure { vol: Dyna, - empty: StructureBlock, default_kind: BlockKind, } @@ -167,13 +166,11 @@ impl assets::Compound for BaseStructure { Ok(BaseStructure { vol, - empty: StructureBlock::None, default_kind: BlockKind::Misc, }) } else { Ok(BaseStructure { vol: Dyna::filled(Vec3::zero(), StructureBlock::None, ()), - empty: StructureBlock::None, default_kind: BlockKind::Misc, }) } diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index c0b0f42a64..b5c8a603ba 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -6,7 +6,7 @@ pub use self::{scatter::apply_scatter_to, tree::apply_trees_to}; use crate::{ column::ColumnSample, - util::{FastNoise, FastNoise2d, RandomField, Sampler}, + util::{FastNoise, RandomField, Sampler}, Canvas, IndexRef, }; use common::{ diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 71e13880d8..d130cbf8a4 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -283,7 +283,7 @@ impl ProceduralTree { // Our trunk starts at the origin... Vec3::zero(), // ...and has a roughly upward direction - Vec3::new(rng.gen_range(-1.0, 1.0), rng.gen_range(-1.0, 1.0), 5.0).normalized(), + Vec3::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0), 5.0).normalized(), config.trunk_len, config.trunk_radius, 0, @@ -313,7 +313,7 @@ impl ProceduralTree { let line = LineSegment3 { start, end }; let wood_radius = branch_radius; let leaf_radius = if depth == config.max_depth { - rng.gen_range(config.leaf_radius.start, config.leaf_radius.end) + rng.gen_range(config.leaf_radius.clone()) } else { 0.0 }; @@ -327,12 +327,12 @@ impl ProceduralTree { let mut child_idx = None; // Don't add child branches if we're already enough layers into the tree if depth < config.max_depth { - let x_axis = dir.cross(Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0))).normalized(); + let x_axis = dir.cross(Vec3::::zero().map(|_| rng.gen_range(-1.0..1.0))).normalized(); let y_axis = dir.cross(x_axis).normalized(); - let screw_shift = rng.gen_range(0.0, f32::consts::TAU); + let screw_shift = rng.gen_range(0.0..f32::consts::TAU); for i in 0..config.splits { - let dist = Lerp::lerp(i as f32 / (config.splits - 1) as f32, rng.gen_range(0.0, 1.0), config.proportionality); + let dist = Lerp::lerp(i as f32 / (config.splits - 1) as f32, rng.gen_range(0.0..1.0), config.proportionality); const PHI: f32 = 0.618; const RAD_PER_BRANCH: f32 = f32::consts::TAU * PHI; @@ -347,7 +347,7 @@ impl ProceduralTree { start, end, split_factor, - ) + Lerp::lerp(Vec3::::zero().map(|_| rng.gen_range(-1.0, 1.0)), screw, config.proportionality); + ) + Lerp::lerp(Vec3::::zero().map(|_| rng.gen_range(-1.0..1.0)), screw, config.proportionality); // Start the branch at the closest point to the target let branch_start = line.projected_point(tgt); // Now, interpolate between the target direction and the parent branch's direction to find a direction From 81206d5e1333ae2a305b6e17f6ba522ea835be45 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 4 Feb 2021 12:47:46 +0000 Subject: [PATCH 22/87] New site work --- world/Cargo.toml | 3 ++- world/examples/site.rs | 27 ++++++++++++++++++++++- world/src/site2/mod.rs | 47 ++++++++++++++++++++++++++++++++++++++--- world/src/site2/plot.rs | 17 +++++++++++---- world/src/site2/tile.rs | 33 +++++++++++++++++++++++------ 5 files changed, 111 insertions(+), 16 deletions(-) diff --git a/world/Cargo.toml b/world/Cargo.toml index 4779c10316..97e6f70d41 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -36,7 +36,8 @@ ron = { version = "0.6", default-features = false } criterion = "0.3" tracing-subscriber = { version = "0.2.3", default-features = false, features = ["fmt", "chrono", "ansi", "smallvec"] } minifb = "0.19.1" -simple = "0.3" +svg_fmt = "0.4" +structopt = "0.3" [[bench]] harness = false diff --git a/world/examples/site.rs b/world/examples/site.rs index c89b901b25..05c01a34c9 100644 --- a/world/examples/site.rs +++ b/world/examples/site.rs @@ -1,3 +1,28 @@ +use structopt::StructOpt; +use svg_fmt::*; +use veloren_world::site2::test_site; + fn main() { - todo!(); + let site = test_site(); + let size = site.bounds().size(); + println!("{}", BeginSvg { w: size.w as f32, h: size.h as f32 }); + + for plot in site.plots() { + let bounds = plot.find_bounds(); + println!("{}", Rectangle { + x: bounds.min.x as f32, + y: bounds.min.y as f32, + w: bounds.size().w as f32, + h: bounds.size().h as f32, + style: Style { + fill: Fill::Color(Color { r: 50, g: 50, b: 50 }), + stroke: Stroke::Color(Color { r: 0, g: 0, b: 0 }, 1.0), + opacity: 1.0, + stroke_opacity: 1.0, + }, + border_radius: 0.0, + }); + } + + println!("{}", EndSvg); } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 9bf80a75b3..e580fdfc9f 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -6,10 +6,51 @@ use common::store::{Store, Id}; use crate::util::Grid; use self::{ tile::TileGrid, - plot::Plot, + plot::{Plot, PlotKind}, }; +use rand::prelude::*; +#[derive(Default)] pub struct Site { - grid: TileGrid, - plot: Store, + tiles: TileGrid, + plots: Store, +} + +impl Site { + pub fn bounds(&self) -> Aabr { + let radius = tile::MAX_BLOCK_RADIUS; + Aabr { + min: -Vec2::broadcast(radius as i32), + max: Vec2::broadcast(radius as i32), + } + } + + pub fn plots(&self) -> impl Iterator + '_ { + self.plots.values() + } + + pub fn create_plot(&mut self, plot: Plot) -> Id { + self.plots.insert(plot) + } + + pub fn generate(rng: &mut impl Rng) -> Self { + let mut site = Site::default(); + + for i in 0..10 { + let dir = Vec2::::zero().map(|_| rng.gen_range(-1.0..1.0)).normalized(); + let search_pos = (dir * 32.0).map(|e| e as i32); + + site.tiles + .find_near(search_pos, |tile| tile.is_empty()) + .map(|center| { + // TODO + }); + } + + site + } +} + +pub fn test_site() -> Site { + Site::generate(&mut thread_rng()) } diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index 9c2b8c658e..5b8627c25d 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -1,12 +1,21 @@ use vek::*; +use crate::util::DHashSet; pub struct Plot { kind: PlotKind, - center_tpos: Vec2, - units: Vec2>, + root_tile: Vec2, + tiles: DHashSet>, +} + +impl Plot { + pub fn find_bounds(&self) -> Aabr { + self.tiles + .iter() + .fold(Aabr::new_empty(self.root_tile), |b, t| b.expanded_to_contain_point(*t)) + } } pub enum PlotKind { - Path, - House { height: i32 }, + Field, + House, } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index b4006c436b..4d7fa35f00 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -1,22 +1,24 @@ use super::*; -const TILE_SIZE: u32 = 7; -const ZONE_SIZE: u32 = 16; -const ZONE_RADIUS: u32 = 16; -const TILE_RADIUS: u32 = ZONE_SIZE * ZONE_RADIUS; -const MAX_BLOCK_RADIUS: u32 = TILE_SIZE * TILE_RADIUS; +pub const TILE_SIZE: u32 = 7; +pub const ZONE_SIZE: u32 = 16; +pub const ZONE_RADIUS: u32 = 16; +pub const TILE_RADIUS: u32 = ZONE_SIZE * ZONE_RADIUS; +pub const MAX_BLOCK_RADIUS: u32 = TILE_SIZE * TILE_RADIUS; pub struct TileGrid { zones: Grid>>>, } -impl TileGrid { - pub fn new() -> Self { +impl Default for TileGrid { + fn default() -> Self { Self { zones: Grid::populate_from(Vec2::broadcast(ZONE_RADIUS as i32 * 2 + 1), |_| None), } } +} +impl TileGrid { pub fn get(&self, tpos: Vec2) -> Option<&Tile> { let tpos = tpos + TILE_RADIUS as i32; self.zones @@ -34,16 +36,33 @@ impl TileGrid { .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) .map(|tile| tile.get_or_insert_with(|| Tile::empty()))) } + + pub fn find_near(&self, tpos: Vec2, f: impl Fn(&Tile) -> bool) -> Option> { + None + } +} + +#[derive(PartialEq)] +pub enum TileKind { + Empty, + Farmland, + Building { levels: u32 }, } pub struct Tile { + kind: TileKind, plot: Option>, } impl Tile { pub fn empty() -> Self { Self { + kind: TileKind::Empty, plot: None, } } + + pub fn is_empty(&self) -> bool { + self.kind == TileKind::Empty + } } From e30c625d81559d3d5c8982c20c022720b7af3a2a Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 6 Feb 2021 23:53:25 +0000 Subject: [PATCH 23/87] More tree variety, denser forests --- common/src/store.rs | 42 ++++--- world/examples/site.rs | 11 +- world/src/layer/tree.rs | 236 ++++++++++++++++++++++++---------------- world/src/sim/mod.rs | 2 +- world/src/site2/mod.rs | 26 ++--- world/src/site2/plot.rs | 6 +- world/src/site2/tile.rs | 22 ++-- 7 files changed, 199 insertions(+), 146 deletions(-) diff --git a/common/src/store.rs b/common/src/store.rs index 49ed00e8c4..3ba7b9ab0d 100644 --- a/common/src/store.rs +++ b/common/src/store.rs @@ -31,7 +31,13 @@ impl PartialEq for Id { } impl fmt::Debug for Id { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Id<{}>({}, {})", std::any::type_name::(), self.idx, self.gen) + write!( + f, + "Id<{}>({}, {})", + std::any::type_name::(), + self.idx, + self.gen + ) } } impl hash::Hash for Id { @@ -69,9 +75,7 @@ impl Store { } pub fn get(&self, id: Id) -> &T { - let entry = self.entries - .get(id.idx as usize) - .unwrap(); + let entry = self.entries.get(id.idx as usize).unwrap(); if entry.gen == id.gen { entry.item.as_ref().unwrap() } else { @@ -80,9 +84,7 @@ impl Store { } pub fn get_mut(&mut self, id: Id) -> &mut T { - let entry = self.entries - .get_mut(id.idx as usize) - .unwrap(); + let entry = self.entries.get_mut(id.idx as usize).unwrap(); if entry.gen == id.gen { entry.item.as_mut().unwrap() } else { @@ -90,13 +92,9 @@ impl Store { } } - pub fn ids(&self) -> impl Iterator> + '_ { - self.iter().map(|(id, _)| id) - } + pub fn ids(&self) -> impl Iterator> + '_ { self.iter().map(|(id, _)| id) } - pub fn values(&self) -> impl Iterator + '_ { - self.iter().map(|(_, item)| item) - } + pub fn values(&self) -> impl Iterator + '_ { self.iter().map(|(_, item)| item) } pub fn values_mut(&mut self) -> impl Iterator + '_ { self.iter_mut().map(|(_, item)| item) @@ -111,7 +109,8 @@ impl Store { idx: idx as u32, gen: entry.gen, phantom: PhantomData, - }).zip(entry.item.as_ref()) + }) + .zip(entry.item.as_ref()) }) } @@ -124,14 +123,16 @@ impl Store { idx: idx as u32, gen: entry.gen, phantom: PhantomData, - }).zip(entry.item.as_mut()) + }) + .zip(entry.item.as_mut()) }) } pub fn insert(&mut self, item: T) -> Id { if self.len < self.entries.len() { // TODO: Make this more efficient with a lookahead system - let (idx, entry) = self.entries + let (idx, entry) = self + .entries .iter_mut() .enumerate() .find(|(_, e)| e.item.is_none()) @@ -161,13 +162,10 @@ impl Store { } pub fn remove(&mut self, id: Id) -> Option { - if let Some(item) = self.entries + if let Some(item) = self + .entries .get_mut(id.idx as usize) - .and_then(|e| if e.gen == id.gen { - e.item.take() - } else { - None - }) + .and_then(|e| if e.gen == id.gen { e.item.take() } else { None }) { self.len -= 1; Some(item) diff --git a/world/examples/site.rs b/world/examples/site.rs index 05c01a34c9..b55e63026e 100644 --- a/world/examples/site.rs +++ b/world/examples/site.rs @@ -5,7 +5,10 @@ use veloren_world::site2::test_site; fn main() { let site = test_site(); let size = site.bounds().size(); - println!("{}", BeginSvg { w: size.w as f32, h: size.h as f32 }); + println!("{}", BeginSvg { + w: size.w as f32, + h: size.h as f32 + }); for plot in site.plots() { let bounds = plot.find_bounds(); @@ -15,7 +18,11 @@ fn main() { w: bounds.size().w as f32, h: bounds.size().h as f32, style: Style { - fill: Fill::Color(Color { r: 50, g: 50, b: 50 }), + fill: Fill::Color(Color { + r: 50, + g: 50, + b: 50 + }), stroke: Stroke::Color(Color { r: 0, g: 0, b: 0 }, 1.0), opacity: 1.0, stroke_opacity: 1.0, diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index d130cbf8a4..ba2d2fb5e7 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -7,14 +7,17 @@ use crate::{ }; use common::{ assets::AssetHandle, - terrain::{Block, BlockKind, structure::{Structure, StructureBlock, StructuresGroup}}, + terrain::{ + structure::{Structure, StructureBlock, StructuresGroup}, + Block, BlockKind, + }, vol::ReadVol, }; use hashbrown::HashMap; use lazy_static::lazy_static; +use rand::prelude::*; use std::{f32, ops::Range}; use vek::*; -use rand::prelude::*; lazy_static! { static ref OAKS: AssetHandle = Structure::load_group("oaks"); @@ -99,15 +102,25 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Acacia => *ACACIAS, ForestKind::Baobab => *BAOBABS, // ForestKind::Oak => *OAKS, - ForestKind::Oak => break 'model TreeModel::Procedural( - ProceduralTree::generate(TreeConfig::OAK, seed), - StructureBlock::TemperateLeaves, - ), + ForestKind::Oak => { + break 'model TreeModel::Procedural( + ProceduralTree::generate( + TreeConfig::oak(&mut RandomPerm::new(seed)), + &mut RandomPerm::new(seed), + ), + StructureBlock::TemperateLeaves, + ); + }, //ForestKind::Pine => *PINES, - ForestKind::Pine => break 'model TreeModel::Procedural( - ProceduralTree::generate(TreeConfig::PINE, seed), - StructureBlock::PineLeaves, - ), + ForestKind::Pine => { + break 'model TreeModel::Procedural( + ProceduralTree::generate( + TreeConfig::pine(&mut RandomPerm::new(seed)), + &mut RandomPerm::new(seed), + ), + StructureBlock::PineLeaves, + ); + }, ForestKind::Birch => *BIRCHES, ForestKind::Mangrove => *MANGROVE_TREES, ForestKind::Swamp => *SWAMP_TREES, @@ -115,8 +128,11 @@ pub fn apply_trees_to(canvas: &mut Canvas) { }; let models = models.read(); - TreeModel::Structure(models[(MODEL_RAND.get(seed.wrapping_mul(17)) / 13) as usize % models.len()] - .clone()) + TreeModel::Structure( + models[(MODEL_RAND.get(seed.wrapping_mul(17)) / 13) as usize + % models.len()] + .clone(), + ) }, seed, units: UNIT_CHOOSER.get(seed), @@ -133,9 +149,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { }; let rpos2d = (wpos2d - tree.pos.xy()) - .map2(Vec2::new(tree.units.0, tree.units.1), |p, unit| { - unit * p - }) + .map2(Vec2::new(tree.units.0, tree.units.1), |p, unit| unit * p) .sum(); if !Aabr::from(bounds).contains_point(rpos2d) { // Skip this column @@ -158,15 +172,17 @@ pub fn apply_trees_to(canvas: &mut Canvas) { info.index(), if let Some(block) = match &tree.model { TreeModel::Structure(s) => s.get(model_pos).ok().copied(), - TreeModel::Procedural(t, leaf_block) => Some(match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { - (true, _) => StructureBlock::Normal(Rgb::new(60, 30, 0)), - (_, true) => *leaf_block, - (_, _) => StructureBlock::None, - }), + TreeModel::Procedural(t, leaf_block) => Some( + match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { + (true, _) => StructureBlock::Normal(Rgb::new(60, 30, 0)), + (_, true) => *leaf_block, + (_, _) => StructureBlock::None, + }, + ), } { block } else { - break + break; }, wpos, tree.pos.xy(), @@ -215,50 +231,62 @@ pub struct TreeConfig { pub max_depth: usize, /// The number of branches that form from each branch. pub splits: usize, - /// The range of proportions along a branch at which a split into another branch might occur. - /// This value is clamped between 0 and 1, but a wider range may bias the results towards branch ends. + /// The range of proportions along a branch at which a split into another + /// branch might occur. This value is clamped between 0 and 1, but a + /// wider range may bias the results towards branch ends. pub split_range: Range, - /// The bias applied to the length of branches based on the proportion along their parent that they eminate from. - /// -1.0 = negative bias (branches at ends are longer, branches at the start are shorter) - /// 0.0 = no bias (branches do not change their length with regard to parent branch proportion) - /// 1.0 = positive bias (branches at ends are shorter, branches at the start are longer) + /// The bias applied to the length of branches based on the proportion along + /// their parent that they eminate from. -1.0 = negative bias (branches + /// at ends are longer, branches at the start are shorter) 0.0 = no bias + /// (branches do not change their length with regard to parent branch + /// proportion) 1.0 = positive bias (branches at ends are shorter, + /// branches at the start are longer) pub branch_len_bias: f32, - /// The scale of leaves in the vertical plane. Less than 1.0 implies a flattening of the leaves. + /// The scale of leaves in the vertical plane. Less than 1.0 implies a + /// flattening of the leaves. pub leaf_vertical_scale: f32, /// How evenly spaced (vs random) sub-branches are along their parent. pub proportionality: f32, } impl TreeConfig { - pub const OAK: Self = Self { - trunk_len: 12.0, - trunk_radius: 3.0, - branch_child_len: 0.8, - branch_child_radius: 0.6, - leaf_radius: 3.0..5.0, - straightness: 0.5, - max_depth: 4, - splits: 3, - split_range: 0.5..1.5, - branch_len_bias: 0.0, - leaf_vertical_scale: 1.0, - proportionality: 0.0, - }; + pub fn oak(rng: &mut impl Rng) -> Self { + let scale = Lerp::lerp(0.8, 1.5, rng.gen::().powi(4)); - pub const PINE: Self = Self { - trunk_len: 32.0, - trunk_radius: 1.5, - branch_child_len: 0.3, - branch_child_radius: 0.0, - leaf_radius: 2.0..2.5, - straightness: 0.0, - max_depth: 1, - splits: 56, - split_range: 0.2..1.2, - branch_len_bias: 0.75, - leaf_vertical_scale: 0.3, - proportionality: 1.0, - }; + Self { + trunk_len: 12.0 * scale, + trunk_radius: 3.0 * scale, + branch_child_len: 0.8, + branch_child_radius: 0.6, + leaf_radius: 3.0 * scale..4.0 * scale, + straightness: 0.5, + max_depth: 4, + splits: 3, + split_range: 0.5..1.5, + branch_len_bias: 0.0, + leaf_vertical_scale: 1.0, + proportionality: 0.0, + } + } + + pub fn pine(rng: &mut impl Rng) -> Self { + let scale = Lerp::lerp(1.0, 2.0, rng.gen::().powi(4)); + + Self { + trunk_len: 32.0 * scale, + trunk_radius: 1.5 * scale, + branch_child_len: 0.3, + branch_child_radius: 0.0, + leaf_radius: 2.0 * scale..2.5 * scale, + straightness: 0.0, + max_depth: 1, + splits: 56, + split_range: 0.2..1.2, + branch_len_bias: 0.75, + leaf_vertical_scale: 0.3, + proportionality: 1.0, + } + } } // TODO: Rename this to `Tree` when the name conflict is gone @@ -269,9 +297,7 @@ pub struct ProceduralTree { impl ProceduralTree { /// Generate a new tree using the given configuration and seed. - pub fn generate(config: TreeConfig, seed: u32) -> Self { - let mut rng = RandomPerm::new(seed); - + pub fn generate(config: TreeConfig, rng: &mut impl Rng) -> Self { let mut this = Self { branches: Vec::new(), trunk_idx: 0, // Gets replaced later @@ -283,20 +309,21 @@ impl ProceduralTree { // Our trunk starts at the origin... Vec3::zero(), // ...and has a roughly upward direction - Vec3::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0), 5.0).normalized(), + Vec3::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0), 10.0).normalized(), config.trunk_len, config.trunk_radius, 0, None, - &mut rng, + rng, ); this.trunk_idx = trunk_idx; this } - // Recursively add a branch (with sub-branches) to the tree's branch graph, returning the index and AABB of the - // branch. This AABB gets propagated down to the parent and is used later during sampling to cull the branches to + // Recursively add a branch (with sub-branches) to the tree's branch graph, + // returning the index and AABB of the branch. This AABB gets propagated + // down to the parent and is used later during sampling to cull the branches to // be sampled. fn add_branch( &mut self, @@ -318,7 +345,8 @@ impl ProceduralTree { 0.0 }; - // The AABB that covers this branch, along with wood and leaves that eminate from it + // The AABB that covers this branch, along with wood and leaves that eminate + // from it let mut aabb = Aabb { min: Vec3::partial_min(start, end) - wood_radius.max(leaf_radius), max: Vec3::partial_max(start, end) + wood_radius.max(leaf_radius), @@ -327,31 +355,43 @@ impl ProceduralTree { let mut child_idx = None; // Don't add child branches if we're already enough layers into the tree if depth < config.max_depth { - let x_axis = dir.cross(Vec3::::zero().map(|_| rng.gen_range(-1.0..1.0))).normalized(); + let x_axis = dir + .cross(Vec3::::zero().map(|_| rng.gen_range(-1.0..1.0))) + .normalized(); let y_axis = dir.cross(x_axis).normalized(); let screw_shift = rng.gen_range(0.0..f32::consts::TAU); for i in 0..config.splits { - let dist = Lerp::lerp(i as f32 / (config.splits - 1) as f32, rng.gen_range(0.0..1.0), config.proportionality); + let dist = Lerp::lerp( + i as f32 / (config.splits - 1) as f32, + rng.gen_range(0.0..1.0), + config.proportionality, + ); const PHI: f32 = 0.618; const RAD_PER_BRANCH: f32 = f32::consts::TAU * PHI; - let screw = - (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).sin() * x_axis + - (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).cos() * y_axis; + let screw = (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).sin() + * x_axis + + (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).cos() * y_axis; - // Choose a point close to the branch to act as the target direction for the branch to grow in - // let split_factor = rng.gen_range(config.split_range.start, config.split_range.end).clamped(0.0, 1.0); - let split_factor = Lerp::lerp(config.split_range.start, config.split_range.end, dist); - let tgt = Lerp::lerp_unclamped( - start, - end, - split_factor, - ) + Lerp::lerp(Vec3::::zero().map(|_| rng.gen_range(-1.0..1.0)), screw, config.proportionality); + // Choose a point close to the branch to act as the target direction for the + // branch to grow in let split_factor = + // rng.gen_range(config.split_range.start, config.split_range.end).clamped(0.0, + // 1.0); + let split_factor = + Lerp::lerp(config.split_range.start, config.split_range.end, dist); + let tgt = Lerp::lerp_unclamped(start, end, split_factor) + + Lerp::lerp( + Vec3::::zero().map(|_| rng.gen_range(-1.0..1.0)), + screw, + config.proportionality, + ); // Start the branch at the closest point to the target let branch_start = line.projected_point(tgt); - // Now, interpolate between the target direction and the parent branch's direction to find a direction - let branch_dir = Lerp::lerp(tgt - branch_start, dir, config.straightness).normalized(); + // Now, interpolate between the target direction and the parent branch's + // direction to find a direction + let branch_dir = + Lerp::lerp(tgt - branch_start, dir, config.straightness).normalized(); let (branch_idx, branch_aabb) = self.add_branch( config, @@ -359,14 +399,18 @@ impl ProceduralTree { branch_dir, branch_len * config.branch_child_len - * (1.0 - (split_factor - 0.5) * 2.0 * config.branch_len_bias.clamped(-1.0, 1.0)), + * (1.0 + - (split_factor - 0.5) + * 2.0 + * config.branch_len_bias.clamped(-1.0, 1.0)), branch_radius * config.branch_child_radius, depth + 1, child_idx, rng, ); child_idx = Some(branch_idx); - // Parent branches AABBs include the AABBs of child branches to allow for culling during sampling + // Parent branches AABBs include the AABBs of child branches to allow for + // culling during sampling aabb.expand_to_contain(branch_aabb); } } @@ -386,19 +430,20 @@ impl ProceduralTree { } /// Get the bounding box that covers the tree (all branches and leaves) - pub fn get_bounds(&self) -> Aabb { - self.branches[self.trunk_idx].aabb - } + pub fn get_bounds(&self) -> Aabb { self.branches[self.trunk_idx].aabb } // Recursively search for branches or leaves by walking the tree's branch graph. fn is_branch_or_leaves_at_inner(&self, pos: Vec3, branch_idx: usize) -> (bool, bool) { let branch = &self.branches[branch_idx]; - // Always probe the sibling branch, since our AABB doesn't include its bounds (it's not one of our children) - let branch_or_leaves = branch.sibling_idx + // Always probe the sibling branch, since our AABB doesn't include its bounds + // (it's not one of our children) + let branch_or_leaves = branch + .sibling_idx .map(|idx| Vec2::from(self.is_branch_or_leaves_at_inner(pos, idx))) .unwrap_or_default(); - // Only continue probing this sub-graph of the tree if the sample position falls within its AABB + // Only continue probing this sub-graph of the tree if the sample position falls + // within its AABB if branch.aabb.contains_point(pos) { (branch_or_leaves // Probe this branch @@ -407,23 +452,25 @@ impl ProceduralTree { | branch.child_idx .map(|idx| Vec2::from(self.is_branch_or_leaves_at_inner(pos, idx))) .unwrap_or_default()) - .into_tuple() + .into_tuple() } else { branch_or_leaves.into_tuple() } } - /// Determine whether there are either branches or leaves at the given position in the tree. + /// Determine whether there are either branches or leaves at the given + /// position in the tree. #[inline(always)] pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { self.is_branch_or_leaves_at_inner(pos, self.trunk_idx) } } -// Branches are arranged in a graph shape. Each branch points to both its first child (if any) and also to the next -// branch in the list of child branches associated with the parent. This means that the entire tree is laid out in a -// walkable graph where each branch refers only to two other branches. As a result, walking the tree is simply a case -// of performing double recursion. +// Branches are arranged in a graph shape. Each branch points to both its first +// child (if any) and also to the next branch in the list of child branches +// associated with the parent. This means that the entire tree is laid out in a +// walkable graph where each branch refers only to two other branches. As a +// result, walking the tree is simply a case of performing double recursion. struct Branch { line: LineSegment3, wood_radius: f32, @@ -436,7 +483,8 @@ struct Branch { } impl Branch { - /// Determine whether there are either branches or leaves at the given position in the branch. + /// Determine whether there are either branches or leaves at the given + /// position in the branch. pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { // fn finvsqrt(x: f32) -> f32 { // let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 7d9d4c1590..4ec3e89b3e 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -516,7 +516,7 @@ impl WorldSim { cave_0_nz: SuperSimplex::new().set_seed(rng.gen()), cave_1_nz: SuperSimplex::new().set_seed(rng.gen()), - structure_gen: StructureGen2d::new(rng.gen(), 32, 16), + structure_gen: StructureGen2d::new(rng.gen(), 24, 8), region_gen: StructureGen2d::new(rng.gen(), 400, 96), humid_nz: Billow::new() .set_octaves(9) diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index e580fdfc9f..916e4fec9a 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -1,14 +1,14 @@ -mod tile; mod plot; +mod tile; -use vek::*; -use common::store::{Store, Id}; -use crate::util::Grid; use self::{ - tile::TileGrid, plot::{Plot, PlotKind}, + tile::TileGrid, }; +use crate::util::Grid; +use common::store::{Id, Store}; use rand::prelude::*; +use vek::*; #[derive(Default)] pub struct Site { @@ -25,19 +25,17 @@ impl Site { } } - pub fn plots(&self) -> impl Iterator + '_ { - self.plots.values() - } + pub fn plots(&self) -> impl Iterator + '_ { self.plots.values() } - pub fn create_plot(&mut self, plot: Plot) -> Id { - self.plots.insert(plot) - } + pub fn create_plot(&mut self, plot: Plot) -> Id { self.plots.insert(plot) } pub fn generate(rng: &mut impl Rng) -> Self { let mut site = Site::default(); for i in 0..10 { - let dir = Vec2::::zero().map(|_| rng.gen_range(-1.0..1.0)).normalized(); + let dir = Vec2::::zero() + .map(|_| rng.gen_range(-1.0..1.0)) + .normalized(); let search_pos = (dir * 32.0).map(|e| e as i32); site.tiles @@ -51,6 +49,4 @@ impl Site { } } -pub fn test_site() -> Site { - Site::generate(&mut thread_rng()) -} +pub fn test_site() -> Site { Site::generate(&mut thread_rng()) } diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index 5b8627c25d..02175c4ac0 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -1,5 +1,5 @@ -use vek::*; use crate::util::DHashSet; +use vek::*; pub struct Plot { kind: PlotKind, @@ -11,7 +11,9 @@ impl Plot { pub fn find_bounds(&self) -> Aabr { self.tiles .iter() - .fold(Aabr::new_empty(self.root_tile), |b, t| b.expanded_to_contain_point(*t)) + .fold(Aabr::new_empty(self.root_tile), |b, t| { + b.expanded_to_contain_point(*t) + }) } } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 4d7fa35f00..2fc225d19c 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -23,18 +23,22 @@ impl TileGrid { let tpos = tpos + TILE_RADIUS as i32; self.zones .get(tpos) - .and_then(|zone| zone.as_ref()?.get(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32)))) + .and_then(|zone| { + zone.as_ref()? + .get(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) + }) .and_then(|tile| tile.as_ref()) } pub fn get_mut(&mut self, tpos: Vec2) -> Option<&mut Tile> { let tpos = tpos + TILE_RADIUS as i32; - self.zones - .get_mut(tpos) - .and_then(|zone| zone - .get_or_insert_with(|| Grid::populate_from(Vec2::broadcast(ZONE_RADIUS as i32 * 2 + 1), |_| None)) - .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) - .map(|tile| tile.get_or_insert_with(|| Tile::empty()))) + self.zones.get_mut(tpos).and_then(|zone| { + zone.get_or_insert_with(|| { + Grid::populate_from(Vec2::broadcast(ZONE_RADIUS as i32 * 2 + 1), |_| None) + }) + .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) + .map(|tile| tile.get_or_insert_with(|| Tile::empty())) + }) } pub fn find_near(&self, tpos: Vec2, f: impl Fn(&Tile) -> bool) -> Option> { @@ -62,7 +66,5 @@ impl Tile { } } - pub fn is_empty(&self) -> bool { - self.kind == TileKind::Empty - } + pub fn is_empty(&self) -> bool { self.kind == TileKind::Empty } } From 7d526da735d8e1fc8078f1804ac5c22a10c4a401 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 7 Feb 2021 19:55:13 +0000 Subject: [PATCH 24/87] Experimental giant mother trees --- assets/voxygen/shaders/particle-vert.glsl | 2 +- common/src/terrain/block.rs | 4 +- voxygen/src/mesh/terrain.rs | 38 ++++---- voxygen/src/render/renderer.rs | 2 +- world/Cargo.toml | 1 + world/src/all.rs | 77 +++++++++++++++- world/src/column/mod.rs | 7 ++ world/src/layer/tree.rs | 59 ++++++------ world/src/sim/mod.rs | 107 ++++++---------------- world/src/util/math.rs | 11 +++ world/src/util/mod.rs | 1 + 11 files changed, 180 insertions(+), 129 deletions(-) create mode 100644 world/src/util/math.rs diff --git a/assets/voxygen/shaders/particle-vert.glsl b/assets/voxygen/shaders/particle-vert.glsl index 7bf80b19c5..8024371b04 100644 --- a/assets/voxygen/shaders/particle-vert.glsl +++ b/assets/voxygen/shaders/particle-vert.glsl @@ -275,7 +275,7 @@ void main() { vec3(0, 0, -2) ) + vec3(sin(lifetime), sin(lifetime + 0.7), sin(lifetime * 0.5)) * 2.0, vec3(4), - vec4(vec3(0.2 + rand7 * 0.2, 0.2 + (0.5 + rand6 * 0.5) * 0.6, 0), 1), + vec4(vec3(0.2 + rand7 * 0.2, 0.2 + (0.5 + rand6 * 0.5) * 0.6, 0) * (0.25 + rand1 * 0.5), 1), spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 5) ); } else if (inst_mode == SNOW) { diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 7c7a4e0168..52552b41e7 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -196,8 +196,8 @@ impl Block { #[inline] pub fn get_max_sunlight(&self) -> Option { match self.kind() { - BlockKind::Water => Some(2), - BlockKind::Leaves => Some(4), + BlockKind::Water => Some(3), + BlockKind::Leaves => Some(6), _ if self.is_opaque() => Some(0), _ => None, } diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index 242ee59fed..09b8e79549 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -69,25 +69,23 @@ fn calc_light + ReadVol + Debug>( if is_sunlight { for x in 0..outer.size().w { for y in 0..outer.size().h { - let z = outer.size().d - 1; - let is_air = vol_cached - .get(outer.min + Vec3::new(x, y, z)) - .ok() - .map_or(false, |b| b.is_air()); - - light_map[lm_idx(x, y, z)] = if is_air { - if vol_cached - .get(outer.min + Vec3::new(x, y, z - 1)) - .ok() - .map_or(false, |b| b.is_air()) + let mut light = SUNLIGHT; + for z in (0..outer.size().d).rev() { + match vol_cached + .get(outer.min + Vec3::new(x, y, z)) + .map_or(None, |b| b.get_max_sunlight()) { - light_map[lm_idx(x, y, z - 1)] = SUNLIGHT; - prop_que.push_back((x as u8, y as u8, z as u16)); + None => {}, + Some(0) => { + light_map[lm_idx(x, y, z)] = 0; + break; + }, + Some(max_sunlight) => light = light.min(max_sunlight), } - SUNLIGHT - } else { - OPAQUE - }; + + light_map[lm_idx(x, y, z)] = light; + prop_que.push_back((x as u8, y as u8, z as u16)); + } } } } @@ -129,7 +127,7 @@ fn calc_light + ReadVol + Debug>( let light = light_map[lm_idx(pos.x, pos.y, pos.z)]; // If ray propagate downwards at full strength - if is_sunlight && light == SUNLIGHT { + if is_sunlight && light == SUNLIGHT && false { // Down is special cased and we know up is a ray // Special cased ray propagation let pos = Vec3::new(pos.x, pos.y, pos.z - 1); @@ -401,7 +399,9 @@ impl<'a, V: RectRasterableVol + ReadVol + Debug + 'static> let greedy_size_cross = Vec3::new(greedy_size.x - 1, greedy_size.y - 1, greedy_size.z); let draw_delta = Vec3::new(1, 1, z_start); - let get_light = |_: &mut (), pos: Vec3| light(pos + range.min); + let get_light = |_: &mut (), pos: Vec3| volume + .get(range.min + pos) + .map_or(1.0, |b| if b.is_opaque() { 0.0 } else { light(pos + range.min) }); let get_glow = |_: &mut (), pos: Vec3| glow(pos + range.min); let get_color = |_: &mut (), pos: Vec3| flat_get(pos).get_color().unwrap_or(Rgb::zero()); diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index f1ae11e340..15ffdb7761 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -1015,7 +1015,7 @@ impl Renderer { /// NOTE: Apparently Macs aren't the only machines that lie. /// /// TODO: Find a way to let graphics cards that don't lie do better. - const MAX_TEXTURE_SIZE_MAX: u16 = 8192; + const MAX_TEXTURE_SIZE_MAX: u16 = 8192 << 1; // NOTE: Many APIs for textures require coordinates to fit in u16, which is why // we perform this conversion. u16::try_from(factory.get_capabilities().max_texture_size) diff --git a/world/Cargo.toml b/world/Cargo.toml index 97e6f70d41..ca3d12b491 100644 --- a/world/Cargo.toml +++ b/world/Cargo.toml @@ -14,6 +14,7 @@ common = { package = "veloren-common", path = "../common" } common-net = { package = "veloren-common-net", path = "../common/net" } bincode = "1.3.1" bitvec = "0.21.0" +enum-iterator = "0.6" fxhash = "0.2.1" image = { version = "0.23.12", default-features = false, features = ["png"] } itertools = "0.10" diff --git a/world/src/all.rs b/world/src/all.rs index fb44983678..2ce6f1ccd8 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -1,4 +1,9 @@ -#[derive(Copy, Clone, Debug)] +use std::ops::Range; +use enum_iterator::IntoEnumIterator; +use vek::*; +use crate::util::math::close; + +#[derive(Copy, Clone, Debug, IntoEnumIterator)] pub enum ForestKind { Palm, Acacia, @@ -9,3 +14,73 @@ pub enum ForestKind { Mangrove, Swamp, } + +pub struct Environment { + pub humid: f32, + pub temp: f32, + pub near_water: f32, +} + +impl ForestKind { + pub fn humid_range(&self) -> Range { + match self { + ForestKind::Palm => 0.25..1.4, + ForestKind::Acacia => 0.1..0.6, + ForestKind::Baobab => 0.2..0.6, + ForestKind::Oak => 0.5..1.5, + ForestKind::Pine => 0.2..1.4, + ForestKind::Birch => 0.0..0.6, + ForestKind::Mangrove => 0.7..1.3, + ForestKind::Swamp => 0.5..1.1, + } + } + + pub fn temp_range(&self) -> Range { + match self { + ForestKind::Palm => 0.4..1.6, + ForestKind::Acacia => 0.4..1.6, + ForestKind::Baobab => 0.4..0.9, + ForestKind::Oak => -0.35..0.5, + ForestKind::Pine => -1.8..-0.2, + ForestKind::Birch => -0.7..0.25, + ForestKind::Mangrove => 0.4..1.6, + ForestKind::Swamp => -0.6..0.8, + } + } + + pub fn near_water_range(&self) -> Option> { + match self { + ForestKind::Palm => Some(0.35..1.8), + ForestKind::Swamp => Some(0.5..1.8), + _ => None, + } + } + + /// The relative rate at which this tree appears under ideal conditions + pub fn ideal_proclivity(&self) -> f32 { + match self { + ForestKind::Palm => 0.4, + ForestKind::Acacia => 0.6, + ForestKind::Baobab => 0.2, + ForestKind::Oak => 1.0, + ForestKind::Pine => 1.0, + ForestKind::Birch => 0.65, + ForestKind::Mangrove => 1.0, + ForestKind::Swamp => 1.0, + } + } + + pub fn proclivity(&self, env: &Environment) -> f32 { + self.ideal_proclivity() + * close(env.humid, self.humid_range()) + * close(env.temp, self.temp_range()) + * self.near_water_range().map_or(1.0, |near_water_range| close(env.near_water, near_water_range)) + } +} + +pub struct TreeAttr { + pub pos: Vec2, + pub seed: u32, + pub scale: f32, + pub forest_kind: ForestKind, +} diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 64bb8bafc0..9a5061f2db 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -982,6 +982,13 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { .map(|wd| Lerp::lerp(sub_surface_color, ground, (wd / 3.0).clamped(0.0, 1.0))) .unwrap_or(ground); + // Ground under thick trees should be receive less sunlight and so often become dirt + let ground = Lerp::lerp( + ground, + sub_surface_color, + marble_mid * tree_density, + ); + let near_ocean = max_river.and_then(|(_, _, river_data, _)| { if (river_data.is_lake() || river_data.river_kind == Some(RiverKind::Ocean)) && alt <= water_level.max(CONFIG.sea_level + 5.0) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index ba2d2fb5e7..13e28a8fe4 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -1,5 +1,5 @@ use crate::{ - all::ForestKind, + all::*, block::block_from_structure, column::ColumnGen, util::{RandomPerm, Sampler, UnitChooser}, @@ -60,9 +60,9 @@ pub fn apply_trees_to(canvas: &mut Canvas) { canvas.foreach_col(|canvas, wpos2d, col| { let trees = info.land().get_near_trees(wpos2d); - for (tree_wpos, seed) in trees { - let tree = if let Some(tree) = tree_cache.entry(tree_wpos).or_insert_with(|| { - let col = ColumnGen::new(info.land()).get((tree_wpos, info.index()))?; + for TreeAttr { pos, seed, scale, forest_kind } in trees { + let tree = if let Some(tree) = tree_cache.entry(pos).or_insert_with(|| { + let col = ColumnGen::new(info.land()).get((pos, info.index()))?; let is_quirky = QUIRKY_RAND.chance(seed, 1.0 / 500.0); @@ -82,7 +82,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { } Some(Tree { - pos: Vec3::new(tree_wpos.x, tree_wpos.y, col.alt as i32), + pos: Vec3::new(pos.x, pos.y, col.alt as i32), model: 'model: { let models: AssetHandle<_> = if is_quirky { if col.temp > CONFIG.desert_temp { @@ -91,7 +91,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { *QUIRKY } } else { - match col.forest_kind { + match forest_kind { ForestKind::Oak if QUIRKY_RAND.chance(seed + 1, 1.0 / 16.0) => { *OAK_STUMPS }, @@ -105,7 +105,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Oak => { break 'model TreeModel::Procedural( ProceduralTree::generate( - TreeConfig::oak(&mut RandomPerm::new(seed)), + TreeConfig::oak(&mut RandomPerm::new(seed), scale), &mut RandomPerm::new(seed), ), StructureBlock::TemperateLeaves, @@ -115,7 +115,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Pine => { break 'model TreeModel::Procedural( ProceduralTree::generate( - TreeConfig::pine(&mut RandomPerm::new(seed)), + TreeConfig::pine(&mut RandomPerm::new(seed), scale), &mut RandomPerm::new(seed), ), StructureBlock::PineLeaves, @@ -230,7 +230,7 @@ pub struct TreeConfig { /// Maximum number of branch layers (not including trunk). pub max_depth: usize, /// The number of branches that form from each branch. - pub splits: usize, + pub splits: Range, /// The range of proportions along a branch at which a split into another /// branch might occur. This value is clamped between 0 and 1, but a /// wider range may bias the results towards branch ends. @@ -250,37 +250,39 @@ pub struct TreeConfig { } impl TreeConfig { - pub fn oak(rng: &mut impl Rng) -> Self { - let scale = Lerp::lerp(0.8, 1.5, rng.gen::().powi(4)); + pub fn oak(rng: &mut impl Rng, scale: f32) -> Self { + let scale = scale * (1.0 + rng.gen::().powi(4)); + let log_scale = 1.0 + scale.log2().max(0.0); Self { - trunk_len: 12.0 * scale, - trunk_radius: 3.0 * scale, + trunk_len: 9.0 * scale, + trunk_radius: 2.0 * scale, branch_child_len: 0.8, - branch_child_radius: 0.6, - leaf_radius: 3.0 * scale..4.0 * scale, + branch_child_radius: 0.75, + leaf_radius: 2.5 * log_scale..3.25 * log_scale, straightness: 0.5, - max_depth: 4, - splits: 3, - split_range: 0.5..1.5, + max_depth: (4.0 + log_scale) as usize, + splits: 2.0..3.0, + split_range: 0.75..1.5, branch_len_bias: 0.0, leaf_vertical_scale: 1.0, proportionality: 0.0, } } - pub fn pine(rng: &mut impl Rng) -> Self { - let scale = Lerp::lerp(1.0, 2.0, rng.gen::().powi(4)); + pub fn pine(rng: &mut impl Rng, scale: f32) -> Self { + let scale = scale * (1.0 + rng.gen::().powi(4)); + let log_scale = 1.0 + scale.log2().max(0.0); Self { trunk_len: 32.0 * scale, - trunk_radius: 1.5 * scale, - branch_child_len: 0.3, + trunk_radius: 1.25 * scale, + branch_child_len: 0.3 / scale, branch_child_radius: 0.0, - leaf_radius: 2.0 * scale..2.5 * scale, + leaf_radius: 1.5 * log_scale..2.0 * log_scale, straightness: 0.0, max_depth: 1, - splits: 56, + splits: 50.0..70.0, split_range: 0.2..1.2, branch_len_bias: 0.75, leaf_vertical_scale: 0.3, @@ -361,18 +363,19 @@ impl ProceduralTree { let y_axis = dir.cross(x_axis).normalized(); let screw_shift = rng.gen_range(0.0..f32::consts::TAU); - for i in 0..config.splits { + let splits = rng.gen_range(config.splits.clone()).round() as usize; + for i in 0..splits { let dist = Lerp::lerp( - i as f32 / (config.splits - 1) as f32, + i as f32 / (splits - 1) as f32, rng.gen_range(0.0..1.0), config.proportionality, ); const PHI: f32 = 0.618; const RAD_PER_BRANCH: f32 = f32::consts::TAU * PHI; - let screw = (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).sin() + let screw = (screw_shift + dist * splits as f32 * RAD_PER_BRANCH).sin() * x_axis - + (screw_shift + dist * config.splits as f32 * RAD_PER_BRANCH).cos() * y_axis; + + (screw_shift + dist * splits as f32 * RAD_PER_BRANCH).cos() * y_axis; // Choose a point close to the branch to act as the target direction for the // branch to grow in let split_factor = diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 4ec3e89b3e..5019db6f52 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -23,7 +23,7 @@ pub use self::{ }; use crate::{ - all::ForestKind, + all::*, block::BlockGen, civ::Place, column::ColumnGen, @@ -45,6 +45,7 @@ use common::{ vol::RectVolSize, }; use common_net::msg::WorldMapMsg; +use enum_iterator::IntoEnumIterator; use noise::{ BasicMulti, Billow, Fbm, HybridMulti, MultiFractal, NoiseFn, RangeFunction, RidgedMulti, Seedable, SuperSimplex, Worley, @@ -114,6 +115,7 @@ pub(crate) struct GenCtx { pub cave_1_nz: SuperSimplex, pub structure_gen: StructureGen2d, + pub big_structure_gen: StructureGen2d, pub region_gen: StructureGen2d, pub fast_turb_x_nz: FastNoise, @@ -516,7 +518,8 @@ impl WorldSim { cave_0_nz: SuperSimplex::new().set_seed(rng.gen()), cave_1_nz: SuperSimplex::new().set_seed(rng.gen()), - structure_gen: StructureGen2d::new(rng.gen(), 24, 8), + structure_gen: StructureGen2d::new(rng.gen(), 24, 12), + big_structure_gen: StructureGen2d::new(rng.gen(), 768, 512), region_gen: StructureGen2d::new(rng.gen(), 400, 96), humid_nz: Billow::new() .set_octaves(9) @@ -1995,9 +1998,25 @@ impl WorldSim { /// Return an iterator over candidate tree positions (note that only some of /// these will become trees since environmental parameters may forbid /// them spawning). - pub fn get_near_trees(&self, wpos: Vec2) -> impl Iterator, u32)> + '_ { + pub fn get_near_trees(&self, wpos: Vec2) -> impl Iterator + '_ { // Deterministic based on wpos - std::array::IntoIter::new(self.gen_ctx.structure_gen.get(wpos)) + let normal_trees = std::array::IntoIter::new(self.gen_ctx.structure_gen.get(wpos)) + .map(move |(pos, seed)| TreeAttr { + pos, + seed, + scale: 1.0, + forest_kind: self.get_wpos(pos).map_or(ForestKind::Oak, |c| c.forest_kind), + }); + + let giant_trees = std::array::IntoIter::new(self.gen_ctx.big_structure_gen.get(wpos)) + .map(move |(pos, seed)| TreeAttr { + pos, + seed, + scale: 10.0, + forest_kind: ForestKind::Oak, + }); + + normal_trees.chain(giant_trees) } } @@ -2232,80 +2251,14 @@ impl SimChunk { }, tree_density, forest_kind: { - // Whittaker diagram - let candidates = [ - // A smaller prevalence means that the range of values this tree appears in - // will shrink compared to neighbouring trees in the - // topology of the Whittaker diagram. - // Humidity, temperature, near_water, each with prevalence - ( - ForestKind::Palm, - (CONFIG.desert_hum, 1.5), - ((CONFIG.tropical_temp + CONFIG.desert_temp) / 2.0, 1.25), - (1.0, 2.0), - ), - ( - ForestKind::Acacia, - (0.0, 1.5), - (CONFIG.tropical_temp, 1.5), - (0.0, 1.0), - ), - ( - ForestKind::Baobab, - (0.0, 1.5), - (CONFIG.tropical_temp, 1.5), - (0.0, 1.0), - ), - ( - ForestKind::Oak, - (CONFIG.forest_hum, 1.5), - (0.0, 1.5), - (0.0, 1.0), - ), - ( - ForestKind::Mangrove, - (CONFIG.jungle_hum, 0.5), - (CONFIG.tropical_temp, 0.5), - (0.0, 1.0), - ), - ( - ForestKind::Pine, - (CONFIG.forest_hum, 1.25), - (CONFIG.snow_temp, 2.5), - (0.0, 1.0), - ), - ( - ForestKind::Birch, - (CONFIG.desert_hum, 1.5), - (CONFIG.temperate_temp, 1.5), - (0.0, 1.0), - ), - ( - ForestKind::Swamp, - ((CONFIG.forest_hum + CONFIG.jungle_hum) / 2.0, 2.0), - ((CONFIG.temperate_temp + CONFIG.snow_temp) / 2.0, 2.0), - (1.0, 2.5), - ), - ]; + let env = Environment { + humid: humidity, + temp, + near_water: if river.is_lake() || river.near_river() { 1.0 } else { 0.0 }, + }; - candidates - .iter() - .enumerate() - .min_by_key(|(i, (_, (h, h_prev), (t, t_prev), (w, w_prev)))| { - let rand = RandomPerm::new(*i as u32 * 1000); - let noise = - Vec3::iota().map(|e| (rand.get(e) & 0xFF) as f32 / 255.0 - 0.5) * 2.0; - (Vec3::new( - (*h - humidity) / *h_prev, - (*t - temp) / *t_prev, - (*w - if river.near_water() { 1.0 } else { 0.0 }) / *w_prev, - ) - .add(noise * 0.1) - .map(|e| e * e) - .sum() - * 10000.0) as i32 - }) - .map(|(_, c)| c.0) + ForestKind::into_enum_iter() + .max_by_key(|fk| (fk.proclivity(&env) * 10000.0) as u32) .unwrap() // Can't fail }, spawn_rate: 1.0, diff --git a/world/src/util/math.rs b/world/src/util/math.rs new file mode 100644 index 0000000000..857dd8c018 --- /dev/null +++ b/world/src/util/math.rs @@ -0,0 +1,11 @@ +use std::ops::Range; +use vek::*; + +/// Return a value between 0 and 1 corresponding to how close to the centre of `range` `x` is. +/// The exact function used is left unspecified, but it shall have the shape of a bell-like curve. +/// This function is required to return `0` (or a value extremely close to `0`) when `x` is outside of `range`. +pub fn close(x: f32, range: Range) -> f32 { + let mean = (range.start + range.end) / 2.0; + let width = (range.end - range.start) / 2.0; + (1.0 - ((x - mean) / width).clamped(-1.0, 1.0).powi(2)).powi(2) +} diff --git a/world/src/util/mod.rs b/world/src/util/mod.rs index a04a8d2bb3..f80f21e0b7 100644 --- a/world/src/util/mod.rs +++ b/world/src/util/mod.rs @@ -1,4 +1,5 @@ pub mod fast_noise; +pub mod math; pub mod map_vec; pub mod random; pub mod sampler; From abd1eec81571d27191abd7894d8c04b18b66dec0 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 7 Feb 2021 21:20:48 +0000 Subject: [PATCH 25/87] Slightly smaller giant trees, more dispersed forests --- world/src/sim/mod.rs | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 5019db6f52..ebe2ef1222 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -29,7 +29,7 @@ use crate::{ column::ColumnGen, site::Site, util::{ - seed_expan, FastNoise, RandomField, RandomPerm, Sampler, StructureGen2d, LOCALITY, + seed_expan, FastNoise, FastNoise2d, RandomField, RandomPerm, Sampler, StructureGen2d, LOCALITY, NEIGHBORS, }, IndexRef, CONFIG, @@ -43,6 +43,7 @@ use common::{ TerrainChunkSize, }, vol::RectVolSize, + lottery::Lottery, }; use common_net::msg::WorldMapMsg; use enum_iterator::IntoEnumIterator; @@ -2001,18 +2002,34 @@ impl WorldSim { pub fn get_near_trees(&self, wpos: Vec2) -> impl Iterator + '_ { // Deterministic based on wpos let normal_trees = std::array::IntoIter::new(self.gen_ctx.structure_gen.get(wpos)) - .map(move |(pos, seed)| TreeAttr { - pos, - seed, - scale: 1.0, - forest_kind: self.get_wpos(pos).map_or(ForestKind::Oak, |c| c.forest_kind), + .filter_map(move |(pos, seed)| { + let chunk = self.get_wpos(pos)?; + let env = Environment { + humid: chunk.humidity, + temp: chunk.temp, + near_water: if chunk.river.is_lake() || chunk.river.near_river() { 1.0 } else { 0.0 }, + }; + Some(TreeAttr { + pos, + seed, + scale: 1.0, + forest_kind: *Lottery::from(ForestKind::into_enum_iter() + .enumerate() + .map(|(i, fk)| { + const CLUSTER_SIZE: f64 = 48.0; + let nz = (FastNoise2d::new(i as u32).get(wpos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; + (fk.proclivity(&env) * nz, fk) + }) + .collect::>()) + .choose_seeded(seed), + }) }); let giant_trees = std::array::IntoIter::new(self.gen_ctx.big_structure_gen.get(wpos)) .map(move |(pos, seed)| TreeAttr { pos, seed, - scale: 10.0, + scale: 4.0, forest_kind: ForestKind::Oak, }); From 185b1c3053da62bf4f0711fd6a5be8d4e72d8a48 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 7 Feb 2021 23:50:05 +0000 Subject: [PATCH 26/87] Specialised giant trees --- assets/voxygen/shaders/particle-vert.glsl | 2 +- common/src/terrain/block.rs | 4 +-- world/src/all.rs | 14 ++++++---- world/src/layer/tree.rs | 31 ++++++++++++++++++++++- world/src/sim/mod.rs | 6 ++--- 5 files changed, 45 insertions(+), 12 deletions(-) diff --git a/assets/voxygen/shaders/particle-vert.glsl b/assets/voxygen/shaders/particle-vert.glsl index 8024371b04..e07c0b90b9 100644 --- a/assets/voxygen/shaders/particle-vert.glsl +++ b/assets/voxygen/shaders/particle-vert.glsl @@ -275,7 +275,7 @@ void main() { vec3(0, 0, -2) ) + vec3(sin(lifetime), sin(lifetime + 0.7), sin(lifetime * 0.5)) * 2.0, vec3(4), - vec4(vec3(0.2 + rand7 * 0.2, 0.2 + (0.5 + rand6 * 0.5) * 0.6, 0) * (0.25 + rand1 * 0.5), 1), + vec4(vec3(0.2 + rand7 * 0.2, 0.2 + (0.25 + rand6 * 0.5) * 0.3, 0) * (0.75 + rand1 * 0.5), 1), spin_in_axis(vec3(rand6, rand7, rand8), rand9 * 3 + lifetime * 5) ); } else if (inst_mode == SNOW) { diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 52552b41e7..37d1d5d3c7 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -196,8 +196,8 @@ impl Block { #[inline] pub fn get_max_sunlight(&self) -> Option { match self.kind() { - BlockKind::Water => Some(3), - BlockKind::Leaves => Some(6), + BlockKind::Water => Some(4), + BlockKind::Leaves => Some(10), _ if self.is_opaque() => Some(0), _ => None, } diff --git a/world/src/all.rs b/world/src/all.rs index 2ce6f1ccd8..2630d78b05 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -13,6 +13,7 @@ pub enum ForestKind { Birch, Mangrove, Swamp, + Giant, } pub struct Environment { @@ -25,26 +26,28 @@ impl ForestKind { pub fn humid_range(&self) -> Range { match self { ForestKind::Palm => 0.25..1.4, - ForestKind::Acacia => 0.1..0.6, + ForestKind::Acacia => 0.05..0.55, ForestKind::Baobab => 0.2..0.6, - ForestKind::Oak => 0.5..1.5, + ForestKind::Oak => 0.35..1.5, ForestKind::Pine => 0.2..1.4, ForestKind::Birch => 0.0..0.6, - ForestKind::Mangrove => 0.7..1.3, + ForestKind::Mangrove => 0.65..1.3, ForestKind::Swamp => 0.5..1.1, + _ => 0.0..0.0 } } pub fn temp_range(&self) -> Range { match self { ForestKind::Palm => 0.4..1.6, - ForestKind::Acacia => 0.4..1.6, + ForestKind::Acacia => 0.3..1.6, ForestKind::Baobab => 0.4..0.9, - ForestKind::Oak => -0.35..0.5, + ForestKind::Oak => -0.35..0.6, ForestKind::Pine => -1.8..-0.2, ForestKind::Birch => -0.7..0.25, ForestKind::Mangrove => 0.4..1.6, ForestKind::Swamp => -0.6..0.8, + _ => 0.0..0.0, } } @@ -67,6 +70,7 @@ impl ForestKind { ForestKind::Birch => 0.65, ForestKind::Mangrove => 1.0, ForestKind::Swamp => 1.0, + _ => 0.0, } } diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 13e28a8fe4..c1e178a188 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -124,6 +124,15 @@ pub fn apply_trees_to(canvas: &mut Canvas) { ForestKind::Birch => *BIRCHES, ForestKind::Mangrove => *MANGROVE_TREES, ForestKind::Swamp => *SWAMP_TREES, + ForestKind::Giant => { + break 'model TreeModel::Procedural( + ProceduralTree::generate( + TreeConfig::giant(&mut RandomPerm::new(seed), scale), + &mut RandomPerm::new(seed), + ), + StructureBlock::TemperateLeaves, + ); + }, } }; @@ -283,12 +292,32 @@ impl TreeConfig { straightness: 0.0, max_depth: 1, splits: 50.0..70.0, - split_range: 0.2..1.2, + split_range: 0.1..1.2, branch_len_bias: 0.75, leaf_vertical_scale: 0.3, proportionality: 1.0, } } + + pub fn giant(rng: &mut impl Rng, scale: f32) -> Self { + let scale = scale * (1.0 + rng.gen::().powi(4)); + let log_scale = 1.0 + scale.log2().max(0.0); + + Self { + trunk_len: 9.0 * scale, + trunk_radius: 4.0 * scale, + branch_child_len: 0.9, + branch_child_radius: 0.7, + leaf_radius: 1.5 * log_scale..2.0 * log_scale, + straightness: 0.4, + max_depth: (6.0 + log_scale) as usize, + splits: 1.8..3.0, + split_range: 0.8..1.5, + branch_len_bias: 0.0, + leaf_vertical_scale: 1.0, + proportionality: 0.0, + } + } } // TODO: Rename this to `Tree` when the name conflict is gone diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index ebe2ef1222..7e10508125 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2017,7 +2017,7 @@ impl WorldSim { .enumerate() .map(|(i, fk)| { const CLUSTER_SIZE: f64 = 48.0; - let nz = (FastNoise2d::new(i as u32).get(wpos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; + let nz = (FastNoise2d::new(i as u32).get(pos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; (fk.proclivity(&env) * nz, fk) }) .collect::>()) @@ -2029,8 +2029,8 @@ impl WorldSim { .map(move |(pos, seed)| TreeAttr { pos, seed, - scale: 4.0, - forest_kind: ForestKind::Oak, + scale: 5.0, + forest_kind: ForestKind::Giant, }); normal_trees.chain(giant_trees) From 6fc7d2a9068af2ec5f0309d8b44529e99ea8cec4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 8 Feb 2021 02:29:25 +0000 Subject: [PATCH 27/87] Faster More interesting giant trees, better oaks, hives on branches --- common/src/terrain/structure.rs | 1 + voxygen/src/scene/particle.rs | 2 +- voxygen/src/scene/terrain/watcher.rs | 7 ++++- world/src/all.rs | 2 +- world/src/block/mod.rs | 1 + world/src/layer/tree.rs | 38 ++++++++++++++++++---------- world/src/lib.rs | 2 +- world/src/sim/mod.rs | 4 ++- 8 files changed, 38 insertions(+), 19 deletions(-) diff --git a/common/src/terrain/structure.rs b/common/src/terrain/structure.rs index 4a9867474a..3db0b3b037 100644 --- a/common/src/terrain/structure.rs +++ b/common/src/terrain/structure.rs @@ -30,6 +30,7 @@ make_case_elim!( Hollow = 13, Liana = 14, Normal(color: Rgb) = 15, + Log = 16, } ); diff --git a/voxygen/src/scene/particle.rs b/voxygen/src/scene/particle.rs index efd3d3de8e..d7d1f658bf 100644 --- a/voxygen/src/scene/particle.rs +++ b/voxygen/src/scene/particle.rs @@ -571,7 +571,7 @@ impl ParticleMgr { cond: |_| true, }, BlockParticles { - blocks: |boi| &boi.reeds, + blocks: |boi| &boi.fireflies, range: 6, rate: 0.004, lifetime: 40.0, diff --git a/voxygen/src/scene/terrain/watcher.rs b/voxygen/src/scene/terrain/watcher.rs index 257e01c05e..2d68b512d5 100644 --- a/voxygen/src/scene/terrain/watcher.rs +++ b/voxygen/src/scene/terrain/watcher.rs @@ -15,6 +15,7 @@ pub struct BlocksOfInterest { pub smokers: Vec>, pub beehives: Vec>, pub reeds: Vec>, + pub fireflies: Vec>, pub flowers: Vec>, pub fire_bowls: Vec>, pub snow: Vec>, @@ -39,6 +40,7 @@ impl BlocksOfInterest { let mut smokers = Vec::new(); let mut beehives = Vec::new(); let mut reeds = Vec::new(); + let mut fireflies = Vec::new(); let mut flowers = Vec::new(); let mut interactables = Vec::new(); let mut lights = Vec::new(); @@ -94,10 +96,12 @@ impl BlocksOfInterest { Some(SpriteKind::Beehive) => beehives.push(pos), Some(SpriteKind::Reed) => { reeds.push(pos); + fireflies.push(pos); if thread_rng().gen_range(0..12) == 0 { - frogs.push(pos) + frogs.push(pos); } }, + Some(SpriteKind::CaveMushroom) => fireflies.push(pos), Some(SpriteKind::PinkFlower) => flowers.push(pos), Some(SpriteKind::PurpleFlower) => flowers.push(pos), Some(SpriteKind::RedFlower) => flowers.push(pos), @@ -123,6 +127,7 @@ impl BlocksOfInterest { smokers, beehives, reeds, + fireflies, flowers, interactables, lights, diff --git a/world/src/all.rs b/world/src/all.rs index 2630d78b05..ecd63e04b3 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -12,8 +12,8 @@ pub enum ForestKind { Pine, Birch, Mangrove, - Swamp, Giant, + Swamp, } pub struct Environment { diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index a7f3c4c156..cdc8d1e2ce 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -249,6 +249,7 @@ pub fn block_from_structure( Some(with_sprite(SpriteKind::Chest)) } }, + StructureBlock::Log => Some(Block::new(BlockKind::Wood, Rgb::new(60, 30, 0))), // We interpolate all these BlockKinds as needed. StructureBlock::TemperateLeaves | StructureBlock::PineLeaves diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index c1e178a188..becc22045a 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -9,7 +9,7 @@ use common::{ assets::AssetHandle, terrain::{ structure::{Structure, StructureBlock, StructuresGroup}, - Block, BlockKind, + Block, BlockKind, SpriteKind, }, vol::ReadVol, }; @@ -40,7 +40,7 @@ static UNIT_CHOOSER: UnitChooser = UnitChooser::new(0x700F4EC7); static QUIRKY_RAND: RandomPerm = RandomPerm::new(0xA634460F); #[allow(clippy::if_same_then_else)] -pub fn apply_trees_to(canvas: &mut Canvas) { +pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { // TODO: Get rid of this enum TreeModel { Structure(Structure), @@ -167,6 +167,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { let mut is_top = true; let mut is_leaf_top = true; + let mut last_block = Block::empty(); for z in (bounds.min.z..bounds.max.z).rev() { let wpos = Vec3::new(wpos2d.x, wpos2d.y, tree.pos.z + z); let model_pos = Vec3::from( @@ -183,7 +184,7 @@ pub fn apply_trees_to(canvas: &mut Canvas) { TreeModel::Structure(s) => s.get(model_pos).ok().copied(), TreeModel::Procedural(t, leaf_block) => Some( match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { - (true, _) => StructureBlock::Normal(Rgb::new(60, 30, 0)), + (true, _) => StructureBlock::Log, (_, true) => *leaf_block, (_, _) => StructureBlock::None, }, @@ -200,8 +201,11 @@ pub fn apply_trees_to(canvas: &mut Canvas) { Block::air, ) .map(|block| { + // Add mushrooms to the tree + if last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..48) == 0 { + canvas.set(wpos + Vec3::unit_z(), Block::air(SpriteKind::CaveMushroom)); // Add a snow covering to the block above under certain circumstances - if col.snow_cover + } else if col.snow_cover && ((block.kind() == BlockKind::Leaves && is_leaf_top) || (is_top && block.is_filled())) { @@ -213,9 +217,15 @@ pub fn apply_trees_to(canvas: &mut Canvas) { canvas.set(wpos, block); is_leaf_top = false; is_top = false; + last_block = block; }) .unwrap_or_else(|| { + if last_block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..512) == 0 { + canvas.set(wpos, Block::air(SpriteKind::Beehive)); + } + is_leaf_top = true; + last_block = Block::empty(); }); } } @@ -260,18 +270,18 @@ pub struct TreeConfig { impl TreeConfig { pub fn oak(rng: &mut impl Rng, scale: f32) -> Self { - let scale = scale * (1.0 + rng.gen::().powi(4)); + let scale = scale * (0.9 + rng.gen::().powi(4)); let log_scale = 1.0 + scale.log2().max(0.0); Self { trunk_len: 9.0 * scale, trunk_radius: 2.0 * scale, - branch_child_len: 0.8, + branch_child_len: 0.9, branch_child_radius: 0.75, leaf_radius: 2.5 * log_scale..3.25 * log_scale, - straightness: 0.5, - max_depth: (4.0 + log_scale) as usize, - splits: 2.0..3.0, + straightness: 0.45, + max_depth: 4, + splits: 2.25..3.25, split_range: 0.75..1.5, branch_len_bias: 0.0, leaf_vertical_scale: 1.0, @@ -308,11 +318,11 @@ impl TreeConfig { trunk_radius: 4.0 * scale, branch_child_len: 0.9, branch_child_radius: 0.7, - leaf_radius: 1.5 * log_scale..2.0 * log_scale, - straightness: 0.4, - max_depth: (6.0 + log_scale) as usize, - splits: 1.8..3.0, - split_range: 0.8..1.5, + leaf_radius: 2.25 * log_scale..3.5 * log_scale, + straightness: 0.5, + max_depth: (7.0 + log_scale) as usize, + splits: 1.5..2.75, + split_range: 1.0..1.1, branch_len_bias: 0.0, leaf_vertical_scale: 1.0, proportionality: 0.0, diff --git a/world/src/lib.rs b/world/src/lib.rs index 73dc97b95a..794948f663 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -286,7 +286,7 @@ impl World { chunk: &mut chunk, }; - layer::apply_trees_to(&mut canvas); + layer::apply_trees_to(&mut canvas, &mut dynamic_rng); layer::apply_scatter_to(&mut canvas, &mut dynamic_rng); layer::apply_caves_to(&mut canvas, &mut dynamic_rng); layer::apply_paths_to(&mut canvas); diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 7e10508125..51914c28d9 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2026,10 +2026,12 @@ impl WorldSim { }); let giant_trees = std::array::IntoIter::new(self.gen_ctx.big_structure_gen.get(wpos)) + // Don't even consider trees if we aren't close + .filter(move |(pos, _)| pos.distance_squared(wpos) < 256i32.pow(2)) .map(move |(pos, seed)| TreeAttr { pos, seed, - scale: 5.0, + scale: 4.0, forest_kind: ForestKind::Giant, }); From 0c302bb020efe7eb816c6bce62864efe6df36c8b Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 8 Feb 2021 11:10:47 +0000 Subject: [PATCH 28/87] Lanterns in trees --- .../voxygen/voxel/sprite/lantern/lantern-orange.vox | 3 +++ assets/voxygen/voxel/sprite_manifest.ron | 12 ++++++++++++ common/src/terrain/block.rs | 1 + common/src/terrain/sprite.rs | 3 +++ world/src/all.rs | 1 + world/src/layer/tree.rs | 6 +++--- world/src/sim/mod.rs | 4 +++- 7 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 assets/voxygen/voxel/sprite/lantern/lantern-orange.vox diff --git a/assets/voxygen/voxel/sprite/lantern/lantern-orange.vox b/assets/voxygen/voxel/sprite/lantern/lantern-orange.vox new file mode 100644 index 0000000000..104ccaec39 --- /dev/null +++ b/assets/voxygen/voxel/sprite/lantern/lantern-orange.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:267dad1374260e2e072027ba005389ba66082f74e7c8ba64a83bb58d41a04fc3 +size 1860 diff --git a/assets/voxygen/voxel/sprite_manifest.ron b/assets/voxygen/voxel/sprite_manifest.ron index c4aff9d909..158bb5e386 100644 --- a/assets/voxygen/voxel/sprite_manifest.ron +++ b/assets/voxygen/voxel/sprite_manifest.ron @@ -2824,4 +2824,16 @@ SapphireSmall: Some(( ], wind_sway: 0.0, )), + +// Lantern +Lantern: Some(( + variations: [ + ( + model: "voxygen.voxel.sprite.lantern.lantern-orange", + offset: (-2.5, -2.5, 0.0), + lod_axes: (0.0, 0.0, 0.0), + ), + ], + wind_sway: 0.0, +)), ) diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 37d1d5d3c7..f72ef8e950 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -189,6 +189,7 @@ impl Block { | SpriteKind::RubySmall | SpriteKind::EmeraldSmall | SpriteKind::SapphireSmall => Some(3), + SpriteKind::Lantern => Some(24), _ => None, } } diff --git a/common/src/terrain/sprite.rs b/common/src/terrain/sprite.rs index de7e8fd6ff..bf67e20c43 100644 --- a/common/src/terrain/sprite.rs +++ b/common/src/terrain/sprite.rs @@ -142,6 +142,7 @@ make_case_elim!( Seagrass = 0x73, RedAlgae = 0x74, UnderwaterVent = 0x75, + Lantern = 0x76, } ); @@ -201,6 +202,7 @@ impl SpriteKind { | SpriteKind::DropGate => 1.0, // TODO: Figure out if this should be solid or not. SpriteKind::Shelf => 1.0, + SpriteKind::Lantern => 0.9, _ => return None, }) } @@ -289,6 +291,7 @@ impl SpriteKind { | SpriteKind::Bowl | SpriteKind::VialEmpty | SpriteKind::FireBowlGround + | SpriteKind::Lantern ) } } diff --git a/world/src/all.rs b/world/src/all.rs index ecd63e04b3..d1a7cc98ec 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -87,4 +87,5 @@ pub struct TreeAttr { pub seed: u32, pub scale: f32, pub forest_kind: ForestKind, + pub lanterns: bool, } diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index becc22045a..7f0f05a0c9 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -60,7 +60,7 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { canvas.foreach_col(|canvas, wpos2d, col| { let trees = info.land().get_near_trees(wpos2d); - for TreeAttr { pos, seed, scale, forest_kind } in trees { + for TreeAttr { pos, seed, scale, forest_kind, lanterns } in trees { let tree = if let Some(tree) = tree_cache.entry(pos).or_insert_with(|| { let col = ColumnGen::new(info.land()).get((pos, info.index()))?; @@ -202,8 +202,8 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { ) .map(|block| { // Add mushrooms to the tree - if last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..48) == 0 { - canvas.set(wpos + Vec3::unit_z(), Block::air(SpriteKind::CaveMushroom)); + if lanterns && last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..48) == 0 { + canvas.set(wpos + Vec3::unit_z(), Block::air(SpriteKind::Lantern)); // Add a snow covering to the block above under certain circumstances } else if col.snow_cover && ((block.kind() == BlockKind::Leaves && is_leaf_top) diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 51914c28d9..676039ed10 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2017,11 +2017,12 @@ impl WorldSim { .enumerate() .map(|(i, fk)| { const CLUSTER_SIZE: f64 = 48.0; - let nz = (FastNoise2d::new(i as u32).get(pos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; + let nz = (FastNoise2d::new(i as u32 * 37).get(pos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; (fk.proclivity(&env) * nz, fk) }) .collect::>()) .choose_seeded(seed), + lanterns: false, }) }); @@ -2033,6 +2034,7 @@ impl WorldSim { seed, scale: 4.0, forest_kind: ForestKind::Giant, + lanterns: true, }); normal_trees.chain(giant_trees) From 284d06106834f50618dde2541c1b6e7d4fbdf82d Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 8 Feb 2021 15:33:19 +0000 Subject: [PATCH 29/87] Added staircases to giant trees --- world/src/layer/tree.rs | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 7f0f05a0c9..879dcbf3e8 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -270,7 +270,7 @@ pub struct TreeConfig { impl TreeConfig { pub fn oak(rng: &mut impl Rng, scale: f32) -> Self { - let scale = scale * (0.9 + rng.gen::().powi(4)); + let scale = scale * (0.8 + rng.gen::().powi(4) * 0.9); let log_scale = 1.0 + scale.log2().max(0.0); Self { @@ -310,21 +310,20 @@ impl TreeConfig { } pub fn giant(rng: &mut impl Rng, scale: f32) -> Self { - let scale = scale * (1.0 + rng.gen::().powi(4)); let log_scale = 1.0 + scale.log2().max(0.0); Self { - trunk_len: 9.0 * scale, - trunk_radius: 4.0 * scale, - branch_child_len: 0.9, - branch_child_radius: 0.7, - leaf_radius: 2.25 * log_scale..3.5 * log_scale, - straightness: 0.5, - max_depth: (7.0 + log_scale) as usize, - splits: 1.5..2.75, + trunk_len: 12.0 * scale, + trunk_radius: 8.0 * scale, + branch_child_len: 0.89, + branch_child_radius: 0.65, + leaf_radius: 3.0 * log_scale..5.25 * log_scale, + straightness: 0.38, + max_depth: (6.0 + log_scale) as usize, + splits: 1.5..2.5, split_range: 1.0..1.1, branch_len_bias: 0.0, - leaf_vertical_scale: 1.0, + leaf_vertical_scale: 0.6, proportionality: 0.0, } } @@ -386,11 +385,14 @@ impl ProceduralTree { 0.0 }; + let has_stairs = branch_radius > 3.0 && start.xy().distance(end.xy()) < (start.z - end.z).abs(); + let bark_radius = if has_stairs { 8.0 } else { 0.0 }; + // The AABB that covers this branch, along with wood and leaves that eminate // from it let mut aabb = Aabb { - min: Vec3::partial_min(start, end) - wood_radius.max(leaf_radius), - max: Vec3::partial_max(start, end) + wood_radius.max(leaf_radius), + min: Vec3::partial_min(start, end) - (wood_radius + bark_radius).max(leaf_radius), + max: Vec3::partial_max(start, end) + (wood_radius + bark_radius).max(leaf_radius), }; let mut child_idx = None; @@ -405,8 +407,8 @@ impl ProceduralTree { let splits = rng.gen_range(config.splits.clone()).round() as usize; for i in 0..splits { let dist = Lerp::lerp( - i as f32 / (splits - 1) as f32, rng.gen_range(0.0..1.0), + i as f32 / (splits - 1) as f32, config.proportionality, ); @@ -466,6 +468,7 @@ impl ProceduralTree { aabb, sibling_idx, child_idx, + has_stairs, }); (idx, aabb) @@ -522,6 +525,8 @@ struct Branch { sibling_idx: Option, child_idx: Option, + + has_stairs: bool, } impl Branch { @@ -538,6 +543,14 @@ impl Branch { if p_d2 < self.wood_radius.powi(2) { (true, false) + } else if self.has_stairs && { + let horizontal_projected = Lerp::lerp_unclamped(self.line.start, self.line.end, (pos.z - self.line.start.z) / (self.line.end.z - self.line.start.z)); + let rpos = pos.xy() - horizontal_projected.xy(); + let stretch = 32.0; + let stair_section = ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + pos.z).rem_euclid(stretch); + stair_section < 2.0 && p_d2 < (self.wood_radius + 8.0).powi(2) + } { + (true, false) } else { let diff = (p - pos) / Vec3::new(1.0, 1.0, self.leaf_vertical_scale); From b07c942aef151b39842052af83ce24d657328cf4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 8 Feb 2021 17:57:55 +0000 Subject: [PATCH 30/87] Added staircase to giant trees --- world/src/all.rs | 2 +- world/src/layer/tree.rs | 65 ++++++++++++++++++++++++----------------- world/src/sim/mod.rs | 4 +-- 3 files changed, 41 insertions(+), 30 deletions(-) diff --git a/world/src/all.rs b/world/src/all.rs index d1a7cc98ec..40158af578 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -87,5 +87,5 @@ pub struct TreeAttr { pub seed: u32, pub scale: f32, pub forest_kind: ForestKind, - pub lanterns: bool, + pub inhabited: bool, } diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 879dcbf3e8..ccfd936c7b 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -60,7 +60,7 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { canvas.foreach_col(|canvas, wpos2d, col| { let trees = info.land().get_near_trees(wpos2d); - for TreeAttr { pos, seed, scale, forest_kind, lanterns } in trees { + for TreeAttr { pos, seed, scale, forest_kind, inhabited } in trees { let tree = if let Some(tree) = tree_cache.entry(pos).or_insert_with(|| { let col = ColumnGen::new(info.land()).get((pos, info.index()))?; @@ -127,7 +127,7 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { ForestKind::Giant => { break 'model TreeModel::Procedural( ProceduralTree::generate( - TreeConfig::giant(&mut RandomPerm::new(seed), scale), + TreeConfig::giant(&mut RandomPerm::new(seed), scale, inhabited), &mut RandomPerm::new(seed), ), StructureBlock::TemperateLeaves, @@ -184,9 +184,10 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { TreeModel::Structure(s) => s.get(model_pos).ok().copied(), TreeModel::Procedural(t, leaf_block) => Some( match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { - (true, _) => StructureBlock::Log, - (_, true) => *leaf_block, - (_, _) => StructureBlock::None, + (_, _, true) => StructureBlock::Hollow, + (true, _, _) => StructureBlock::Log, + (_, true, _) => *leaf_block, + (_, _, _) => StructureBlock::None, }, ), } { @@ -201,8 +202,8 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { Block::air, ) .map(|block| { - // Add mushrooms to the tree - if lanterns && last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..48) == 0 { + // Add lights to the tree + if inhabited && last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..256) == 0 { canvas.set(wpos + Vec3::unit_z(), Block::air(SpriteKind::Lantern)); // Add a snow covering to the block above under certain circumstances } else if col.snow_cover @@ -266,6 +267,8 @@ pub struct TreeConfig { pub leaf_vertical_scale: f32, /// How evenly spaced (vs random) sub-branches are along their parent. pub proportionality: f32, + /// Whether the tree is inhabited (adds various features and effects) + pub inhabited: bool, } impl TreeConfig { @@ -286,6 +289,7 @@ impl TreeConfig { branch_len_bias: 0.0, leaf_vertical_scale: 1.0, proportionality: 0.0, + inhabited: false, } } @@ -306,10 +310,11 @@ impl TreeConfig { branch_len_bias: 0.75, leaf_vertical_scale: 0.3, proportionality: 1.0, + inhabited: false, } } - pub fn giant(rng: &mut impl Rng, scale: f32) -> Self { + pub fn giant(rng: &mut impl Rng, scale: f32, inhabited: bool) -> Self { let log_scale = 1.0 + scale.log2().max(0.0); Self { @@ -325,6 +330,7 @@ impl TreeConfig { branch_len_bias: 0.0, leaf_vertical_scale: 0.6, proportionality: 0.0, + inhabited, } } } @@ -385,7 +391,7 @@ impl ProceduralTree { 0.0 }; - let has_stairs = branch_radius > 3.0 && start.xy().distance(end.xy()) < (start.z - end.z).abs(); + let has_stairs = config.inhabited && branch_radius > 3.0 && start.xy().distance(end.xy()) < (start.z - end.z).abs(); let bark_radius = if has_stairs { 8.0 } else { 0.0 }; // The AABB that covers this branch, along with wood and leaves that eminate @@ -478,13 +484,13 @@ impl ProceduralTree { pub fn get_bounds(&self) -> Aabb { self.branches[self.trunk_idx].aabb } // Recursively search for branches or leaves by walking the tree's branch graph. - fn is_branch_or_leaves_at_inner(&self, pos: Vec3, branch_idx: usize) -> (bool, bool) { + fn is_branch_or_leaves_at_inner(&self, pos: Vec3, branch_idx: usize) -> (bool, bool, bool) { let branch = &self.branches[branch_idx]; // Always probe the sibling branch, since our AABB doesn't include its bounds // (it's not one of our children) let branch_or_leaves = branch .sibling_idx - .map(|idx| Vec2::from(self.is_branch_or_leaves_at_inner(pos, idx))) + .map(|idx| Vec3::from(self.is_branch_or_leaves_at_inner(pos, idx))) .unwrap_or_default(); // Only continue probing this sub-graph of the tree if the sample position falls @@ -492,10 +498,10 @@ impl ProceduralTree { if branch.aabb.contains_point(pos) { (branch_or_leaves // Probe this branch - | Vec2::from(branch.is_branch_or_leaves_at(pos)) + | Vec3::from(branch.is_branch_or_leaves_at(pos)) // Probe the children of this branch | branch.child_idx - .map(|idx| Vec2::from(self.is_branch_or_leaves_at_inner(pos, idx))) + .map(|idx| Vec3::from(self.is_branch_or_leaves_at_inner(pos, idx))) .unwrap_or_default()) .into_tuple() } else { @@ -506,7 +512,7 @@ impl ProceduralTree { /// Determine whether there are either branches or leaves at the given /// position in the tree. #[inline(always)] - pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { + pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool, bool) { self.is_branch_or_leaves_at_inner(pos, self.trunk_idx) } } @@ -532,7 +538,7 @@ struct Branch { impl Branch { /// Determine whether there are either branches or leaves at the given /// position in the branch. - pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool) { + pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool, bool) { // fn finvsqrt(x: f32) -> f32 { // let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); // y * (1.5 - ( x * 0.5 * y * y )) @@ -542,19 +548,24 @@ impl Branch { let p_d2 = p.distance_squared(pos); if p_d2 < self.wood_radius.powi(2) { - (true, false) - } else if self.has_stairs && { - let horizontal_projected = Lerp::lerp_unclamped(self.line.start, self.line.end, (pos.z - self.line.start.z) / (self.line.end.z - self.line.start.z)); - let rpos = pos.xy() - horizontal_projected.xy(); - let stretch = 32.0; - let stair_section = ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + pos.z).rem_euclid(stretch); - stair_section < 2.0 && p_d2 < (self.wood_radius + 8.0).powi(2) - } { - (true, false) - } else { + (true, false, false) // Wood + } else if { let diff = (p - pos) / Vec3::new(1.0, 1.0, self.leaf_vertical_scale); - - (false, diff.magnitude_squared() < self.leaf_radius.powi(2)) + diff.magnitude_squared() < self.leaf_radius.powi(2) + } { + (false, true, false) // Leaves + } else { + let stair_width = 5.0; + let stair_thickness = 1.5; + let stair_space = 6.0; + if self.has_stairs && p_d2 < (self.wood_radius + stair_width).powi(2) { + let rpos = pos.xy() - p.xy(); + let stretch = 32.0; + let stair_section = ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + pos.z).rem_euclid(stretch); + (stair_section < stair_thickness, false, stair_section >= stair_thickness && stair_section < stair_thickness + stair_space) // Stairs + } else { + (false, false, false) + } } } } diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 676039ed10..80659f319e 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2022,7 +2022,7 @@ impl WorldSim { }) .collect::>()) .choose_seeded(seed), - lanterns: false, + inhabited: false, }) }); @@ -2034,7 +2034,7 @@ impl WorldSim { seed, scale: 4.0, forest_kind: ForestKind::Giant, - lanterns: true, + inhabited: (seed / 13) % 2 == 0, }); normal_trees.chain(giant_trees) From 6af0e77efdca9ce99e0aa6938c5d694a4646f4cd Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 9 Feb 2021 01:11:42 +0000 Subject: [PATCH 31/87] Better stairs --- common/src/terrain/structure.rs | 1 + world/src/block/mod.rs | 1 + world/src/layer/tree.rs | 89 ++++++++++++++++++++------------- world/src/sim/mod.rs | 6 +-- 4 files changed, 58 insertions(+), 39 deletions(-) diff --git a/common/src/terrain/structure.rs b/common/src/terrain/structure.rs index 3db0b3b037..c9b12d8d0c 100644 --- a/common/src/terrain/structure.rs +++ b/common/src/terrain/structure.rs @@ -31,6 +31,7 @@ make_case_elim!( Liana = 14, Normal(color: Rgb) = 15, Log = 16, + Block(kind: BlockKind, color: Rgb) = 17, } ); diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index cdc8d1e2ce..9b8adfab55 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -220,6 +220,7 @@ pub fn block_from_structure( sample.surface_color.map(|e| (e * 255.0) as u8), )), StructureBlock::Normal(color) => Some(Block::new(BlockKind::Misc, color)), + StructureBlock::Block(kind, color) => Some(Block::new(kind, color)), StructureBlock::Water => Some(Block::water(SpriteKind::Empty)), // TODO: If/when liquid supports other colors again, revisit this. StructureBlock::GreenSludge => Some(Block::water(SpriteKind::Empty)), diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index ccfd936c7b..31dafa596b 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -184,10 +184,11 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { TreeModel::Structure(s) => s.get(model_pos).ok().copied(), TreeModel::Procedural(t, leaf_block) => Some( match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { - (_, _, true) => StructureBlock::Hollow, - (true, _, _) => StructureBlock::Log, - (_, true, _) => *leaf_block, - (_, _, _) => StructureBlock::None, + (_, _, true, _) => StructureBlock::Block(BlockKind::Wood, Rgb::new(110, 68, 22)), + (_, _, _, true) => StructureBlock::Hollow, + (true, _, _, _) => StructureBlock::Log, + (_, true, _, _) => *leaf_block, + _ => StructureBlock::None, }, ), } { @@ -273,7 +274,7 @@ pub struct TreeConfig { impl TreeConfig { pub fn oak(rng: &mut impl Rng, scale: f32) -> Self { - let scale = scale * (0.8 + rng.gen::().powi(4) * 0.9); + let scale = scale * (0.8 + rng.gen::().powi(4) * 0.75); let log_scale = 1.0 + scale.log2().max(0.0); Self { @@ -318,13 +319,13 @@ impl TreeConfig { let log_scale = 1.0 + scale.log2().max(0.0); Self { - trunk_len: 12.0 * scale, - trunk_radius: 8.0 * scale, - branch_child_len: 0.89, - branch_child_radius: 0.65, - leaf_radius: 3.0 * log_scale..5.25 * log_scale, - straightness: 0.38, - max_depth: (6.0 + log_scale) as usize, + trunk_len: 11.0 * scale, + trunk_radius: 6.0 * scale, + branch_child_len: 0.9, + branch_child_radius: 0.75, + leaf_radius: 2.5 * scale..3.75 * scale, + straightness: 0.36, + max_depth: (7.0 + log_scale) as usize, splits: 1.5..2.5, split_range: 1.0..1.1, branch_len_bias: 0.0, @@ -391,8 +392,8 @@ impl ProceduralTree { 0.0 }; - let has_stairs = config.inhabited && branch_radius > 3.0 && start.xy().distance(end.xy()) < (start.z - end.z).abs(); - let bark_radius = if has_stairs { 8.0 } else { 0.0 }; + let has_stairs = config.inhabited && depth < config.max_depth && branch_radius > 6.5 && start.xy().distance(end.xy()) < (start.z - end.z).abs() * 1.5; + let bark_radius = if has_stairs { 5.0 } else { 0.0 } + wood_radius * 0.25; // The AABB that covers this branch, along with wood and leaves that eminate // from it @@ -484,26 +485,30 @@ impl ProceduralTree { pub fn get_bounds(&self) -> Aabb { self.branches[self.trunk_idx].aabb } // Recursively search for branches or leaves by walking the tree's branch graph. - fn is_branch_or_leaves_at_inner(&self, pos: Vec3, branch_idx: usize) -> (bool, bool, bool) { + fn is_branch_or_leaves_at_inner(&self, pos: Vec3, parent_d2: f32, branch_idx: usize) -> (bool, bool, bool, bool) { let branch = &self.branches[branch_idx]; // Always probe the sibling branch, since our AABB doesn't include its bounds // (it's not one of our children) let branch_or_leaves = branch .sibling_idx - .map(|idx| Vec3::from(self.is_branch_or_leaves_at_inner(pos, idx))) + .map(|idx| Vec4::::from(self.is_branch_or_leaves_at_inner(pos, parent_d2, idx))) .unwrap_or_default(); // Only continue probing this sub-graph of the tree if the sample position falls // within its AABB if branch.aabb.contains_point(pos) { - (branch_or_leaves - // Probe this branch - | Vec3::from(branch.is_branch_or_leaves_at(pos)) - // Probe the children of this branch - | branch.child_idx - .map(|idx| Vec3::from(self.is_branch_or_leaves_at_inner(pos, idx))) - .unwrap_or_default()) - .into_tuple() + // Probe this branch + let (this, d2) = branch.is_branch_or_leaves_at(pos, parent_d2); + + let siblings = branch_or_leaves | Vec4::from(this); + + // Probe the children of this branch + let children = branch.child_idx + .map(|idx| Vec4::from(self.is_branch_or_leaves_at_inner(pos, d2, idx))) + .unwrap_or_default(); + + // Only allow empties for children if there is no solid at the current depth + (siblings | (children & Vec4::new(true, true, true, !(siblings.x | siblings.y)))).into_tuple() } else { branch_or_leaves.into_tuple() } @@ -512,8 +517,8 @@ impl ProceduralTree { /// Determine whether there are either branches or leaves at the given /// position in the tree. #[inline(always)] - pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool, bool) { - self.is_branch_or_leaves_at_inner(pos, self.trunk_idx) + pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool, bool, bool) { + self.is_branch_or_leaves_at_inner(pos, 10000.0, self.trunk_idx) } } @@ -538,34 +543,46 @@ struct Branch { impl Branch { /// Determine whether there are either branches or leaves at the given /// position in the branch. - pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool, bool) { + pub fn is_branch_or_leaves_at(&self, pos: Vec3, parent_d2: f32) -> ((bool, bool, bool, bool), f32) { // fn finvsqrt(x: f32) -> f32 { // let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); // y * (1.5 - ( x * 0.5 * y * y )) // } - let p = self.line.projected_point(pos); - let p_d2 = p.distance_squared(pos); + fn smooth(a: f32, b: f32, k: f32) -> f32 { + // let h = (0.5 + 0.5 * (b - a) / k).clamped(0.0, 1.0); + // Lerp::lerp(b, a, h) - k * h * (1.0 - h) - if p_d2 < self.wood_radius.powi(2) { - (true, false, false) // Wood + let h = (k-(a-b).abs()).max(0.0); + a.min(b) - h * h * 0.25 / k + } + + let p = self.line.projected_point(pos); + let d2 = p.distance_squared(pos); + + let d2_smooth = d2;//smooth(d2.sqrt(), parent_d2.sqrt(), 30.0).powi(2); + + let mask = if d2_smooth < self.wood_radius.powi(2) { + (true, false, false, false) // Wood } else if { let diff = (p - pos) / Vec3::new(1.0, 1.0, self.leaf_vertical_scale); diff.magnitude_squared() < self.leaf_radius.powi(2) } { - (false, true, false) // Leaves + (false, true, false, false) // Leaves } else { let stair_width = 5.0; let stair_thickness = 1.5; let stair_space = 6.0; - if self.has_stairs && p_d2 < (self.wood_radius + stair_width).powi(2) { + if self.has_stairs && d2_smooth < (self.wood_radius + stair_width).powi(2) { let rpos = pos.xy() - p.xy(); let stretch = 32.0; let stair_section = ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + pos.z).rem_euclid(stretch); - (stair_section < stair_thickness, false, stair_section >= stair_thickness && stair_section < stair_thickness + stair_space) // Stairs + (false, false, stair_section < stair_thickness, stair_section >= stair_thickness && stair_section < stair_thickness + stair_space) // Stairs } else { - (false, false, false) + (false, false, false, false) } - } + }; + + (mask, d2) } } diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 80659f319e..2c210ba6df 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -519,7 +519,7 @@ impl WorldSim { cave_0_nz: SuperSimplex::new().set_seed(rng.gen()), cave_1_nz: SuperSimplex::new().set_seed(rng.gen()), - structure_gen: StructureGen2d::new(rng.gen(), 24, 12), + structure_gen: StructureGen2d::new(rng.gen(), 24, 10), big_structure_gen: StructureGen2d::new(rng.gen(), 768, 512), region_gen: StructureGen2d::new(rng.gen(), 400, 96), humid_nz: Billow::new() @@ -2028,11 +2028,11 @@ impl WorldSim { let giant_trees = std::array::IntoIter::new(self.gen_ctx.big_structure_gen.get(wpos)) // Don't even consider trees if we aren't close - .filter(move |(pos, _)| pos.distance_squared(wpos) < 256i32.pow(2)) + .filter(move |(pos, _)| pos.distance_squared(wpos) < 512i32.pow(2)) .map(move |(pos, seed)| TreeAttr { pos, seed, - scale: 4.0, + scale: 5.0, forest_kind: ForestKind::Giant, inhabited: (seed / 13) % 2 == 0, }); From c7e82aea26d41d797620648516ac050814315d6c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 10 Feb 2021 01:18:22 +0000 Subject: [PATCH 32/87] Began work integrating new sites into the world --- world/src/civ/mod.rs | 21 ++++++++--- world/src/layer/tree.rs | 82 +++++++++++++++++++++++++++-------------- world/src/lib.rs | 3 +- world/src/site/mod.rs | 37 +++++++++++++++---- world/src/site2/mod.rs | 26 ++++++++++++- world/src/site2/tile.rs | 16 ++++++-- 6 files changed, 138 insertions(+), 47 deletions(-) diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index cf791fef6e..2b9ca633e6 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -8,6 +8,7 @@ use crate::{ sim::WorldSim, site::{namegen::NameGen, Castle, Dungeon, Settlement, Site as WorldSite}, util::{attempt, seed_expan, MapVec, CARDINALS, NEIGHBORS}, + site2, Index, }; use common::{ @@ -107,6 +108,7 @@ impl Civs { attempt(5, || { let (kind, size) = match ctx.rng.gen_range(0..8) { 0 => (SiteKind::Castle, 3), + 1 => (SiteKind::Refactor, 5), _ => (SiteKind::Dungeon, 0), }; let loc = find_site_loc(&mut ctx, None, size)?; @@ -142,14 +144,13 @@ impl Civs { // Flatten ground around sites for site in this.sites.values() { - let radius = 48i32; - let wpos = site.center * TerrainChunkSize::RECT_SIZE.map(|e: u32| e as i32); - let flatten_radius = match &site.kind { - SiteKind::Settlement => 10.0, - SiteKind::Dungeon => 2.0, - SiteKind::Castle => 5.0, + let (radius, flatten_radius) = match &site.kind { + SiteKind::Settlement => (32i32, 10.0), + SiteKind::Dungeon => (8i32, 2.0), + SiteKind::Castle => (16i32, 5.0), + SiteKind::Refactor => (0i32, 0.0), }; let (raise, raise_dist): (f32, i32) = match &site.kind { @@ -215,6 +216,13 @@ impl Civs { SiteKind::Castle => { WorldSite::castle(Castle::generate(wpos, Some(ctx.sim), &mut rng)) }, + SiteKind::Refactor => { + WorldSite::refactor({ + let mut site = site2::Site::generate(&mut rng); + site.origin = wpos; + site + }) + }, }); sim_site.site_tmp = Some(site); let site_ref = &index.sites[site]; @@ -893,6 +901,7 @@ pub enum SiteKind { Settlement, Dungeon, Castle, + Refactor, } impl Site { diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 31dafa596b..ab7bd7d6ca 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -185,7 +185,7 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { TreeModel::Procedural(t, leaf_block) => Some( match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { (_, _, true, _) => StructureBlock::Block(BlockKind::Wood, Rgb::new(110, 68, 22)), - (_, _, _, true) => StructureBlock::Hollow, + (_, _, _, true) => StructureBlock::None, (true, _, _, _) => StructureBlock::Log, (_, true, _, _) => *leaf_block, _ => StructureBlock::None, @@ -299,17 +299,17 @@ impl TreeConfig { let log_scale = 1.0 + scale.log2().max(0.0); Self { - trunk_len: 32.0 * scale, + trunk_len: 24.0 * scale, trunk_radius: 1.25 * scale, - branch_child_len: 0.3 / scale, + branch_child_len: 0.4 / scale, branch_child_radius: 0.0, leaf_radius: 1.5 * log_scale..2.0 * log_scale, straightness: 0.0, max_depth: 1, splits: 50.0..70.0, - split_range: 0.1..1.2, + split_range: 0.15..1.2, branch_len_bias: 0.75, - leaf_vertical_scale: 0.3, + leaf_vertical_scale: 0.5, proportionality: 1.0, inhabited: false, } @@ -362,6 +362,7 @@ impl ProceduralTree { 0, None, rng, + true, ); this.trunk_idx = trunk_idx; @@ -382,6 +383,7 @@ impl ProceduralTree { depth: usize, sibling_idx: Option, rng: &mut impl Rng, + has_stairs: bool, ) -> (usize, Aabb) { let end = start + dir * branch_len; let line = LineSegment3 { start, end }; @@ -392,7 +394,7 @@ impl ProceduralTree { 0.0 }; - let has_stairs = config.inhabited && depth < config.max_depth && branch_radius > 6.5 && start.xy().distance(end.xy()) < (start.z - end.z).abs() * 1.5; + let has_stairs = /*has_stairs &&*/ config.inhabited && depth < config.max_depth && branch_radius > 6.5 && start.xy().distance(end.xy()) < (start.z - end.z).abs() * 1.5; let bark_radius = if has_stairs { 5.0 } else { 0.0 } + wood_radius * 0.25; // The AABB that covers this branch, along with wood and leaves that eminate @@ -458,6 +460,7 @@ impl ProceduralTree { depth + 1, child_idx, rng, + has_stairs, ); child_idx = Some(branch_idx); // Parent branches AABBs include the AABBs of child branches to allow for @@ -485,30 +488,30 @@ impl ProceduralTree { pub fn get_bounds(&self) -> Aabb { self.branches[self.trunk_idx].aabb } // Recursively search for branches or leaves by walking the tree's branch graph. - fn is_branch_or_leaves_at_inner(&self, pos: Vec3, parent_d2: f32, branch_idx: usize) -> (bool, bool, bool, bool) { + fn is_branch_or_leaves_at_inner(&self, pos: Vec3, parent: &Branch, branch_idx: usize) -> (bool, bool, bool, bool) { let branch = &self.branches[branch_idx]; // Always probe the sibling branch, since our AABB doesn't include its bounds // (it's not one of our children) let branch_or_leaves = branch .sibling_idx - .map(|idx| Vec4::::from(self.is_branch_or_leaves_at_inner(pos, parent_d2, idx))) + .map(|idx| Vec4::::from(self.is_branch_or_leaves_at_inner(pos, parent, idx))) .unwrap_or_default(); // Only continue probing this sub-graph of the tree if the sample position falls // within its AABB if branch.aabb.contains_point(pos) { // Probe this branch - let (this, d2) = branch.is_branch_or_leaves_at(pos, parent_d2); + let (this, d2) = branch.is_branch_or_leaves_at(pos, parent); let siblings = branch_or_leaves | Vec4::from(this); // Probe the children of this branch let children = branch.child_idx - .map(|idx| Vec4::from(self.is_branch_or_leaves_at_inner(pos, d2, idx))) + .map(|idx| Vec4::::from(self.is_branch_or_leaves_at_inner(pos, branch, idx))) .unwrap_or_default(); // Only allow empties for children if there is no solid at the current depth - (siblings | (children & Vec4::new(true, true, true, !(siblings.x | siblings.y)))).into_tuple() + (siblings | children).into_tuple() } else { branch_or_leaves.into_tuple() } @@ -518,7 +521,8 @@ impl ProceduralTree { /// position in the tree. #[inline(always)] pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool, bool, bool) { - self.is_branch_or_leaves_at_inner(pos, 10000.0, self.trunk_idx) + let (log, leaf, platform, air) = self.is_branch_or_leaves_at_inner(pos, &self.branches[self.trunk_idx], self.trunk_idx); + (log /*& !air*/, leaf & !air, platform & !air, air) } } @@ -543,26 +547,36 @@ struct Branch { impl Branch { /// Determine whether there are either branches or leaves at the given /// position in the branch. - pub fn is_branch_or_leaves_at(&self, pos: Vec3, parent_d2: f32) -> ((bool, bool, bool, bool), f32) { + pub fn is_branch_or_leaves_at(&self, pos: Vec3, parent: &Branch) -> ((bool, bool, bool, bool), f32) { // fn finvsqrt(x: f32) -> f32 { // let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); // y * (1.5 - ( x * 0.5 * y * y )) // } - fn smooth(a: f32, b: f32, k: f32) -> f32 { - // let h = (0.5 + 0.5 * (b - a) / k).clamped(0.0, 1.0); - // Lerp::lerp(b, a, h) - k * h * (1.0 - h) - - let h = (k-(a-b).abs()).max(0.0); - a.min(b) - h * h * 0.25 / k + fn length_factor(line: LineSegment3, p: Vec3) -> f32 { + let len_sq = line.start.distance_squared(line.end); + if len_sq < 0.001 { + 0.0 + } else { + (p - line.start).dot(line.end - line.start) / len_sq + } } + // fn smooth(a: f32, b: f32, k: f32) -> f32 { + // // let h = (0.5 + 0.5 * (b - a) / k).clamped(0.0, 1.0); + // // Lerp::lerp(b, a, h) - k * h * (1.0 - h) + + // let h = (k-(a-b).abs()).max(0.0); + // a.min(b) - h * h * 0.25 / k + // } + let p = self.line.projected_point(pos); let d2 = p.distance_squared(pos); - let d2_smooth = d2;//smooth(d2.sqrt(), parent_d2.sqrt(), 30.0).powi(2); + let length_factor = length_factor(self.line, pos); + let wood_radius = Lerp::lerp(parent.wood_radius, self.wood_radius, length_factor); - let mask = if d2_smooth < self.wood_radius.powi(2) { + let mask = if d2 < wood_radius.powi(2) { (true, false, false, false) // Wood } else if { let diff = (p - pos) / Vec3::new(1.0, 1.0, self.leaf_vertical_scale); @@ -571,13 +585,25 @@ impl Branch { (false, true, false, false) // Leaves } else { let stair_width = 5.0; - let stair_thickness = 1.5; - let stair_space = 6.0; - if self.has_stairs && d2_smooth < (self.wood_radius + stair_width).powi(2) { - let rpos = pos.xy() - p.xy(); - let stretch = 32.0; - let stair_section = ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + pos.z).rem_euclid(stretch); - (false, false, stair_section < stair_thickness, stair_section >= stair_thickness && stair_section < stair_thickness + stair_space) // Stairs + let stair_thickness = 2.0; + let stair_space = 5.0; + if self.has_stairs { + let (platform, air) = if pos.z >= self.line.start.z.min(self.line.end.z) - 1.0 && pos.z <= self.line.start.z.max(self.line.end.z) + stair_thickness + stair_space && d2 < (wood_radius + stair_width).powi(2) { + let rpos = pos.xy() - p; + let stretch = 32.0; + let stair_section = ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + pos.z).rem_euclid(stretch); + (stair_section < stair_thickness, stair_section >= stair_thickness && stair_section < stair_thickness + stair_space) // Stairs + } else { + (false, false) + }; + + let platform = platform || (self.has_stairs + && self.wood_radius > 4.0 + && !air + && d2 < (wood_radius + 10.0).powi(2) + && pos.z % 48.0 < stair_thickness); + + (false, false, platform, air) } else { (false, false, false, false) } diff --git a/world/src/lib.rs b/world/src/lib.rs index 794948f663..018b1da2bf 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -118,6 +118,7 @@ impl World { }, }, civ::SiteKind::Castle => world_msg::SiteKind::Castle, + civ::SiteKind::Refactor => world_msg::SiteKind::Town, }, wpos: site.center * TerrainChunkSize::RECT_SIZE.map(|e| e as i32), } @@ -294,7 +295,7 @@ impl World { // Apply site generation sim_chunk.sites.iter().for_each(|site| { - index.sites[*site].apply_to(index, chunk_wpos2d, sample_get, &mut chunk) + index.sites[*site].apply_to(&mut canvas, &mut dynamic_rng) }); let gen_entity_pos = |dynamic_rng: &mut rand::rngs::ThreadRng| { diff --git a/world/src/site/mod.rs b/world/src/site/mod.rs index da168c28f5..a18b4ca1ae 100644 --- a/world/src/site/mod.rs +++ b/world/src/site/mod.rs @@ -11,7 +11,12 @@ pub use self::{ settlement::Settlement, }; -use crate::{column::ColumnSample, IndexRef}; +use crate::{ + column::ColumnSample, + IndexRef, + site2, + Canvas, +}; use common::{ generation::ChunkSupplement, terrain::Block, @@ -45,6 +50,7 @@ pub enum SiteKind { Settlement(Settlement), Dungeon(Dungeon), Castle(Castle), + Refactor(site2::Site), } impl Site { @@ -69,11 +75,19 @@ impl Site { } } + pub fn refactor(s: site2::Site) -> Self { + Self { + kind: SiteKind::Refactor(s), + economy: Economy::default(), + } + } + pub fn radius(&self) -> f32 { match &self.kind { SiteKind::Settlement(s) => s.radius(), SiteKind::Dungeon(d) => d.radius(), SiteKind::Castle(c) => c.radius(), + SiteKind::Refactor(s) => s.radius(), } } @@ -82,6 +96,7 @@ impl Site { SiteKind::Settlement(s) => s.get_origin(), SiteKind::Dungeon(d) => d.get_origin(), SiteKind::Castle(c) => c.get_origin(), + SiteKind::Refactor(s) => s.origin, } } @@ -90,6 +105,7 @@ impl Site { SiteKind::Settlement(s) => s.spawn_rules(wpos), SiteKind::Dungeon(d) => d.spawn_rules(wpos), SiteKind::Castle(c) => c.spawn_rules(wpos), + SiteKind::Refactor(s) => s.spawn_rules(wpos), } } @@ -98,20 +114,24 @@ impl Site { SiteKind::Settlement(s) => s.name(), SiteKind::Dungeon(d) => d.name(), SiteKind::Castle(c) => c.name(), + SiteKind::Refactor(s) => "Experimental", } } pub fn apply_to<'a>( &'a self, - index: IndexRef, - wpos2d: Vec2, - get_column: impl FnMut(Vec2) -> Option<&'a ColumnSample<'a>>, - vol: &mut (impl BaseVol + RectSizedVol + ReadVol + WriteVol), + canvas: &mut Canvas, + dynamic_rng: &mut impl Rng, ) { + let info = canvas.info(); + let get_col = |wpos| info.col(wpos + info.wpos); match &self.kind { - SiteKind::Settlement(s) => s.apply_to(index, wpos2d, get_column, vol), - SiteKind::Dungeon(d) => d.apply_to(index, wpos2d, get_column, vol), - SiteKind::Castle(c) => c.apply_to(index, wpos2d, get_column, vol), + SiteKind::Settlement(s) => s.apply_to(canvas.index, canvas.wpos, get_col, canvas.chunk), + SiteKind::Dungeon(d) => d.apply_to(canvas.index, canvas.wpos, get_col, canvas.chunk), + SiteKind::Castle(c) => c.apply_to(canvas.index, canvas.wpos, get_col, canvas.chunk), + SiteKind::Refactor(s) => { + s.render(canvas, dynamic_rng); + }, } } @@ -129,6 +149,7 @@ impl Site { }, SiteKind::Dungeon(d) => d.apply_supplement(dynamic_rng, wpos2d, get_column, supplement), SiteKind::Castle(c) => c.apply_supplement(dynamic_rng, wpos2d, get_column, supplement), + SiteKind::Refactor(_) => {}, } } } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 916e4fec9a..05758419f5 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -5,18 +5,38 @@ use self::{ plot::{Plot, PlotKind}, tile::TileGrid, }; -use crate::util::Grid; +use crate::{ + site::SpawnRules, + util::Grid, + Canvas, +}; use common::store::{Id, Store}; use rand::prelude::*; use vek::*; #[derive(Default)] pub struct Site { + pub(crate) origin: Vec2, tiles: TileGrid, plots: Store, } impl Site { + pub fn radius(&self) -> f32 { + (tile::MAX_BLOCK_RADIUS.pow(2) as f32 * 2.0).sqrt() + } + + pub fn spawn_rules(&self, wpos: Vec2) -> SpawnRules { + if wpos.distance_squared(self.origin) < 100i32.pow(2) { + SpawnRules { + trees: false, + ..SpawnRules::default() + } + } else { + SpawnRules::default() + } + } + pub fn bounds(&self) -> Aabr { let radius = tile::MAX_BLOCK_RADIUS; Aabr { @@ -47,6 +67,10 @@ impl Site { site } + + pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { + // TODO + } } pub fn test_site() -> Site { Site::generate(&mut thread_rng()) } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 2fc225d19c..7f7483b4f8 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -1,4 +1,5 @@ use super::*; +use common::spiral::Spiral2d; pub const TILE_SIZE: u32 = 7; pub const ZONE_SIZE: u32 = 16; @@ -19,7 +20,9 @@ impl Default for TileGrid { } impl TileGrid { - pub fn get(&self, tpos: Vec2) -> Option<&Tile> { + pub fn get(&self, tpos: Vec2) -> &Tile { + static EMPTY: Tile = Tile::empty(); + let tpos = tpos + TILE_RADIUS as i32; self.zones .get(tpos) @@ -28,6 +31,7 @@ impl TileGrid { .get(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) }) .and_then(|tile| tile.as_ref()) + .unwrap_or(&EMPTY) } pub fn get_mut(&mut self, tpos: Vec2) -> Option<&mut Tile> { @@ -41,8 +45,14 @@ impl TileGrid { }) } + pub fn set(&mut self, tpos: Vec2, tile: Tile) -> Option { + self.get_mut(tpos).map(|t| std::mem::replace(t, tile)) + } + pub fn find_near(&self, tpos: Vec2, f: impl Fn(&Tile) -> bool) -> Option> { - None + const MAX_SEARCH_RADIUS_BLOCKS: u32 = 256; + const MAX_SEARCH_CELLS: u32 = ((MAX_SEARCH_RADIUS_BLOCKS / TILE_SIZE) * 2).pow(2); + Spiral2d::new().take(MAX_SEARCH_CELLS as usize).map(|r| tpos + r).find(|tpos| (&f)(self.get(*tpos))) } } @@ -59,7 +69,7 @@ pub struct Tile { } impl Tile { - pub fn empty() -> Self { + pub const fn empty() -> Self { Self { kind: TileKind::Empty, plot: None, From 100cafa91b78022dee517094885cda1542f03b23 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 10 Feb 2021 19:38:37 +0000 Subject: [PATCH 33/87] Directional baked lights for figures --- assets/voxygen/shaders/figure-frag.glsl | 3 +- assets/voxygen/shaders/figure-vert.glsl | 1 + .../shaders/light-shadows-figure-vert.glsl | 1 + .../voxygen/shaders/player-shadow-frag.glsl | 1 + assets/voxygen/shaders/terrain-frag.glsl | 2 +- voxygen/src/mesh/terrain.rs | 4 +-- voxygen/src/render/pipelines/figure.rs | 8 +++-- voxygen/src/scene/figure/mod.rs | 11 +++--- voxygen/src/scene/terrain.rs | 34 ++++++++++++++++++- 9 files changed, 52 insertions(+), 13 deletions(-) diff --git a/assets/voxygen/shaders/figure-frag.glsl b/assets/voxygen/shaders/figure-frag.glsl index 3b69a17d8b..a1a74cad20 100644 --- a/assets/voxygen/shaders/figure-frag.glsl +++ b/assets/voxygen/shaders/figure-frag.glsl @@ -50,6 +50,7 @@ uniform u_locals { mat4 model_mat; vec4 highlight_col; vec4 model_light; + vec4 model_glow; ivec4 atlas_offs; vec3 model_pos; // bit 0 - is player @@ -181,7 +182,7 @@ void main() { float ao = f_ao * sqrt(f_ao);//0.25 + f_ao * 0.75; ///*pow(f_ao, 0.5)*/f_ao * 0.85 + 0.15; - vec3 glow = pow(model_light.y, 3) * 4 * GLOW_COLOR; + vec3 glow = pow(pow(model_glow.w, 2.0) * (max(dot(f_norm, normalize(model_glow.xyz)), 0.0) * 1.0 + max(1.0 - length(model_glow.xyz), 0.0)), 1) * 4 * GLOW_COLOR; emitted_light += glow; reflected_light *= ao; diff --git a/assets/voxygen/shaders/figure-vert.glsl b/assets/voxygen/shaders/figure-vert.glsl index 50acb8e4eb..c126f76095 100644 --- a/assets/voxygen/shaders/figure-vert.glsl +++ b/assets/voxygen/shaders/figure-vert.glsl @@ -28,6 +28,7 @@ uniform u_locals { mat4 model_mat; vec4 highlight_col; vec4 model_light; + vec4 model_glow; ivec4 atlas_offs; vec3 model_pos; // bit 0 - is player diff --git a/assets/voxygen/shaders/light-shadows-figure-vert.glsl b/assets/voxygen/shaders/light-shadows-figure-vert.glsl index 154cc23b88..10adaed520 100644 --- a/assets/voxygen/shaders/light-shadows-figure-vert.glsl +++ b/assets/voxygen/shaders/light-shadows-figure-vert.glsl @@ -40,6 +40,7 @@ uniform u_locals { mat4 model_mat; vec4 highlight_col; vec4 model_light; + vec4 model_glow; ivec4 atlas_offs; vec3 model_pos; // bit 0 - is player diff --git a/assets/voxygen/shaders/player-shadow-frag.glsl b/assets/voxygen/shaders/player-shadow-frag.glsl index dd28aaba34..bb7da1b60d 100644 --- a/assets/voxygen/shaders/player-shadow-frag.glsl +++ b/assets/voxygen/shaders/player-shadow-frag.glsl @@ -26,6 +26,7 @@ uniform u_locals { mat4 model_mat; vec4 highlight_col; vec4 model_light; + vec4 model_glow; ivec4 atlas_offs; vec3 model_pos; int flags; diff --git a/assets/voxygen/shaders/terrain-frag.glsl b/assets/voxygen/shaders/terrain-frag.glsl index d81466ea6c..025429d64b 100644 --- a/assets/voxygen/shaders/terrain-frag.glsl +++ b/assets/voxygen/shaders/terrain-frag.glsl @@ -266,7 +266,7 @@ void main() { max_light *= f_light; // TODO: Apply AO after this - vec3 glow = GLOW_COLOR * (pow(f_glow, 6) * 8 + pow(f_glow, 2) * 0.5); + vec3 glow = GLOW_COLOR * (pow(f_glow, 6) * 8 + pow(f_glow, 1.5) * 1.0); emitted_light += glow; reflected_light += glow; diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index 09b8e79549..551b3267a0 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -30,8 +30,8 @@ enum FaceKind { Fluid, } -const SUNLIGHT: u8 = 24; -const MAX_LIGHT_DIST: i32 = SUNLIGHT as i32; +pub const SUNLIGHT: u8 = 24; +pub const MAX_LIGHT_DIST: i32 = SUNLIGHT as i32; fn calc_light + ReadVol + Debug>( is_sunlight: bool, diff --git a/voxygen/src/render/pipelines/figure.rs b/voxygen/src/render/pipelines/figure.rs index 662a44953f..d9f5f45b74 100644 --- a/voxygen/src/render/pipelines/figure.rs +++ b/voxygen/src/render/pipelines/figure.rs @@ -14,6 +14,7 @@ gfx_defines! { model_mat: [[f32; 4]; 4] = "model_mat", highlight_col: [f32; 4] = "highlight_col", model_light: [f32; 4] = "model_light", + model_glow: [f32; 4] = "model_glow", atlas_offs: [i32; 4] = "atlas_offs", model_pos: [f32; 3] = "model_pos", flags: u32 = "flags", @@ -60,7 +61,7 @@ impl Locals { atlas_offs: Vec2, is_player: bool, light: f32, - glow: f32, + glow: (Vec3, f32), ) -> Self { let mut flags = 0; flags |= is_player as u32; @@ -70,7 +71,8 @@ impl Locals { highlight_col: [col.r, col.g, col.b, 1.0], model_pos: pos.into_array(), atlas_offs: Vec4::from(atlas_offs).into_array(), - model_light: [light, glow, 1.0, 1.0], + model_light: [light, 1.0, 1.0, 1.0], + model_glow: [glow.0.x, glow.0.y, glow.0.z, glow.1], flags, } } @@ -85,7 +87,7 @@ impl Default for Locals { Vec2::default(), false, 1.0, - 0.0, + (Vec3::zero(), 0.0), ) } } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 1780fa7f8f..e8821425e2 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -4602,7 +4602,7 @@ pub struct FigureStateMeta { last_pos: Option>, avg_vel: anim::vek::Vec3, last_light: f32, - last_glow: f32, + last_glow: (Vec3, f32), acc_vel: f32, } @@ -4649,7 +4649,7 @@ impl FigureState { last_pos: None, avg_vel: anim::vek::Vec3::zero(), last_light: 1.0, - last_glow: 0.0, + last_glow: (Vec3::zero(), 0.0), acc_vel: 0.0, }, skeleton, @@ -4743,14 +4743,15 @@ impl FigureState { let s = Lerp::lerp(s_10, s_11, (wpos.x.fract() - 0.5).abs() * 2.0); */ - Vec2::new(t.light_at_wpos(wposi), t.glow_at_wpos(wposi)).into_tuple() + (t.light_at_wpos(wposi), t.glow_normal_at_wpos(wpos)) }) - .unwrap_or((1.0, 0.0)); + .unwrap_or((1.0, (Vec3::zero(), 0.0))); // Fade between light and glow levels // TODO: Making this temporal rather than spatial is a bit dumb but it's a very // subtle difference self.last_light = vek::Lerp::lerp(self.last_light, light, 16.0 * dt); - self.last_glow = vek::Lerp::lerp(self.last_glow, glow, 16.0 * dt); + self.last_glow.0 = vek::Lerp::lerp(self.last_glow.0, glow.0, 16.0 * dt); + self.last_glow.1 = vek::Lerp::lerp(self.last_glow.1, glow.1, 16.0 * dt); let locals = FigureLocals::new( mat, diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index 4b6aeb7d44..c43d3af7fd 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -3,7 +3,7 @@ mod watcher; pub use self::watcher::BlocksOfInterest; use crate::{ - mesh::{greedy::GreedyMesh, Meshable}, + mesh::{greedy::GreedyMesh, Meshable, terrain::SUNLIGHT}, render::{ ColLightFmt, ColLightInfo, Consts, FluidPipeline, GlobalModel, Instances, Mesh, Model, RenderError, Renderer, ShadowPipeline, SpriteInstance, SpriteLocals, SpritePipeline, @@ -508,6 +508,38 @@ impl Terrain { .unwrap_or(0.0) } + pub fn glow_normal_at_wpos(&self, wpos: Vec3) -> (Vec3, f32) { + let wpos_chunk = wpos.xy().map2(TerrainChunk::RECT_SIZE, |e: f32, sz| { + (e as i32).div_euclid(sz as i32) + }); + + const AMBIANCE: f32 = 0.2; // 0-1, the proportion of light that should illuminate the rear of an object + + let (bias, total, max) = Spiral2d::new() + .take(9) + .map(|rpos| { + let chunk_pos = wpos_chunk + rpos; + self.chunks + .get(&chunk_pos) + .map(|c| c.blocks_of_interest.lights.iter()) + .into_iter() + .flatten() + .map(move |(lpos, level)| (Vec3::::from(chunk_pos * TerrainChunk::RECT_SIZE.map(|e| e as i32)) + *lpos, level)) + }) + .flatten() + .fold((Vec3::broadcast(0.001), 0.0, 0.0f32), |(bias, total, max), (lpos, level)| { + let rpos = lpos.map(|e| e as f32 + 0.5) - wpos; + let level = (*level as f32 - rpos.magnitude()).max(0.0) / SUNLIGHT as f32; + ( + bias + rpos.try_normalized().unwrap_or_else(Vec3::zero) * level * (1.0 - AMBIANCE), + total + level, + max.max(level), + ) + }); + + (bias.try_normalized().unwrap_or_else(Vec3::zero) / total.max(0.001), self.glow_at_wpos(wpos.map(|e| e.floor() as i32))) + } + /// Maintain terrain data. To be called once per tick. #[allow(clippy::for_loops_over_fallibles)] // TODO: Pending review in #587 #[allow(clippy::len_zero)] // TODO: Pending review in #587 From aabe1d7cfd83d89e51e1e8edc9aef4840ceb3595 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 10 Feb 2021 21:45:29 +0000 Subject: [PATCH 34/87] Point light ambiance for less harsh shadows --- assets/voxygen/shaders/figure-frag.glsl | 2 +- assets/voxygen/shaders/include/light.glsl | 3 ++- voxygen/src/scene/terrain.rs | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/voxygen/shaders/figure-frag.glsl b/assets/voxygen/shaders/figure-frag.glsl index a1a74cad20..0deb727bb0 100644 --- a/assets/voxygen/shaders/figure-frag.glsl +++ b/assets/voxygen/shaders/figure-frag.glsl @@ -182,7 +182,7 @@ void main() { float ao = f_ao * sqrt(f_ao);//0.25 + f_ao * 0.75; ///*pow(f_ao, 0.5)*/f_ao * 0.85 + 0.15; - vec3 glow = pow(pow(model_glow.w, 2.0) * (max(dot(f_norm, normalize(model_glow.xyz)), 0.0) * 1.0 + max(1.0 - length(model_glow.xyz), 0.0)), 1) * 4 * GLOW_COLOR; + vec3 glow = pow(pow(model_glow.w, 2.0) * (max(dot(f_norm, normalize(model_glow.xyz)) * 0.5 + 0.5, 0.0) * 1.0 + max(1.0 - length(model_glow.xyz), 0.0)), 1) * 4 * GLOW_COLOR; emitted_light += glow; reflected_light *= ao; diff --git a/assets/voxygen/shaders/include/light.glsl b/assets/voxygen/shaders/include/light.glsl index 8aabebd6ec..ba75b5db71 100644 --- a/assets/voxygen/shaders/include/light.glsl +++ b/assets/voxygen/shaders/include/light.glsl @@ -183,7 +183,8 @@ float lights_at(vec3 wpos, vec3 wnorm, vec3 /*cam_to_frag*/view_dir, vec3 mu, ve vec3 direct_light = PI * color * strength * square_factor * light_reflection_factor(/*direct_norm_dir*/wnorm, /*cam_to_frag*/view_dir, direct_light_dir, k_d, k_s, alpha, voxel_norm, voxel_lighting); float computed_shadow = ShadowCalculationPoint(i, -difference, wnorm, wpos/*, light_distance*/); // directed_light += is_direct ? max(computed_shadow, /*LIGHT_AMBIANCE*/0.0) * direct_light * square_factor : vec3(0.0); - directed_light += is_direct ? mix(LIGHT_AMBIANCE, 1.0, computed_shadow) * direct_light * square_factor : vec3(0.0); + vec3 ambiance = color * 1.0 / distance_2; // Non-physical hack, but it's pretty subtle and *damn* does it make character shadows look better + directed_light += (is_direct ? mix(LIGHT_AMBIANCE, 1.0, computed_shadow) * direct_light * square_factor : vec3(0.0)) + ambiance; // directed_light += (is_direct ? 1.0 : LIGHT_AMBIANCE) * max(computed_shadow, /*LIGHT_AMBIANCE*/0.0) * direct_light * square_factor;// : vec3(0.0); // directed_light += mix(LIGHT_AMBIANCE, 1.0, computed_shadow) * direct_light * square_factor; // ambient_light += is_direct ? vec3(0.0) : vec3(0.0); // direct_light * square_factor * LIGHT_AMBIANCE; diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index c43d3af7fd..888c4edd31 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -513,7 +513,7 @@ impl Terrain { (e as i32).div_euclid(sz as i32) }); - const AMBIANCE: f32 = 0.2; // 0-1, the proportion of light that should illuminate the rear of an object + const AMBIANCE: f32 = 0.3; // 0-1, the proportion of light that should illuminate the rear of an object let (bias, total, max) = Spiral2d::new() .take(9) @@ -531,13 +531,13 @@ impl Terrain { let rpos = lpos.map(|e| e as f32 + 0.5) - wpos; let level = (*level as f32 - rpos.magnitude()).max(0.0) / SUNLIGHT as f32; ( - bias + rpos.try_normalized().unwrap_or_else(Vec3::zero) * level * (1.0 - AMBIANCE), + bias + rpos.try_normalized().unwrap_or_else(Vec3::zero) * level, total + level, max.max(level), ) }); - (bias.try_normalized().unwrap_or_else(Vec3::zero) / total.max(0.001), self.glow_at_wpos(wpos.map(|e| e.floor() as i32))) + (bias.try_normalized().unwrap_or_else(Vec3::zero) * (1.0 - AMBIANCE) / total.max(0.001), self.glow_at_wpos(wpos.map(|e| e.floor() as i32))) } /// Maintain terrain data. To be called once per tick. From 31832e1245263dfbf59cfa7814d891597e4010f4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 10 Feb 2021 23:15:59 +0000 Subject: [PATCH 35/87] Fixed wall leaking with dynamic light ambiance --- assets/voxygen/shaders/figure-frag.glsl | 2 ++ assets/voxygen/shaders/figure-vert.glsl | 2 ++ assets/voxygen/shaders/include/light.glsl | 6 +++++- assets/voxygen/shaders/light-shadows-figure-vert.glsl | 2 ++ assets/voxygen/shaders/player-shadow-frag.glsl | 2 ++ voxygen/src/scene/terrain.rs | 2 +- 6 files changed, 14 insertions(+), 2 deletions(-) diff --git a/assets/voxygen/shaders/figure-frag.glsl b/assets/voxygen/shaders/figure-frag.glsl index 0deb727bb0..7d3586ee5b 100644 --- a/assets/voxygen/shaders/figure-frag.glsl +++ b/assets/voxygen/shaders/figure-frag.glsl @@ -1,5 +1,7 @@ #version 330 core +#define FIGURE_SHADER + #include #define LIGHTING_TYPE LIGHTING_TYPE_REFLECTION diff --git a/assets/voxygen/shaders/figure-vert.glsl b/assets/voxygen/shaders/figure-vert.glsl index c126f76095..021b319a11 100644 --- a/assets/voxygen/shaders/figure-vert.glsl +++ b/assets/voxygen/shaders/figure-vert.glsl @@ -2,6 +2,8 @@ #include +#define FIGURE_SHADER + #define LIGHTING_TYPE LIGHTING_TYPE_REFLECTION #define LIGHTING_REFLECTION_KIND LIGHTING_REFLECTION_KIND_GLOSSY diff --git a/assets/voxygen/shaders/include/light.glsl b/assets/voxygen/shaders/include/light.glsl index ba75b5db71..e4fdf92f73 100644 --- a/assets/voxygen/shaders/include/light.glsl +++ b/assets/voxygen/shaders/include/light.glsl @@ -183,7 +183,11 @@ float lights_at(vec3 wpos, vec3 wnorm, vec3 /*cam_to_frag*/view_dir, vec3 mu, ve vec3 direct_light = PI * color * strength * square_factor * light_reflection_factor(/*direct_norm_dir*/wnorm, /*cam_to_frag*/view_dir, direct_light_dir, k_d, k_s, alpha, voxel_norm, voxel_lighting); float computed_shadow = ShadowCalculationPoint(i, -difference, wnorm, wpos/*, light_distance*/); // directed_light += is_direct ? max(computed_shadow, /*LIGHT_AMBIANCE*/0.0) * direct_light * square_factor : vec3(0.0); - vec3 ambiance = color * 1.0 / distance_2; // Non-physical hack, but it's pretty subtle and *damn* does it make character shadows look better + #ifdef FIGURE_SHADER + vec3 ambiance = color * 0.5 / distance_2; // Non-physical hack, but it's pretty subtle and *damn* does it make shadows on characters look better + #else + vec3 ambiance = vec3(0.0); + #endif directed_light += (is_direct ? mix(LIGHT_AMBIANCE, 1.0, computed_shadow) * direct_light * square_factor : vec3(0.0)) + ambiance; // directed_light += (is_direct ? 1.0 : LIGHT_AMBIANCE) * max(computed_shadow, /*LIGHT_AMBIANCE*/0.0) * direct_light * square_factor;// : vec3(0.0); // directed_light += mix(LIGHT_AMBIANCE, 1.0, computed_shadow) * direct_light * square_factor; diff --git a/assets/voxygen/shaders/light-shadows-figure-vert.glsl b/assets/voxygen/shaders/light-shadows-figure-vert.glsl index 10adaed520..2178cae73e 100644 --- a/assets/voxygen/shaders/light-shadows-figure-vert.glsl +++ b/assets/voxygen/shaders/light-shadows-figure-vert.glsl @@ -1,6 +1,8 @@ #version 330 core // #extension ARB_texture_storage : enable +#define FIGURE_SHADER + #include #define LIGHTING_TYPE LIGHTING_TYPE_REFLECTION diff --git a/assets/voxygen/shaders/player-shadow-frag.glsl b/assets/voxygen/shaders/player-shadow-frag.glsl index bb7da1b60d..d64be8f67e 100644 --- a/assets/voxygen/shaders/player-shadow-frag.glsl +++ b/assets/voxygen/shaders/player-shadow-frag.glsl @@ -1,5 +1,7 @@ #version 330 core +#define FIGURE_SHADER + #include #define LIGHTING_TYPE LIGHTING_TYPE_REFLECTION diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index 888c4edd31..51f73973cf 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -513,7 +513,7 @@ impl Terrain { (e as i32).div_euclid(sz as i32) }); - const AMBIANCE: f32 = 0.3; // 0-1, the proportion of light that should illuminate the rear of an object + const AMBIANCE: f32 = 0.15; // 0-1, the proportion of light that should illuminate the rear of an object let (bias, total, max) = Spiral2d::new() .take(9) From 9e09c96a2a63e6cc44d35f177e1047712180dac8 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 11 Feb 2021 01:00:40 +0000 Subject: [PATCH 36/87] Fixed static light directionality --- voxygen/src/scene/terrain.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index 51f73973cf..8ce523ab31 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -537,7 +537,9 @@ impl Terrain { ) }); - (bias.try_normalized().unwrap_or_else(Vec3::zero) * (1.0 - AMBIANCE) / total.max(0.001), self.glow_at_wpos(wpos.map(|e| e.floor() as i32))) + let bias_factor = bias.magnitude() * (1.0 - AMBIANCE) / total.max(0.001); + + (bias.try_normalized().unwrap_or_else(Vec3::zero) * bias_factor.powf(0.5), self.glow_at_wpos(wpos.map(|e| e.floor() as i32))) } /// Maintain terrain data. To be called once per tick. From 717bbbf23e9a87362cfb9291242856d04bac98cf Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 11 Feb 2021 01:36:42 +0000 Subject: [PATCH 37/87] Better static light propagation between translucent objects --- common/src/terrain/block.rs | 11 ++++++----- voxygen/src/mesh/terrain.rs | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index f72ef8e950..d95acc9db6 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -194,13 +194,14 @@ impl Block { } } + // minimum block, attenuation #[inline] - pub fn get_max_sunlight(&self) -> Option { + pub fn get_max_sunlight(&self) -> (u8, u8) { match self.kind() { - BlockKind::Water => Some(4), - BlockKind::Leaves => Some(10), - _ if self.is_opaque() => Some(0), - _ => None, + BlockKind::Water => (1, 1), + BlockKind::Leaves => (10, 255), + _ if self.is_opaque() => (0, 255), + _ => (0, 0), } } diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index 551b3267a0..8dbf7892ae 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -71,20 +71,21 @@ fn calc_light + ReadVol + Debug>( for y in 0..outer.size().h { let mut light = SUNLIGHT; for z in (0..outer.size().d).rev() { - match vol_cached + let (min_light, attenuation) = vol_cached .get(outer.min + Vec3::new(x, y, z)) - .map_or(None, |b| b.get_max_sunlight()) - { - None => {}, - Some(0) => { - light_map[lm_idx(x, y, z)] = 0; - break; - }, - Some(max_sunlight) => light = light.min(max_sunlight), + .map_or((0, 0), |b| b.get_max_sunlight()); + + if light > min_light { + light = light.saturating_sub(attenuation).max(min_light); } light_map[lm_idx(x, y, z)] = light; - prop_que.push_back((x as u8, y as u8, z as u16)); + + if light == 0 { + break; + } else { + prop_que.push_back((x as u8, y as u8, z as u16)); + } } } } From 3aff271a0534517c11d5c5a62378e8f0409967b0 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 12 Feb 2021 20:30:30 +0000 Subject: [PATCH 38/87] Initial test site generation --- world/src/site2/mod.rs | 57 +++++++++++++++++++++++++++----- world/src/site2/tile.rs | 72 +++++++++++++++++++++++++++++++++++------ 2 files changed, 111 insertions(+), 18 deletions(-) diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 05758419f5..8ea1b8b28c 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -3,14 +3,17 @@ mod tile; use self::{ plot::{Plot, PlotKind}, - tile::TileGrid, + tile::{TileGrid, Tile, TileKind, TILE_SIZE}, }; use crate::{ site::SpawnRules, util::Grid, Canvas, }; -use common::store::{Id, Store}; +use common::{ + terrain::{Block, BlockKind, SpriteKind}, + store::{Id, Store}, +}; use rand::prelude::*; use vek::*; @@ -52,24 +55,62 @@ impl Site { pub fn generate(rng: &mut impl Rng) -> Self { let mut site = Site::default(); - for i in 0..10 { + for i in 0..100 { let dir = Vec2::::zero() .map(|_| rng.gen_range(-1.0..1.0)) .normalized(); - let search_pos = (dir * 32.0).map(|e| e as i32); + let search_pos = (dir * rng.gen_range(0.0f32..1.0).powf(2.0) * 24.0).map(|e| e as i32); site.tiles - .find_near(search_pos, |tile| tile.is_empty()) - .map(|center| { - // TODO + .find_near(search_pos, |_, tile| tile.is_empty()) + .and_then(|center| site.tiles.grow_aabr(center, 6..16, Extent2::new(2, 2)).ok()) + .map(|aabr| { + let tile = match i % 2 { + 0 => TileKind::Farmland { seed: i }, + _ => TileKind::Building { levels: 1 + i % 3 }, + }; + + for x in 0..aabr.size().w { + for y in 0..aabr.size().h { + let pos = aabr.min + Vec2::new(x, y); + site.tiles.set(pos, Tile::free(tile.clone())); + } + } }); } site } + pub fn wpos_tile(&self, wpos2d: Vec2) -> &Tile { + self.tiles.get((wpos2d - self.origin).map(|e| e.div_euclid(TILE_SIZE as i32))) + } + pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { - // TODO + canvas.foreach_col(|canvas, wpos2d, col| { + match self.wpos_tile(wpos2d).kind { + TileKind::Farmland { seed } => (-4..5).for_each(|z| canvas.map( + Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), + |b| if [ + BlockKind::Grass, + BlockKind::Earth, + BlockKind::Sand, + BlockKind::Snow, + BlockKind::Rock, + ] + .contains(&b.kind()) { + Block::new(BlockKind::Earth, Rgb::new(40, 5 + (seed % 32) as u8, 0)) + } else { + b.with_sprite(SpriteKind::Empty) + }, + )), + TileKind::Building { levels } => (-4..7 * levels as i32).for_each(|z| canvas.set( + Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), + Block::new(BlockKind::Wood, Rgb::new(180, 150, 120)) + )), + _ => {}, + } + }); } } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 7f7483b4f8..75e5c552d4 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -1,5 +1,6 @@ use super::*; use common::spiral::Spiral2d; +use std::ops::Range; pub const TILE_SIZE: u32 = 7; pub const ZONE_SIZE: u32 = 16; @@ -25,7 +26,7 @@ impl TileGrid { let tpos = tpos + TILE_RADIUS as i32; self.zones - .get(tpos) + .get(tpos.map(|e| e.div_euclid(ZONE_SIZE as i32))) .and_then(|zone| { zone.as_ref()? .get(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) @@ -36,9 +37,9 @@ impl TileGrid { pub fn get_mut(&mut self, tpos: Vec2) -> Option<&mut Tile> { let tpos = tpos + TILE_RADIUS as i32; - self.zones.get_mut(tpos).and_then(|zone| { + self.zones.get_mut(tpos.map(|e| e.div_euclid(ZONE_SIZE as i32))).and_then(|zone| { zone.get_or_insert_with(|| { - Grid::populate_from(Vec2::broadcast(ZONE_RADIUS as i32 * 2 + 1), |_| None) + Grid::populate_from(Vec2::broadcast(ZONE_SIZE as i32), |_| None) }) .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) .map(|tile| tile.get_or_insert_with(|| Tile::empty())) @@ -49,23 +50,66 @@ impl TileGrid { self.get_mut(tpos).map(|t| std::mem::replace(t, tile)) } - pub fn find_near(&self, tpos: Vec2, f: impl Fn(&Tile) -> bool) -> Option> { + pub fn find_near(&self, tpos: Vec2, f: impl Fn(Vec2, &Tile) -> bool) -> Option> { const MAX_SEARCH_RADIUS_BLOCKS: u32 = 256; - const MAX_SEARCH_CELLS: u32 = ((MAX_SEARCH_RADIUS_BLOCKS / TILE_SIZE) * 2).pow(2); - Spiral2d::new().take(MAX_SEARCH_CELLS as usize).map(|r| tpos + r).find(|tpos| (&f)(self.get(*tpos))) + const MAX_SEARCH_CELLS: u32 = ((MAX_SEARCH_RADIUS_BLOCKS / TILE_SIZE) * 2 + 1).pow(2); + Spiral2d::new().take(MAX_SEARCH_CELLS as usize).map(|r| tpos + r).find(|tpos| (&f)(*tpos, self.get(*tpos))) + } + + pub fn grow_aabr(&self, center: Vec2, area_range: Range, min_dims: Extent2) -> Result, Aabr> { + let mut aabr = Aabr::new_empty(center); + + let mut last_growth = 0; + for i in 0.. { + if i - last_growth >= 4 { + break; + } else if aabr.size().product() + if i % 2 == 0 { aabr.size().h } else { aabr.size().w } > area_range.end as i32 { + break; + } else { + match i % 4 { + 0 if (aabr.min.y..aabr.max.y).all(|y| self.get(Vec2::new(aabr.max.x + 1, y)).is_empty()) => { + aabr.max.x += 1; + last_growth = i; + }, + 1 if (aabr.min.x..aabr.max.x).all(|x| self.get(Vec2::new(x, aabr.max.y + 1)).is_empty()) => { + aabr.max.y += 1; + last_growth = i; + }, + 2 if (aabr.min.y..aabr.max.y).all(|y| self.get(Vec2::new(aabr.min.x - 1, y)).is_empty()) => { + aabr.min.x -= 1; + last_growth = i; + }, + 3 if (aabr.min.x..aabr.max.x).all(|x| self.get(Vec2::new(x, aabr.min.y - 1)).is_empty()) => { + aabr.min.y -= 1; + last_growth = i; + }, + _ => {}, + } + } + } + + if aabr.size().product() as u32 >= area_range.start + && aabr.size().w as u32 >= min_dims.w + && aabr.size().h as u32 >= min_dims.h + { + Ok(aabr) + } else { + Err(aabr) + } } } -#[derive(PartialEq)] +#[derive(Clone, PartialEq)] pub enum TileKind { Empty, - Farmland, + Farmland { seed: u32 }, Building { levels: u32 }, } +#[derive(Clone)] pub struct Tile { - kind: TileKind, - plot: Option>, + pub(crate) kind: TileKind, + pub(crate) plot: Option>, } impl Tile { @@ -76,5 +120,13 @@ impl Tile { } } + /// Create a tile that is not associated with any plot. + pub const fn free(kind: TileKind) -> Self { + Self { + kind, + plot: None, + } + } + pub fn is_empty(&self) -> bool { self.kind == TileKind::Empty } } From 8214c9df82a44aae197fe79b694b9fec33292923 Mon Sep 17 00:00:00 2001 From: Monty Date: Fri, 12 Feb 2021 22:59:33 +0100 Subject: [PATCH 39/87] PoI icon --- assets/voxygen/element/map/excl.png | 3 +++ voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/map.rs | 6 +++++- voxygen/src/hud/minimap.rs | 2 ++ 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 assets/voxygen/element/map/excl.png diff --git a/assets/voxygen/element/map/excl.png b/assets/voxygen/element/map/excl.png new file mode 100644 index 0000000000..15770458c3 --- /dev/null +++ b/assets/voxygen/element/map/excl.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6450c2f8c4a97c5ca4ffe3bedc2cf9ed0b36fd60c146d8f8b3c4d326d9b771ec +size 10816 diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 1d4cc01cfc..f10c028252 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -364,6 +364,7 @@ image_ids! { mmap_site_cave_bg: "voxygen.element.map.cave_bg", mmap_site_cave_hover: "voxygen.element.map.cave_hover", mmap_site_cave: "voxygen.element.map.cave", + mmap_site_excl: "voxygen.element.map.excl", // Window Parts window_3: "voxygen.element.frames.window_3", diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index d22d920408..b31720d8b9 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -528,6 +528,7 @@ impl<'a> Widget for Map<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon, SiteKind::Castle => self.imgs.mmap_site_castle, SiteKind::Cave => self.imgs.mmap_site_cave, + _ => self.imgs.mmap_site_excl, }) .x_y_position_relative_to( state.ids.grid, @@ -540,6 +541,7 @@ impl<'a> Widget for Map<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon_hover, SiteKind::Castle => self.imgs.mmap_site_castle_hover, SiteKind::Cave => self.imgs.mmap_site_cave_hover, + _ => self.imgs.mmap_site_excl, }) .image_color(UI_HIGHLIGHT_0) .with_tooltip( @@ -560,6 +562,7 @@ impl<'a> Widget for Map<'a> { _ => TEXT_COLOR, }, SiteKind::Cave => TEXT_COLOR, + _ => TEXT_COLOR, }, ); // Only display sites that are toggled on @@ -583,7 +586,8 @@ impl<'a> Widget for Map<'a> { if show_caves { site_btn.set(state.ids.mmap_site_icons[i], ui); } - }, + }, + _ => {site_btn.set(state.ids.mmap_site_icons[i], ui);}, } // Difficulty from 0-6 diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index 3162bb6681..401f1b88a9 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -303,6 +303,7 @@ impl<'a> Widget for MiniMap<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon_bg, SiteKind::Castle => self.imgs.mmap_site_castle_bg, SiteKind::Cave => self.imgs.mmap_site_cave_bg, + _ => self.imgs.mmap_site_excl, }) .x_y_position_relative_to( state.ids.grid, @@ -331,6 +332,7 @@ impl<'a> Widget for MiniMap<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon, SiteKind::Castle => self.imgs.mmap_site_castle, SiteKind::Cave => self.imgs.mmap_site_cave, + _ => self.imgs.mmap_site_excl, }) .middle_of(state.ids.mmap_site_icons_bgs[i]) .w_h(20.0, 20.0) From 620e2000d2d8f3bdc1f33e711870bb9eff41570f Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 02:17:21 +0000 Subject: [PATCH 40/87] Experimental cliffs, use column alt for world map --- common/src/terrain/block.rs | 3 +- world/src/civ/mod.rs | 1 - world/src/column/mod.rs | 12 ++++-- world/src/sim/map.rs | 12 +++--- world/src/sim/mod.rs | 76 +++++++++++++++++++++++++++++++++++-- 5 files changed, 91 insertions(+), 13 deletions(-) diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index d95acc9db6..195663991f 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -199,7 +199,8 @@ impl Block { pub fn get_max_sunlight(&self) -> (u8, u8) { match self.kind() { BlockKind::Water => (1, 1), - BlockKind::Leaves => (10, 255), + BlockKind::Leaves => (9, 255), + BlockKind::Wood => (6, 2), _ if self.is_opaque() => (0, 255), _ => (0, 0), } diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 2b9ca633e6..1966e1df0c 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -188,7 +188,6 @@ impl Civs { chunk.alt += diff; chunk.basement += diff; chunk.rockiness = 0.0; - chunk.warp_factor = 0.0; chunk.surface_veg *= 1.0 - factor * rng.gen_range(0.25..0.9); }); } diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 9a5061f2db..0437477640 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -69,7 +69,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let sim = &self.sim; - let _turb = Vec2::new( + let turb = Vec2::new( sim.gen_ctx.turb_x_nz.get((wposf.div(48.0)).into_array()) as f32, sim.gen_ctx.turb_y_nz.get((wposf.div(48.0)).into_array()) as f32, ) * 12.0; @@ -83,7 +83,6 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let spawn_rate = sim.get_interpolated(wpos, |chunk| chunk.spawn_rate)?; let alt = sim.get_interpolated_monotone(wpos, |chunk| chunk.alt)?; let surface_veg = sim.get_interpolated_monotone(wpos, |chunk| chunk.surface_veg)?; - let chunk_warp_factor = sim.get_interpolated_monotone(wpos, |chunk| chunk.warp_factor)?; let sim_chunk = sim.get(chunk_pos)?; let neighbor_coef = TerrainChunkSize::RECT_SIZE.map(|e| e as f64); let my_chunk_idx = vec2_as_uniform_idx(self.sim.map_size_lg(), chunk_pos); @@ -93,6 +92,12 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let neighbor_chunk = sim.get(neighbor_pos)?; Some((neighbor_pos, neighbor_chunk, &neighbor_chunk.river)) }); + let cliff_height = sim.get_interpolated(wpos, |chunk| chunk.cliff_height)?; + let cliff_scale = 1.0; + let cliff_factor = (alt + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) as f32 * 16.0).rem_euclid(128.0) / 64.0 - 1.0; + let cliff_offset = cliff_factor.abs().powf(if cliff_factor < 0.0 { 1.0 } else { 64.0 }) * cliff_height; + let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.125 + 0.75).max(0.0) as f32; + let alt = alt + cliff_offset * cliff_scale; let lake_width = (TerrainChunkSize::RECT_SIZE.x as f64 * (2.0f64.sqrt())) + 12.0; let neighbor_river_data = neighbor_river_data.map(|(posj, chunkj, river)| { @@ -701,7 +706,6 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { 1.0, ) }; - let warp_factor = warp_factor * chunk_warp_factor; // NOTE: To disable warp, uncomment this line. // let warp_factor = 0.0; @@ -1054,6 +1058,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { path, cave, snow_cover, + cliff_offset, chunk: sim_chunk, }) @@ -1084,6 +1089,7 @@ pub struct ColumnSample<'a> { pub path: Option<(f32, Vec2, Path, Vec2)>, pub cave: Option<(f32, Vec2, Cave, Vec2)>, pub snow_cover: bool, + pub cliff_offset: f32, pub chunk: &'a SimChunk, } diff --git a/world/src/sim/map.rs b/world/src/sim/map.rs index 59b9a0f947..7541757361 100644 --- a/world/src/sim/map.rs +++ b/world/src/sim/map.rs @@ -133,7 +133,7 @@ pub fn sample_pos( let humidity = humidity.min(1.0).max(0.0); let temperature = temperature.min(1.0).max(-1.0) * 0.5 + 0.5; let wpos = pos * TerrainChunkSize::RECT_SIZE.map(|e| e as i32); - let column_rgb = samples + let column_rgb_alt = samples .and_then(|samples| { chunk_idx .and_then(|chunk_idx| samples.get(chunk_idx)) @@ -146,7 +146,7 @@ pub fn sample_pos( let basement = sample.basement; let grass_depth = (1.5 + 2.0 * sample.chaos).min(alt - basement); let wposz = if is_basement { basement } else { alt }; - if is_basement && wposz < alt - grass_depth { + let rgb = if is_basement && wposz < alt - grass_depth { Lerp::lerp( sample.sub_surface_color, sample.stone_col.map(|e| e as f32 / 255.0), @@ -160,11 +160,13 @@ pub fn sample_pos( ((wposz as f32 - (alt - grass_depth)) / grass_depth).sqrt(), ) .map(|e| e as f64) - } + }; + + (rgb, alt) }); let downhill_wpos = downhill.unwrap_or(wpos + TerrainChunkSize::RECT_SIZE.map(|e| e as i32)); - let alt = if is_basement { basement } else { alt }; + let alt = if is_basement { basement } else { column_rgb_alt.map_or(alt, |(_, alt)| alt) }; let true_water_alt = (alt.max(water_alt) as f64 - focus.z) / gain as f64; let true_alt = (alt as f64 - focus.z) / gain as f64; @@ -183,7 +185,7 @@ pub fn sample_pos( if is_shaded { 1.0 } else { alt }, if is_shaded || is_humidity { 1.0 } else { 0.0 }, ); - let column_rgb = column_rgb.unwrap_or(default_rgb); + let column_rgb = column_rgb_alt.map(|(rgb, _)| rgb).unwrap_or(default_rgb); let mut connections = [None; 8]; let mut has_connections = false; // TODO: Support non-river connections. diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 2c210ba6df..78d8bc1145 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -30,7 +30,7 @@ use crate::{ site::Site, util::{ seed_expan, FastNoise, FastNoise2d, RandomField, RandomPerm, Sampler, StructureGen2d, LOCALITY, - NEIGHBORS, + NEIGHBORS, CARDINALS, DHashSet, }, IndexRef, CONFIG, }; @@ -44,6 +44,7 @@ use common::{ }, vol::RectVolSize, lottery::Lottery, + spiral::Spiral2d, }; use common_net::msg::WorldMapMsg; use enum_iterator::IntoEnumIterator; @@ -1401,6 +1402,8 @@ impl WorldSim { rng, }; + this.generate_cliffs(); + if opts.seed_elements { this.seed_elements(); } @@ -1513,6 +1516,72 @@ impl WorldSim { } } + pub fn generate_cliffs(&mut self) { + let mut rng = self.rng.clone(); + + for _ in 0..self.get_size().product() / 10 { + let mut pos = self.get_size().map(|e| rng.gen_range(0..e) as i32); + + let mut cliffs = DHashSet::default(); + let mut cliff_path = Vec::new(); + + for _ in 0..64 { + if self.get_gradient_approx(pos).map_or(false, |g| g > 1.5) { + if !cliffs.insert(pos) { + break; + } + cliff_path.push((pos, 0.0)); + + pos += CARDINALS + .iter() + .copied() + .max_by_key(|rpos| self.get_gradient_approx(pos + rpos).map_or(0, |g| (g * 1000.0) as i32)) + .unwrap(); // Can't fail + } else { + break; + } + } + + // for locs in cliff_path.windows(3) { + // let to_prev_idx = NEIGHBORS + // .iter() + // .enumerate() + // .find(|(_, dir)| **dir == locs[0].0 - locs[1].0) + // .expect("Track locations must be neighbors") + // .0; + // let to_next_idx = NEIGHBORS + // .iter() + // .enumerate() + // .find(|(_, dir)| **dir == locs[2].0 - locs[1].0) + // .expect("Track locations must be neighbors") + // .0; + + // self.get_mut(locs[0].0).unwrap().cliff.0.neighbors |= + // 1 << ((to_prev_idx as u8 + 4) % 8); + // self.get_mut(locs[1].0).unwrap().cliff.0.neighbors |= + // (1 << (to_prev_idx as u8)) | (1 << (to_next_idx as u8)); + // self.get_mut(locs[2].0).unwrap().cliff.0.neighbors |= + // 1 << ((to_next_idx as u8 + 4) % 8); + + // self.get_mut(locs[1].0).unwrap().cliff.0.offset = Vec2::new(rng.gen_range(-16..17), rng.gen_range(-16..17)); + // } + + for cliff in cliffs { + let alt = self.get(cliff).map_or(0.0, |c| c.alt); + Spiral2d::new() + .take((4usize * 2 + 1).pow(2)) + .for_each(|rpos| { + let dist = rpos.map(|e| e as f32).magnitude(); + if let Some(c) = self.get_mut(cliff + rpos) { + let warp = 1.0 / (1.0 + dist); + c.tree_density *= (1.0 - warp); + c.cliff_height = Lerp::lerp(44.0, 0.0, (-1.0 + dist / 3.5)); + } + }); + } + } + } + /// Prepare the world for simulation pub fn seed_elements(&mut self) { let mut rng = self.rng.clone(); @@ -2056,7 +2125,6 @@ pub struct SimChunk { pub forest_kind: ForestKind, pub spawn_rate: f32, pub river: RiverData, - pub warp_factor: f32, pub surface_veg: f32, pub sites: Vec>, @@ -2064,6 +2132,7 @@ pub struct SimChunk { pub path: (Way, Path), pub cave: (Way, Cave), + pub cliff_height: f32, pub contains_waypoint: bool, } @@ -2284,13 +2353,14 @@ impl SimChunk { }, spawn_rate: 1.0, river, - warp_factor: 1.0, surface_veg: 1.0, sites: Vec::new(), place: None, path: Default::default(), cave: Default::default(), + cliff_height: 0.0, + contains_waypoint: false, } } From 9b5c9d12460dda3faceed2003ea2d26fc66f32ff Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 02:45:39 +0000 Subject: [PATCH 41/87] Cliff improvements --- world/src/column/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 0437477640..e83514c651 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -94,9 +94,11 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { }); let cliff_height = sim.get_interpolated(wpos, |chunk| chunk.cliff_height)?; let cliff_scale = 1.0; - let cliff_factor = (alt + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) as f32 * 16.0).rem_euclid(128.0) / 64.0 - 1.0; + let cliff_factor = (alt + + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 10.0 + + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0).rem_euclid(128.0) / 64.0 - 1.0; let cliff_offset = cliff_factor.abs().powf(if cliff_factor < 0.0 { 1.0 } else { 64.0 }) * cliff_height; - let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.125 + 0.75).max(0.0) as f32; + let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 + 0.5).max(0.0) as f32; let alt = alt + cliff_offset * cliff_scale; let lake_width = (TerrainChunkSize::RECT_SIZE.x as f64 * (2.0f64.sqrt())) + 12.0; From 740dcbb440bcccc3892fa54e330dbf1faa21a005 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 03:33:52 +0000 Subject: [PATCH 42/87] Stone layering --- world/src/block/mod.rs | 14 ++++++++++++-- world/src/column/mod.rs | 4 ++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 9b8adfab55..b2d5859cd9 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -70,6 +70,7 @@ impl<'a> BlockGen<'a> { // humidity, stone_col, snow_cover, + cliff_offset, .. } = sample; @@ -118,7 +119,16 @@ impl<'a> BlockGen<'a> { .map(|e| (e * 255.0) as u8); if stone_factor >= 0.5 { - Some(Block::new(BlockKind::Rock, col)) + if wposf.z as f32 > height - cliff_offset.max(0.0) { + let col = Lerp::lerp( + col.map(|e| e as f32), + col.map(|e| e as f32) * 0.7, + (wposf.z as f32 - basement).div(2.0).sin() * 0.5 + 0.5, + ).map(|e| e as u8); + Some(Block::new(BlockKind::Rock, col)) + } else { + Some(Block::new(BlockKind::Rock, col)) + } } else { Some(Block::new(BlockKind::Earth, col)) } @@ -183,7 +193,7 @@ pub struct ZCache<'a> { impl<'a> ZCache<'a> { pub fn get_z_limits(&self) -> (f32, f32) { - let min = self.sample.alt - (self.sample.chaos.min(1.0) * 16.0); + let min = self.sample.alt - (self.sample.chaos.min(1.0) * 16.0) - self.sample.cliff_offset.max(0.0); let min = min - 4.0; let rocks = if self.sample.rock > 0.0 { 12.0 } else { 0.0 }; diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index e83514c651..e2759acdcc 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -97,9 +97,9 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let cliff_factor = (alt + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 10.0 + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0).rem_euclid(128.0) / 64.0 - 1.0; - let cliff_offset = cliff_factor.abs().powf(if cliff_factor < 0.0 { 1.0 } else { 64.0 }) * cliff_height; let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 + 0.5).max(0.0) as f32; - let alt = alt + cliff_offset * cliff_scale; + let cliff_offset = cliff_factor.abs().powf(if cliff_factor < 0.0 { 1.0 } else { 64.0 }) * cliff_height * cliff_scale; + let alt = alt + cliff_offset; let lake_width = (TerrainChunkSize::RECT_SIZE.x as f64 * (2.0f64.sqrt())) + 12.0; let neighbor_river_data = neighbor_river_data.map(|(posj, chunkj, river)| { From 4ffdcd0fa17632118302f5a539a4c96daa0fa573 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 14:02:14 +0000 Subject: [PATCH 43/87] Cliff overhangs --- world/src/block/mod.rs | 19 ++++++++++++------- world/src/column/mod.rs | 8 +++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index b2d5859cd9..a57e3973fd 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -1,6 +1,6 @@ use crate::{ column::{ColumnGen, ColumnSample}, - util::{RandomField, Sampler, SmallCache}, + util::{RandomField, Sampler, SmallCache, FastNoise}, IndexRef, }; use common::terrain::{ @@ -71,6 +71,7 @@ impl<'a> BlockGen<'a> { stone_col, snow_cover, cliff_offset, + cliff_height, .. } = sample; @@ -120,12 +121,16 @@ impl<'a> BlockGen<'a> { if stone_factor >= 0.5 { if wposf.z as f32 > height - cliff_offset.max(0.0) { - let col = Lerp::lerp( - col.map(|e| e as f32), - col.map(|e| e as f32) * 0.7, - (wposf.z as f32 - basement).div(2.0).sin() * 0.5 + 0.5, - ).map(|e| e as u8); - Some(Block::new(BlockKind::Rock, col)) + if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - wposf.z as f32).mul(0.25).clamped(0.0, 12.0) { + Some(Block::empty()) + } else { + let col = Lerp::lerp( + col.map(|e| e as f32), + col.map(|e| e as f32) * 0.7, + (wposf.z as f32 - basement).div(2.0).sin() * 0.5 + 0.5, + ).map(|e| e as u8); + Some(Block::new(BlockKind::Rock, col)) + } } else { Some(Block::new(BlockKind::Rock, col)) } diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index e2759acdcc..7ba5669533 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -93,13 +93,13 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { Some((neighbor_pos, neighbor_chunk, &neighbor_chunk.river)) }); let cliff_height = sim.get_interpolated(wpos, |chunk| chunk.cliff_height)?; - let cliff_scale = 1.0; let cliff_factor = (alt + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 10.0 + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0).rem_euclid(128.0) / 64.0 - 1.0; let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 + 0.5).max(0.0) as f32; - let cliff_offset = cliff_factor.abs().powf(if cliff_factor < 0.0 { 1.0 } else { 64.0 }) * cliff_height * cliff_scale; - let alt = alt + cliff_offset; + let cliff = if cliff_factor < 0.0 { cliff_factor.abs().powf(1.5) } else { 0.0 }; + let cliff_offset = cliff * cliff_height; + let alt = alt + (cliff - 0.5) * cliff_height; let lake_width = (TerrainChunkSize::RECT_SIZE.x as f64 * (2.0f64.sqrt())) + 12.0; let neighbor_river_data = neighbor_river_data.map(|(posj, chunkj, river)| { @@ -1061,6 +1061,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { cave, snow_cover, cliff_offset, + cliff_height, chunk: sim_chunk, }) @@ -1092,6 +1093,7 @@ pub struct ColumnSample<'a> { pub cave: Option<(f32, Vec2, Cave, Vec2)>, pub snow_cover: bool, pub cliff_offset: f32, + pub cliff_height: f32, pub chunk: &'a SimChunk, } From fe2479ee4c14063920afc0e8390cb0f76b88dbc0 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 16:19:14 +0000 Subject: [PATCH 44/87] Better LoD water prediction --- assets/voxygen/shaders/lod-terrain-frag.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/voxygen/shaders/lod-terrain-frag.glsl b/assets/voxygen/shaders/lod-terrain-frag.glsl index d53eba5abe..defb468ec7 100644 --- a/assets/voxygen/shaders/lod-terrain-frag.glsl +++ b/assets/voxygen/shaders/lod-terrain-frag.glsl @@ -640,7 +640,7 @@ void main() { // f_col = f_col + (hash(vec4(floor(vec3(focus_pos.xy + splay(v_pos_orig), f_pos.z)) * 3.0 - round(f_norm) * 0.5, 0)) - 0.5) * 0.05; // Small-scale noise vec3 surf_color; #if (FLUID_MODE == FLUID_MODE_SHINY) - if (f_col_raw.b > max(f_col_raw.r, f_col_raw.g) * 2.0 && dot(vec3(0, 0, 1), f_norm) > 0.9) { + if (length(f_col_raw - vec3(0.02, 0.06, 0.22)) < 0.025 && dot(vec3(0, 0, 1), f_norm) > 0.9) { vec3 water_color = (1.0 - MU_WATER) * MU_SCATTER; vec3 reflect_ray = cam_to_frag * vec3(1, 1, -1); From 6274987fa63eaaf69c8f8b1be9bf827788c341a8 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 17:04:20 +0000 Subject: [PATCH 45/87] Fixed snow blocking all light --- common/src/terrain/block.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/common/src/terrain/block.rs b/common/src/terrain/block.rs index 195663991f..74fe3e852f 100644 --- a/common/src/terrain/block.rs +++ b/common/src/terrain/block.rs @@ -201,6 +201,7 @@ impl Block { BlockKind::Water => (1, 1), BlockKind::Leaves => (9, 255), BlockKind::Wood => (6, 2), + BlockKind::Snow => (6, 2), _ if self.is_opaque() => (0, 255), _ => (0, 0), } From 466f3919d22db1b8cca71dd81b3151a7dccfadd6 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 17:04:39 +0000 Subject: [PATCH 46/87] Removed the worst water/cliff interaction issues --- world/src/column/mod.rs | 43 +++++++++++++++++++++++++++-------------- world/src/lib.rs | 7 ++++--- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 7ba5669533..34dcbf3ee1 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -81,6 +81,11 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let rockiness = sim.get_interpolated(wpos, |chunk| chunk.rockiness)?; let tree_density = sim.get_interpolated(wpos, |chunk| chunk.tree_density)?; let spawn_rate = sim.get_interpolated(wpos, |chunk| chunk.spawn_rate)?; + let near_water = + sim.get_interpolated( + wpos, + |chunk| if chunk.river.near_water() { 1.0 } else { 0.0 }, + )?; let alt = sim.get_interpolated_monotone(wpos, |chunk| chunk.alt)?; let surface_veg = sim.get_interpolated_monotone(wpos, |chunk| chunk.surface_veg)?; let sim_chunk = sim.get(chunk_pos)?; @@ -92,14 +97,6 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let neighbor_chunk = sim.get(neighbor_pos)?; Some((neighbor_pos, neighbor_chunk, &neighbor_chunk.river)) }); - let cliff_height = sim.get_interpolated(wpos, |chunk| chunk.cliff_height)?; - let cliff_factor = (alt - + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 10.0 - + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0).rem_euclid(128.0) / 64.0 - 1.0; - let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 + 0.5).max(0.0) as f32; - let cliff = if cliff_factor < 0.0 { cliff_factor.abs().powf(1.5) } else { 0.0 }; - let cliff_offset = cliff * cliff_height; - let alt = alt + (cliff - 0.5) * cliff_height; let lake_width = (TerrainChunkSize::RECT_SIZE.x as f64 * (2.0f64.sqrt())) + 12.0; let neighbor_river_data = neighbor_river_data.map(|(posj, chunkj, river)| { @@ -268,6 +265,27 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { ) }); + // Cliffs + let cliff_height = + sim.get_interpolated(wpos, |chunk| chunk.cliff_height)? * (1.0 - near_water).powf(2.0); + let cliff_factor = (alt + + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 10.0 + + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0) + .rem_euclid(128.0) + / 64.0 + - 1.0; + let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 + + 0.5) + .max(0.0) as f32; + let cliff = if cliff_factor < 0.0 { + cliff_factor.abs().powf(1.5) + } else { + 0.0 + }; + let cliff_offset = cliff * cliff_height; + let alt = alt + (cliff - 0.5) * cliff_height; + // Find the average distance to each neighboring body of water. let mut river_count = 0.0f64; let mut overlap_count = 0.0f64; @@ -988,12 +1006,9 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { .map(|wd| Lerp::lerp(sub_surface_color, ground, (wd / 3.0).clamped(0.0, 1.0))) .unwrap_or(ground); - // Ground under thick trees should be receive less sunlight and so often become dirt - let ground = Lerp::lerp( - ground, - sub_surface_color, - marble_mid * tree_density, - ); + // Ground under thick trees should be receive less sunlight and so often become + // dirt + let ground = Lerp::lerp(ground, sub_surface_color, marble_mid * tree_density); let near_ocean = max_river.and_then(|(_, _, river_data, _)| { if (river_data.is_lake() || river_data.river_kind == Some(RiverKind::Ocean)) diff --git a/world/src/lib.rs b/world/src/lib.rs index 018b1da2bf..575c9ba726 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -294,9 +294,10 @@ impl World { layer::apply_coral_to(&mut canvas); // Apply site generation - sim_chunk.sites.iter().for_each(|site| { - index.sites[*site].apply_to(&mut canvas, &mut dynamic_rng) - }); + sim_chunk + .sites + .iter() + .for_each(|site| index.sites[*site].apply_to(&mut canvas, &mut dynamic_rng)); let gen_entity_pos = |dynamic_rng: &mut rand::rngs::ThreadRng| { let lpos2d = TerrainChunkSize::RECT_SIZE From e5b02ff7dac5e831c9ef1994bc0d17c50e4f3cc2 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 17:55:48 +0000 Subject: [PATCH 47/87] Better water/cave/cliff interaction --- world/src/block/mod.rs | 2 +- world/src/column/mod.rs | 6 +++--- world/src/layer/mod.rs | 25 ++++++++++++++++--------- world/src/lib.rs | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index a57e3973fd..62792a9abb 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -121,7 +121,7 @@ impl<'a> BlockGen<'a> { if stone_factor >= 0.5 { if wposf.z as f32 > height - cliff_offset.max(0.0) { - if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - wposf.z as f32).mul(0.25).clamped(0.0, 12.0) { + if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - wposf.z as f32).mul(0.25).clamped(0.0, 10.0) { Some(Block::empty()) } else { let col = Lerp::lerp( diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 34dcbf3ee1..813478b488 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -267,9 +267,9 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { // Cliffs let cliff_height = - sim.get_interpolated(wpos, |chunk| chunk.cliff_height)? * (1.0 - near_water).powf(2.0); + sim.get_interpolated(wpos, |chunk| chunk.cliff_height)?; let cliff_factor = (alt - + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 10.0 + + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 8.0 + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0) .rem_euclid(128.0) / 64.0 @@ -282,7 +282,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { cliff_factor.abs().powf(1.5) } else { 0.0 - }; + } * (1.0 - near_water * 3.0).max(0.0).powi(2); let cliff_offset = cliff * cliff_height; let alt = alt + (cliff - 0.5) * cliff_height; diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index b5c8a603ba..6ce4c16494 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -110,7 +110,7 @@ pub fn apply_paths_to(canvas: &mut Canvas) { pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) { let info = canvas.info(); canvas.foreach_col(|canvas, wpos2d, col| { - let surface_z = col.riverless_alt.floor() as i32; + let surface_z = col.alt.floor() as i32; if let Some((cave_dist, _, cave, _)) = col.cave.filter(|(dist, _, cave, _)| *dist < cave.width) @@ -164,14 +164,21 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) { ) .mul(45.0) as i32; - for z in cave_roof - stalagtites..cave_roof { - canvas.set( - Vec3::new(wpos2d.x, wpos2d.y, z), - Block::new( - BlockKind::WeakRock, - info.index().colors.layer.stalagtite.into(), - ), - ); + // Generate stalagtites if there's something for them to hold on to + if canvas + .get(Vec3::new(wpos2d.x, wpos2d.y, cave_roof)) + .map(|b| b.is_filled()) + .unwrap_or(false) + { + for z in cave_roof - stalagtites..cave_roof { + canvas.set( + Vec3::new(wpos2d.x, wpos2d.y, z), + Block::new( + BlockKind::WeakRock, + info.index().colors.layer.stalagtite.into(), + ), + ); + } } let cave_depth = (col.alt - cave.alt).max(0.0); diff --git a/world/src/lib.rs b/world/src/lib.rs index 575c9ba726..67a62735ed 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -287,9 +287,9 @@ impl World { chunk: &mut chunk, }; + layer::apply_caves_to(&mut canvas, &mut dynamic_rng); layer::apply_trees_to(&mut canvas, &mut dynamic_rng); layer::apply_scatter_to(&mut canvas, &mut dynamic_rng); - layer::apply_caves_to(&mut canvas, &mut dynamic_rng); layer::apply_paths_to(&mut canvas); layer::apply_coral_to(&mut canvas); From 7ea9e32acf477fc4b972e5ac2489ecbb2f4d145b Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 14 Feb 2021 21:46:06 +0000 Subject: [PATCH 48/87] Better cliffs --- world/src/block/mod.rs | 2 +- world/src/column/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 62792a9abb..0a08ecc6ed 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -121,7 +121,7 @@ impl<'a> BlockGen<'a> { if stone_factor >= 0.5 { if wposf.z as f32 > height - cliff_offset.max(0.0) { - if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - wposf.z as f32).mul(0.25).clamped(0.0, 10.0) { + if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - wposf.z as f32).mul(0.25).clamped(0.0, 6.0) { Some(Block::empty()) } else { let col = Lerp::lerp( diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 813478b488..fe0e01187b 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -274,7 +274,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { .rem_euclid(128.0) / 64.0 - 1.0; - let cliff_scale = (self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) + let cliff_scale = ((self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) * 2.0 - 1.0) + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 + 0.5) .max(0.0) as f32; From 81b93b548e9cf6337b05b6c5723ba6951b2d13b3 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 15 Feb 2021 00:58:58 +0000 Subject: [PATCH 49/87] More varied cliff placement --- world/src/block/mod.rs | 2 +- world/src/column/mod.rs | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 0a08ecc6ed..b193f09ffa 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -121,7 +121,7 @@ impl<'a> BlockGen<'a> { if stone_factor >= 0.5 { if wposf.z as f32 > height - cliff_offset.max(0.0) { - if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - wposf.z as f32).mul(0.25).clamped(0.0, 6.0) { + if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - grass_depth - wposf.z as f32).mul(0.25).clamped(0.0, 8.0) { Some(Block::empty()) } else { let col = Lerp::lerp( diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index fe0e01187b..dab7a5b328 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -266,18 +266,17 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { }); // Cliffs - let cliff_height = - sim.get_interpolated(wpos, |chunk| chunk.cliff_height)?; let cliff_factor = (alt - + self.sim.gen_ctx.hill_nz.get(wposf.div(32.0).into_array()) as f32 * 8.0 + + self.sim.gen_ctx.hill_nz.get(wposf.div(64.0).into_array()) as f32 * 8.0 + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0) .rem_euclid(128.0) / 64.0 - 1.0; - let cliff_scale = ((self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) * 2.0 - 1.0) - + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1 - + 0.5) - .max(0.0) as f32; + let cliff_scale = ((self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) * 2.0 + 1.0) + + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1) + .clamped(0.0, 1.0) as f32; + let cliff_height = + sim.get_interpolated(wpos, |chunk| chunk.cliff_height)? * cliff_scale; let cliff = if cliff_factor < 0.0 { cliff_factor.abs().powf(1.5) } else { From 7b807ed34c7bc85fca68d26049f8554a11665038 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 15 Feb 2021 01:23:16 +0000 Subject: [PATCH 50/87] Removed dead code --- voxygen/src/mesh/terrain.rs | 60 +++++++++++++------------------------ 1 file changed, 20 insertions(+), 40 deletions(-) diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index 8dbf7892ae..8812f5a348 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -127,46 +127,26 @@ fn calc_light + ReadVol + Debug>( let pos = Vec3::new(pos.0 as i32, pos.1 as i32, pos.2 as i32); let light = light_map[lm_idx(pos.x, pos.y, pos.z)]; - // If ray propagate downwards at full strength - if is_sunlight && light == SUNLIGHT && false { - // Down is special cased and we know up is a ray - // Special cased ray propagation - let pos = Vec3::new(pos.x, pos.y, pos.z - 1); - let (is_air, is_liquid) = vol_cached - .get(outer.min + pos) - .ok() - .map_or((false, false), |b| (b.is_air(), b.is_liquid())); - light_map[lm_idx(pos.x, pos.y, pos.z)] = if is_air { - prop_que.push_back((pos.x as u8, pos.y as u8, pos.z as u16)); - SUNLIGHT - } else if is_liquid { - prop_que.push_back((pos.x as u8, pos.y as u8, pos.z as u16)); - SUNLIGHT - 1 - } else { - OPAQUE - } - } else { - // Up - // Bounds checking - if pos.z + 1 < outer.size().d { - propagate( - light, - light_map.get_mut(lm_idx(pos.x, pos.y, pos.z + 1)).unwrap(), - Vec3::new(pos.x, pos.y, pos.z + 1), - &mut prop_que, - &mut vol_cached, - ) - } - // Down - if pos.z > 0 { - propagate( - light, - light_map.get_mut(lm_idx(pos.x, pos.y, pos.z - 1)).unwrap(), - Vec3::new(pos.x, pos.y, pos.z - 1), - &mut prop_que, - &mut vol_cached, - ) - } + // Up + // Bounds checking + if pos.z + 1 < outer.size().d { + propagate( + light, + light_map.get_mut(lm_idx(pos.x, pos.y, pos.z + 1)).unwrap(), + Vec3::new(pos.x, pos.y, pos.z + 1), + &mut prop_que, + &mut vol_cached, + ) + } + // Down + if pos.z > 0 { + propagate( + light, + light_map.get_mut(lm_idx(pos.x, pos.y, pos.z - 1)).unwrap(), + Vec3::new(pos.x, pos.y, pos.z - 1), + &mut prop_que, + &mut vol_cached, + ) } // The XY directions if pos.y + 1 < outer.size().h { From 660b297dd0d817ec9a958ea88d9dc9ca1a53137c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 15 Feb 2021 17:35:54 +0000 Subject: [PATCH 51/87] Cliff height variety --- world/src/block/mod.rs | 2 +- world/src/civ/mod.rs | 2 +- world/src/column/mod.rs | 10 +++++----- world/src/sim/mod.rs | 4 ++++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index b193f09ffa..4defa2e087 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -127,7 +127,7 @@ impl<'a> BlockGen<'a> { let col = Lerp::lerp( col.map(|e| e as f32), col.map(|e| e as f32) * 0.7, - (wposf.z as f32 - basement).div(2.0).sin() * 0.5 + 0.5, + (wposf.z as f32 - basement * 0.3).div(2.0).sin() * 0.5 + 0.5, ).map(|e| e as u8); Some(Block::new(BlockKind::Rock, col)) } diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 1966e1df0c..060da91cc2 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -701,7 +701,7 @@ fn walk_in_dir(sim: &WorldSim, a: Vec2, dir: Vec2) -> Option { /// Return true if a position is suitable for walking on fn loc_suitable_for_walking(sim: &WorldSim, loc: Vec2) -> bool { if let Some(chunk) = sim.get(loc) { - !chunk.river.is_ocean() && !chunk.river.is_lake() + !chunk.river.is_ocean() && !chunk.river.is_lake() && !chunk.near_cliffs() } else { false } diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index dab7a5b328..a24ed76f23 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -268,13 +268,13 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { // Cliffs let cliff_factor = (alt + self.sim.gen_ctx.hill_nz.get(wposf.div(64.0).into_array()) as f32 * 8.0 - + self.sim.gen_ctx.hill_nz.get(wposf.div(256.0).into_array()) as f32 * 64.0) - .rem_euclid(128.0) + + self.sim.gen_ctx.hill_nz.get(wposf.div(350.0).into_array()) as f32 * 128.0) + .rem_euclid(200.0) / 64.0 - 1.0; - let cliff_scale = ((self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) * 2.0 + 1.0) - + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) * 0.1) - .clamped(0.0, 1.0) as f32; + let cliff_scale = ((self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) as f32 * 1.5 + 0.75) + + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) as f32 * 0.1) + .clamped(0.0, 1.0).powf(2.0); let cliff_height = sim.get_interpolated(wpos, |chunk| chunk.cliff_height)? * cliff_scale; let cliff = if cliff_factor < 0.0 { diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 78d8bc1145..258e264f49 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2392,4 +2392,8 @@ impl SimChunk { BiomeKind::Grassland } } + + pub fn near_cliffs(&self) -> bool { + self.cliff_height > 0.0 + } } From 7d94c3600fdb064f9be73e22ce8ae176a4e7b28f Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 17 Feb 2021 01:47:16 +0000 Subject: [PATCH 52/87] New town layouts, initial progress --- Cargo.lock | 307 ++++++++++++---------------------------- common/src/path.rs | 9 ++ common/src/store.rs | 4 + world/src/civ/mod.rs | 7 +- world/src/land.rs | 21 +++ world/src/lib.rs | 2 + world/src/site2/mod.rs | 303 ++++++++++++++++++++++++++++++++++----- world/src/site2/plot.rs | 12 +- world/src/site2/tile.rs | 37 +++-- world/src/util/mod.rs | 19 +++ 10 files changed, 448 insertions(+), 273 deletions(-) create mode 100644 world/src/land.rs diff --git a/Cargo.lock b/Cargo.lock index 5232d5ff14..298e334c49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,7 +80,7 @@ checksum = "44581add1add74ade32aca327b550342359ec00191672c23c1caa3d492b85930" dependencies = [ "alsa-sys", "bitflags", - "libc 0.2.77", + "libc", "nix 0.15.0", ] @@ -90,7 +90,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5a0559bcd3f7a482690d98be41c08a43e92f669b179433e95ddf5e8b8fd36a3" dependencies = [ - "libc 0.2.77", + "libc", "pkg-config", ] @@ -290,7 +290,7 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ac2c016b079e771204030951c366db398864f5026f84a44dafb0ff20f02085d" dependencies = [ - "libc 0.2.77", + "libc", "winapi 0.3.9", ] @@ -307,7 +307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", - "libc 0.2.77", + "libc", "winapi 0.3.9", ] @@ -356,7 +356,7 @@ checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" dependencies = [ "addr2line", "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "miniz_oxide 0.4.2", "object 0.20.0", "rustc-demangle", @@ -596,7 +596,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -605,7 +605,7 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d021fddb7bd3e734370acfa4a83f34095571d8570c039f1420d77540f68d5772" dependencies = [ - "libc 0.2.77", + "libc", "num-integer", "num-traits 0.2.14", "time", @@ -625,7 +625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" dependencies = [ "glob", - "libc 0.2.77", + "libc", "libloading 0.5.2", ] @@ -724,7 +724,7 @@ dependencies = [ "core-foundation 0.9.1", "core-graphics 0.22.1", "foreign-types", - "libc 0.2.77", + "libc", "objc", ] @@ -755,7 +755,7 @@ dependencies = [ "core-foundation 0.9.1", "core-graphics-types", "foreign-types", - "libc 0.2.77", + "libc", "objc", ] @@ -919,7 +919,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25b9e03f145fd4f2bf705e07b900cd41fc636598fe5dc452fd0db1441c3f496d" dependencies = [ "core-foundation-sys 0.6.2", - "libc 0.2.77", + "libc", ] [[package]] @@ -929,7 +929,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ "core-foundation-sys 0.7.0", - "libc 0.2.77", + "libc", ] [[package]] @@ -939,7 +939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ "core-foundation-sys 0.8.1", - "libc 0.2.77", + "libc", ] [[package]] @@ -969,7 +969,7 @@ dependencies = [ "bitflags", "core-foundation 0.7.0", "foreign-types", - "libc 0.2.77", + "libc", ] [[package]] @@ -982,7 +982,7 @@ dependencies = [ "core-foundation 0.9.1", "core-graphics-types", "foreign-types", - "libc 0.2.77", + "libc", ] [[package]] @@ -994,7 +994,7 @@ dependencies = [ "bitflags", "core-foundation 0.9.1", "foreign-types", - "libc 0.2.77", + "libc", ] [[package]] @@ -1006,7 +1006,7 @@ dependencies = [ "cfg-if 0.1.10", "core-foundation-sys 0.7.0", "core-graphics 0.19.2", - "libc 0.2.77", + "libc", "objc", ] @@ -1041,7 +1041,7 @@ dependencies = [ "jni 0.17.0", "js-sys", "lazy_static", - "libc 0.2.77", + "libc", "mach 0.3.2", "ndk", "ndk-glue", @@ -1320,7 +1320,7 @@ dependencies = [ "bitflags", "crossterm_winapi", "lazy_static", - "libc 0.2.77", + "libc", "mio 0.7.0", "parking_lot 0.10.2", "signal-hook 0.1.16", @@ -1336,7 +1336,7 @@ dependencies = [ "bitflags", "crossterm_winapi", "lazy_static", - "libc 0.2.77", + "libc", "mio 0.7.0", "parking_lot 0.11.0", "signal-hook 0.1.16", @@ -1539,7 +1539,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ - "libc 0.2.77", + "libc", "redox_users", "winapi 0.3.9", ] @@ -1550,7 +1550,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c60f7b8a8953926148223260454befb50c751d3c50e1c178c4fd1ace4083c9a" dependencies = [ - "libc 0.2.77", + "libc", "redox_users", "winapi 0.3.9", ] @@ -1664,9 +1664,6 @@ checksum = "959a80a2062fedd66ed41d99736212de987b3a8c83a4c2cef243968075256bd1" dependencies = [ "enumset_derive", "num-traits 0.2.14", - "errno-dragonfly", - "libc 0.2.77", - "winapi 0.3.9", ] [[package]] @@ -1679,8 +1676,6 @@ dependencies = [ "proc-macro2 1.0.24", "quote 1.0.7", "syn 1.0.54", - "gcc", - "libc 0.2.77", ] [[package]] @@ -1699,7 +1694,7 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b49c94f66f2d2c5ee8685039e458b4e6c9f13af7c28736baf10ce42966a5ab52" dependencies = [ - "libc 0.2.77", + "libc", "str-buf", ] @@ -1764,7 +1759,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "redox_syscall", "winapi 0.3.9", ] @@ -1828,7 +1823,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f41b048a94555da0f42f1d632e2e19510084fb8e303b0daa2816e733fb3644a0" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -1837,7 +1832,7 @@ version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a29c77f1ca394c3e73a9a5d24cfcabb734682d9634fc398f2204a63c994120" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -2038,7 +2033,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -2049,7 +2044,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -2118,7 +2113,7 @@ checksum = "43c758daf46af26d6872fe55507e3b2339779a160a06ad7a9b2a082f221209cd" dependencies = [ "core-foundation 0.6.4", "io-kit-sys", - "libc 0.2.77", + "libc", "libudev-sys", "log", "nix 0.15.0", @@ -2147,7 +2142,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e094214efbc7fdbbdee952147e493b00e99a4e52817492277e98967ae918165" dependencies = [ "bitflags", - "libc 0.2.77", + "libc", "libgit2-sys", "log", "openssl-probe", @@ -2413,7 +2408,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -2729,7 +2724,7 @@ checksum = "4816c66d2c8ae673df83366c18341538f234a26d65a9ecea5c348b453ac1d02f" dependencies = [ "bitflags", "inotify-sys", - "libc 0.2.77", + "libc", ] [[package]] @@ -2740,7 +2735,7 @@ checksum = "46dd0a94b393c730779ccfd2a872b67b1eb67be3fc33082e733bdb38b5fde4d4" dependencies = [ "bitflags", "inotify-sys", - "libc 0.2.77", + "libc", ] [[package]] @@ -2749,7 +2744,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -2777,7 +2772,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -2850,7 +2845,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -2922,12 +2917,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "libc" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" - [[package]] name = "libc" version = "0.2.77" @@ -2953,7 +2942,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "069eea34f76ec15f2822ccf78fe0cdb8c9016764d0a12865278585a74dbdeae5" dependencies = [ "cc", - "libc 0.2.77", + "libc", "libssh2-sys", "libz-sys", "openssl-sys", @@ -3004,7 +2993,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" dependencies = [ "cc", - "libc 0.2.77", + "libc", "libz-sys", "openssl-sys", "pkg-config", @@ -3017,7 +3006,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c8469b4a23b962c1396b9b451dda50ef5b283e8dd309d69033475fa9b334324" dependencies = [ - "libc 0.2.77", + "libc", "pkg-config", ] @@ -3028,7 +3017,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" dependencies = [ "cc", - "libc 0.2.77", + "libc", "pkg-config", "vcpkg", ] @@ -3094,7 +3083,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86dd2487cdfea56def77b88438a2c915fb45113c5319bfe7e14306ca4cd0b0e1" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -3103,7 +3092,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -3112,7 +3101,7 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -3148,7 +3137,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" dependencies = [ - "libc 0.2.77", + "libc", "winapi 0.3.9", ] @@ -3265,7 +3254,7 @@ dependencies = [ "fuchsia-zircon-sys", "iovec", "kernel32-sys", - "libc 0.2.77", + "libc", "log", "miow 0.2.1", "net2", @@ -3280,7 +3269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e9971bc8349a361217a8f2a41f5d011274686bd4436465ba51730921039d7fb" dependencies = [ "lazy_static", - "libc 0.2.77", + "libc", "log", "miow 0.3.5", "ntapi", @@ -3306,7 +3295,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" dependencies = [ "iovec", - "libc 0.2.77", + "libc", "mio 0.6.22", ] @@ -3381,7 +3370,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6c938c36cd15ea13d0972fdceb3a03982d49967e5fd7508cf129c5300b66cc" dependencies = [ "lazy_static", - "libc 0.2.77", + "libc", "log", "ndk", "ndk-macro", @@ -3414,7 +3403,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "winapi 0.3.9", ] @@ -3427,7 +3416,7 @@ dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "void", ] @@ -3440,7 +3429,7 @@ dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "void", ] @@ -3453,7 +3442,7 @@ dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", - "libc 0.2.77", + "libc", ] [[package]] @@ -3497,7 +3486,7 @@ dependencies = [ "fsevent 0.4.0", "fsevent-sys 2.0.1", "inotify 0.7.1", - "libc 0.2.77", + "libc", "mio 0.6.22", "mio-extras", "walkdir 2.3.1", @@ -3517,7 +3506,7 @@ dependencies = [ "fsevent 2.0.2", "fsevent-sys 3.0.2", "inotify 0.8.3", - "libc 0.2.77", + "libc", "mio 0.6.22", "mio-extras", "walkdir 2.3.1", @@ -3539,11 +3528,8 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" dependencies = [ - "num-bigint 0.1.44", - "num-complex 0.1.43", "num-integer", "num-iter", - "num-rational 0.1.42", "num-traits 0.2.14", ] @@ -3575,18 +3561,6 @@ dependencies = [ "num-traits 0.2.14", ] -[[package]] -name = "num-bigint" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e63899ad0da84ce718c14936262a41cee2c79c981fc0a0e7c7beb47d5a07e8c1" -dependencies = [ - "num-integer", - "num-traits 0.2.14", - "rand 0.4.6", - "rustc-serialize", -] - [[package]] name = "num-bigint" version = "0.2.6" @@ -3609,16 +3583,6 @@ dependencies = [ "num-traits 0.2.14", ] -[[package]] -name = "num-complex" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b288631d7878aaf59442cffd36910ea604ecd7745c36054328595114001c9656" -dependencies = [ - "num-traits 0.2.14", - "rustc-serialize", -] - [[package]] name = "num-complex" version = "0.2.4" @@ -3670,18 +3634,6 @@ dependencies = [ "num-traits 0.2.14", ] -[[package]] -name = "num-rational" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee314c74bd753fc86b4780aa9475da469155f3848473a261d2d18e35245a784e" -dependencies = [ - "num-bigint 0.1.44", - "num-integer", - "num-traits 0.2.14", - "rustc-serialize", -] - [[package]] name = "num-rational" version = "0.2.4" @@ -3731,7 +3683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" dependencies = [ "hermit-abi", - "libc 0.2.77", + "libc", ] [[package]] @@ -3870,7 +3822,7 @@ checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" dependencies = [ "autocfg 1.0.1", "cc", - "libc 0.2.77", + "libc", "pkg-config", "vcpkg", ] @@ -3940,16 +3892,6 @@ dependencies = [ "libm", ] -[[package]] -name = "page_size" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" -dependencies = [ - "libc 0.2.77", - "winapi 0.3.9", -] - [[package]] name = "parking_lot" version = "0.9.0" @@ -3990,7 +3932,7 @@ checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" dependencies = [ "cfg-if 0.1.10", "cloudabi 0.0.3", - "libc 0.2.77", + "libc", "redox_syscall", "rustc_version", "smallvec 0.6.13", @@ -4005,7 +3947,7 @@ checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ "cfg-if 0.1.10", "cloudabi 0.0.3", - "libc 0.2.77", + "libc", "redox_syscall", "smallvec 1.5.1", "winapi 0.3.9", @@ -4020,7 +3962,7 @@ dependencies = [ "cfg-if 0.1.10", "cloudabi 0.1.0", "instant", - "libc 0.2.77", + "libc", "redox_syscall", "smallvec 1.5.1", "winapi 0.3.9", @@ -4286,42 +4228,6 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9e006811e1fdd12672b0820a7f44c18dde429f367d50cec003d22aa9b3c8ddc" -[[package]] -name = "rand" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" -dependencies = [ - "libc 0.2.77", - "rand 0.4.6", -] - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc 0.2.77", - "rand_core 0.3.1", - "rdrand", - "winapi 0.3.9", -] - -[[package]] -name = "rand" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" -dependencies = [ - "cloudabi 0.0.3", - "fuchsia-cprng", - "libc 0.2.77", - "rand_core 0.3.1", - "winapi 0.3.9", -] - [[package]] name = "rand" version = "0.6.5" @@ -4329,7 +4235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" dependencies = [ "autocfg 0.1.7", - "libc 0.2.77", + "libc", "rand_chacha 0.1.1", "rand_core 0.4.2", "rand_hc 0.1.0", @@ -4348,7 +4254,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ "getrandom 0.1.15", - "libc 0.2.77", + "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", "rand_hc 0.2.0", @@ -4471,7 +4377,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" dependencies = [ - "libc 0.2.77", + "libc", "rand_core 0.4.2", "winapi 0.3.9", ] @@ -4484,7 +4390,7 @@ checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" dependencies = [ "cloudabi 0.0.3", "fuchsia-cprng", - "libc 0.2.77", + "libc", "rand_core 0.4.2", "rdrand", "winapi 0.3.9", @@ -4535,7 +4441,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -4693,7 +4599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" dependencies = [ "cc", - "libc 0.2.77", + "libc", "once_cell", "spin", "untrusted", @@ -4765,12 +4671,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" - [[package]] name = "rustc_version" version = "0.2.3" @@ -4905,7 +4805,7 @@ checksum = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" dependencies = [ "bitflags", "lazy_static", - "libc 0.2.77", + "libc", "num 0.1.42", "rand 0.6.5", "sdl2-sys", @@ -4918,7 +4818,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.77", + "libc", ] [[package]] @@ -5043,7 +4943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a9e7e0f2bfae24d8a5b5a66c5b257a83c7412304311512a0c054cd5e619da11" dependencies = [ "lazy_static", - "libc 0.2.77", + "libc", ] [[package]] @@ -5099,7 +4999,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" dependencies = [ - "libc 0.2.77", + "libc", "mio 0.7.0", "signal-hook-registry", ] @@ -5110,7 +5010,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8133fd06d2c721d4168f9b76a9a7fd3a0bfc96df58cf7316c7fb9f23bd677f4e" dependencies = [ - "libc 0.2.77", + "libc", "signal-hook-registry", ] @@ -5121,19 +5021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" dependencies = [ "arc-swap", - "libc 0.2.77", -] - -[[package]] -name = "simple" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa821f780dcfc349088d15d40eec3de34e1dc6923b1e39c83041d5ca6c686087" -dependencies = [ - "libc 0.1.12", - "num 0.1.42", - "rand 0.3.23", - "sdl2", + "libc", ] [[package]] @@ -5232,7 +5120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "redox_syscall", "winapi 0.3.9", ] @@ -5470,7 +5358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "489997b7557e9a43e192c527face4feacc78bfbe6eed67fd55c4c9e381cba290" dependencies = [ "filetime", - "libc 0.2.77", + "libc", "redox_syscall", "xattr", ] @@ -5488,7 +5376,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.77", + "libc", "rand 0.7.3", "redox_syscall", "remove_dir_all", @@ -5569,7 +5457,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ - "libc 0.2.77", + "libc", "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] @@ -6435,6 +6323,7 @@ dependencies = [ "bincode", "bitvec", "criterion", + "enum-iterator", "fxhash", "hashbrown 0.9.1", "image", @@ -6450,7 +6339,8 @@ dependencies = [ "rayon", "ron", "serde", - "simple", + "structopt", + "svg_fmt", "tracing", "tracing-subscriber", "vek 0.12.0", @@ -6652,13 +6542,6 @@ checksum = "fc85134b257e5fba5870693441e300b601d08f18833ac4fa6934f0b72afc56d2" dependencies = [ "enumset", "raw-cpuid", - "byteorder", - "cranelift-codegen", - "cranelift-entity", - "cranelift-native", - "libc 0.2.77", - "nix 0.15.0", - "rayon", "serde", "serde_bytes", "smallvec 1.5.1", @@ -6730,18 +6613,6 @@ dependencies = [ "bincode", "cfg-if 0.1.10", "region", - "blake3", - "cc", - "digest 0.8.1", - "errno", - "hex 0.4.2", - "indexmap", - "lazy_static", - "libc 0.2.77", - "nix 0.15.0", - "page_size", - "parking_lot 0.10.2", - "rustc_version", "serde", "serde_bytes", "wasmer-compiler", @@ -6812,8 +6683,6 @@ dependencies = [ "serde", "thiserror", "wasmer-types", - "libc 0.2.77", - "wasmer-runtime-core", "winapi 0.3.9", ] @@ -6849,7 +6718,7 @@ checksum = "ab702fefbcd6d6f67fb5816e3a89a3b5a42a94290abbc015311c9a30d1068ae4" dependencies = [ "bitflags", "downcast-rs", - "libc 0.2.77", + "libc", "nix 0.17.0", "scoped-tls", "wayland-commons 0.27.0", @@ -6865,7 +6734,7 @@ checksum = "80c54f9b90b2c044784f91fe22c5619a8a9c681db38492f2fd78ff968cf3f184" dependencies = [ "bitflags", "downcast-rs", - "libc 0.2.77", + "libc", "nix 0.18.0", "scoped-tls", "wayland-commons 0.28.1", @@ -7041,7 +6910,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e713040b67aae5bf1a0ae3e1ebba8cc29ab2b90da9aa1bff6e09031a8a41d7a8" dependencies = [ - "libc 0.2.77", + "libc", "winapi 0.3.9", ] @@ -7051,7 +6920,7 @@ version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87c14ef7e1b8b8ecfc75d5eca37949410046e66f15d185c01d70824f1f8111ef" dependencies = [ - "libc 0.2.77", + "libc", "thiserror", ] @@ -7124,7 +6993,7 @@ dependencies = [ "dispatch 0.2.0", "instant", "lazy_static", - "libc 0.2.77", + "libc", "log", "mio 0.6.22", "mio-extras", @@ -7192,7 +7061,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" dependencies = [ "lazy_static", - "libc 0.2.77", + "libc", "maybe-uninit", "pkg-config", ] @@ -7203,7 +7072,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" dependencies = [ - "libc 0.2.77", + "libc", ] [[package]] @@ -7212,7 +7081,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62056f63138b39116f82a540c983cc11f1c90cd70b3d492a70c25eaa50bd22a6" dependencies = [ - "libc 0.2.77", + "libc", "log", ] @@ -7244,7 +7113,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aec02bc5de902aa579f3d2f2c522edaf40fa42963cbaffe645b058ddcc68fdb2" dependencies = [ "bitflags", - "libc 0.2.77", + "libc", "xkbcommon-sys", ] @@ -7254,7 +7123,7 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa434980dca02ebf28795d71e570dbb78316d095a228707efd6117bf8246d78b" dependencies = [ - "libc 0.2.77", + "libc", "pkg-config", ] diff --git a/common/src/path.rs b/common/src/path.rs index d8b475dad5..8c5eab36ea 100644 --- a/common/src/path.rs +++ b/common/src/path.rs @@ -32,6 +32,15 @@ impl FromIterator for Path { } } +impl IntoIterator for Path { + type Item = T; + type IntoIter = std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.nodes.into_iter() + } +} + impl Path { pub fn is_empty(&self) -> bool { self.nodes.is_empty() } diff --git a/common/src/store.rs b/common/src/store.rs index 3ba7b9ab0d..0b61090350 100644 --- a/common/src/store.rs +++ b/common/src/store.rs @@ -67,6 +67,10 @@ impl Default for Store { } impl Store { + pub fn len(&self) -> usize { + self.len + } + pub fn contains(&self, id: Id) -> bool { self.entries .get(id.idx as usize) diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 060da91cc2..ce451ce42d 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -10,6 +10,7 @@ use crate::{ util::{attempt, seed_expan, MapVec, CARDINALS, NEIGHBORS}, site2, Index, + Land, }; use common::{ astar::Astar, @@ -216,11 +217,7 @@ impl Civs { WorldSite::castle(Castle::generate(wpos, Some(ctx.sim), &mut rng)) }, SiteKind::Refactor => { - WorldSite::refactor({ - let mut site = site2::Site::generate(&mut rng); - site.origin = wpos; - site - }) + WorldSite::refactor(site2::Site::generate(&Land::from_sim(&ctx.sim), &mut rng, wpos)) }, }); sim_site.site_tmp = Some(site); diff --git a/world/src/land.rs b/world/src/land.rs new file mode 100644 index 0000000000..9790b3091b --- /dev/null +++ b/world/src/land.rs @@ -0,0 +1,21 @@ +use crate::sim; +use vek::*; + +/// A wrapper type that may contain a reference to a generated world. If not, default values will be provided. +pub struct Land<'a> { + sim: Option<&'a sim::WorldSim>, +} + +impl<'a> Land<'a> { + pub fn empty() -> Self { + Self { sim: None } + } + + pub fn from_sim(sim: &'a sim::WorldSim) -> Self { + Self { sim: Some(sim) } + } + + pub fn get_alt_approx(&self, wpos: Vec2) -> f32 { + self.sim.and_then(|sim| sim.get_alt_approx(wpos)).unwrap_or(0.0) + } +} diff --git a/world/src/lib.rs b/world/src/lib.rs index 67a62735ed..78e755a5a5 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -19,6 +19,7 @@ pub mod civ; mod column; pub mod config; pub mod index; +pub mod land; pub mod layer; pub mod pathfinding; pub mod sim; @@ -30,6 +31,7 @@ pub mod util; // Reexports pub use crate::{ canvas::{Canvas, CanvasInfo}, + land::Land, config::CONFIG, }; pub use block::BlockGen; diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 8ea1b8b28c..716e92fcdd 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -7,21 +7,28 @@ use self::{ }; use crate::{ site::SpawnRules, - util::Grid, + util::{Grid, attempt, CARDINALS, SQUARE_9}, Canvas, + Land, }; use common::{ terrain::{Block, BlockKind, SpriteKind}, store::{Id, Store}, + astar::Astar, + lottery::Lottery, }; +use hashbrown::hash_map::DefaultHashBuilder; use rand::prelude::*; use vek::*; +use std::ops::Range; #[derive(Default)] pub struct Site { pub(crate) origin: Vec2, tiles: TileGrid, plots: Store, + plazas: Vec>, + roads: Vec>, } impl Site { @@ -30,13 +37,11 @@ impl Site { } pub fn spawn_rules(&self, wpos: Vec2) -> SpawnRules { - if wpos.distance_squared(self.origin) < 100i32.pow(2) { - SpawnRules { - trees: false, - ..SpawnRules::default() - } - } else { - SpawnRules::default() + SpawnRules { + trees: SQUARE_9 + .iter() + .all(|&rpos| self.wpos_tile(wpos + rpos * tile::TILE_SIZE as i32).is_empty()), + ..SpawnRules::default() } } @@ -48,35 +53,226 @@ impl Site { } } + pub fn plot(&self, id: Id) -> &Plot { &self.plots[id] } + pub fn plots(&self) -> impl Iterator + '_ { self.plots.values() } pub fn create_plot(&mut self, plot: Plot) -> Id { self.plots.insert(plot) } - pub fn generate(rng: &mut impl Rng) -> Self { - let mut site = Site::default(); + pub fn blit_aabr(&mut self, aabr: Aabr, tile: Tile) { + for y in 0..aabr.size().h { + for x in 0..aabr.size().w { + self.tiles.set(aabr.min + Vec2::new(x, y), tile.clone()); + } + } + } - for i in 0..100 { - let dir = Vec2::::zero() - .map(|_| rng.gen_range(-1.0..1.0)) - .normalized(); - let search_pos = (dir * rng.gen_range(0.0f32..1.0).powf(2.0) * 24.0).map(|e| e as i32); + pub fn create_road(&mut self, land: &Land, rng: &mut impl Rng, a: Vec2, b: Vec2) -> Option> { + const MAX_ITERS: usize = 4096; + let heuristic = |tile: &Vec2| if self.tiles.get(*tile).is_obstacle() { 100.0 } else { 0.0 }; + let path = Astar::new(MAX_ITERS, a, &heuristic, DefaultHashBuilder::default()).poll( + MAX_ITERS, + &heuristic, + |tile| { let tile = *tile; CARDINALS.iter().map(move |dir| tile + *dir) }, + |a, b| (a.distance_squared(*b) as f32).sqrt(), + |tile| *tile == b, + ).into_path()?; - site.tiles - .find_near(search_pos, |_, tile| tile.is_empty()) - .and_then(|center| site.tiles.grow_aabr(center, 6..16, Extent2::new(2, 2)).ok()) - .map(|aabr| { - let tile = match i % 2 { - 0 => TileKind::Farmland { seed: i }, - _ => TileKind::Building { levels: 1 + i % 3 }, - }; + let plot = self.create_plot(Plot { + kind: PlotKind::Road(path.clone()), + root_tile: a, + tiles: path.clone().into_iter().collect(), + seed: rng.gen(), + base_alt: 0, + }); - for x in 0..aabr.size().w { - for y in 0..aabr.size().h { - let pos = aabr.min + Vec2::new(x, y); - site.tiles.set(pos, Tile::free(tile.clone())); - } + self.roads.push(plot); + + for &tile in path.iter() { + self.tiles.set(tile, Tile { + kind: TileKind::Road, + plot: Some(plot), + }); + } + + Some(plot) + } + + pub fn find_aabr(&mut self, search_pos: Vec2, area_range: Range, min_dims: Extent2) -> Option<(Aabr, Vec2)> { + self.tiles.find_near( + search_pos, + |center, _| if CARDINALS.iter().any(|&dir| self.tiles.get(center + dir).kind == TileKind::Road) { + self.tiles.grow_aabr(center, area_range.clone(), min_dims).ok() + } else { + None + }, + ) + } + + pub fn find_roadside_aabr(&mut self, rng: &mut impl Rng, area_range: Range, min_dims: Extent2) -> Option<(Aabr, Vec2)> { + let dir = Vec2::::zero().map(|_| rng.gen_range(-1.0..1.0)); + let search_pos = if rng.gen() { + self.plot(*self.plazas.choose(rng).unwrap()).root_tile + (dir * 5.0).map(|e: f32| e.round() as i32) + } else { + if let PlotKind::Road(path) = &self.plot(*self.roads.choose(rng)?).kind { + *path.nodes().choose(rng)? + (dir * 1.5).map(|e: f32| e.round() as i32) + } else { + return None; + } + }; + + self.find_aabr(search_pos, area_range, min_dims) + } + + pub fn make_plaza(&mut self, land: &Land, rng: &mut impl Rng) -> Id { + let pos = attempt(32, || { + self.plazas + .choose(rng) + .map(|&p| self.plot(p).root_tile + Vec2::new(rng.gen_range(-24..24), rng.gen_range(-24..24))) + .filter(|&tile| self + .plazas + .iter() + .all(|&p| self.plot(p).root_tile.distance_squared(tile) > 16i32.pow(2)) + && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max()) + }) + .unwrap_or_else(Vec2::zero); + + let aabr = Aabr { min: pos + Vec2::broadcast(-3), max: pos + Vec2::broadcast(4) }; + let plaza = self.create_plot(Plot { + kind: PlotKind::Plaza, + root_tile: pos, + tiles: aabr_tiles(aabr).collect(), + seed: rng.gen(), + base_alt: land.get_alt_approx(self.tile_center_wpos(aabr.center())) as i32, + }); + self.plazas.push(plaza); + self.blit_aabr(aabr, Tile { + kind: TileKind::Road, + plot: Some(plaza), + }); + + let mut already_pathed = vec![plaza]; + for _ in 0..2 { + if let Some(&p) = self.plazas + .iter() + .filter(|p| !already_pathed.contains(p)) + .min_by_key(|&&p| self.plot(p).root_tile.distance_squared(pos)) + { + self.create_road(land, rng, self.plot(p).root_tile, pos); + already_pathed.push(p); + } else { + break; + } + } + + plaza + } + + pub fn generate(land: &Land, rng: &mut impl Rng, origin: Vec2) -> Self { + let mut site = Site { + origin, + ..Site::default() + }; + + site.make_plaza(land, rng); + + let build_chance = Lottery::from(vec![ + (1.0, 0), + (48.0, 1), + (2.0, 2), + (1.0, 3), + ]); + + let mut castles = 0; + + for _ in 0..1000 { + if site.plots.len() > 80 { + break; + } + + match *build_chance.choose_seeded(rng.gen()) { + // Plaza + 0 => { + site.make_plaza(land, rng); + }, + // House + 1 => { + let size = (2.0 + rng.gen::().powf(4.0) * 3.0).round() as u32; + if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { + let plot = site.create_plot(Plot { + kind: PlotKind::House, + root_tile: aabr.center(), + tiles: aabr_tiles(aabr).collect(), + seed: rng.gen(), + base_alt: land.get_alt_approx(site.tile_center_wpos(aabr.center())) as i32, + }); + + site.blit_aabr(aabr, Tile { + kind: TileKind::Building { levels: size - 1 + rng.gen_range(0..2) }, + plot: Some(plot), + }); } - }); + }, + // Guard tower + 2 => { + if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 4..4, Extent2::new(2, 2))) { + let plot = site.create_plot(Plot { + kind: PlotKind::Castle, + root_tile: aabr.center(), + tiles: aabr_tiles(aabr).collect(), + seed: rng.gen(), + base_alt: land.get_alt_approx(site.tile_center_wpos(aabr.center())) as i32, + }); + + site.blit_aabr(aabr, Tile { + kind: TileKind::Castle, + plot: Some(plot), + }); + } + }, + // Castle + _ if castles < 1 => { + if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 16 * 16..18 * 18, Extent2::new(16, 16))) { + let plot = site.create_plot(Plot { + kind: PlotKind::Castle, + root_tile: aabr.center(), + tiles: aabr_tiles(aabr).collect(), + seed: rng.gen(), + base_alt: land.get_alt_approx(site.tile_center_wpos(aabr.center())) as i32, + }); + + // Walls + site.blit_aabr(aabr, Tile { + kind: TileKind::Wall, + plot: Some(plot), + }); + + let tower = Tile { + kind: TileKind::Castle, + plot: Some(plot), + }; + site.tiles.set(Vec2::new(aabr.min.x, aabr.min.y), tower.clone()); + site.tiles.set(Vec2::new(aabr.max.x - 1, aabr.min.y), tower.clone()); + site.tiles.set(Vec2::new(aabr.min.x, aabr.max.y - 1), tower.clone()); + site.tiles.set(Vec2::new(aabr.max.x - 1, aabr.max.y - 1), tower.clone()); + + // Courtyard + site.blit_aabr(Aabr { min: aabr.min + 1, max: aabr.max - 1 } , Tile { + kind: TileKind::Road, + plot: Some(plot), + }); + + // Keep + site.blit_aabr(Aabr { min: aabr.center() - 3, max: aabr.center() + 3 }, Tile { + kind: TileKind::Castle, + plot: Some(plot), + }); + + castles += 1; + } + }, + _ => {}, + } } site @@ -86,10 +282,16 @@ impl Site { self.tiles.get((wpos2d - self.origin).map(|e| e.div_euclid(TILE_SIZE as i32))) } + pub fn tile_center_wpos(&self, tile: Vec2) -> Vec2 { + self.origin + tile * tile::TILE_SIZE as i32 + tile::TILE_SIZE as i32 / 2 + } + pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { canvas.foreach_col(|canvas, wpos2d, col| { - match self.wpos_tile(wpos2d).kind { - TileKind::Farmland { seed } => (-4..5).for_each(|z| canvas.map( + let tile = self.wpos_tile(wpos2d); + let seed = tile.plot.map_or(0, |p| self.plot(p).seed); + match tile.kind { + TileKind::Field | TileKind::Road => (-4..5).for_each(|z| canvas.map( Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), |b| if [ BlockKind::Grass, @@ -99,19 +301,46 @@ impl Site { BlockKind::Rock, ] .contains(&b.kind()) { - Block::new(BlockKind::Earth, Rgb::new(40, 5 + (seed % 32) as u8, 0)) + match tile.kind { + TileKind::Field => Block::new(BlockKind::Earth, Rgb::new(40, 5 + (seed % 32) as u8, 0)), + TileKind::Road => Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)), + _ => unreachable!(), + } } else { b.with_sprite(SpriteKind::Empty) }, )), - TileKind::Building { levels } => (-4..7 * levels as i32).for_each(|z| canvas.set( - Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), - Block::new(BlockKind::Wood, Rgb::new(180, 150, 120)) - )), + TileKind::Building { levels } => { + let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); + for z in base_alt - 12..base_alt + 4 + 6 * levels as i32 { + canvas.set( + Vec3::new(wpos2d.x, wpos2d.y, z), + Block::new(BlockKind::Wood, Rgb::new(180, 90 + (seed % 64) as u8, 120)) + ); + } + }, + TileKind::Castle | TileKind::Wall => { + let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); + for z in base_alt - 12..base_alt + if tile.kind == TileKind::Wall { 24 } else { 40 } { + canvas.set( + Vec3::new(wpos2d.x, wpos2d.y, z), + Block::new(BlockKind::Wood, Rgb::new(40, 40, 55)) + ); + } + }, _ => {}, } }); } } -pub fn test_site() -> Site { Site::generate(&mut thread_rng()) } +pub fn test_site() -> Site { Site::generate(&Land::empty(), &mut thread_rng(), Vec2::zero()) } + +pub fn aabr_tiles(aabr: Aabr) -> impl Iterator> { + (0..aabr.size().h) + .map(move |y| (0..aabr.size().w) + .map(move |x| aabr.min + Vec2::new(x, y))) + .flatten() +} + +pub struct Plaza {} diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index 02175c4ac0..4d8a771c71 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -1,10 +1,13 @@ use crate::util::DHashSet; +use common::path::Path; use vek::*; pub struct Plot { - kind: PlotKind, - root_tile: Vec2, - tiles: DHashSet>, + pub(crate) kind: PlotKind, + pub(crate) root_tile: Vec2, + pub(crate) tiles: DHashSet>, + pub(crate) seed: u32, + pub(crate) base_alt: i32, } impl Plot { @@ -20,4 +23,7 @@ impl Plot { pub enum PlotKind { Field, House, + Plaza, + Castle, + Road(Path>), } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 75e5c552d4..ea557dc077 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -50,14 +50,21 @@ impl TileGrid { self.get_mut(tpos).map(|t| std::mem::replace(t, tile)) } - pub fn find_near(&self, tpos: Vec2, f: impl Fn(Vec2, &Tile) -> bool) -> Option> { - const MAX_SEARCH_RADIUS_BLOCKS: u32 = 256; + pub fn find_near(&self, tpos: Vec2, f: impl Fn(Vec2, &Tile) -> Option) -> Option<(R, Vec2)> { + const MAX_SEARCH_RADIUS_BLOCKS: u32 = 70; const MAX_SEARCH_CELLS: u32 = ((MAX_SEARCH_RADIUS_BLOCKS / TILE_SIZE) * 2 + 1).pow(2); - Spiral2d::new().take(MAX_SEARCH_CELLS as usize).map(|r| tpos + r).find(|tpos| (&f)(*tpos, self.get(*tpos))) + Spiral2d::new() + .take(MAX_SEARCH_CELLS as usize) + .map(|r| tpos + r) + .find_map(|tpos| (&f)(tpos, self.get(tpos)).zip(Some(tpos))) } pub fn grow_aabr(&self, center: Vec2, area_range: Range, min_dims: Extent2) -> Result, Aabr> { - let mut aabr = Aabr::new_empty(center); + let mut aabr = Aabr { min: center, max: center + 1 }; + + if !self.get(center).is_empty() { + return Err(aabr); + }; let mut last_growth = 0; for i in 0.. { @@ -67,19 +74,19 @@ impl TileGrid { break; } else { match i % 4 { - 0 if (aabr.min.y..aabr.max.y).all(|y| self.get(Vec2::new(aabr.max.x + 1, y)).is_empty()) => { + 0 if (aabr.min.y..aabr.max.y + 1).all(|y| self.get(Vec2::new(aabr.max.x, y)).is_empty()) => { aabr.max.x += 1; last_growth = i; }, - 1 if (aabr.min.x..aabr.max.x).all(|x| self.get(Vec2::new(x, aabr.max.y + 1)).is_empty()) => { + 1 if (aabr.min.x..aabr.max.x + 1).all(|x| self.get(Vec2::new(x, aabr.max.y)).is_empty()) => { aabr.max.y += 1; last_growth = i; }, - 2 if (aabr.min.y..aabr.max.y).all(|y| self.get(Vec2::new(aabr.min.x - 1, y)).is_empty()) => { + 2 if (aabr.min.y..aabr.max.y + 1).all(|y| self.get(Vec2::new(aabr.min.x - 1, y)).is_empty()) => { aabr.min.x -= 1; last_growth = i; }, - 3 if (aabr.min.x..aabr.max.x).all(|x| self.get(Vec2::new(x, aabr.min.y - 1)).is_empty()) => { + 3 if (aabr.min.x..aabr.max.x + 1).all(|x| self.get(Vec2::new(x, aabr.min.y - 1)).is_empty()) => { aabr.min.y -= 1; last_growth = i; }, @@ -102,8 +109,11 @@ impl TileGrid { #[derive(Clone, PartialEq)] pub enum TileKind { Empty, - Farmland { seed: u32 }, + Field, + Road, Building { levels: u32 }, + Castle, + Wall, } #[derive(Clone)] @@ -129,4 +139,13 @@ impl Tile { } pub fn is_empty(&self) -> bool { self.kind == TileKind::Empty } + + pub fn is_obstacle(&self) -> bool { + matches!( + self.kind, + TileKind::Building { .. } + | TileKind::Castle + | TileKind::Wall + ) + } } diff --git a/world/src/util/mod.rs b/world/src/util/mod.rs index f80f21e0b7..60868f52c3 100644 --- a/world/src/util/mod.rs +++ b/world/src/util/mod.rs @@ -82,3 +82,22 @@ pub const CARDINAL_LOCALITY: [Vec2; 5] = [ Vec2::new(0, -1), Vec2::new(-1, 0), ]; + +pub const SQUARE_4: [Vec2; 4] = [ + Vec2::new(0, 0), + Vec2::new(1, 0), + Vec2::new(0, 1), + Vec2::new(1, 1), +]; + +pub const SQUARE_9: [Vec2; 9] = [ + Vec2::new(-1, -1), + Vec2::new(0, -1), + Vec2::new(1, -1), + Vec2::new(-1, 0), + Vec2::new(0, 0), + Vec2::new(1, 0), + Vec2::new(-1, 1), + Vec2::new(0, 1), + Vec2::new(1, 1), +]; From 1dab08075e9908f53c4bfc52abccb42ca8f0482e Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 17 Feb 2021 02:17:19 +0000 Subject: [PATCH 53/87] Fixed biasing bug --- world/src/site2/mod.rs | 10 +++++----- world/src/site2/tile.rs | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 716e92fcdd..0c7e584a90 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -110,14 +110,14 @@ impl Site { } pub fn find_roadside_aabr(&mut self, rng: &mut impl Rng, area_range: Range, min_dims: Extent2) -> Option<(Aabr, Vec2)> { - let dir = Vec2::::zero().map(|_| rng.gen_range(-1.0..1.0)); + let dir = Vec2::::zero().map(|_| rng.gen_range(-1.0..1.0)).normalized(); let search_pos = if rng.gen() { - self.plot(*self.plazas.choose(rng).unwrap()).root_tile + (dir * 5.0).map(|e: f32| e.round() as i32) + self.plot(*self.plazas.choose(rng)?).root_tile + (dir * 5.0).map(|e: f32| e.round() as i32) } else { if let PlotKind::Road(path) = &self.plot(*self.roads.choose(rng)?).kind { *path.nodes().choose(rng)? + (dir * 1.5).map(|e: f32| e.round() as i32) } else { - return None; + unreachable!() } }; @@ -128,7 +128,7 @@ impl Site { let pos = attempt(32, || { self.plazas .choose(rng) - .map(|&p| self.plot(p).root_tile + Vec2::new(rng.gen_range(-24..24), rng.gen_range(-24..24))) + .map(|&p| self.plot(p).root_tile + Vec2::new(rng.gen_range(-20..20), rng.gen_range(-20..20))) .filter(|&tile| self .plazas .iter() @@ -186,7 +186,7 @@ impl Site { let mut castles = 0; for _ in 0..1000 { - if site.plots.len() > 80 { + if site.plots.len() - site.plazas.len() > 80 { break; } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index ea557dc077..64d23da4c0 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -73,7 +73,8 @@ impl TileGrid { } else if aabr.size().product() + if i % 2 == 0 { aabr.size().h } else { aabr.size().w } > area_range.end as i32 { break; } else { - match i % 4 { + // `center.sum()` to avoid biasing certain directions + match (i + center.sum().abs()) % 4 { 0 if (aabr.min.y..aabr.max.y + 1).all(|y| self.get(Vec2::new(aabr.max.x, y)).is_empty()) => { aabr.max.x += 1; last_growth = i; From cd97a4b2fc0a851a258f437efc9af84478fb7fc2 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 19 Feb 2021 18:43:17 +0000 Subject: [PATCH 54/87] Wider roads, better structure --- world/src/site2/mod.rs | 57 +++++++++++++++++++++++++++--------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 0c7e584a90..5bb834dab5 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -67,14 +67,23 @@ impl Site { } } - pub fn create_road(&mut self, land: &Land, rng: &mut impl Rng, a: Vec2, b: Vec2) -> Option> { + pub fn create_road(&mut self, land: &Land, rng: &mut impl Rng, a: Vec2, b: Vec2, w: i32) -> Option> { const MAX_ITERS: usize = 4096; - let heuristic = |tile: &Vec2| if self.tiles.get(*tile).is_obstacle() { 100.0 } else { 0.0 }; + let heuristic = |tile: &Vec2| { + for y in 0..w { + for x in 0..w { + if self.tiles.get(*tile + Vec2::new(x, y)).is_obstacle() { + return 100.0; + } + } + } + (tile.distance_squared(b) as f32).sqrt() + }; let path = Astar::new(MAX_ITERS, a, &heuristic, DefaultHashBuilder::default()).poll( MAX_ITERS, &heuristic, |tile| { let tile = *tile; CARDINALS.iter().map(move |dir| tile + *dir) }, - |a, b| (a.distance_squared(*b) as f32).sqrt(), + |a, b| rng.gen_range(1.0..1.5), |tile| *tile == b, ).into_path()?; @@ -89,10 +98,14 @@ impl Site { self.roads.push(plot); for &tile in path.iter() { - self.tiles.set(tile, Tile { - kind: TileKind::Road, - plot: Some(plot), - }); + for y in 0..w { + for x in 0..w { + self.tiles.set(tile + Vec2::new(x, y), Tile { + kind: TileKind::Road, + plot: Some(plot), + }); + } + } } Some(plot) @@ -101,21 +114,24 @@ impl Site { pub fn find_aabr(&mut self, search_pos: Vec2, area_range: Range, min_dims: Extent2) -> Option<(Aabr, Vec2)> { self.tiles.find_near( search_pos, - |center, _| if CARDINALS.iter().any(|&dir| self.tiles.get(center + dir).kind == TileKind::Road) { - self.tiles.grow_aabr(center, area_range.clone(), min_dims).ok() - } else { - None - }, + |center, _| self.tiles.grow_aabr(center, area_range.clone(), min_dims) + .ok() + .filter(|aabr| { + (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.min.y - 1)).kind == TileKind::Road) + || (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.max.y)).kind == TileKind::Road) + || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.min.x - 1, y)).kind == TileKind::Road) + || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.max.x, y)).kind == TileKind::Road) + }), ) } pub fn find_roadside_aabr(&mut self, rng: &mut impl Rng, area_range: Range, min_dims: Extent2) -> Option<(Aabr, Vec2)> { let dir = Vec2::::zero().map(|_| rng.gen_range(-1.0..1.0)).normalized(); let search_pos = if rng.gen() { - self.plot(*self.plazas.choose(rng)?).root_tile + (dir * 5.0).map(|e: f32| e.round() as i32) + self.plot(*self.plazas.choose(rng)?).root_tile + (dir * 4.0).map(|e: f32| e.round() as i32) } else { if let PlotKind::Road(path) = &self.plot(*self.roads.choose(rng)?).kind { - *path.nodes().choose(rng)? + (dir * 1.5).map(|e: f32| e.round() as i32) + *path.nodes().choose(rng)? + (dir * 1.0).map(|e: f32| e.round() as i32) } else { unreachable!() } @@ -128,11 +144,11 @@ impl Site { let pos = attempt(32, || { self.plazas .choose(rng) - .map(|&p| self.plot(p).root_tile + Vec2::new(rng.gen_range(-20..20), rng.gen_range(-20..20))) + .map(|&p| self.plot(p).root_tile + (Vec2::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0)).normalized() * 24.0).map(|e| e as i32)) .filter(|&tile| self .plazas .iter() - .all(|&p| self.plot(p).root_tile.distance_squared(tile) > 16i32.pow(2)) + .all(|&p| self.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2)) && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max()) }) .unwrap_or_else(Vec2::zero); @@ -152,13 +168,14 @@ impl Site { }); let mut already_pathed = vec![plaza]; - for _ in 0..2 { + // One major, one minor road + for width in (1..=2).rev() { if let Some(&p) = self.plazas .iter() .filter(|p| !already_pathed.contains(p)) .min_by_key(|&&p| self.plot(p).root_tile.distance_squared(pos)) { - self.create_road(land, rng, self.plot(p).root_tile, pos); + self.create_road(land, rng, self.plot(p).root_tile, pos, width); already_pathed.push(p); } else { break; @@ -179,7 +196,7 @@ impl Site { let build_chance = Lottery::from(vec![ (1.0, 0), (48.0, 1), - (2.0, 2), + (5.0, 2), (1.0, 3), ]); @@ -197,7 +214,7 @@ impl Site { }, // House 1 => { - let size = (2.0 + rng.gen::().powf(4.0) * 3.0).round() as u32; + let size = (2.0 + rng.gen::().powf(8.0) * 3.0).round() as u32; if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { let plot = site.create_plot(Plot { kind: PlotKind::House, From 95af1536be1ce23c7eeb2f5a430290d66c3d4378 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 23 Feb 2021 12:42:45 +0000 Subject: [PATCH 55/87] Town hazards --- world/src/civ/mod.rs | 4 +- world/src/land.rs | 14 +++ world/src/site2/mod.rs | 249 +++++++++++++++++++++++++++++++--------- world/src/site2/tile.rs | 16 ++- 4 files changed, 226 insertions(+), 57 deletions(-) diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index ce451ce42d..19bac38ed2 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -109,8 +109,8 @@ impl Civs { attempt(5, || { let (kind, size) = match ctx.rng.gen_range(0..8) { 0 => (SiteKind::Castle, 3), - 1 => (SiteKind::Refactor, 5), - _ => (SiteKind::Dungeon, 0), + 1 => (SiteKind::Dungeon, 0), + _ => (SiteKind::Refactor, 5), }; let loc = find_site_loc(&mut ctx, None, size)?; this.establish_site(&mut ctx.reseed(), loc, |place| Site { diff --git a/world/src/land.rs b/world/src/land.rs index 9790b3091b..2bf8ec6b09 100644 --- a/world/src/land.rs +++ b/world/src/land.rs @@ -1,4 +1,8 @@ use crate::sim; +use common::{ + terrain::TerrainChunkSize, + vol::RectVolSize, +}; use vek::*; /// A wrapper type that may contain a reference to a generated world. If not, default values will be provided. @@ -18,4 +22,14 @@ impl<'a> Land<'a> { pub fn get_alt_approx(&self, wpos: Vec2) -> f32 { self.sim.and_then(|sim| sim.get_alt_approx(wpos)).unwrap_or(0.0) } + + pub fn get_gradient_approx(&self, wpos: Vec2) -> f32 { + self.sim + .and_then(|sim| sim.get_gradient_approx(wpos.map2(TerrainChunkSize::RECT_SIZE, |e, sz| e.div_euclid(sz as i32)))) + .unwrap_or(0.0) + } + + pub fn get_chunk_at(&self, wpos: Vec2) -> Option<&sim::SimChunk> { + self.sim.and_then(|sim| sim.get_wpos(wpos)) + } } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 5bb834dab5..3be06ebf8f 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -3,19 +3,21 @@ mod tile; use self::{ plot::{Plot, PlotKind}, - tile::{TileGrid, Tile, TileKind, TILE_SIZE}, + tile::{TileGrid, Tile, TileKind, HazardKind, TILE_SIZE}, }; use crate::{ site::SpawnRules, - util::{Grid, attempt, CARDINALS, SQUARE_9}, + util::{Grid, attempt, CARDINALS, SQUARE_4, SQUARE_9}, Canvas, Land, }; use common::{ - terrain::{Block, BlockKind, SpriteKind}, + terrain::{Block, BlockKind, SpriteKind, TerrainChunkSize}, + vol::RectVolSize, store::{Id, Store}, astar::Astar, lottery::Lottery, + spiral::Spiral2d, }; use hashbrown::hash_map::DefaultHashBuilder; use rand::prelude::*; @@ -33,7 +35,8 @@ pub struct Site { impl Site { pub fn radius(&self) -> f32 { - (tile::MAX_BLOCK_RADIUS.pow(2) as f32 * 2.0).sqrt() + ((self.tiles.bounds.min.map(|e| e.abs()).reduce_max() + .max(self.tiles.bounds.max.map(|e| e.abs()).reduce_max()) + 1) * tile::TILE_SIZE as i32) as f32 } pub fn spawn_rules(&self, wpos: Vec2) -> SpawnRules { @@ -46,10 +49,10 @@ impl Site { } pub fn bounds(&self) -> Aabr { - let radius = tile::MAX_BLOCK_RADIUS; + let border = 1; Aabr { - min: -Vec2::broadcast(radius as i32), - max: Vec2::broadcast(radius as i32), + min: self.origin + self.tile_wpos(self.tiles.bounds.min - border), + max: self.origin + self.tile_wpos(self.tiles.bounds.max + 1 + border), } } @@ -73,7 +76,7 @@ impl Site { for y in 0..w { for x in 0..w { if self.tiles.get(*tile + Vec2::new(x, y)).is_obstacle() { - return 100.0; + return 1000.0; } } } @@ -145,6 +148,7 @@ impl Site { self.plazas .choose(rng) .map(|&p| self.plot(p).root_tile + (Vec2::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0)).normalized() * 24.0).map(|e| e as i32)) + .filter(|tile| !self.tiles.get(*tile).is_obstacle()) .filter(|&tile| self .plazas .iter() @@ -185,19 +189,37 @@ impl Site { plaza } + pub fn demarcate_obstacles(&mut self, land: &Land) { + const SEARCH_RADIUS: u32 = 96; + + Spiral2d::new() + .take((SEARCH_RADIUS * 2 + 1).pow(2) as usize) + .for_each(|tile| { + if let Some(kind) = wpos_is_hazard(land, self.tile_wpos(tile)) { + for &rpos in &SQUARE_4 { + // `get_mut` doesn't increase generation bounds + self.tiles.get_mut(tile - rpos - 1).map(|tile| tile.kind = TileKind::Hazard(kind)); + } + } + }); + } + pub fn generate(land: &Land, rng: &mut impl Rng, origin: Vec2) -> Self { let mut site = Site { origin, ..Site::default() }; + site.demarcate_obstacles(land); + site.make_plaza(land, rng); let build_chance = Lottery::from(vec![ (1.0, 0), (48.0, 1), (5.0, 2), - (1.0, 3), + (20.0, 3), + (1.0, 4), ]); let mut castles = 0; @@ -247,6 +269,38 @@ impl Site { }); } }, + // Field + 3 => { + attempt(10, || { + let search_pos = attempt(16, || { + let tile = (Vec2::new( + rng.gen_range(-1.0..1.0), + rng.gen_range(-1.0..1.0), + ).normalized() * rng.gen_range(32.0..48.0)).map(|e| e as i32); + + if site + .plazas + .iter() + .all(|&p| site.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2)) + && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max() + { + Some(tile) + } else { + None + } + }) + .unwrap_or_else(Vec2::zero); + site.tiles.find_near( + search_pos, + |center, _| site.tiles.grow_aabr(center, 9..25, Extent2::new(3, 3)).ok()) + }) + .map(|(aabr, _)| { + site.blit_aabr(aabr, Tile { + kind: TileKind::Field, + plot: None, + }); + }); + }, // Castle _ if castles < 1 => { if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 16 * 16..18 * 18, Extent2::new(16, 16))) { @@ -295,64 +349,153 @@ impl Site { site } + pub fn wpos_tile_pos(&self, wpos2d: Vec2) -> Vec2 { + (wpos2d - self.origin).map(|e| e.div_euclid(TILE_SIZE as i32)) + } + pub fn wpos_tile(&self, wpos2d: Vec2) -> &Tile { - self.tiles.get((wpos2d - self.origin).map(|e| e.div_euclid(TILE_SIZE as i32))) + self.tiles.get(self.wpos_tile_pos(wpos2d)) + } + + pub fn tile_wpos(&self, tile: Vec2) -> Vec2 { + self.origin + tile * tile::TILE_SIZE as i32 } pub fn tile_center_wpos(&self, tile: Vec2) -> Vec2 { self.origin + tile * tile::TILE_SIZE as i32 + tile::TILE_SIZE as i32 / 2 } + pub fn render_tile(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng, tpos: Vec2) { + let tile = self.tiles.get(tpos); + let twpos = self.tile_wpos(tpos); + let cols = (-(TILE_SIZE as i32)..TILE_SIZE as i32 * 2).map(|y| (-(TILE_SIZE as i32)..TILE_SIZE as i32 * 2).map(move |x| (twpos + Vec2::new(x, y), Vec2::new(x, y)))).flatten(); + + match &tile.kind { + TileKind::Empty | TileKind::Hazard(_) => {}, + TileKind::Road => cols.for_each(|(wpos2d, offs)| { + let tpos = self.tile_wpos(wpos2d); + + let is_x = [ + self.tiles.get(tpos - Vec2::unit_x()) == tile, + self.tiles.get(tpos) == tile, + self.tiles.get(tpos + Vec2::unit_x()) == tile, + ]; + + let dist_x = [ + if is_x[0] ^ is_x[1] { Some((offs.x % tile::TILE_SIZE as i32) * if is_x[1] { -1 } else { 1 }) } else { None }, + if is_x[1] ^ is_x[2] { Some((tile::TILE_SIZE as i32 - offs.x % tile::TILE_SIZE as i32) * if is_x[1] { -1 } else { 1 }) } else { None }, + ].iter().filter_map(|x| *x).min(); + + let is_y = [ + self.tiles.get(tpos - Vec2::unit_y()) == tile, + self.tiles.get(tpos) == tile, + self.tiles.get(tpos + Vec2::unit_y()) == tile, + ]; + + let dist_y = [ + if is_y[0] ^ is_y[1] { Some((offs.y % tile::TILE_SIZE as i32) * if is_y[1] { -1 } else { 1 }) } else { None }, + if is_y[1] ^ is_y[2] { Some((tile::TILE_SIZE as i32 - offs.y % tile::TILE_SIZE as i32) * if is_y[1] { -1 } else { 1 }) } else { None }, + ].iter().filter_map(|x| *x).min(); + + let dist = dist_x.unwrap_or(-(tile::TILE_SIZE as i32)).min(dist_y.unwrap_or(-(tile::TILE_SIZE as i32))); + + if dist > 4 { + let alt = canvas.col(wpos2d).map_or(0, |c| c.alt as i32); + (-4..5).for_each(|z| canvas.map( + Vec3::new(wpos2d.x, wpos2d.y, alt + z), + |b| if [ + BlockKind::Grass, + BlockKind::Earth, + BlockKind::Sand, + BlockKind::Snow, + BlockKind::Rock, + ] + .contains(&b.kind()) { + Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)) + } else { + b.with_sprite(SpriteKind::Empty) + }, + )); + } + }), + _ => {}, + } + } + pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { - canvas.foreach_col(|canvas, wpos2d, col| { - let tile = self.wpos_tile(wpos2d); - let seed = tile.plot.map_or(0, |p| self.plot(p).seed); - match tile.kind { - TileKind::Field | TileKind::Road => (-4..5).for_each(|z| canvas.map( - Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), - |b| if [ - BlockKind::Grass, - BlockKind::Earth, - BlockKind::Sand, - BlockKind::Snow, - BlockKind::Rock, - ] - .contains(&b.kind()) { - match tile.kind { - TileKind::Field => Block::new(BlockKind::Earth, Rgb::new(40, 5 + (seed % 32) as u8, 0)), - TileKind::Road => Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)), - _ => unreachable!(), - } - } else { - b.with_sprite(SpriteKind::Empty) - }, - )), - TileKind::Building { levels } => { - let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); - for z in base_alt - 12..base_alt + 4 + 6 * levels as i32 { - canvas.set( - Vec3::new(wpos2d.x, wpos2d.y, z), - Block::new(BlockKind::Wood, Rgb::new(180, 90 + (seed % 64) as u8, 120)) - ); - } - }, - TileKind::Castle | TileKind::Wall => { - let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); - for z in base_alt - 12..base_alt + if tile.kind == TileKind::Wall { 24 } else { 40 } { - canvas.set( - Vec3::new(wpos2d.x, wpos2d.y, z), - Block::new(BlockKind::Wood, Rgb::new(40, 40, 55)) - ); - } - }, - _ => {}, + let tile_aabr = Aabr { + min: self.wpos_tile_pos(canvas.wpos()) - 1, + max: self.wpos_tile_pos(canvas.wpos() + TerrainChunkSize::RECT_SIZE.map(|e| e as i32) + 2) + 3, // Round up, uninclusive, border + }; + + for y in tile_aabr.min.y..tile_aabr.max.y { + for x in tile_aabr.min.x..tile_aabr.max.x { + self.render_tile(canvas, dynamic_rng, Vec2::new(x, y)); } - }); + } + + // canvas.foreach_col(|canvas, wpos2d, col| { + // let tile = self.wpos_tile(wpos2d); + // let seed = tile.plot.map_or(0, |p| self.plot(p).seed); + // match tile.kind { + // TileKind::Field | TileKind::Road => (-4..5).for_each(|z| canvas.map( + // Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), + // |b| if [ + // BlockKind::Grass, + // BlockKind::Earth, + // BlockKind::Sand, + // BlockKind::Snow, + // BlockKind::Rock, + // ] + // .contains(&b.kind()) { + // match tile.kind { + // TileKind::Field => Block::new(BlockKind::Earth, Rgb::new(40, 5 + (seed % 32) as u8, 0)), + // TileKind::Road => Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)), + // _ => unreachable!(), + // } + // } else { + // b.with_sprite(SpriteKind::Empty) + // }, + // )), + // TileKind::Building { levels } => { + // let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); + // for z in base_alt - 12..base_alt + 4 + 6 * levels as i32 { + // canvas.set( + // Vec3::new(wpos2d.x, wpos2d.y, z), + // Block::new(BlockKind::Wood, Rgb::new(180, 90 + (seed % 64) as u8, 120)) + // ); + // } + // }, + // TileKind::Castle | TileKind::Wall => { + // let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); + // for z in base_alt - 12..base_alt + if tile.kind == TileKind::Wall { 24 } else { 40 } { + // canvas.set( + // Vec3::new(wpos2d.x, wpos2d.y, z), + // Block::new(BlockKind::Wood, Rgb::new(40, 40, 55)) + // ); + // } + // }, + // _ => {}, + // } + // }); } } pub fn test_site() -> Site { Site::generate(&Land::empty(), &mut thread_rng(), Vec2::zero()) } +fn wpos_is_hazard(land: &Land, wpos: Vec2) -> Option { + if land + .get_chunk_at(wpos) + .map_or(true, |c| c.river.near_water()) + { + Some(HazardKind::Water) + } else if let Some(gradient) = Some(land.get_gradient_approx(wpos)).filter(|g| *g > 0.8) { + Some(HazardKind::Hill { gradient }) + } else { + None + } +} + pub fn aabr_tiles(aabr: Aabr) -> impl Iterator> { (0..aabr.size().h) .map(move |y| (0..aabr.size().w) diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 64d23da4c0..64b7ff8fa7 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -9,12 +9,14 @@ pub const TILE_RADIUS: u32 = ZONE_SIZE * ZONE_RADIUS; pub const MAX_BLOCK_RADIUS: u32 = TILE_SIZE * TILE_RADIUS; pub struct TileGrid { + pub(crate) bounds: Aabr, // Inclusive zones: Grid>>>, } impl Default for TileGrid { fn default() -> Self { Self { + bounds: Aabr::new_empty(Vec2::zero()), zones: Grid::populate_from(Vec2::broadcast(ZONE_RADIUS as i32 * 2 + 1), |_| None), } } @@ -35,6 +37,7 @@ impl TileGrid { .unwrap_or(&EMPTY) } + // WILL NOT EXPAND BOUNDS! pub fn get_mut(&mut self, tpos: Vec2) -> Option<&mut Tile> { let tpos = tpos + TILE_RADIUS as i32; self.zones.get_mut(tpos.map(|e| e.div_euclid(ZONE_SIZE as i32))).and_then(|zone| { @@ -47,6 +50,7 @@ impl TileGrid { } pub fn set(&mut self, tpos: Vec2, tile: Tile) -> Option { + self.bounds.expand_to_contain_point(tpos); self.get_mut(tpos).map(|t| std::mem::replace(t, tile)) } @@ -110,6 +114,7 @@ impl TileGrid { #[derive(Clone, PartialEq)] pub enum TileKind { Empty, + Hazard(HazardKind), Field, Road, Building { levels: u32 }, @@ -117,7 +122,7 @@ pub enum TileKind { Wall, } -#[derive(Clone)] +#[derive(Clone, PartialEq)] pub struct Tile { pub(crate) kind: TileKind, pub(crate) plot: Option>, @@ -144,9 +149,16 @@ impl Tile { pub fn is_obstacle(&self) -> bool { matches!( self.kind, - TileKind::Building { .. } + TileKind::Hazard(_) + | TileKind::Building { .. } | TileKind::Castle | TileKind::Wall ) } } + +#[derive(Copy, Clone, PartialEq)] +pub enum HazardKind { + Water, + Hill { gradient: f32 }, +} From 331375fd8f242ebf79e50fe4b0d5c6111b80f721 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 28 Feb 2021 12:19:18 +0000 Subject: [PATCH 56/87] Adjusted static lighting --- assets/voxygen/shaders/include/sky.glsl | 2 +- assets/voxygen/shaders/terrain-frag.glsl | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index a65962c099..7e9dd14eda 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -45,7 +45,7 @@ const float UNDERWATER_MIST_DIST = 100.0; const float PERSISTENT_AMBIANCE = 1.0 / 32.0;// 1.0 / 80; // 1.0 / 512; // 0.00125 // 0.1;// 0.025; // 0.1; // Allowed to be > 1 due to HDR -const vec3 GLOW_COLOR = vec3(2, 1.30, 0.1); +const vec3 GLOW_COLOR = vec3(3.0, 0.9, 0.05); //vec3 get_sun_dir(float time_of_day) { // const float TIME_FACTOR = (PI * 2.0) / (3600.0 * 24.0); diff --git a/assets/voxygen/shaders/terrain-frag.glsl b/assets/voxygen/shaders/terrain-frag.glsl index 025429d64b..93a013cf33 100644 --- a/assets/voxygen/shaders/terrain-frag.glsl +++ b/assets/voxygen/shaders/terrain-frag.glsl @@ -266,8 +266,7 @@ void main() { max_light *= f_light; // TODO: Apply AO after this - vec3 glow = GLOW_COLOR * (pow(f_glow, 6) * 8 + pow(f_glow, 1.5) * 1.0); - emitted_light += glow; + vec3 glow = GLOW_COLOR * (pow(f_glow, 6) * 5 + pow(f_glow, 1.5) * 2); reflected_light += glow; max_light += lights_at(f_pos, f_norm, view_dir, mu, cam_attenuation, fluid_alt, k_a, k_d, k_s, alpha, f_norm, 1.0, emitted_light, reflected_light); From 9875e2c0259208c2ed773026a71d0ed990ee5ba5 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 28 Feb 2021 23:34:36 +0000 Subject: [PATCH 57/87] Began work on CSG-based primitive tree site structure generation system --- common/src/store.rs | 12 +++- world/src/canvas.rs | 11 ++- world/src/layer/tree.rs | 4 +- world/src/lib.rs | 5 +- world/src/site2/gen.rs | 63 ++++++++++++++++ world/src/site2/mod.rs | 130 ++++++++++++++++++++-------------- world/src/site2/plot.rs | 10 ++- world/src/site2/plot/house.rs | 43 +++++++++++ 8 files changed, 215 insertions(+), 63 deletions(-) create mode 100644 world/src/site2/gen.rs create mode 100644 world/src/site2/plot/house.rs diff --git a/common/src/store.rs b/common/src/store.rs index 0b61090350..6666ccadd4 100644 --- a/common/src/store.rs +++ b/common/src/store.rs @@ -1,5 +1,5 @@ use std::{ - cmp::{Eq, PartialEq}, + cmp::{Eq, PartialEq, Ord, PartialOrd, Ordering}, fmt, hash, marker::PhantomData, ops::{Index, IndexMut}, @@ -29,6 +29,16 @@ impl Eq for Id {} impl PartialEq for Id { fn eq(&self, other: &Self) -> bool { self.idx == other.idx && self.gen == other.gen } } +impl Ord for Id { + fn cmp(&self, other: &Self) -> Ordering { + (self.idx, self.gen).cmp(&(other.idx, other.gen)) + } +} +impl PartialOrd for Id { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} impl fmt::Debug for Id { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( diff --git a/world/src/canvas.rs b/world/src/canvas.rs index d6ed1acd14..02de530bba 100644 --- a/world/src/canvas.rs +++ b/world/src/canvas.rs @@ -2,8 +2,9 @@ use crate::{ block::ZCache, column::ColumnSample, index::IndexRef, - sim::{SimChunk, WorldSim as Land}, + sim::{SimChunk, WorldSim}, util::Grid, + land::Land, }; use common::{ terrain::{Block, TerrainChunk, TerrainChunkSize}, @@ -17,7 +18,7 @@ pub struct CanvasInfo<'a> { pub(crate) wpos: Vec2, pub(crate) column_grid: &'a Grid>>, pub(crate) column_grid_border: i32, - pub(crate) land: &'a Land, + pub(crate) chunks: &'a WorldSim, pub(crate) index: IndexRef<'a>, pub(crate) chunk: &'a SimChunk, } @@ -45,7 +46,11 @@ impl<'a> CanvasInfo<'a> { pub fn chunk(&self) -> &'a SimChunk { self.chunk } - pub fn land(&self) -> &'a Land { self.land } + pub fn chunks(&self) -> &'a WorldSim { self.chunks } + + pub fn land(&self) -> Land<'_> { + Land::from_sim(self.chunks) + } } pub struct Canvas<'a> { diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index ab7bd7d6ca..9198f08bd6 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -58,11 +58,11 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { let info = canvas.info(); canvas.foreach_col(|canvas, wpos2d, col| { - let trees = info.land().get_near_trees(wpos2d); + let trees = info.chunks().get_near_trees(wpos2d); for TreeAttr { pos, seed, scale, forest_kind, inhabited } in trees { let tree = if let Some(tree) = tree_cache.entry(pos).or_insert_with(|| { - let col = ColumnGen::new(info.land()).get((pos, info.index()))?; + let col = ColumnGen::new(info.chunks()).get((pos, info.index()))?; let is_quirky = QUIRKY_RAND.chance(seed, 1.0 / 500.0); diff --git a/world/src/lib.rs b/world/src/lib.rs index 78e755a5a5..6a90f4c34a 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -9,7 +9,8 @@ const_panic, label_break_value, or_patterns, - array_value_iter + array_value_iter, + array_map, )] mod all; @@ -282,7 +283,7 @@ impl World { wpos: chunk_pos * TerrainChunkSize::RECT_SIZE.map(|e| e as i32), column_grid: &zcache_grid, column_grid_border: grid_border, - land: &self.sim, + chunks: &self.sim, index, chunk: sim_chunk, }, diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs new file mode 100644 index 0000000000..c6f94d34e8 --- /dev/null +++ b/world/src/site2/gen.rs @@ -0,0 +1,63 @@ +use common::{ + terrain::Block, + store::{Id, Store}, +}; +use vek::*; + +pub enum Primitive { + Empty, // Placeholder + Aabb(Aabb), + And(Id, Id), + Or(Id, Id), + Xor(Id, Id), +} + +pub struct Fill { + pub prim: Id, + pub block: Block, +} + +impl Fill { + fn contains_at(&self, tree: &Store, prim: Id, pos: Vec3) -> bool { + match &tree[prim] { + Primitive::Empty => false, + Primitive::Aabb(aabb) => (aabb.min.x..aabb.max.x).contains(&pos.x) && (aabb.min.y..aabb.max.y).contains(&pos.y), + Primitive::And(a, b) => self.contains_at(tree, *a, pos) & self.contains_at(tree, *b, pos), + Primitive::Or(a, b) => self.contains_at(tree, *a, pos) | self.contains_at(tree, *b, pos), + Primitive::Xor(a, b) => self.contains_at(tree, *a, pos) ^ self.contains_at(tree, *b, pos), + } + } + + pub fn sample_at(&self, tree: &Store, pos: Vec3) -> Option { + Some(self.block).filter(|_| self.contains_at(tree, self.prim, pos)) + } + + fn get_bounds_inner(&self, tree: &Store, prim: Id) -> Aabb { + match &tree[prim] { + Primitive::Empty => Aabb::new_empty(Vec3::zero()), + Primitive::Aabb(aabb) => *aabb, + Primitive::And(a, b) => self.get_bounds_inner(tree, *a).intersection(self.get_bounds_inner(tree, *b)), + Primitive::Or(a, b) | Primitive::Xor(a, b) => self.get_bounds_inner(tree, *a).union(self.get_bounds_inner(tree, *b)), + } + } + + pub fn get_bounds(&self, tree: &Store) -> Aabb { + self.get_bounds_inner(tree, self.prim) + } +} + +pub trait Structure { + fn render Id, G: FnMut(Fill)>( + &self, + emit_prim: F, + emit_fill: G, + ) {} + + // Generate a primitive tree and fills for this structure + fn render_collect(&self) -> (Store, Vec) { + let mut tree = Store::default(); + let mut fills = Vec::new(); + let root = self.render(|p| tree.insert(p), |f| fills.push(f)); + (tree, fills) + } +} diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 3be06ebf8f..d154c48ca2 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -1,13 +1,15 @@ +mod gen; mod plot; mod tile; use self::{ plot::{Plot, PlotKind}, tile::{TileGrid, Tile, TileKind, HazardKind, TILE_SIZE}, + gen::{Primitive, Fill, Structure}, }; use crate::{ site::SpawnRules, - util::{Grid, attempt, CARDINALS, SQUARE_4, SQUARE_9}, + util::{Grid, attempt, DHashSet, CARDINALS, SQUARE_4, SQUARE_9, LOCALITY}, Canvas, Land, }; @@ -86,7 +88,11 @@ impl Site { MAX_ITERS, &heuristic, |tile| { let tile = *tile; CARDINALS.iter().map(move |dir| tile + *dir) }, - |a, b| rng.gen_range(1.0..1.5), + |a, b| { + let alt_a = land.get_alt_approx(self.tile_center_wpos(*a)); + let alt_b = land.get_alt_approx(self.tile_center_wpos(*b)); + (alt_a - alt_b).abs() / TILE_SIZE as f32 + }, |tile| *tile == b, ).into_path()?; @@ -95,7 +101,6 @@ impl Site { root_tile: a, tiles: path.clone().into_iter().collect(), seed: rng.gen(), - base_alt: 0, }); self.roads.push(plot); @@ -163,7 +168,6 @@ impl Site { root_tile: pos, tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), - base_alt: land.get_alt_approx(self.tile_center_wpos(aabr.center())) as i32, }); self.plazas.push(plaza); self.blit_aabr(aabr, Tile { @@ -239,11 +243,10 @@ impl Site { let size = (2.0 + rng.gen::().powf(8.0) * 3.0).round() as u32; if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { let plot = site.create_plot(Plot { - kind: PlotKind::House, + kind: PlotKind::House(plot::House::generate(land, rng, &site, aabr)), root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), - base_alt: land.get_alt_approx(site.tile_center_wpos(aabr.center())) as i32, }); site.blit_aabr(aabr, Tile { @@ -260,7 +263,6 @@ impl Site { root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), - base_alt: land.get_alt_approx(site.tile_center_wpos(aabr.center())) as i32, }); site.blit_aabr(aabr, Tile { @@ -309,7 +311,6 @@ impl Site { root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), - base_alt: land.get_alt_approx(site.tile_center_wpos(aabr.center())) as i32, }); // Walls @@ -367,57 +368,47 @@ impl Site { pub fn render_tile(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng, tpos: Vec2) { let tile = self.tiles.get(tpos); - let twpos = self.tile_wpos(tpos); + let twpos = self.tile_center_wpos(tpos); let cols = (-(TILE_SIZE as i32)..TILE_SIZE as i32 * 2).map(|y| (-(TILE_SIZE as i32)..TILE_SIZE as i32 * 2).map(move |x| (twpos + Vec2::new(x, y), Vec2::new(x, y)))).flatten(); match &tile.kind { TileKind::Empty | TileKind::Hazard(_) => {}, - TileKind::Road => cols.for_each(|(wpos2d, offs)| { - let tpos = self.tile_wpos(wpos2d); + TileKind::Road => { + let near_roads = CARDINALS + .map(|rpos| if self.tiles.get(tpos + rpos) == tile { + Some(LineSegment2 { + start: self.tile_center_wpos(tpos).map(|e| e as f32), + end: self.tile_center_wpos(tpos + rpos).map(|e| e as f32), + }) + } else { + None + }); - let is_x = [ - self.tiles.get(tpos - Vec2::unit_x()) == tile, - self.tiles.get(tpos) == tile, - self.tiles.get(tpos + Vec2::unit_x()) == tile, - ]; + cols.for_each(|(wpos2d, offs)| { + let wpos2df = wpos2d.map(|e| e as f32); + let nearest_road = near_roads + .iter() + .copied() + .filter_map(|line| Some(line?.projected_point(wpos2df))) + .min_by_key(|p| p.distance_squared(wpos2df) as i32); - let dist_x = [ - if is_x[0] ^ is_x[1] { Some((offs.x % tile::TILE_SIZE as i32) * if is_x[1] { -1 } else { 1 }) } else { None }, - if is_x[1] ^ is_x[2] { Some((tile::TILE_SIZE as i32 - offs.x % tile::TILE_SIZE as i32) * if is_x[1] { -1 } else { 1 }) } else { None }, - ].iter().filter_map(|x| *x).min(); + let is_near_road = nearest_road.map_or(false, |r| r.distance_squared(wpos2df) < 3.0f32.powi(2)); - let is_y = [ - self.tiles.get(tpos - Vec2::unit_y()) == tile, - self.tiles.get(tpos) == tile, - self.tiles.get(tpos + Vec2::unit_y()) == tile, - ]; - - let dist_y = [ - if is_y[0] ^ is_y[1] { Some((offs.y % tile::TILE_SIZE as i32) * if is_y[1] { -1 } else { 1 }) } else { None }, - if is_y[1] ^ is_y[2] { Some((tile::TILE_SIZE as i32 - offs.y % tile::TILE_SIZE as i32) * if is_y[1] { -1 } else { 1 }) } else { None }, - ].iter().filter_map(|x| *x).min(); - - let dist = dist_x.unwrap_or(-(tile::TILE_SIZE as i32)).min(dist_y.unwrap_or(-(tile::TILE_SIZE as i32))); - - if dist > 4 { - let alt = canvas.col(wpos2d).map_or(0, |c| c.alt as i32); - (-4..5).for_each(|z| canvas.map( - Vec3::new(wpos2d.x, wpos2d.y, alt + z), - |b| if [ - BlockKind::Grass, - BlockKind::Earth, - BlockKind::Sand, - BlockKind::Snow, - BlockKind::Rock, - ] - .contains(&b.kind()) { - Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)) - } else { - b.with_sprite(SpriteKind::Empty) - }, - )); - } - }), + if let Some(nearest_road) = nearest_road + .filter(|r| r.distance_squared(wpos2df) < 4.0f32.powi(2)) + { + let road_alt = canvas.col(nearest_road.map(|e| e.floor() as i32)).map_or(0, |col| col.alt as i32); + (-4..5).for_each(|z| canvas.map( + Vec3::new(wpos2d.x, wpos2d.y, road_alt + z), + |b| if z > 0 { + Block::air(SpriteKind::Empty) + } else { + Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)) + }, + )); + } + }); + }, _ => {}, } } @@ -428,9 +419,42 @@ impl Site { max: self.wpos_tile_pos(canvas.wpos() + TerrainChunkSize::RECT_SIZE.map(|e| e as i32) + 2) + 3, // Round up, uninclusive, border }; + // Don't double-generate the same plot per chunk! + let mut plots = DHashSet::default(); + for y in tile_aabr.min.y..tile_aabr.max.y { for x in tile_aabr.min.x..tile_aabr.max.x { self.render_tile(canvas, dynamic_rng, Vec2::new(x, y)); + + if let Some(plot) = self.tiles.get(Vec2::new(x, y)).plot { + plots.insert(plot); + } + } + } + + let mut plots_to_render = plots.into_iter().collect::>(); + plots_to_render.sort_unstable(); + + for plot in plots_to_render { + let (prim_tree, fills) = match &self.plots[plot].kind { + PlotKind::House(house) => house.render_collect(), + _ => continue, + }; + + for fill in fills { + let aabb = fill.get_bounds(&prim_tree); + + for x in aabb.min.x..aabb.max.x + 1 { + for y in aabb.min.y..aabb.max.y + 1 { + for z in aabb.min.z..aabb.max.z + 1 { + let pos = Vec3::new(x, y, z); + + if let Some(block) = fill.sample_at(&prim_tree, pos) { + canvas.set(pos, block); + } + } + } + } } } @@ -438,7 +462,7 @@ impl Site { // let tile = self.wpos_tile(wpos2d); // let seed = tile.plot.map_or(0, |p| self.plot(p).seed); // match tile.kind { - // TileKind::Field | TileKind::Road => (-4..5).for_each(|z| canvas.map( + // TileKind::Field /*| TileKind::Road*/ => (-4..5).for_each(|z| canvas.map( // Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), // |b| if [ // BlockKind::Grass, diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index 4d8a771c71..cb50abbc19 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -1,3 +1,10 @@ +mod house; + +pub use self::{ + house::House, +}; + +use super::*; use crate::util::DHashSet; use common::path::Path; use vek::*; @@ -7,7 +14,6 @@ pub struct Plot { pub(crate) root_tile: Vec2, pub(crate) tiles: DHashSet>, pub(crate) seed: u32, - pub(crate) base_alt: i32, } impl Plot { @@ -22,7 +28,7 @@ impl Plot { pub enum PlotKind { Field, - House, + House(House), Plaza, Castle, Road(Path>), diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs new file mode 100644 index 0000000000..2eb7cb37ea --- /dev/null +++ b/world/src/site2/plot/house.rs @@ -0,0 +1,43 @@ +use super::*; +use crate::Land; +use common::terrain::{Block, BlockKind}; +use vek::*; +use rand::prelude::*; + +pub struct House { + bounds: Aabr, + alt: i32, +} + +impl House { + pub fn generate(land: &Land, rng: &mut impl Rng, site: &Site, tile_aabr: Aabr) -> Self { + Self { + bounds: Aabr { + min: site.tile_wpos(tile_aabr.min), + max: site.tile_wpos(tile_aabr.max), + }, + alt: land.get_alt_approx(site.tile_center_wpos(tile_aabr.center())) as i32, + } + } +} + +impl Structure for House { + fn render Id, G: FnMut(Fill)>( + &self, + mut emit_prim: F, + mut emit_fill: G, + ) { + let wall = emit_prim(Primitive::Aabb(Aabb { + min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt - 8), + max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + 16), + })); + let inner = emit_prim(Primitive::Aabb(Aabb { + min: Vec3::new(self.bounds.min.x + 1, self.bounds.min.y + 1, self.alt - 8), + max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + 16), + })); + emit_fill(Fill { + prim: emit_prim(Primitive::Xor(wall, inner)), + block: Block::new(BlockKind::Rock, Rgb::new(150, 50, 10)), + }); + } +} From 14bac81dc4695146118ec8a23bae0a91d4bd4337 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 28 Feb 2021 23:59:04 +0000 Subject: [PATCH 58/87] Added CSG house roofs --- world/src/site2/gen.rs | 20 +++++++++++++++++++- world/src/site2/mod.rs | 6 +++--- world/src/site2/plot/house.rs | 23 +++++++++++++++++++++-- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index c6f94d34e8..2d8d3d94bb 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -6,7 +6,12 @@ use vek::*; pub enum Primitive { Empty, // Placeholder + + // Shapes Aabb(Aabb), + Pyramid { aabb: Aabb, inset: i32 }, + + // Combinators And(Id, Id), Or(Id, Id), Xor(Id, Id), @@ -19,9 +24,21 @@ pub struct Fill { impl Fill { fn contains_at(&self, tree: &Store, prim: Id, pos: Vec3) -> bool { + // Custom closure because vek's impl of `contains_point` is inclusive :( + let aabb_contains = |aabb: Aabb, pos: Vec3| (aabb.min.x..aabb.max.x).contains(&pos.x) + && (aabb.min.y..aabb.max.y).contains(&pos.y); + match &tree[prim] { Primitive::Empty => false, - Primitive::Aabb(aabb) => (aabb.min.x..aabb.max.x).contains(&pos.x) && (aabb.min.y..aabb.max.y).contains(&pos.y), + + Primitive::Aabb(aabb) => aabb_contains(*aabb, pos), + Primitive::Pyramid { aabb, inset } => { + let inner = Aabr { min: aabb.min.xy() + *inset, max: aabb.max.xy() - *inset }; + aabb_contains(*aabb, pos) && (inner.projected_point(pos.xy()) - pos.xy()) + .map(|e| e.abs()) + .reduce_max() as f32 / (*inset as f32) < 1.0 - (pos.z - aabb.min.z) as f32 / (aabb.max.z - aabb.min.z) as f32 + }, + Primitive::And(a, b) => self.contains_at(tree, *a, pos) & self.contains_at(tree, *b, pos), Primitive::Or(a, b) => self.contains_at(tree, *a, pos) | self.contains_at(tree, *b, pos), Primitive::Xor(a, b) => self.contains_at(tree, *a, pos) ^ self.contains_at(tree, *b, pos), @@ -36,6 +53,7 @@ impl Fill { match &tree[prim] { Primitive::Empty => Aabb::new_empty(Vec3::zero()), Primitive::Aabb(aabb) => *aabb, + Primitive::Pyramid { aabb, .. } => *aabb, Primitive::And(a, b) => self.get_bounds_inner(tree, *a).intersection(self.get_bounds_inner(tree, *b)), Primitive::Or(a, b) | Primitive::Xor(a, b) => self.get_bounds_inner(tree, *a).union(self.get_bounds_inner(tree, *b)), } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index d154c48ca2..7f2d4c7576 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -444,9 +444,9 @@ impl Site { for fill in fills { let aabb = fill.get_bounds(&prim_tree); - for x in aabb.min.x..aabb.max.x + 1 { - for y in aabb.min.y..aabb.max.y + 1 { - for z in aabb.min.z..aabb.max.z + 1 { + for x in aabb.min.x..aabb.max.x { + for y in aabb.min.y..aabb.max.y { + for z in aabb.min.z..aabb.max.z { let pos = Vec3::new(x, y, z); if let Some(block) = fill.sample_at(&prim_tree, pos) { diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 2eb7cb37ea..6f8e04b152 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -27,17 +27,36 @@ impl Structure for House { mut emit_prim: F, mut emit_fill: G, ) { + let ceiling = 12; + + // Walls let wall = emit_prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt - 8), - max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + 16), + max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + ceiling), })); let inner = emit_prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x + 1, self.bounds.min.y + 1, self.alt - 8), - max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + 16), + max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + ceiling), })); emit_fill(Fill { prim: emit_prim(Primitive::Xor(wall, inner)), block: Block::new(BlockKind::Rock, Rgb::new(150, 50, 10)), }); + + + let roof_lip = 3; + let roof_height = self.bounds.size().reduce_min() / 2 + roof_lip; + + // Roof + emit_fill(Fill { + prim: emit_prim(Primitive::Pyramid { + aabb: Aabb { + min: Vec3::new(self.bounds.min.x - roof_lip, self.bounds.min.y - roof_lip, self.alt + ceiling), + max: Vec3::new(self.bounds.max.x + roof_lip, self.bounds.max.y + roof_lip, self.alt + ceiling + roof_height), + }, + inset: roof_height, + }), + block: Block::new(BlockKind::Wood, Rgb::new(100, 80, 100)), + }); } } From 9e20d7390f94fa42c3303bb6a26d56f0f48e9b9c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 1 Mar 2021 21:14:38 +0000 Subject: [PATCH 59/87] Better house generation --- world/src/site2/gen.rs | 5 +-- world/src/site2/mod.rs | 4 +-- world/src/site2/plot/house.rs | 65 ++++++++++++++++++++++++++++------- 3 files changed, 57 insertions(+), 17 deletions(-) diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index 2d8d3d94bb..244e1ff196 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -33,10 +33,11 @@ impl Fill { Primitive::Aabb(aabb) => aabb_contains(*aabb, pos), Primitive::Pyramid { aabb, inset } => { - let inner = Aabr { min: aabb.min.xy() + *inset, max: aabb.max.xy() - *inset }; + let inset = (*inset).max(aabb.size().reduce_min()); + let inner = Aabr { min: aabb.min.xy() - 1 + inset, max: aabb.max.xy() - inset }; aabb_contains(*aabb, pos) && (inner.projected_point(pos.xy()) - pos.xy()) .map(|e| e.abs()) - .reduce_max() as f32 / (*inset as f32) < 1.0 - (pos.z - aabb.min.z) as f32 / (aabb.max.z - aabb.min.z) as f32 + .reduce_max() as f32 / (inset as f32) < 1.0 - ((pos.z - aabb.min.z) as f32 + 0.5) / (aabb.max.z - aabb.min.z) as f32 }, Primitive::And(a, b) => self.contains_at(tree, *a, pos) & self.contains_at(tree, *b, pos), diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 7f2d4c7576..2f3dcbac5d 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -241,9 +241,9 @@ impl Site { // House 1 => { let size = (2.0 + rng.gen::().powf(8.0) * 3.0).round() as u32; - if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { + if let Some((aabr, door_tile)) = attempt(10, || site.find_roadside_aabr(rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { let plot = site.create_plot(Plot { - kind: PlotKind::House(plot::House::generate(land, rng, &site, aabr)), + kind: PlotKind::House(plot::House::generate(land, rng, &site, door_tile, aabr)), root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 6f8e04b152..dd6e4f0f2d 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -1,22 +1,26 @@ use super::*; -use crate::Land; +use crate::{Land, util::SQUARE_4}; use common::terrain::{Block, BlockKind}; use vek::*; use rand::prelude::*; pub struct House { + door_tile: Vec2, bounds: Aabr, alt: i32, + levels: u32, } impl House { - pub fn generate(land: &Land, rng: &mut impl Rng, site: &Site, tile_aabr: Aabr) -> Self { + pub fn generate(land: &Land, rng: &mut impl Rng, site: &Site, door_tile: Vec2, tile_aabr: Aabr) -> Self { Self { + door_tile, bounds: Aabr { min: site.tile_wpos(tile_aabr.min), max: site.tile_wpos(tile_aabr.max), }, - alt: land.get_alt_approx(site.tile_center_wpos(tile_aabr.center())) as i32, + alt: land.get_alt_approx(site.tile_center_wpos(door_tile)) as i32, + levels: rng.gen_range(1..3), } } } @@ -27,36 +31,71 @@ impl Structure for House { mut emit_prim: F, mut emit_fill: G, ) { - let ceiling = 12; + let storey = 8; + let roof = storey * self.levels as i32; + let foundations = 8; // Walls let wall = emit_prim(Primitive::Aabb(Aabb { - min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt - 8), - max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + ceiling), + min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt - foundations), + max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + roof), })); let inner = emit_prim(Primitive::Aabb(Aabb { - min: Vec3::new(self.bounds.min.x + 1, self.bounds.min.y + 1, self.alt - 8), - max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + ceiling), + min: Vec3::new(self.bounds.min.x + 1, self.bounds.min.y + 1, self.alt + 0), + max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + roof), })); emit_fill(Fill { prim: emit_prim(Primitive::Xor(wall, inner)), - block: Block::new(BlockKind::Rock, Rgb::new(150, 50, 10)), + block: Block::new(BlockKind::Rock, Rgb::new(181, 170, 148)), }); + // Floor + for i in 0..self.levels + 1 { + let height = storey * i as i32; + emit_fill(Fill { + prim: emit_prim(Primitive::Aabb(Aabb { + min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt + height + 0), + max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + height + 1), + })), + block: Block::new(BlockKind::Rock, Rgb::new(89, 44, 14)), + }); + } + + // Corner pillars + for &rpos in SQUARE_4.iter() { + let pos = self.bounds.min + (self.bounds.max - self.bounds.min) * rpos; + emit_fill(Fill { + prim: emit_prim(Primitive::Aabb(Aabb { + min: Vec3::new(pos.x - 1, pos.y - 1, self.alt - foundations), + max: Vec3::new(pos.x + 1, pos.y + 1, self.alt + roof), + })), + block: Block::new(BlockKind::Wood, Rgb::new(89, 44, 14)), + }); + } + let roof_lip = 3; - let roof_height = self.bounds.size().reduce_min() / 2 + roof_lip; + let roof_height = (self.bounds.min - self.bounds.max).map(|e| e.abs()).reduce_min() / 2 + roof_lip; // Roof emit_fill(Fill { prim: emit_prim(Primitive::Pyramid { aabb: Aabb { - min: Vec3::new(self.bounds.min.x - roof_lip, self.bounds.min.y - roof_lip, self.alt + ceiling), - max: Vec3::new(self.bounds.max.x + roof_lip, self.bounds.max.y + roof_lip, self.alt + ceiling + roof_height), + min: Vec3::new(self.bounds.min.x - roof_lip, self.bounds.min.y - roof_lip, self.alt + roof), + max: Vec3::new(self.bounds.max.x + roof_lip, self.bounds.max.y + roof_lip, self.alt + roof + roof_height), }, inset: roof_height, }), - block: Block::new(BlockKind::Wood, Rgb::new(100, 80, 100)), + block: Block::new(BlockKind::Wood, Rgb::new(21, 43, 48)), + }); + + // Foundations + emit_fill(Fill { + prim: emit_prim(Primitive::Aabb(Aabb { + min: Vec3::new(self.bounds.min.x - 1, self.bounds.min.y - 1, self.alt - foundations), + max: Vec3::new(self.bounds.max.x + 1, self.bounds.max.y + 1, self.alt + 1), + })), + block: Block::new(BlockKind::Rock, Rgb::new(31, 33, 32)), }); } } From 293d1f2d5e187d43426d7d204ccbf29ac95573a0 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 1 Mar 2021 23:43:26 +0000 Subject: [PATCH 60/87] More plot generation work --- world/src/site2/gen.rs | 4 ++-- world/src/site2/mod.rs | 2 +- world/src/site2/plot/house.rs | 28 ++++++++++++++-------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index 244e1ff196..c72c02d3f6 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -68,8 +68,8 @@ impl Fill { pub trait Structure { fn render Id, G: FnMut(Fill)>( &self, - emit_prim: F, - emit_fill: G, + prim: F, + fill: G, ) {} // Generate a primitive tree and fills for this structure diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 2f3dcbac5d..3b11c32a3b 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -500,7 +500,7 @@ impl Site { // } // }, // _ => {}, - // } + // } // }); } } diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index dd6e4f0f2d..6a503c87b0 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -28,32 +28,32 @@ impl House { impl Structure for House { fn render Id, G: FnMut(Fill)>( &self, - mut emit_prim: F, - mut emit_fill: G, + mut prim: F, + mut fill: G, ) { let storey = 8; let roof = storey * self.levels as i32; let foundations = 8; // Walls - let wall = emit_prim(Primitive::Aabb(Aabb { + let wall = prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt - foundations), max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + roof), })); - let inner = emit_prim(Primitive::Aabb(Aabb { + let inner = prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x + 1, self.bounds.min.y + 1, self.alt + 0), max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + roof), })); - emit_fill(Fill { - prim: emit_prim(Primitive::Xor(wall, inner)), + fill(Fill { + prim: prim(Primitive::Xor(wall, inner)), block: Block::new(BlockKind::Rock, Rgb::new(181, 170, 148)), }); // Floor for i in 0..self.levels + 1 { let height = storey * i as i32; - emit_fill(Fill { - prim: emit_prim(Primitive::Aabb(Aabb { + fill(Fill { + prim: prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt + height + 0), max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + height + 1), })), @@ -64,8 +64,8 @@ impl Structure for House { // Corner pillars for &rpos in SQUARE_4.iter() { let pos = self.bounds.min + (self.bounds.max - self.bounds.min) * rpos; - emit_fill(Fill { - prim: emit_prim(Primitive::Aabb(Aabb { + fill(Fill { + prim: prim(Primitive::Aabb(Aabb { min: Vec3::new(pos.x - 1, pos.y - 1, self.alt - foundations), max: Vec3::new(pos.x + 1, pos.y + 1, self.alt + roof), })), @@ -78,8 +78,8 @@ impl Structure for House { let roof_height = (self.bounds.min - self.bounds.max).map(|e| e.abs()).reduce_min() / 2 + roof_lip; // Roof - emit_fill(Fill { - prim: emit_prim(Primitive::Pyramid { + fill(Fill { + prim: prim(Primitive::Pyramid { aabb: Aabb { min: Vec3::new(self.bounds.min.x - roof_lip, self.bounds.min.y - roof_lip, self.alt + roof), max: Vec3::new(self.bounds.max.x + roof_lip, self.bounds.max.y + roof_lip, self.alt + roof + roof_height), @@ -90,8 +90,8 @@ impl Structure for House { }); // Foundations - emit_fill(Fill { - prim: emit_prim(Primitive::Aabb(Aabb { + fill(Fill { + prim: prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x - 1, self.bounds.min.y - 1, self.alt - foundations), max: Vec3::new(self.bounds.max.x + 1, self.bounds.max.y + 1, self.alt + 1), })), From 6e6e322e908227f8479417d86f4435bdfa153798 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 2 Mar 2021 14:07:30 +0000 Subject: [PATCH 61/87] Fixed stupid generation bugs, made houses more interesting --- world/src/site2/gen.rs | 13 +++--- world/src/site2/mod.rs | 2 +- world/src/site2/plot/house.rs | 76 +++++++++++++++++++++++++++++++---- 3 files changed, 78 insertions(+), 13 deletions(-) diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index c72c02d3f6..7fb17ee45e 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -1,3 +1,4 @@ +use super::*; use common::{ terrain::Block, store::{Id, Store}, @@ -26,7 +27,8 @@ impl Fill { fn contains_at(&self, tree: &Store, prim: Id, pos: Vec3) -> bool { // Custom closure because vek's impl of `contains_point` is inclusive :( let aabb_contains = |aabb: Aabb, pos: Vec3| (aabb.min.x..aabb.max.x).contains(&pos.x) - && (aabb.min.y..aabb.max.y).contains(&pos.y); + && (aabb.min.y..aabb.max.y).contains(&pos.y) + && (aabb.min.z..aabb.max.z).contains(&pos.z); match &tree[prim] { Primitive::Empty => false, @@ -40,8 +42,8 @@ impl Fill { .reduce_max() as f32 / (inset as f32) < 1.0 - ((pos.z - aabb.min.z) as f32 + 0.5) / (aabb.max.z - aabb.min.z) as f32 }, - Primitive::And(a, b) => self.contains_at(tree, *a, pos) & self.contains_at(tree, *b, pos), - Primitive::Or(a, b) => self.contains_at(tree, *a, pos) | self.contains_at(tree, *b, pos), + Primitive::And(a, b) => self.contains_at(tree, *a, pos) && self.contains_at(tree, *b, pos), + Primitive::Or(a, b) => self.contains_at(tree, *a, pos) || self.contains_at(tree, *b, pos), Primitive::Xor(a, b) => self.contains_at(tree, *a, pos) ^ self.contains_at(tree, *b, pos), } } @@ -68,15 +70,16 @@ impl Fill { pub trait Structure { fn render Id, G: FnMut(Fill)>( &self, + site: &Site, prim: F, fill: G, ) {} // Generate a primitive tree and fills for this structure - fn render_collect(&self) -> (Store, Vec) { + fn render_collect(&self, site: &Site) -> (Store, Vec) { let mut tree = Store::default(); let mut fills = Vec::new(); - let root = self.render(|p| tree.insert(p), |f| fills.push(f)); + let root = self.render(site, |p| tree.insert(p), |f| fills.push(f)); (tree, fills) } } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 3b11c32a3b..7211734589 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -437,7 +437,7 @@ impl Site { for plot in plots_to_render { let (prim_tree, fills) = match &self.plots[plot].kind { - PlotKind::House(house) => house.render_collect(), + PlotKind::House(house) => house.render_collect(self), _ => continue, }; diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 6a503c87b0..677a3de3f1 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -1,11 +1,12 @@ use super::*; use crate::{Land, util::SQUARE_4}; -use common::terrain::{Block, BlockKind}; +use common::terrain::{Block, BlockKind, SpriteKind}; use vek::*; use rand::prelude::*; pub struct House { door_tile: Vec2, + tile_aabr: Aabr, bounds: Aabr, alt: i32, levels: u32, @@ -15,11 +16,12 @@ impl House { pub fn generate(land: &Land, rng: &mut impl Rng, site: &Site, door_tile: Vec2, tile_aabr: Aabr) -> Self { Self { door_tile, + tile_aabr, bounds: Aabr { min: site.tile_wpos(tile_aabr.min), max: site.tile_wpos(tile_aabr.max), }, - alt: land.get_alt_approx(site.tile_center_wpos(door_tile)) as i32, + alt: land.get_alt_approx(site.tile_center_wpos(door_tile)) as i32 + 2, levels: rng.gen_range(1..3), } } @@ -28,15 +30,16 @@ impl House { impl Structure for House { fn render Id, G: FnMut(Fill)>( &self, + site: &Site, mut prim: F, mut fill: G, ) { - let storey = 8; + let storey = 6; let roof = storey * self.levels as i32; - let foundations = 8; + let foundations = 12; // Walls - let wall = prim(Primitive::Aabb(Aabb { + let outer = prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt - foundations), max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + roof), })); @@ -44,14 +47,73 @@ impl Structure for House { min: Vec3::new(self.bounds.min.x + 1, self.bounds.min.y + 1, self.alt + 0), max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + roof), })); + let walls = prim(Primitive::Xor(outer, inner)); fill(Fill { - prim: prim(Primitive::Xor(wall, inner)), + prim: walls, block: Block::new(BlockKind::Rock, Rgb::new(181, 170, 148)), }); - // Floor + // wall pillars + let mut pillars = prim(Primitive::Empty); + for x in self.tile_aabr.min.x + 1..self.tile_aabr.max.x { + let pillar = prim(Primitive::Aabb(Aabb { + min: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y))) + Vec3::unit_z() * self.alt, + max: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.max.y)) + Vec2::unit_x()) + Vec3::unit_z() * (self.alt + roof), + })); + pillars = prim(Primitive::Or(pillars, pillar)); + } + for y in self.tile_aabr.min.y + 1..self.tile_aabr.max.y { + let pillar = prim(Primitive::Aabb(Aabb { + min: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y))) + Vec3::unit_z() * self.alt, + max: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y)) + Vec2::unit_y()) + Vec3::unit_z() * (self.alt + roof), + })); + pillars = prim(Primitive::Or(pillars, pillar)); + } + fill(Fill { + prim: prim(Primitive::And(walls, pillars)), + block: Block::new(BlockKind::Wood, Rgb::new(89, 44, 14)), + }); + + // For each storey... for i in 0..self.levels + 1 { let height = storey * i as i32; + + // Windows x axis + { + let mut windows = prim(Primitive::Empty); + for y in self.tile_aabr.min.y..self.tile_aabr.max.y { + let window = prim(Primitive::Aabb(Aabb { + min: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)) + Vec2::unit_y() * 2) + Vec3::unit_z() * (self.alt + height + 2), + max: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y + 1)) - Vec2::unit_y() * 1) + Vec3::unit_z() * (self.alt + height + 5), + })); + windows = prim(Primitive::Or(windows, window)); + } + fill(Fill { + prim: prim(Primitive::And(walls, windows)), + block: Block::air(SpriteKind::Window1) + .with_ori(2) + .unwrap(), + }); + } + // Windows y axis + { + let mut windows = prim(Primitive::Empty); + for x in self.tile_aabr.min.x..self.tile_aabr.max.x { + let window = prim(Primitive::Aabb(Aabb { + min: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)) + Vec2::unit_x() * 2) + Vec3::unit_z() * (self.alt + height + 2), + max: Vec3::from(site.tile_wpos(Vec2::new(x + 1, self.tile_aabr.max.y)) - Vec2::unit_x() * 1) + Vec3::unit_z() * (self.alt + height + 5), + })); + windows = prim(Primitive::Or(windows, window)); + } + fill(Fill { + prim: prim(Primitive::And(walls, windows)), + block: Block::air(SpriteKind::Window1) + .with_ori(0) + .unwrap(), + }); + } + + // Floor fill(Fill { prim: prim(Primitive::Aabb(Aabb { min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt + height + 0), From fe8ffc8f873b1046998094e1aab90701ba905881 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 3 Mar 2021 13:31:25 +0000 Subject: [PATCH 62/87] Fixed more silly issues --- world/src/site2/gen.rs | 23 ++++++++++++++++------- world/src/site2/mod.rs | 6 +++--- world/src/site2/plot/house.rs | 34 ++++++++++++++++++---------------- world/src/site2/tile.rs | 4 ++-- 4 files changed, 39 insertions(+), 28 deletions(-) diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index 7fb17ee45e..642d83cdce 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -52,18 +52,27 @@ impl Fill { Some(self.block).filter(|_| self.contains_at(tree, self.prim, pos)) } - fn get_bounds_inner(&self, tree: &Store, prim: Id) -> Aabb { - match &tree[prim] { - Primitive::Empty => Aabb::new_empty(Vec3::zero()), + fn get_bounds_inner(&self, tree: &Store, prim: Id) -> Option> { + fn or_zip_with T>(a: Option, b: Option, f: F) -> Option { + match (a, b) { + (Some(a), Some(b)) => Some(f(a, b)), + (Some(a), _) => Some(a), + (_, b) => b, + } + } + + Some(match &tree[prim] { + Primitive::Empty => return None, Primitive::Aabb(aabb) => *aabb, Primitive::Pyramid { aabb, .. } => *aabb, - Primitive::And(a, b) => self.get_bounds_inner(tree, *a).intersection(self.get_bounds_inner(tree, *b)), - Primitive::Or(a, b) | Primitive::Xor(a, b) => self.get_bounds_inner(tree, *a).union(self.get_bounds_inner(tree, *b)), - } + Primitive::And(a, b) => or_zip_with(self.get_bounds_inner(tree, *a), self.get_bounds_inner(tree, *b), |a, b| a.intersection(b))?, + Primitive::Or(a, b) | Primitive::Xor(a, b) => + or_zip_with(self.get_bounds_inner(tree, *a), self.get_bounds_inner(tree, *b), |a, b| a.union(b))?, + }) } pub fn get_bounds(&self, tree: &Store) -> Aabb { - self.get_bounds_inner(tree, self.prim) + self.get_bounds_inner(tree, self.prim).unwrap_or_else(|| Aabb::new_empty(Vec3::zero())) } } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 7211734589..567fdfae58 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -250,7 +250,7 @@ impl Site { }); site.blit_aabr(aabr, Tile { - kind: TileKind::Building { levels: size - 1 + rng.gen_range(0..2) }, + kind: TileKind::Building, plot: Some(plot), }); } @@ -481,9 +481,9 @@ impl Site { // b.with_sprite(SpriteKind::Empty) // }, // )), - // TileKind::Building { levels } => { + // TileKind::Building => { // let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); - // for z in base_alt - 12..base_alt + 4 + 6 * levels as i32 { + // for z in base_alt - 12..base_alt + 16 { // canvas.set( // Vec3::new(wpos2d.x, wpos2d.y, z), // Block::new(BlockKind::Wood, Rgb::new(180, 90 + (seed % 64) as u8, 120)) diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 677a3de3f1..89e92e3ae0 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -54,23 +54,25 @@ impl Structure for House { }); // wall pillars - let mut pillars = prim(Primitive::Empty); - for x in self.tile_aabr.min.x + 1..self.tile_aabr.max.x { + let mut pillars_y = prim(Primitive::Empty); + for x in self.tile_aabr.min.x..self.tile_aabr.max.x + 2 { let pillar = prim(Primitive::Aabb(Aabb { min: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y))) + Vec3::unit_z() * self.alt, max: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.max.y)) + Vec2::unit_x()) + Vec3::unit_z() * (self.alt + roof), })); - pillars = prim(Primitive::Or(pillars, pillar)); + pillars_y = prim(Primitive::Or(pillars_y, pillar)); } - for y in self.tile_aabr.min.y + 1..self.tile_aabr.max.y { + let mut pillars_x = prim(Primitive::Empty); + for y in self.tile_aabr.min.y..self.tile_aabr.max.y + 2 { let pillar = prim(Primitive::Aabb(Aabb { min: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y))) + Vec3::unit_z() * self.alt, max: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y)) + Vec2::unit_y()) + Vec3::unit_z() * (self.alt + roof), })); - pillars = prim(Primitive::Or(pillars, pillar)); + pillars_x = prim(Primitive::Or(pillars_x, pillar)); } + let pillars = prim(Primitive::And(pillars_x, pillars_y)); fill(Fill { - prim: prim(Primitive::And(walls, pillars)), + prim: pillars, block: Block::new(BlockKind::Wood, Rgb::new(89, 44, 14)), }); @@ -124,16 +126,16 @@ impl Structure for House { } // Corner pillars - for &rpos in SQUARE_4.iter() { - let pos = self.bounds.min + (self.bounds.max - self.bounds.min) * rpos; - fill(Fill { - prim: prim(Primitive::Aabb(Aabb { - min: Vec3::new(pos.x - 1, pos.y - 1, self.alt - foundations), - max: Vec3::new(pos.x + 1, pos.y + 1, self.alt + roof), - })), - block: Block::new(BlockKind::Wood, Rgb::new(89, 44, 14)), - }); - } + // for &rpos in SQUARE_4.iter() { + // let pos = self.bounds.min + (self.bounds.max - self.bounds.min) * rpos; + // fill(Fill { + // prim: prim(Primitive::Aabb(Aabb { + // min: Vec3::new(pos.x - 1, pos.y - 1, self.alt - foundations), + // max: Vec3::new(pos.x + 1, pos.y + 1, self.alt + roof), + // })), + // block: Block::new(BlockKind::Wood, Rgb::new(89, 44, 14)), + // }); + // } let roof_lip = 3; diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 64b7ff8fa7..b9947c5643 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -117,7 +117,7 @@ pub enum TileKind { Hazard(HazardKind), Field, Road, - Building { levels: u32 }, + Building, Castle, Wall, } @@ -150,7 +150,7 @@ impl Tile { matches!( self.kind, TileKind::Hazard(_) - | TileKind::Building { .. } + | TileKind::Building | TileKind::Castle | TileKind::Wall ) From f537f82b1720cf723cba88987800d1af1ad379fe Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 3 Mar 2021 19:20:48 +0000 Subject: [PATCH 63/87] Updated vek, fixed house wall bugs --- voxygen/Cargo.toml | 2 +- voxygen/anim/src/vek.rs | 8 ++--- voxygen/src/scene/math.rs | 5 ++- world/src/lib.rs | 4 +-- world/src/site2/plot/house.rs | 64 +++++++++++++++++++---------------- 5 files changed, 44 insertions(+), 39 deletions(-) diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index 7002bac3f6..beb4070daa 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -16,7 +16,7 @@ simd = ["vek/platform_intrinsics"] tracy = ["tracing-tracy", "common/tracy"] plugins = ["client/plugins"] -default = ["gl", "singleplayer", "native-dialog", "plugins", "simd"] +default = ["gl", "singleplayer", "native-dialog", "plugins"]#, "simd"] [dependencies] client = {package = "veloren-client", path = "../client"} diff --git a/voxygen/anim/src/vek.rs b/voxygen/anim/src/vek.rs index ee9bda3c45..b7c1660f8d 100644 --- a/voxygen/anim/src/vek.rs +++ b/voxygen/anim/src/vek.rs @@ -1,8 +1,8 @@ -pub use ::vek::{ +/*pub use ::vek::{ bezier::repr_simd::*, geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, quaternion::repr_simd::*, transform::repr_simd::*, transition::*, vec::repr_simd::*, -}; -/* pub use ::vek::{ +}; */ +pub use ::vek::{ bezier::repr_c::*, geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, quaternion::repr_c::*, transform::repr_c::*, transition::*, vec::repr_c::*, -}; */ +}; diff --git a/voxygen/src/scene/math.rs b/voxygen/src/scene/math.rs index 7f21fac5f5..26e7543c9a 100644 --- a/voxygen/src/scene/math.rs +++ b/voxygen/src/scene/math.rs @@ -1,9 +1,8 @@ use core::{iter, mem}; use hashbrown::HashMap; use num::traits::Float; -pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; -// pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, -// vec::repr_c::*}; +// pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; +pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; pub fn aabb_to_points(bounds: Aabb) -> [Vec3; 8] { [ diff --git a/world/src/lib.rs b/world/src/lib.rs index 6a90f4c34a..c9ad01cb98 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -10,7 +10,7 @@ label_break_value, or_patterns, array_value_iter, - array_map, + array_map )] mod all; @@ -32,8 +32,8 @@ pub mod util; // Reexports pub use crate::{ canvas::{Canvas, CanvasInfo}, - land::Land, config::CONFIG, + land::Land, }; pub use block::BlockGen; pub use column::ColumnSample; diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 89e92e3ae0..425800709c 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -1,8 +1,8 @@ use super::*; -use crate::{Land, util::SQUARE_4}; +use crate::{util::SQUARE_4, Land}; use common::terrain::{Block, BlockKind, SpriteKind}; -use vek::*; use rand::prelude::*; +use vek::*; pub struct House { door_tile: Vec2, @@ -13,7 +13,13 @@ pub struct House { } impl House { - pub fn generate(land: &Land, rng: &mut impl Rng, site: &Site, door_tile: Vec2, tile_aabr: Aabr) -> Self { + pub fn generate( + land: &Land, + rng: &mut impl Rng, + site: &Site, + door_tile: Vec2, + tile_aabr: Aabr, + ) -> Self { Self { door_tile, tile_aabr, @@ -40,12 +46,12 @@ impl Structure for House { // Walls let outer = prim(Primitive::Aabb(Aabb { - min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt - foundations), - max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + roof), + min: self.bounds.min.with_z(self.alt - foundations), + max: (self.bounds.max + 1).with_z(self.alt + roof), })); let inner = prim(Primitive::Aabb(Aabb { - min: Vec3::new(self.bounds.min.x + 1, self.bounds.min.y + 1, self.alt + 0), - max: Vec3::new(self.bounds.max.x - 1, self.bounds.max.y - 1, self.alt + roof), + min: (self.bounds.min + 1).with_z(self.alt), + max: self.bounds.max.with_z(self.alt + roof), })); let walls = prim(Primitive::Xor(outer, inner)); fill(Fill { @@ -57,16 +63,16 @@ impl Structure for House { let mut pillars_y = prim(Primitive::Empty); for x in self.tile_aabr.min.x..self.tile_aabr.max.x + 2 { let pillar = prim(Primitive::Aabb(Aabb { - min: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y))) + Vec3::unit_z() * self.alt, - max: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.max.y)) + Vec2::unit_x()) + Vec3::unit_z() * (self.alt + roof), + min: site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)).with_z(self.alt), + max: (site.tile_wpos(Vec2::new(x, self.tile_aabr.max.y + 1)) + Vec2::unit_x()).with_z(self.alt + roof), })); pillars_y = prim(Primitive::Or(pillars_y, pillar)); } let mut pillars_x = prim(Primitive::Empty); for y in self.tile_aabr.min.y..self.tile_aabr.max.y + 2 { let pillar = prim(Primitive::Aabb(Aabb { - min: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y))) + Vec3::unit_z() * self.alt, - max: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y)) + Vec2::unit_y()) + Vec3::unit_z() * (self.alt + roof), + min: site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)).with_z(self.alt), + max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x + 1, y)) + Vec2::unit_y()).with_z(self.alt + roof), })); pillars_x = prim(Primitive::Or(pillars_x, pillar)); } @@ -85,16 +91,14 @@ impl Structure for House { let mut windows = prim(Primitive::Empty); for y in self.tile_aabr.min.y..self.tile_aabr.max.y { let window = prim(Primitive::Aabb(Aabb { - min: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)) + Vec2::unit_y() * 2) + Vec3::unit_z() * (self.alt + height + 2), - max: Vec3::from(site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y + 1)) - Vec2::unit_y() * 1) + Vec3::unit_z() * (self.alt + height + 5), + min: (site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)) + Vec2::unit_y() * 2).with_z(self.alt + height + 2), + max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y + 1)) + Vec2::new(1, -1)).with_z(self.alt + height + 5), })); windows = prim(Primitive::Or(windows, window)); } fill(Fill { prim: prim(Primitive::And(walls, windows)), - block: Block::air(SpriteKind::Window1) - .with_ori(2) - .unwrap(), + block: Block::air(SpriteKind::Window1).with_ori(2).unwrap(), }); } // Windows y axis @@ -102,24 +106,22 @@ impl Structure for House { let mut windows = prim(Primitive::Empty); for x in self.tile_aabr.min.x..self.tile_aabr.max.x { let window = prim(Primitive::Aabb(Aabb { - min: Vec3::from(site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)) + Vec2::unit_x() * 2) + Vec3::unit_z() * (self.alt + height + 2), - max: Vec3::from(site.tile_wpos(Vec2::new(x + 1, self.tile_aabr.max.y)) - Vec2::unit_x() * 1) + Vec3::unit_z() * (self.alt + height + 5), + min: (site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)) + Vec2::unit_x() * 2).with_z(self.alt + height + 2), + max: (site.tile_wpos(Vec2::new(x + 1, self.tile_aabr.max.y)) + Vec2::new(-1, 1)).with_z(self.alt + height + 5), })); windows = prim(Primitive::Or(windows, window)); } fill(Fill { prim: prim(Primitive::And(walls, windows)), - block: Block::air(SpriteKind::Window1) - .with_ori(0) - .unwrap(), + block: Block::air(SpriteKind::Window1).with_ori(0).unwrap(), }); } // Floor fill(Fill { prim: prim(Primitive::Aabb(Aabb { - min: Vec3::new(self.bounds.min.x, self.bounds.min.y, self.alt + height + 0), - max: Vec3::new(self.bounds.max.x, self.bounds.max.y, self.alt + height + 1), + min: self.bounds.min.with_z(self.alt + height), + max: (self.bounds.max + 1).with_z(self.alt + height + 1), })), block: Block::new(BlockKind::Rock, Rgb::new(89, 44, 14)), }); @@ -137,16 +139,20 @@ impl Structure for House { // }); // } - let roof_lip = 3; - let roof_height = (self.bounds.min - self.bounds.max).map(|e| e.abs()).reduce_min() / 2 + roof_lip; + let roof_height = (self.bounds.min - self.bounds.max) + .map(|e| e.abs()) + .reduce_min() + / 2 + + roof_lip + + 1; // Roof fill(Fill { prim: prim(Primitive::Pyramid { aabb: Aabb { - min: Vec3::new(self.bounds.min.x - roof_lip, self.bounds.min.y - roof_lip, self.alt + roof), - max: Vec3::new(self.bounds.max.x + roof_lip, self.bounds.max.y + roof_lip, self.alt + roof + roof_height), + min: (self.bounds.min - roof_lip).with_z(self.alt + roof), + max: (self.bounds.max + 1 + roof_lip).with_z(self.alt + roof + roof_height), }, inset: roof_height, }), @@ -156,8 +162,8 @@ impl Structure for House { // Foundations fill(Fill { prim: prim(Primitive::Aabb(Aabb { - min: Vec3::new(self.bounds.min.x - 1, self.bounds.min.y - 1, self.alt - foundations), - max: Vec3::new(self.bounds.max.x + 1, self.bounds.max.y + 1, self.alt + 1), + min: (self.bounds.min - 1).with_z(self.alt - foundations), + max: (self.bounds.max + 2).with_z(self.alt + 1), })), block: Block::new(BlockKind::Rock, Rgb::new(31, 33, 32)), }); From 1d16f14dd54bf0b2246007c358d0360a5c14cc6f Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 3 Mar 2021 22:12:08 +0000 Subject: [PATCH 64/87] Small fixes --- assets/voxygen/shaders/include/light.glsl | 4 ++++ voxygen/anim/src/vek.rs | 8 ++++---- voxygen/src/scene/math.rs | 4 ++-- world/src/site2/plot/house.rs | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/assets/voxygen/shaders/include/light.glsl b/assets/voxygen/shaders/include/light.glsl index e4fdf92f73..e30c1fc052 100644 --- a/assets/voxygen/shaders/include/light.glsl +++ b/assets/voxygen/shaders/include/light.glsl @@ -139,6 +139,10 @@ float lights_at(vec3 wpos, vec3 wnorm, vec3 /*cam_to_frag*/view_dir, vec3 mu, ve vec3 difference = light_pos - wpos; float distance_2 = dot(difference, difference); + if (distance_2 > 10000.0) { + continue; + } + // float strength = attenuation_strength(difference);// pow(attenuation_strength(difference), 0.6); // NOTE: This normalizes strength to 0.25 at the center of the point source. float strength = 1.0 / (4 + distance_2); diff --git a/voxygen/anim/src/vek.rs b/voxygen/anim/src/vek.rs index b7c1660f8d..ee9bda3c45 100644 --- a/voxygen/anim/src/vek.rs +++ b/voxygen/anim/src/vek.rs @@ -1,8 +1,8 @@ -/*pub use ::vek::{ +pub use ::vek::{ bezier::repr_simd::*, geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, quaternion::repr_simd::*, transform::repr_simd::*, transition::*, vec::repr_simd::*, -}; */ -pub use ::vek::{ +}; +/* pub use ::vek::{ bezier::repr_c::*, geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, quaternion::repr_c::*, transform::repr_c::*, transition::*, vec::repr_c::*, -}; +}; */ diff --git a/voxygen/src/scene/math.rs b/voxygen/src/scene/math.rs index 26e7543c9a..f228b33ebe 100644 --- a/voxygen/src/scene/math.rs +++ b/voxygen/src/scene/math.rs @@ -1,8 +1,8 @@ use core::{iter, mem}; use hashbrown::HashMap; use num::traits::Float; -// pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; -pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; +pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; +//pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; pub fn aabb_to_points(bounds: Aabb) -> [Vec3; 8] { [ diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 425800709c..5cb2aeae57 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -139,7 +139,7 @@ impl Structure for House { // }); // } - let roof_lip = 3; + let roof_lip = 2; let roof_height = (self.bounds.min - self.bounds.max) .map(|e| e.abs()) .reduce_min() From 427e0af73c6606fb726c88b48f5531b7832eb970 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Wed, 3 Mar 2021 23:40:47 +0000 Subject: [PATCH 65/87] Reverted to repr_c vek --- voxygen/anim/src/vek.rs | 8 ++++---- voxygen/src/render/renderer.rs | 2 +- voxygen/src/scene/math.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/voxygen/anim/src/vek.rs b/voxygen/anim/src/vek.rs index ee9bda3c45..e12d02e73e 100644 --- a/voxygen/anim/src/vek.rs +++ b/voxygen/anim/src/vek.rs @@ -1,8 +1,8 @@ -pub use ::vek::{ +/*pub use ::vek::{ bezier::repr_simd::*, geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, quaternion::repr_simd::*, transform::repr_simd::*, transition::*, vec::repr_simd::*, -}; -/* pub use ::vek::{ +};*/ +pub use ::vek::{ bezier::repr_c::*, geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, quaternion::repr_c::*, transform::repr_c::*, transition::*, vec::repr_c::*, -}; */ +}; diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index 15ffdb7761..f1ae11e340 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -1015,7 +1015,7 @@ impl Renderer { /// NOTE: Apparently Macs aren't the only machines that lie. /// /// TODO: Find a way to let graphics cards that don't lie do better. - const MAX_TEXTURE_SIZE_MAX: u16 = 8192 << 1; + const MAX_TEXTURE_SIZE_MAX: u16 = 8192; // NOTE: Many APIs for textures require coordinates to fit in u16, which is why // we perform this conversion. u16::try_from(factory.get_capabilities().max_texture_size) diff --git a/voxygen/src/scene/math.rs b/voxygen/src/scene/math.rs index f228b33ebe..53ac8371ca 100644 --- a/voxygen/src/scene/math.rs +++ b/voxygen/src/scene/math.rs @@ -1,8 +1,8 @@ use core::{iter, mem}; use hashbrown::HashMap; use num::traits::Float; -pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; -//pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; +//pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; +pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; pub fn aabb_to_points(bounds: Aabb) -> [Vec3; 8] { [ From d4ce69df999301eb1fe59ffd0b75a3585b2023fe Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 4 Mar 2021 11:02:40 +0000 Subject: [PATCH 66/87] Static light flickering --- assets/voxygen/shaders/figure-frag.glsl | 2 +- assets/voxygen/shaders/include/random.glsl | 5 +++++ assets/voxygen/shaders/include/sky.glsl | 4 ++++ assets/voxygen/shaders/sprite-frag.glsl | 2 +- assets/voxygen/shaders/terrain-frag.glsl | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/assets/voxygen/shaders/figure-frag.glsl b/assets/voxygen/shaders/figure-frag.glsl index 7d3586ee5b..3b3fd6d84f 100644 --- a/assets/voxygen/shaders/figure-frag.glsl +++ b/assets/voxygen/shaders/figure-frag.glsl @@ -184,7 +184,7 @@ void main() { float ao = f_ao * sqrt(f_ao);//0.25 + f_ao * 0.75; ///*pow(f_ao, 0.5)*/f_ao * 0.85 + 0.15; - vec3 glow = pow(pow(model_glow.w, 2.0) * (max(dot(f_norm, normalize(model_glow.xyz)) * 0.5 + 0.5, 0.0) * 1.0 + max(1.0 - length(model_glow.xyz), 0.0)), 1) * 4 * GLOW_COLOR; + vec3 glow = pow(pow(model_glow.w, 2.0) * (max(dot(f_norm, normalize(model_glow.xyz)) * 0.5 + 0.5, 0.0) * 1.0 + max(1.0 - length(model_glow.xyz), 0.0)), 1) * 4 * glow_light(f_pos); emitted_light += glow; reflected_light *= ao; diff --git a/assets/voxygen/shaders/include/random.glsl b/assets/voxygen/shaders/include/random.glsl index 9a5432cb1a..6f337fee35 100644 --- a/assets/voxygen/shaders/include/random.glsl +++ b/assets/voxygen/shaders/include/random.glsl @@ -26,6 +26,11 @@ float hash_fast(uvec3 q) return float(n) * (1.0/float(0xffffffffU)); } +// 2D, but using shifted 2D textures +float noise_2d(vec2 pos) { + return texture(t_noise, pos).x; +} + // 3D, but using shifted 2D textures float noise_3d(vec3 pos) { pos.z *= 15.0; diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index 7e9dd14eda..ddbb15efbf 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -47,6 +47,10 @@ const float PERSISTENT_AMBIANCE = 1.0 / 32.0;// 1.0 / 80; // 1.0 / 512; // 0.001 // Allowed to be > 1 due to HDR const vec3 GLOW_COLOR = vec3(3.0, 0.9, 0.05); +vec3 glow_light(vec3 pos) { + return GLOW_COLOR * (1.0 + (noise_3d(vec3(pos.xy * 0.005, tick.x * 0.5)) - 0.5) * 1.0); +} + //vec3 get_sun_dir(float time_of_day) { // const float TIME_FACTOR = (PI * 2.0) / (3600.0 * 24.0); // diff --git a/assets/voxygen/shaders/sprite-frag.glsl b/assets/voxygen/shaders/sprite-frag.glsl index 5295423998..317f385417 100644 --- a/assets/voxygen/shaders/sprite-frag.glsl +++ b/assets/voxygen/shaders/sprite-frag.glsl @@ -174,7 +174,7 @@ void main() { reflected_light += point_light; */ // float ao = /*pow(f_ao, 0.5)*/f_ao * 0.85 + 0.15; - vec3 glow = pow(f_inst_light.y, 3) * 4 * GLOW_COLOR; + vec3 glow = pow(f_inst_light.y, 3) * 4 * glow_light(f_pos); emitted_light += glow; float ao = f_ao; diff --git a/assets/voxygen/shaders/terrain-frag.glsl b/assets/voxygen/shaders/terrain-frag.glsl index 93a013cf33..16863e36eb 100644 --- a/assets/voxygen/shaders/terrain-frag.glsl +++ b/assets/voxygen/shaders/terrain-frag.glsl @@ -266,7 +266,7 @@ void main() { max_light *= f_light; // TODO: Apply AO after this - vec3 glow = GLOW_COLOR * (pow(f_glow, 6) * 5 + pow(f_glow, 1.5) * 2); + vec3 glow = glow_light(f_pos) * (pow(f_glow, 6) * 5 + pow(f_glow, 1.5) * 2); reflected_light += glow; max_light += lights_at(f_pos, f_norm, view_dir, mu, cam_attenuation, fluid_alt, k_a, k_d, k_s, alpha, f_norm, 1.0, emitted_light, reflected_light); From 120cb86c0d66fc0d123964521b4fd74c44731bda Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 4 Mar 2021 12:06:04 +0000 Subject: [PATCH 67/87] Switched back to simd repr --- voxygen/Cargo.toml | 2 +- voxygen/anim/src/vek.rs | 8 ++++---- voxygen/src/scene/math.rs | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/voxygen/Cargo.toml b/voxygen/Cargo.toml index beb4070daa..7002bac3f6 100644 --- a/voxygen/Cargo.toml +++ b/voxygen/Cargo.toml @@ -16,7 +16,7 @@ simd = ["vek/platform_intrinsics"] tracy = ["tracing-tracy", "common/tracy"] plugins = ["client/plugins"] -default = ["gl", "singleplayer", "native-dialog", "plugins"]#, "simd"] +default = ["gl", "singleplayer", "native-dialog", "plugins", "simd"] [dependencies] client = {package = "veloren-client", path = "../client"} diff --git a/voxygen/anim/src/vek.rs b/voxygen/anim/src/vek.rs index e12d02e73e..1d00e7cd4e 100644 --- a/voxygen/anim/src/vek.rs +++ b/voxygen/anim/src/vek.rs @@ -1,8 +1,8 @@ -/*pub use ::vek::{ +pub use ::vek::{ bezier::repr_simd::*, geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, quaternion::repr_simd::*, transform::repr_simd::*, transition::*, vec::repr_simd::*, -};*/ -pub use ::vek::{ +}; +/*pub use ::vek::{ bezier::repr_c::*, geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, quaternion::repr_c::*, transform::repr_c::*, transition::*, vec::repr_c::*, -}; +};*/ diff --git a/voxygen/src/scene/math.rs b/voxygen/src/scene/math.rs index 53ac8371ca..f228b33ebe 100644 --- a/voxygen/src/scene/math.rs +++ b/voxygen/src/scene/math.rs @@ -1,8 +1,8 @@ use core::{iter, mem}; use hashbrown::HashMap; use num::traits::Float; -//pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; -pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; +pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; +//pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; pub fn aabb_to_points(bounds: Aabb) -> [Vec3; 8] { [ From a229d65932400982f59e0bee7e0a787d8d332c5e Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Thu, 4 Mar 2021 12:57:29 +0000 Subject: [PATCH 68/87] Static light improvements, fixed lighting update bug --- common/src/volumes/vol_grid_2d.rs | 2 +- voxygen/src/scene/terrain.rs | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/common/src/volumes/vol_grid_2d.rs b/common/src/volumes/vol_grid_2d.rs index 4432fc80a5..03ecec38af 100644 --- a/common/src/volumes/vol_grid_2d.rs +++ b/common/src/volumes/vol_grid_2d.rs @@ -26,7 +26,7 @@ impl VolGrid2d { #[inline(always)] pub fn chunk_key>>(pos: P) -> Vec2 { pos.into() - .map2(V::RECT_SIZE, |e, sz: u32| e >> (sz - 1).count_ones()) + .map2(V::RECT_SIZE, |e, sz: u32| e.div_euclid(sz as i32)) } #[inline(always)] diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index 8ce523ab31..345d6d79b3 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -630,13 +630,25 @@ impl Terrain { // be meshed span!(guard, "Add chunks with modified blocks to mesh todo list"); // TODO: would be useful if modified blocks were grouped by chunk - for pos in scene_data + for (&pos, &block) in scene_data .state .terrain_changes() .modified_blocks .iter() - .map(|(p, _)| *p) { + // TODO: Be cleverer about this to avoid remeshing all neighbours. There are a few things that can create + // an 'effect at a distance'. These are as follows: + // - A glowing block is added or removed, thereby causing a lighting recalculation proportional to its glow + // radius. + // - An opaque block that was blocking sunlight from entering a cavity is removed (or added) thereby + // changing the way that sunlight propagates into the cavity. + // + // We can and should be cleverer about this, but it's non-trivial. For now, just conservatively assume that + // the lighting in all neighbouring chunks is invalidated. Thankfully, this doesn't need to happen often + // because block modification is unusual in Veloren. + // let block_effect_radius = block.get_glow().unwrap_or(0).max(1); + let block_effect_radius = crate::mesh::terrain::MAX_LIGHT_DIST; + // Handle block changes on chunk borders // Remesh all neighbours because we have complex lighting now // TODO: if lighting is on the server this can be updated to only remesh when @@ -644,7 +656,7 @@ impl Terrain { // change was on the border for x in -1..2 { for y in -1..2 { - let neighbour_pos = pos + Vec3::new(x, y, 0); + let neighbour_pos = pos + Vec3::new(x, y, 0) * block_effect_radius; let neighbour_chunk_pos = scene_data.state.terrain().pos_key(neighbour_pos); // Only remesh if this chunk has all its neighbors From 02d86f0fb0bc17f54fbe8bfbc4f3390531157142 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 5 Mar 2021 00:40:15 +0000 Subject: [PATCH 69/87] Switched to 6x6 tiles, more natural paths --- world/src/canvas.rs | 4 +- world/src/layer/mod.rs | 14 +- world/src/layer/scatter.rs | 10 +- world/src/site2/mod.rs | 337 ++++++++++++++++++++++------------ world/src/site2/plot/house.rs | 42 +++-- world/src/site2/tile.rs | 42 ++++- 6 files changed, 293 insertions(+), 156 deletions(-) diff --git a/world/src/canvas.rs b/world/src/canvas.rs index 02de530bba..abc6f3a4b7 100644 --- a/world/src/canvas.rs +++ b/world/src/canvas.rs @@ -65,8 +65,8 @@ impl<'a> Canvas<'a> { /// inner `CanvasInfo` such that it may be used independently. pub fn info(&mut self) -> CanvasInfo<'a> { self.info } - pub fn get(&mut self, pos: Vec3) -> Option { - self.chunk.get(pos - self.wpos()).ok().copied() + pub fn get(&mut self, pos: Vec3) -> Block { + self.chunk.get(pos - self.wpos()).ok().copied().unwrap_or(Block::empty()) } pub fn set(&mut self, pos: Vec3, block: Block) { diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index 6ce4c16494..2ee84d558f 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -99,7 +99,7 @@ pub fn apply_paths_to(canvas: &mut Canvas) { let head_space = path.head_space(path_dist); for z in inset..inset + head_space { let pos = Vec3::new(wpos2d.x, wpos2d.y, surface_z + z); - if canvas.get(pos).unwrap().kind() != BlockKind::Water { + if canvas.get(pos).kind() != BlockKind::Water { let _ = canvas.set(pos, EMPTY_AIR); } } @@ -135,11 +135,7 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) { { // If the block a little above is liquid, we should stop carving out the cave in // order to leave a ceiling, and not floating water - if canvas - .get(Vec3::new(wpos2d.x, wpos2d.y, z + 2)) - .map(|b| b.is_liquid()) - .unwrap_or(false) - { + if canvas.get(Vec3::new(wpos2d.x, wpos2d.y, z + 2)).is_liquid() { break; } @@ -165,11 +161,7 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) { .mul(45.0) as i32; // Generate stalagtites if there's something for them to hold on to - if canvas - .get(Vec3::new(wpos2d.x, wpos2d.y, cave_roof)) - .map(|b| b.is_filled()) - .unwrap_or(false) - { + if canvas.get(Vec3::new(wpos2d.x, wpos2d.y, cave_roof)).is_filled() { for z in cave_roof - stalagtites..cave_roof { canvas.set( Vec3::new(wpos2d.x, wpos2d.y, z), diff --git a/world/src/layer/scatter.rs b/world/src/layer/scatter.rs index b1a153d6d9..870ba6ad0e 100644 --- a/world/src/layer/scatter.rs +++ b/world/src/layer/scatter.rs @@ -577,17 +577,11 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) { // surface if let Some(solid_end) = (-4..8) .find(|z| { - canvas - .get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)) - .map(|b| b.is_solid()) - .unwrap_or(false) + canvas.get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)).is_solid() }) .and_then(|solid_start| { (1..8).map(|z| solid_start + z).find(|z| { - canvas - .get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)) - .map(|b| !b.is_solid()) - .unwrap_or(true) + !canvas.get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)).is_solid() }) }) { diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 567fdfae58..f8a3a6855c 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -23,9 +23,19 @@ use common::{ }; use hashbrown::hash_map::DefaultHashBuilder; use rand::prelude::*; +use rand_chacha::ChaChaRng; use vek::*; use std::ops::Range; +/// Seed a new RNG from an old RNG, thereby making the old RNG indepedent of changing use of the new RNG. The practical +/// effect of this is to reduce the extent to which changes to child generation algorithm produce a 'butterfly effect' +/// on their parent generators, meaning that generators will be less likely to produce entirely different outcomes if +/// some detail of a generation algorithm changes slightly. This is generally good and makes worldgen code easier to +/// maintain and less liable to breaking changes. +fn reseed(rng: &mut impl Rng) -> impl Rng { + ChaChaRng::from_seed(rng.gen::<[u8; 32]>()) +} + #[derive(Default)] pub struct Site { pub(crate) origin: Vec2, @@ -72,11 +82,12 @@ impl Site { } } - pub fn create_road(&mut self, land: &Land, rng: &mut impl Rng, a: Vec2, b: Vec2, w: i32) -> Option> { + pub fn create_road(&mut self, land: &Land, rng: &mut impl Rng, a: Vec2, b: Vec2, w: u16) -> Option> { const MAX_ITERS: usize = 4096; + let range = -(w as i32) / 2..w as i32 - w as i32 / 2; let heuristic = |tile: &Vec2| { - for y in 0..w { - for x in 0..w { + for y in range.clone() { + for x in range.clone() { if self.tiles.get(*tile + Vec2::new(x, y)).is_obstacle() { return 1000.0; } @@ -105,11 +116,15 @@ impl Site { self.roads.push(plot); - for &tile in path.iter() { - for y in 0..w { - for x in 0..w { + for (i, &tile) in path.iter().enumerate() { + for y in range.clone() { + for x in range.clone() { self.tiles.set(tile + Vec2::new(x, y), Tile { - kind: TileKind::Road, + kind: TileKind::Road { + a: i.saturating_sub(1) as u16, + b: (i + 1).min(path.len() - 1) as u16, + w, + }, plot: Some(plot), }); } @@ -125,10 +140,10 @@ impl Site { |center, _| self.tiles.grow_aabr(center, area_range.clone(), min_dims) .ok() .filter(|aabr| { - (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.min.y - 1)).kind == TileKind::Road) - || (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.max.y)).kind == TileKind::Road) - || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.min.x - 1, y)).kind == TileKind::Road) - || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.max.x, y)).kind == TileKind::Road) + (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.min.y - 1)).is_road()) + || (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.max.y)).is_road()) + || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.min.x - 1, y)).is_road()) + || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.max.x, y)).is_road()) }), ) } @@ -171,7 +186,7 @@ impl Site { }); self.plazas.push(plaza); self.blit_aabr(aabr, Tile { - kind: TileKind::Road, + kind: TileKind::Road { a: 0, b: 0, w: 0 }, plot: Some(plaza), }); @@ -209,6 +224,8 @@ impl Site { } pub fn generate(land: &Land, rng: &mut impl Rng, origin: Vec2) -> Self { + let mut rng = reseed(rng); + let mut site = Site { origin, ..Site::default() @@ -216,34 +233,25 @@ impl Site { site.demarcate_obstacles(land); - site.make_plaza(land, rng); + site.make_plaza(land, &mut rng); let build_chance = Lottery::from(vec![ - (1.0, 0), - (48.0, 1), + (64.0, 1), (5.0, 2), (20.0, 3), - (1.0, 4), + (0.75, 4), ]); let mut castles = 0; - for _ in 0..1000 { - if site.plots.len() - site.plazas.len() > 80 { - break; - } - + for _ in 0..120 { match *build_chance.choose_seeded(rng.gen()) { - // Plaza - 0 => { - site.make_plaza(land, rng); - }, // House 1 => { let size = (2.0 + rng.gen::().powf(8.0) * 3.0).round() as u32; - if let Some((aabr, door_tile)) = attempt(10, || site.find_roadside_aabr(rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { + if let Some((aabr, door_tile)) = attempt(32, || site.find_roadside_aabr(&mut rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { let plot = site.create_plot(Plot { - kind: PlotKind::House(plot::House::generate(land, rng, &site, door_tile, aabr)), + kind: PlotKind::House(plot::House::generate(land, &mut reseed(&mut rng), &site, door_tile, aabr)), root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), @@ -253,11 +261,13 @@ impl Site { kind: TileKind::Building, plot: Some(plot), }); + } else { + site.make_plaza(land, &mut rng); } }, // Guard tower 2 => { - if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 4..4, Extent2::new(2, 2))) { + if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(&mut rng, 4..4, Extent2::new(2, 2))) { let plot = site.create_plot(Plot { kind: PlotKind::Castle, root_tile: aabr.center(), @@ -278,7 +288,7 @@ impl Site { let tile = (Vec2::new( rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0), - ).normalized() * rng.gen_range(32.0..48.0)).map(|e| e as i32); + ).normalized() * rng.gen_range(16.0..48.0)).map(|e| e as i32); if site .plazas @@ -292,20 +302,24 @@ impl Site { } }) .unwrap_or_else(Vec2::zero); + site.tiles.find_near( search_pos, - |center, _| site.tiles.grow_aabr(center, 9..25, Extent2::new(3, 3)).ok()) + |center, _| site.tiles.grow_organic(&mut rng, center, 12..64).ok() + ) }) - .map(|(aabr, _)| { - site.blit_aabr(aabr, Tile { - kind: TileKind::Field, - plot: None, - }); + .map(|(tiles, _)| { + for tile in tiles { + site.tiles.set(tile, Tile { + kind: TileKind::Field, + plot: None, + }); + } }); }, // Castle - _ if castles < 1 => { - if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(rng, 16 * 16..18 * 18, Extent2::new(16, 16))) { + 4 if castles < 1 => { + if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(&mut rng, 16 * 16..18 * 18, Extent2::new(16, 16))) { let plot = site.create_plot(Plot { kind: PlotKind::Castle, root_tile: aabr.center(), @@ -330,7 +344,7 @@ impl Site { // Courtyard site.blit_aabr(Aabr { min: aabr.min + 1, max: aabr.max - 1 } , Tile { - kind: TileKind::Road, + kind: TileKind::Road { a: 0, b: 0, w: 0 }, plot: Some(plot), }); @@ -368,52 +382,184 @@ impl Site { pub fn render_tile(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng, tpos: Vec2) { let tile = self.tiles.get(tpos); - let twpos = self.tile_center_wpos(tpos); - let cols = (-(TILE_SIZE as i32)..TILE_SIZE as i32 * 2).map(|y| (-(TILE_SIZE as i32)..TILE_SIZE as i32 * 2).map(move |x| (twpos + Vec2::new(x, y), Vec2::new(x, y)))).flatten(); + let twpos = self.tile_wpos(tpos); + let border = TILE_SIZE as i32; + let cols = (-border..TILE_SIZE as i32 + border).map(|y| (-border..TILE_SIZE as i32 + border).map(move |x| (twpos + Vec2::new(x, y), Vec2::new(x, y)))).flatten(); match &tile.kind { TileKind::Empty | TileKind::Hazard(_) => {}, - TileKind::Road => { - let near_roads = CARDINALS - .map(|rpos| if self.tiles.get(tpos + rpos) == tile { - Some(LineSegment2 { - start: self.tile_center_wpos(tpos).map(|e| e as f32), - end: self.tile_center_wpos(tpos + rpos).map(|e| e as f32), - }) - } else { - None - }); + // TileKind::Road => { + // let near_roads = CARDINALS + // .map(|rpos| if self.tiles.get(tpos + rpos) == tile { + // Some(LineSegment2 { + // start: self.tile_center_wpos(tpos).map(|e| e as f32), + // end: self.tile_center_wpos(tpos + rpos).map(|e| e as f32), + // }) + // } else { + // None + // }); - cols.for_each(|(wpos2d, offs)| { - let wpos2df = wpos2d.map(|e| e as f32); - let nearest_road = near_roads - .iter() - .copied() - .filter_map(|line| Some(line?.projected_point(wpos2df))) - .min_by_key(|p| p.distance_squared(wpos2df) as i32); + // let near_roads = CARDINALS + // .iter() + // .filter_map(|rpos| if self.tiles.get(tpos + rpos) == tile { + // Some(Aabr { + // min: self.tile_wpos(tpos).map(|e| e as f32), + // max: self.tile_wpos(tpos + 1).map(|e| e as f32), + // }) + // } else { + // None + // }); - let is_near_road = nearest_road.map_or(false, |r| r.distance_squared(wpos2df) < 3.0f32.powi(2)); + // // cols.for_each(|(wpos2d, offs)| { + // // let wpos2df = wpos2d.map(|e| e as f32); + // // let nearest_road = near_roads + // // .iter() + // // .copied() + // // .filter_map(|line| Some(line?.projected_point(wpos2df))) + // // .min_by_key(|p| p.distance_squared(wpos2df) as i32); - if let Some(nearest_road) = nearest_road - .filter(|r| r.distance_squared(wpos2df) < 4.0f32.powi(2)) - { - let road_alt = canvas.col(nearest_road.map(|e| e.floor() as i32)).map_or(0, |col| col.alt as i32); - (-4..5).for_each(|z| canvas.map( - Vec3::new(wpos2d.x, wpos2d.y, road_alt + z), - |b| if z > 0 { - Block::air(SpriteKind::Empty) - } else { - Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)) - }, - )); - } - }); - }, + // // let is_near_road = nearest_road.map_or(false, |r| r.distance_squared(wpos2df) < 3.0f32.powi(2)); + + // // if let Some(nearest_road) = nearest_road + // // .filter(|r| r.distance_squared(wpos2df) < 6.0f32.powi(2)) + // // { + // // let road_alt = canvas.col(nearest_road.map(|e| e.floor() as i32)).map_or(0, |col| col.alt as i32); + // // (-4..5).for_each(|z| canvas.map( + // // Vec3::new(wpos2d.x, wpos2d.y, road_alt + z), + // // |b| if z > 0 { + // // Block::air(SpriteKind::Empty) + // // } else { + // // Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)) + // // }, + // // )); + // // } + // // }); + + // cols.for_each(|(wpos2d, offs)| { + // let wpos2df = wpos2d.map(|e| e as f32); + + // let dist = near_roads + // .clone() + // .map(|aabr| aabr.distance_to_point(wpos2df).powi(2)) + // .sum::() + // .sqrt(); + + // if dist < 4.0 { + // let mut z = canvas.col(wpos2d).map_or(0, |col| col.alt as i32) + 8; + // for _ in 0..16 { + // let pos = Vec3::new(wpos2d.x, wpos2d.y, z); + // z -= 1; + // if !canvas.get(pos).is_filled() { + // canvas.map(pos, |b| b.with_sprite(SpriteKind::Empty)); + // } else { + // canvas.set(pos, Block::empty()); + // break; + // } + // } + + // for _ in 0..2 { + // let pos = Vec3::new(wpos2d.x, wpos2d.y, z); + // z -= 1; + // canvas.set(pos, Block::new(BlockKind::Rock, Rgb::new(55, 45, 50))); + // } + // } + // }); + // }, _ => {}, } } pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { + canvas.foreach_col(|canvas, wpos2d, col| { + + let tpos = self.wpos_tile_pos(wpos2d); + let near_roads = SQUARE_9 + .iter() + .filter_map(|rpos| { + let tile = self.tiles.get(tpos + rpos); + if let TileKind::Road { a, b, w } = &tile.kind { + if let Some(PlotKind::Road(path)) = tile.plot.map(|p| &self.plot(p).kind) { + Some((LineSegment2 { + start: self.tile_center_wpos(path.nodes()[*a as usize]).map(|e| e as f32), + end: self.tile_center_wpos(path.nodes()[*b as usize]).map(|e| e as f32), + }, *w)) + } else { + None + } + } else { + None + } + }); + + let wpos2df = wpos2d.map(|e| e as f32); + let dist = near_roads + .map(|(line, w)| (line.distance_to_point(wpos2df) - w as f32 * 2.0).max(0.0)) + .min_by_key(|d| (*d * 100.0) as i32); + + if dist.map_or(false, |d| d <= 0.75) { + let mut z = canvas.col(wpos2d).map_or(0, |col| col.alt as i32) + 8; + for _ in 0..16 { + let pos = Vec3::new(wpos2d.x, wpos2d.y, z); + z -= 1; + if !canvas.get(pos).is_filled() { + canvas.map(pos, |b| b.with_sprite(SpriteKind::Empty)); + } else { + canvas.set(pos, Block::empty()); + break; + } + } + + for _ in 0..2 { + let pos = Vec3::new(wpos2d.x, wpos2d.y, z); + z -= 1; + canvas.set(pos, Block::new(BlockKind::Rock, Rgb::new(55, 45, 50))); + } + } + + let tile = self.wpos_tile(wpos2d); + let seed = tile.plot.map_or(0, |p| self.plot(p).seed); + match tile.kind { + TileKind::Field /*| TileKind::Road*/ => (-4..5).for_each(|z| canvas.map( + Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), + |b| if [ + BlockKind::Grass, + BlockKind::Earth, + BlockKind::Sand, + BlockKind::Snow, + BlockKind::Rock, + ] + .contains(&b.kind()) { + match tile.kind { + TileKind::Field => Block::new(BlockKind::Earth, Rgb::new(40, 5 + (seed % 32) as u8, 0)), + TileKind::Road { .. } => Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)), + _ => unreachable!(), + } + } else { + b.with_sprite(SpriteKind::Empty) + }, + )), + // TileKind::Building => { + // let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); + // for z in base_alt - 12..base_alt + 16 { + // canvas.set( + // Vec3::new(wpos2d.x, wpos2d.y, z), + // Block::new(BlockKind::Wood, Rgb::new(180, 90 + (seed % 64) as u8, 120)) + // ); + // } + // }, + // TileKind::Castle | TileKind::Wall => { + // let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); + // for z in base_alt - 12..base_alt + if tile.kind == TileKind::Wall { 24 } else { 40 } { + // canvas.set( + // Vec3::new(wpos2d.x, wpos2d.y, z), + // Block::new(BlockKind::Wood, Rgb::new(40, 40, 55)) + // ); + // } + // }, + _ => {}, + } + }); + let tile_aabr = Aabr { min: self.wpos_tile_pos(canvas.wpos()) - 1, max: self.wpos_tile_pos(canvas.wpos() + TerrainChunkSize::RECT_SIZE.map(|e| e as i32) + 2) + 3, // Round up, uninclusive, border @@ -457,51 +603,6 @@ impl Site { } } } - - // canvas.foreach_col(|canvas, wpos2d, col| { - // let tile = self.wpos_tile(wpos2d); - // let seed = tile.plot.map_or(0, |p| self.plot(p).seed); - // match tile.kind { - // TileKind::Field /*| TileKind::Road*/ => (-4..5).for_each(|z| canvas.map( - // Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), - // |b| if [ - // BlockKind::Grass, - // BlockKind::Earth, - // BlockKind::Sand, - // BlockKind::Snow, - // BlockKind::Rock, - // ] - // .contains(&b.kind()) { - // match tile.kind { - // TileKind::Field => Block::new(BlockKind::Earth, Rgb::new(40, 5 + (seed % 32) as u8, 0)), - // TileKind::Road => Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)), - // _ => unreachable!(), - // } - // } else { - // b.with_sprite(SpriteKind::Empty) - // }, - // )), - // TileKind::Building => { - // let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); - // for z in base_alt - 12..base_alt + 16 { - // canvas.set( - // Vec3::new(wpos2d.x, wpos2d.y, z), - // Block::new(BlockKind::Wood, Rgb::new(180, 90 + (seed % 64) as u8, 120)) - // ); - // } - // }, - // TileKind::Castle | TileKind::Wall => { - // let base_alt = tile.plot.map(|p| self.plot(p)).map_or(col.alt as i32, |p| p.base_alt); - // for z in base_alt - 12..base_alt + if tile.kind == TileKind::Wall { 24 } else { 40 } { - // canvas.set( - // Vec3::new(wpos2d.x, wpos2d.y, z), - // Block::new(BlockKind::Wood, Rgb::new(40, 40, 55)) - // ); - // } - // }, - // _ => {}, - // } - // }); } } diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 5cb2aeae57..8a6455db34 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -10,6 +10,7 @@ pub struct House { bounds: Aabr, alt: i32, levels: u32, + roof_color: Rgb, } impl House { @@ -28,7 +29,19 @@ impl House { max: site.tile_wpos(tile_aabr.max), }, alt: land.get_alt_approx(site.tile_center_wpos(door_tile)) as i32 + 2, - levels: rng.gen_range(1..3), + levels: rng.gen_range(1..2 + (tile_aabr.max - tile_aabr.min).product() / 6) as u32, + roof_color: { + let colors = [ + Rgb::new(21, 43, 48), + Rgb::new(11, 23, 38), + Rgb::new(45, 28, 21), + Rgb::new(10, 55, 40), + Rgb::new(5, 35, 15), + Rgb::new(40, 5, 11), + Rgb::new(55, 45, 11), + ]; + *colors.choose(rng).unwrap() + }, } } } @@ -40,24 +53,28 @@ impl Structure for House { mut prim: F, mut fill: G, ) { - let storey = 6; + let storey = 5; let roof = storey * self.levels as i32; let foundations = 12; // Walls - let outer = prim(Primitive::Aabb(Aabb { - min: self.bounds.min.with_z(self.alt - foundations), - max: (self.bounds.max + 1).with_z(self.alt + roof), - })); let inner = prim(Primitive::Aabb(Aabb { min: (self.bounds.min + 1).with_z(self.alt), max: self.bounds.max.with_z(self.alt + roof), })); - let walls = prim(Primitive::Xor(outer, inner)); + let outer = prim(Primitive::Aabb(Aabb { + min: self.bounds.min.with_z(self.alt - foundations), + max: (self.bounds.max + 1).with_z(self.alt + roof), + })); fill(Fill { - prim: walls, + prim: outer, block: Block::new(BlockKind::Rock, Rgb::new(181, 170, 148)), }); + fill(Fill { + prim: inner, + block: Block::empty(), + }); + let walls = prim(Primitive::Xor(outer, inner)); // wall pillars let mut pillars_y = prim(Primitive::Empty); @@ -79,12 +96,13 @@ impl Structure for House { let pillars = prim(Primitive::And(pillars_x, pillars_y)); fill(Fill { prim: pillars, - block: Block::new(BlockKind::Wood, Rgb::new(89, 44, 14)), + block: Block::new(BlockKind::Wood, Rgb::new(55, 25, 8)), }); // For each storey... for i in 0..self.levels + 1 { let height = storey * i as i32; + let window_height = storey - 3; // Windows x axis { @@ -92,7 +110,7 @@ impl Structure for House { for y in self.tile_aabr.min.y..self.tile_aabr.max.y { let window = prim(Primitive::Aabb(Aabb { min: (site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)) + Vec2::unit_y() * 2).with_z(self.alt + height + 2), - max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y + 1)) + Vec2::new(1, -1)).with_z(self.alt + height + 5), + max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y + 1)) + Vec2::new(1, -1)).with_z(self.alt + height + 2 + window_height), })); windows = prim(Primitive::Or(windows, window)); } @@ -107,7 +125,7 @@ impl Structure for House { for x in self.tile_aabr.min.x..self.tile_aabr.max.x { let window = prim(Primitive::Aabb(Aabb { min: (site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)) + Vec2::unit_x() * 2).with_z(self.alt + height + 2), - max: (site.tile_wpos(Vec2::new(x + 1, self.tile_aabr.max.y)) + Vec2::new(-1, 1)).with_z(self.alt + height + 5), + max: (site.tile_wpos(Vec2::new(x + 1, self.tile_aabr.max.y)) + Vec2::new(-1, 1)).with_z(self.alt + height + 2 + window_height), })); windows = prim(Primitive::Or(windows, window)); } @@ -156,7 +174,7 @@ impl Structure for House { }, inset: roof_height, }), - block: Block::new(BlockKind::Wood, Rgb::new(21, 43, 48)), + block: Block::new(BlockKind::Wood, self.roof_color), }); // Foundations diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index b9947c5643..f80fac3bec 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -1,8 +1,9 @@ use super::*; +use crate::util::DHashSet; use common::spiral::Spiral2d; use std::ops::Range; -pub const TILE_SIZE: u32 = 7; +pub const TILE_SIZE: u32 = 6; pub const ZONE_SIZE: u32 = 16; pub const ZONE_RADIUS: u32 = 16; pub const TILE_RADIUS: u32 = ZONE_SIZE * ZONE_RADIUS; @@ -54,13 +55,13 @@ impl TileGrid { self.get_mut(tpos).map(|t| std::mem::replace(t, tile)) } - pub fn find_near(&self, tpos: Vec2, f: impl Fn(Vec2, &Tile) -> Option) -> Option<(R, Vec2)> { + pub fn find_near(&self, tpos: Vec2, mut f: impl FnMut(Vec2, &Tile) -> Option) -> Option<(R, Vec2)> { const MAX_SEARCH_RADIUS_BLOCKS: u32 = 70; const MAX_SEARCH_CELLS: u32 = ((MAX_SEARCH_RADIUS_BLOCKS / TILE_SIZE) * 2 + 1).pow(2); Spiral2d::new() .take(MAX_SEARCH_CELLS as usize) .map(|r| tpos + r) - .find_map(|tpos| (&f)(tpos, self.get(tpos)).zip(Some(tpos))) + .find_map(|tpos| (&mut f)(tpos, self.get(tpos)).zip(Some(tpos))) } pub fn grow_aabr(&self, center: Vec2, area_range: Range, min_dims: Extent2) -> Result, Aabr> { @@ -71,7 +72,7 @@ impl TileGrid { }; let mut last_growth = 0; - for i in 0.. { + for i in 0..32 { if i - last_growth >= 4 { break; } else if aabr.size().product() + if i % 2 == 0 { aabr.size().h } else { aabr.size().w } > area_range.end as i32 { @@ -109,6 +110,33 @@ impl TileGrid { Err(aabr) } } + + pub fn grow_organic(&self, rng: &mut impl Rng, center: Vec2, area_range: Range) -> Result>, DHashSet>> { + let mut tiles = DHashSet::default(); + let mut open = Vec::new(); + + tiles.insert(center); + open.push(center); + + while tiles.len() < area_range.end as usize && !open.is_empty() { + let tile = open.remove(rng.gen_range(0..open.len())); + + for &rpos in CARDINALS.iter() { + let neighbor = tile + rpos; + + if self.get(neighbor).is_empty() && !tiles.contains(&neighbor) { + tiles.insert(neighbor); + open.push(neighbor); + } + } + } + + if tiles.len() >= area_range.start as usize { + Ok(tiles) + } else { + Err(tiles) + } + } } #[derive(Clone, PartialEq)] @@ -116,7 +144,7 @@ pub enum TileKind { Empty, Hazard(HazardKind), Field, - Road, + Road { a: u16, b: u16, w: u16 }, Building, Castle, Wall, @@ -146,6 +174,10 @@ impl Tile { pub fn is_empty(&self) -> bool { self.kind == TileKind::Empty } + pub fn is_road(&self) -> bool { + matches!(self.kind, TileKind::Road { .. }) + } + pub fn is_obstacle(&self) -> bool { matches!( self.kind, From 862cd5fe494d6c7e4bf728bb8f06aea16c03932a Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 5 Mar 2021 01:23:11 +0000 Subject: [PATCH 70/87] fmt --- Cargo.lock | 897 ++++++++++------------------------ common/src/path.rs | 6 +- common/src/store.rs | 14 +- voxygen/src/hud/img_ids.rs | 2 +- voxygen/src/hud/map.rs | 6 +- voxygen/src/mesh/terrain.rs | 12 +- voxygen/src/scene/math.rs | 3 +- voxygen/src/scene/terrain.rs | 61 ++- world/src/all.rs | 16 +- world/src/block/mod.rs | 18 +- world/src/canvas.rs | 12 +- world/src/civ/mod.rs | 13 +- world/src/column/mod.rs | 11 +- world/src/land.rs | 26 +- world/src/layer/mod.rs | 5 +- world/src/layer/scatter.rs | 8 +- world/src/layer/tree.rs | 80 ++- world/src/sim/map.rs | 6 +- world/src/sim/mod.rs | 56 ++- world/src/site/mod.rs | 13 +- world/src/site2/gen.rs | 56 ++- world/src/site2/mod.rs | 287 +++++++---- world/src/site2/plot.rs | 4 +- world/src/site2/plot/house.rs | 30 +- world/src/site2/tile.rs | 88 ++-- world/src/util/math.rs | 7 +- world/src/util/mod.rs | 2 +- 27 files changed, 800 insertions(+), 939 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 298e334c49..097c0e9674 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -42,9 +42,6 @@ name = "ahash" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" -dependencies = [ - "const-random", -] [[package]] name = "ahash" @@ -235,12 +232,6 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" -[[package]] -name = "ascii" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf56136a5198c7b01a49e3afcbef6cf84597273d298f54432926024107b0109" - [[package]] name = "assets_manager" version = "0.4.2" @@ -259,39 +250,25 @@ dependencies = [ ] [[package]] -name = "async-std" -version = "1.5.0" +name = "async-channel" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538ecb01eb64eecd772087e5b6f7540cbc917f047727339a472dafed2185b267" +checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" dependencies = [ - "async-task", - "broadcaster", - "crossbeam-channel 0.4.4", - "crossbeam-deque 0.7.3", - "crossbeam-utils 0.7.2", + "concurrent-queue", + "event-listener", "futures-core", - "futures-io", - "futures-timer 2.0.2", - "kv-log-macro", - "log", - "memchr", - "mio 0.6.22", - "mio-uds", - "num_cpus", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", ] [[package]] -name = "async-task" -version = "1.3.1" +name = "async-trait" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ac2c016b079e771204030951c366db398864f5026f84a44dafb0ff20f02085d" +checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" dependencies = [ - "libc", - "winapi 0.3.9", + "proc-macro2 1.0.24", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -427,9 +404,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bitvec" -version = "0.20.1" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5011ffc90248764d7005b0e10c7294f5aa1bd87d9dd7248f4ad475b347c294d" +checksum = "d23f76a953a42e113af6b4f3481ca32ff0a1ddbdcaa714a2333c956807b74a5f" dependencies = [ "funty", "radium", @@ -454,20 +431,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" -[[package]] -name = "broadcaster" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c972e21e0d055a36cf73e4daae870941fe7a8abcd5ac3396aab9e4c126bd87" -dependencies = [ - "futures-channel", - "futures-core", - "futures-sink", - "futures-util", - "parking_lot 0.10.2", - "slab", -] - [[package]] name = "bstr" version = "0.2.13" @@ -512,23 +475,24 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "either", - "iovec", -] - [[package]] name = "bytes" version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +[[package]] +name = "bytes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" + +[[package]] +name = "cache-padded" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" + [[package]] name = "calloop" version = "0.6.4" @@ -771,7 +735,7 @@ version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da3da6baa321ec19e1cc41d31bf599f00c783d0517095cdaf0332e3fe8d20680" dependencies = [ - "ascii 0.9.3", + "ascii", "byteorder", "either", "memchr", @@ -786,7 +750,16 @@ checksum = "2809f67365382d65fd2b6d9c22577231b954ed27400efeafbe687bda75abcc0b" dependencies = [ "bytes 0.5.6", "memchr", - "pin-project-lite", + "pin-project-lite 0.1.9", +] + +[[package]] +name = "concurrent-queue" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" +dependencies = [ + "cache-padded", ] [[package]] @@ -819,54 +792,6 @@ name = "conrod_winit" version = "0.63.0" source = "git+https://gitlab.com/veloren/conrod.git?branch=copypasta_0.7#1ae5193588fb662a7189d81edd9f2d653c7f1da0" -[[package]] -name = "const-random" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f1af9ac737b2dd2d577701e59fd09ba34822f6f2ebdb30a7647405d9e55e16a" -dependencies = [ - "const-random-macro", - "proc-macro-hack", -] - -[[package]] -name = "const-random-macro" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25e4c606eb459dd29f7c57b2e0879f2b6f14ee130918c2b78ccb58a9624e6c7a" -dependencies = [ - "getrandom 0.1.15", - "proc-macro-hack", -] - -[[package]] -name = "const-tweaker" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297be2ecc39b6e680c7bb03d8d053a483c32a61d95bd758fca76e9b95ce7e276" -dependencies = [ - "async-std", - "const-tweaker-attribute", - "ctor", - "dashmap", - "horrorshow", - "lazy_static", - "serde", - "tide", -] - -[[package]] -name = "const-tweaker-attribute" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d709e38f0f6100c0c8c0b3aefb0aa1f83af865d7b6b267e8402820513a0c0d8" -dependencies = [ - "darling", - "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", -] - [[package]] name = "const_fn" version = "0.4.3" @@ -1130,16 +1055,17 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70daa7ceec6cf143990669a04c7df13391d55fb27bd4079d252fca774ba244d8" +checksum = "ab327ed7354547cc2ef43cbe20ef68b988e70b4b593cbd66a2a61733123a3d23" dependencies = [ "atty", "cast", "clap", "criterion-plot", "csv", - "itertools 0.9.0", + "futures", + "itertools 0.10.0", "lazy_static", "num-traits 0.2.14", "oorandom", @@ -1151,6 +1077,7 @@ dependencies = [ "serde_derive", "serde_json", "tinytemplate", + "tokio 1.2.0", "walkdir 2.3.1", ] @@ -1174,19 +1101,10 @@ dependencies = [ "crossbeam-channel 0.5.0", "crossbeam-deque 0.8.0", "crossbeam-epoch 0.9.0", - "crossbeam-queue 0.3.1", + "crossbeam-queue", "crossbeam-utils 0.8.1", ] -[[package]] -name = "crossbeam-channel" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" -dependencies = [ - "crossbeam-utils 0.6.6", -] - [[package]] name = "crossbeam-channel" version = "0.4.4" @@ -1258,17 +1176,6 @@ dependencies = [ "scopeguard", ] -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - [[package]] name = "crossbeam-queue" version = "0.3.1" @@ -1279,16 +1186,6 @@ dependencies = [ "crossbeam-utils 0.8.1", ] -[[package]] -name = "crossbeam-utils" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" -dependencies = [ - "cfg-if 0.1.10", - "lazy_static", -] - [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -1321,7 +1218,7 @@ dependencies = [ "crossterm_winapi", "lazy_static", "libc", - "mio 0.7.0", + "mio 0.7.9", "parking_lot 0.10.2", "signal-hook 0.1.16", "winapi 0.3.9", @@ -1337,7 +1234,7 @@ dependencies = [ "crossterm_winapi", "lazy_static", "libc", - "mio 0.7.0", + "mio 0.7.9", "parking_lot 0.11.0", "signal-hook 0.1.16", "winapi 0.3.9", @@ -1374,16 +1271,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ctor" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbaabec2c953050352311293be5c6aba8e141ba19d6811862b232d6fd020484" -dependencies = [ - "quote 1.0.7", - "syn 1.0.54", -] - [[package]] name = "daggy" version = "0.5.0" @@ -1428,23 +1315,6 @@ dependencies = [ "syn 1.0.54", ] -[[package]] -name = "dashmap" -version = "3.11.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f260e2fc850179ef410018660006951c1b55b79e8087e87111a2c388994b9b5" -dependencies = [ - "ahash 0.3.8", - "cfg-if 0.1.10", - "num_cpus", -] - -[[package]] -name = "data-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" - [[package]] name = "deflate" version = "0.8.6" @@ -1700,10 +1570,11 @@ dependencies = [ [[package]] name = "euc" -version = "0.5.1" -source = "git+https://github.com/zesterer/euc.git#c9a7c17a03d45fce00caeeca09afa1e1558cd183" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed019c07d54f49d3efd699f68c47ced2958b9917fca7c48092c489792732faa5" dependencies = [ - "vek 0.11.2", + "vek 0.10.4", ] [[package]] @@ -1715,6 +1586,12 @@ dependencies = [ "num-traits 0.2.14", ] +[[package]] +name = "event-listener" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" + [[package]] name = "fallible-iterator" version = "0.2.0" @@ -1859,15 +1736,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "funty" -version = "1.0.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba62103ce691c2fd80fbae2213dfdda9ce60804973ac6b6e97de818ea7f52c8" - -[[package]] -name = "futures" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" +checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "futures" @@ -1900,16 +1771,6 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" -[[package]] -name = "futures-cpupool" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -dependencies = [ - "futures 0.1.29", - "num_cpus", -] - [[package]] name = "futures-executor" version = "0.3.5" @@ -1955,25 +1816,12 @@ dependencies = [ "once_cell", ] -[[package]] -name = "futures-timer" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" - -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - [[package]] name = "futures-util" version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" dependencies = [ - "futures 0.1.29", "futures-channel", "futures-core", "futures-io", @@ -1986,7 +1834,6 @@ dependencies = [ "proc-macro-hack", "proc-macro-nested", "slab", - "tokio-io", ] [[package]] @@ -2092,9 +1939,9 @@ dependencies = [ [[package]] name = "gilrs" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "122bb249f904e5f4ac73fc514b9b2ce6cce3af511f5df00ffc8000e47de6b290" +checksum = "3b64ac678e1174eb012be1cfd409ff2483f23cb79bc880ce4737147245b0fbff" dependencies = [ "fnv", "gilrs-core", @@ -2107,17 +1954,18 @@ dependencies = [ [[package]] name = "gilrs-core" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c758daf46af26d6872fe55507e3b2339779a160a06ad7a9b2a082f221209cd" +checksum = "1024d4046c5c67d2adb8c90f6ed235163b58e05d35a63bf699b53f0cceeba2c6" dependencies = [ "core-foundation 0.6.4", "io-kit-sys", "libc", "libudev-sys", "log", - "nix 0.15.0", + "nix 0.18.0", "rusty-xinput", + "serde", "stdweb 0.4.20", "uuid", "vec_map", @@ -2307,24 +2155,6 @@ dependencies = [ "svg_fmt", ] -[[package]] -name = "h2" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" -dependencies = [ - "byteorder", - "bytes 0.4.12", - "fnv", - "futures 0.1.29", - "http 0.1.21", - "indexmap", - "log", - "slab", - "string", - "tokio-io", -] - [[package]] name = "h2" version = "0.2.7" @@ -2336,7 +2166,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.2", + "http", "indexmap", "slab", "tokio 0.2.24", @@ -2427,29 +2257,12 @@ dependencies = [ "rayon", ] -[[package]] -name = "horrorshow" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ce7e0a1bc8e4489896abc94e5664e811a502a151bebfe113b3214fa181d3fb" - [[package]] name = "hound" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -dependencies = [ - "bytes 0.4.12", - "fnv", - "itoa", -] - [[package]] name = "http" version = "0.2.2" @@ -2461,18 +2274,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "http 0.1.21", - "tokio-buf", -] - [[package]] name = "http-body" version = "0.3.1" @@ -2480,32 +2281,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" dependencies = [ "bytes 0.5.6", - "http 0.2.2", + "http", ] [[package]] -name = "http-service" +name = "http-body" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9625f605ddfaf894bf78a544a7b8e31f562dc843654723a49892d9c7e75ac708" +checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" dependencies = [ - "async-std", - "bytes 0.4.12", - "futures 0.3.5", - "http 0.1.21", - "pin-project-lite", -] - -[[package]] -name = "http-service-hyper" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d5dae94e0fdb82f9524ea2f2b98458b3d8448526d8cc8beccb3d3fded8aff" -dependencies = [ - "futures 0.3.5", - "http 0.1.21", - "http-service", - "hyper 0.12.35", + "bytes 1.0.1", + "http", ] [[package]] @@ -2520,36 +2306,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" -[[package]] -name = "hyper" -version = "0.12.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "futures-cpupool", - "h2 0.1.26", - "http 0.1.21", - "http-body 0.1.0", - "httparse", - "iovec", - "itoa", - "log", - "net2", - "rustc_version", - "time", - "tokio 0.1.22", - "tokio-buf", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-tcp", - "tokio-threadpool", - "tokio-timer", - "want 0.2.0", -] - [[package]] name = "hyper" version = "0.13.9" @@ -2560,8 +2316,8 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.2.7", - "http 0.2.2", + "h2", + "http", "http-body 0.3.1", "httparse", "httpdate", @@ -2571,7 +2327,30 @@ dependencies = [ "tokio 0.2.24", "tower-service", "tracing", - "want 0.3.0", + "want", +] + +[[package]] +name = "hyper" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8e946c2b1349055e0b72ae281b238baf1a3ea7307c7e9f9d64673bdd9c26ac7" +dependencies = [ + "bytes 1.0.1", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body 0.4.0", + "httparse", + "httpdate", + "itoa", + "pin-project 1.0.2", + "socket2", + "tokio 1.2.0", + "tower-service", + "tracing", + "want", ] [[package]] @@ -2600,7 +2379,7 @@ name = "iced_futures" version = "0.2.0" source = "git+https://github.com/hecrj/iced?rev=8d882d787e6b7fd7c2435f42f82933e2ed904edf#8d882d787e6b7fd7c2435f42f82933e2ed904edf" dependencies = [ - "futures 0.3.5", + "futures", "log", "wasm-bindgen-futures", ] @@ -2873,15 +2652,6 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy-bytes-cast" version = "5.0.1" @@ -2919,9 +2689,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.77" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f96b10ec2560088a8e76961b00d47107b3a625fecb76dedb29ee7ccbf98235" +checksum = "265d751d31d6780a3f956bb5b8022feba2d94eeee5a84ba64f4212eedca42213" [[package]] name = "libflate" @@ -3264,14 +3034,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.0" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e9971bc8349a361217a8f2a41f5d011274686bd4436465ba51730921039d7fb" +checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a" dependencies = [ - "lazy_static", "libc", "log", - "miow 0.3.5", + "miow 0.3.6", "ntapi", "winapi 0.3.9", ] @@ -3288,17 +3057,6 @@ dependencies = [ "slab", ] -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio 0.6.22", -] - [[package]] name = "miow" version = "0.2.1" @@ -3313,9 +3071,9 @@ dependencies = [ [[package]] name = "miow" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" +checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" dependencies = [ "socket2", "winapi 0.3.9", @@ -3798,9 +3556,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.4.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" +checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" [[package]] name = "oorandom" @@ -4041,6 +3799,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fe74897791e156a0cd8cce0db31b9b2198e67877316bf3086c3acd187f719f0" +[[package]] +name = "pin-project-lite" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cf491442e4b033ed1c722cb9f0df5fcfcf4de682466c46469c36bc47dc5548a" + [[package]] name = "pin-utils" version = "0.1.0" @@ -4082,16 +3846,32 @@ checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" [[package]] name = "plotters" -version = "0.2.15" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d1685fbe7beba33de0330629da9d955ac75bd54f33d7b79f9a895590124f6bb" +checksum = "45ca0ae5f169d0917a7c7f5a9c1a3d3d9598f18f529dd2b8373ed988efea307a" dependencies = [ - "js-sys", "num-traits 0.2.14", + "plotters-backend", + "plotters-svg", "wasm-bindgen", "web-sys", ] +[[package]] +name = "plotters-backend" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b07fffcddc1cb3a1de753caa4e4df03b79922ba43cf882acc1bdd7e8df9f4590" + +[[package]] +name = "plotters-svg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b38a02e23bd9604b842a812063aec4ef702b57989c37b655254bb61c471ad211" +dependencies = [ + "plotters-backend", +] + [[package]] name = "png" version = "0.16.7" @@ -4195,6 +3975,18 @@ dependencies = [ "thiserror", ] +[[package]] +name = "prometheus-hyper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc47fa532a12d544229015dd3fae32394949af098b8fe9a327b8c1e4c911d1c8" +dependencies = [ + "hyper 0.14.4", + "prometheus", + "tokio 1.2.0", + "tracing", +] + [[package]] name = "qstring" version = "0.7.2" @@ -4566,7 +4358,7 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "http 0.2.2", + "http", "http-body 0.3.1", "hyper 0.13.9", "hyper-rustls", @@ -4577,7 +4369,7 @@ dependencies = [ "mime", "mime_guess", "percent-encoding 2.1.0", - "pin-project-lite", + "pin-project-lite 0.1.9", "rustls 0.18.1", "serde", "serde_json", @@ -4641,12 +4433,6 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84348444bd7ad45729d0c49a4240d7cdc11c9d512c06c5ad1835c1ad4acda6db" -[[package]] -name = "route-recognizer" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea509065eb0b3c446acdd0102f0d46567dc30902dc0be91d6552035d92b0f4f8" - [[package]] name = "rust-argon2" version = "0.8.2" @@ -4886,18 +4672,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_qs" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d43eef44996bbe16e99ac720e1577eefa16f7b76b5172165c98ced20ae9903e1" -dependencies = [ - "data-encoding", - "error-chain", - "percent-encoding 1.0.1", - "serde", -] - [[package]] name = "serde_repr" version = "0.1.6" @@ -5000,7 +4774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" dependencies = [ "libc", - "mio 0.7.0", + "mio 0.7.9", "signal-hook-registry", ] @@ -5115,13 +4889,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.3.15" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" +checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "redox_syscall", "winapi 0.3.9", ] @@ -5130,7 +4903,7 @@ name = "specs" version = "0.16.1" source = "git+https://github.com/amethyst/specs.git?rev=d4435bdf496cf322c74886ca09dd8795984919b4#d4435bdf496cf322c74886ca09dd8795984919b4" dependencies = [ - "crossbeam-queue 0.3.1", + "crossbeam-queue", "hashbrown 0.9.1", "hibitset", "log", @@ -5148,8 +4921,8 @@ version = "0.4.1" source = "git+https://github.com/amethyst/specs.git?rev=d4435bdf496cf322c74886ca09dd8795984919b4#d4435bdf496cf322c74886ca09dd8795984919b4" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -5260,15 +5033,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d44a3643b4ff9caf57abcee9c2c621d6c03d9135e0d8b589bd9afb5992cb176a" -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" -dependencies = [ - "bytes 0.4.12", -] - [[package]] name = "strsim" version = "0.8.0" @@ -5430,27 +5194,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "tide" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e619c99048ae107912703d0efeec4ff4fbff704f064e51d3eee614b28ea7b739" -dependencies = [ - "async-std", - "cookie", - "futures 0.3.5", - "http 0.1.21", - "http-service", - "http-service-hyper", - "log", - "mime", - "pin-project-lite", - "route-recognizer", - "serde", - "serde_json", - "serde_qs", -] - [[package]] name = "time" version = "0.1.44" @@ -5462,19 +5205,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "tiny_http" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ce4fc3c4cdea1a4399bb1819a539195fb69db4bbe0bde5b7c7f18fed412e02" -dependencies = [ - "ascii 1.0.0", - "chrono", - "chunked_transfer", - "log", - "url 2.1.1", -] - [[package]] name = "tinytemplate" version = "1.1.0" @@ -5491,24 +5221,6 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" -[[package]] -name = "tokio" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "mio 0.6.22", - "num_cpus", - "tokio-current-thread", - "tokio-executor", - "tokio-io", - "tokio-reactor", - "tokio-threadpool", - "tokio-timer", -] - [[package]] name = "tokio" version = "0.2.24" @@ -5523,69 +5235,38 @@ dependencies = [ "memchr", "mio 0.6.22", "num_cpus", - "pin-project-lite", + "pin-project-lite 0.1.9", "slab", ] [[package]] -name = "tokio-buf" -version = "0.1.1" +name = "tokio" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" +checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a" dependencies = [ - "bytes 0.4.12", - "either", - "futures 0.1.29", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -dependencies = [ - "futures 0.1.29", - "tokio-executor", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", -] - -[[package]] -name = "tokio-io" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "log", -] - -[[package]] -name = "tokio-reactor" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "lazy_static", - "log", - "mio 0.6.22", + "autocfg 1.0.1", + "bytes 1.0.1", + "libc", + "memchr", + "mio 0.7.9", "num_cpus", - "parking_lot 0.9.0", - "slab", - "tokio-executor", - "tokio-io", - "tokio-sync", + "once_cell", + "pin-project-lite 0.2.5", + "signal-hook-registry", + "tokio-macros", + "winapi 0.3.9", +] + +[[package]] +name = "tokio-macros" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +dependencies = [ + "proc-macro2 1.0.24", + "quote 1.0.7", + "syn 1.0.54", ] [[package]] @@ -5601,56 +5282,14 @@ dependencies = [ ] [[package]] -name = "tokio-sync" -version = "0.1.8" +name = "tokio-stream" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" +checksum = "1981ad97df782ab506a1f43bf82c967326960d278acf3bf8279809648c3ff3ea" dependencies = [ - "fnv", - "futures 0.1.29", -] - -[[package]] -name = "tokio-tcp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -dependencies = [ - "bytes 0.4.12", - "futures 0.1.29", - "iovec", - "mio 0.6.22", - "tokio-io", - "tokio-reactor", -] - -[[package]] -name = "tokio-threadpool" -version = "0.1.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -dependencies = [ - "crossbeam-deque 0.7.3", - "crossbeam-queue 0.2.3", - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "lazy_static", - "log", - "num_cpus", - "slab", - "tokio-executor", -] - -[[package]] -name = "tokio-timer" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" -dependencies = [ - "crossbeam-utils 0.7.2", - "futures 0.1.29", - "slab", - "tokio-executor", + "futures-core", + "pin-project-lite 0.2.5", + "tokio 1.2.0", ] [[package]] @@ -5663,7 +5302,7 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite", + "pin-project-lite 0.1.9", "tokio 0.2.24", ] @@ -5684,13 +5323,13 @@ checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" [[package]] name = "tracing" -version = "0.1.21" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" +checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "log", - "pin-project-lite", + "pin-project-lite 0.2.5", "tracing-attributes", "tracing-core", ] @@ -5708,9 +5347,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" +checksum = "a8a9bd1db7706f2373a190b0d067146caa39350c486f3d455b0e33b431f94c07" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.7", @@ -5979,28 +5618,6 @@ dependencies = [ "serde", ] -[[package]] -name = "uvth" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e59a167890d173eb0fcd7a1b99b84dc05c521ae8d76599130b8e19bef287abbf" -dependencies = [ - "crossbeam-channel 0.3.9", - "log", - "num_cpus", -] - -[[package]] -name = "uvth" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e5910f9106b96334c6cae1f1d77a764bda66ac4ca9f507f73259f184fe1bb6b" -dependencies = [ - "crossbeam-channel 0.3.9", - "log", - "num_cpus", -] - [[package]] name = "vcpkg" version = "0.2.10" @@ -6015,9 +5632,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vek" -version = "0.11.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2657d8704e5e0be82b60157c8dbc71a269273ad766984508fdc54030a0690c4d" +checksum = "4e44defd4e0c629bdc842e5d180dda428b3abd2c6b0c7e1fced8c718f65d5f77" dependencies = [ "approx 0.3.2", "num-integer", @@ -6029,13 +5646,26 @@ dependencies = [ [[package]] name = "vek" -version = "0.12.0" -source = "git+https://gitlab.com/veloren/vek.git?branch=fix_intrinsics#237a78528b505f34f6dde5dc77db3b642388fe4a" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2657d8704e5e0be82b60157c8dbc71a269273ad766984508fdc54030a0690c4d" dependencies = [ "approx 0.3.2", "num-integer", "num-traits 0.2.14", "rustc_version", + "static_assertions", +] + +[[package]] +name = "vek" +version = "0.14.1" +source = "git+https://gitlab.com/veloren/vek.git?branch=fix_intrinsics2#df6842cc874a697dec8896c66851817e744af7e8" +dependencies = [ + "approx 0.4.0", + "num-integer", + "num-traits 0.2.14", + "rustc_version", "serde", "static_assertions", ] @@ -6046,29 +5676,27 @@ version = "0.8.0" dependencies = [ "authc", "byteorder", - "futures-executor", - "futures-timer 3.0.2", "futures-util", "hashbrown 0.9.1", "image", "num 0.3.1", - "num_cpus", "rayon", "specs", + "tokio 1.2.0", "tracing", "tracing-subscriber", - "uvth 3.1.1", - "vek 0.12.0", + "vek 0.14.1", "veloren-common", "veloren-common-net", "veloren-common-sys", - "veloren_network", + "veloren-network", ] [[package]] name = "veloren-common" version = "0.8.0" dependencies = [ + "approx 0.4.0", "arraygen", "assets_manager", "criterion", @@ -6101,7 +5729,7 @@ dependencies = [ "tracing", "tracy-client", "uuid", - "vek 0.12.0", + "vek 0.14.1", ] [[package]] @@ -6115,7 +5743,7 @@ dependencies = [ "sum_type", "tracing", "tracy-client", - "vek 0.12.0", + "vek 0.14.1", "veloren-common", ] @@ -6136,13 +5764,56 @@ dependencies = [ "toml", "tracing", "tracy-client", - "vek 0.12.0", + "vek 0.14.1", "veloren-common", "veloren-common-net", "veloren-plugin-api", "wasmer", ] +[[package]] +name = "veloren-network" +version = "0.3.0" +dependencies = [ + "async-channel", + "async-trait", + "bincode", + "bitflags", + "bytes 1.0.1", + "clap", + "criterion", + "crossbeam-channel 0.5.0", + "futures-core", + "futures-util", + "lazy_static", + "lz-fear", + "prometheus", + "prometheus-hyper", + "rand 0.8.3", + "serde", + "shellexpand", + "tokio 1.2.0", + "tokio-stream", + "tracing", + "tracing-subscriber", + "veloren-network-protocol", +] + +[[package]] +name = "veloren-network-protocol" +version = "0.6.0" +dependencies = [ + "async-channel", + "async-trait", + "bitflags", + "bytes 1.0.1", + "criterion", + "prometheus", + "rand 0.8.3", + "tokio 1.2.0", + "tracing", +] + [[package]] name = "veloren-plugin-api" version = "0.1.0" @@ -6177,14 +5848,10 @@ version = "0.8.0" dependencies = [ "authc", "chrono", - "const-tweaker", "crossbeam-channel 0.5.0", "diesel", "diesel_migrations", "dotenv", - "futures-channel", - "futures-executor", - "futures-timer 3.0.2", "futures-util", "hashbrown 0.9.1", "itertools 0.9.0", @@ -6192,6 +5859,7 @@ dependencies = [ "libsqlite3-sys", "portpicker", "prometheus", + "prometheus-hyper", "rand 0.8.3", "rayon", "ron", @@ -6201,16 +5869,15 @@ dependencies = [ "slab", "specs", "specs-idvs", - "tiny_http", + "tokio 1.2.0", "tracing", - "uvth 3.1.1", - "vek 0.12.0", + "vek 0.14.1", "veloren-common", "veloren-common-net", "veloren-common-sys", + "veloren-network", "veloren-plugin-api", "veloren-world", - "veloren_network", ] [[package]] @@ -6225,6 +5892,7 @@ dependencies = [ "serde", "signal-hook 0.2.2", "termcolor", + "tokio 1.2.0", "tracing", "tracing-subscriber", "tracing-tracy", @@ -6243,8 +5911,8 @@ dependencies = [ "chrono", "conrod_core", "conrod_winit", - "const-tweaker", "copy_dir", + "coreaudio-sys", "cpal", "criterion", "crossbeam", @@ -6272,6 +5940,7 @@ dependencies = [ "lazy_static", "native-dialog", "num 0.3.1", + "num_cpus", "old_school_gfx_glutin_ext", "ordered-float 2.0.1", "rand 0.8.3", @@ -6281,14 +5950,14 @@ dependencies = [ "specs", "specs-idvs", "termcolor", + "tokio 1.2.0", "tracing", "tracing-appender", "tracing-log", "tracing-subscriber", "tracing-tracy", "treeculler", - "uvth 3.1.1", - "vek 0.12.0", + "vek 0.14.1", "veloren-client", "veloren-common", "veloren-common-net", @@ -6311,7 +5980,7 @@ dependencies = [ "libloading 0.6.3", "notify 5.0.0-pre.3", "tracing", - "vek 0.12.0", + "vek 0.14.1", "veloren-common", ] @@ -6343,34 +6012,11 @@ dependencies = [ "svg_fmt", "tracing", "tracing-subscriber", - "vek 0.12.0", + "vek 0.14.1", "veloren-common", "veloren-common-net", ] -[[package]] -name = "veloren_network" -version = "0.2.0" -dependencies = [ - "async-std", - "bincode", - "bitflags", - "clap", - "crossbeam-channel 0.5.0", - "futures 0.3.5", - "lazy_static", - "lz-fear", - "prometheus", - "rand 0.8.3", - "serde", - "shellexpand", - "tiny_http", - "tracing", - "tracing-futures", - "tracing-subscriber", - "uvth 4.0.1", -] - [[package]] name = "version_check" version = "0.1.5" @@ -6410,17 +6056,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "want" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" -dependencies = [ - "futures 0.1.29", - "log", - "try-lock", -] - [[package]] name = "want" version = "0.3.0" diff --git a/common/src/path.rs b/common/src/path.rs index 8c5eab36ea..0743191b0c 100644 --- a/common/src/path.rs +++ b/common/src/path.rs @@ -33,12 +33,10 @@ impl FromIterator for Path { } impl IntoIterator for Path { - type Item = T; type IntoIter = std::vec::IntoIter; + type Item = T; - fn into_iter(self) -> Self::IntoIter { - self.nodes.into_iter() - } + fn into_iter(self) -> Self::IntoIter { self.nodes.into_iter() } } impl Path { diff --git a/common/src/store.rs b/common/src/store.rs index 6666ccadd4..2b819dd47d 100644 --- a/common/src/store.rs +++ b/common/src/store.rs @@ -1,5 +1,5 @@ use std::{ - cmp::{Eq, PartialEq, Ord, PartialOrd, Ordering}, + cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}, fmt, hash, marker::PhantomData, ops::{Index, IndexMut}, @@ -30,14 +30,10 @@ impl PartialEq for Id { fn eq(&self, other: &Self) -> bool { self.idx == other.idx && self.gen == other.gen } } impl Ord for Id { - fn cmp(&self, other: &Self) -> Ordering { - (self.idx, self.gen).cmp(&(other.idx, other.gen)) - } + fn cmp(&self, other: &Self) -> Ordering { (self.idx, self.gen).cmp(&(other.idx, other.gen)) } } impl PartialOrd for Id { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } impl fmt::Debug for Id { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -77,9 +73,7 @@ impl Default for Store { } impl Store { - pub fn len(&self) -> usize { - self.len - } + pub fn len(&self) -> usize { self.len } pub fn contains(&self, id: Id) -> bool { self.entries diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index f10c028252..c82fe87355 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -364,7 +364,7 @@ image_ids! { mmap_site_cave_bg: "voxygen.element.map.cave_bg", mmap_site_cave_hover: "voxygen.element.map.cave_hover", mmap_site_cave: "voxygen.element.map.cave", - mmap_site_excl: "voxygen.element.map.excl", + mmap_site_excl: "voxygen.element.map.excl", // Window Parts window_3: "voxygen.element.frames.window_3", diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index b31720d8b9..bca1b2ffe9 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -586,8 +586,10 @@ impl<'a> Widget for Map<'a> { if show_caves { site_btn.set(state.ids.mmap_site_icons[i], ui); } - }, - _ => {site_btn.set(state.ids.mmap_site_icons[i], ui);}, + }, + _ => { + site_btn.set(state.ids.mmap_site_icons[i], ui); + }, } // Difficulty from 0-6 diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index 8812f5a348..de08a545a7 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -380,9 +380,15 @@ impl<'a, V: RectRasterableVol + ReadVol + Debug + 'static> let greedy_size_cross = Vec3::new(greedy_size.x - 1, greedy_size.y - 1, greedy_size.z); let draw_delta = Vec3::new(1, 1, z_start); - let get_light = |_: &mut (), pos: Vec3| volume - .get(range.min + pos) - .map_or(1.0, |b| if b.is_opaque() { 0.0 } else { light(pos + range.min) }); + let get_light = |_: &mut (), pos: Vec3| { + volume.get(range.min + pos).map_or(1.0, |b| { + if b.is_opaque() { + 0.0 + } else { + light(pos + range.min) + } + }) + }; let get_glow = |_: &mut (), pos: Vec3| glow(pos + range.min); let get_color = |_: &mut (), pos: Vec3| flat_get(pos).get_color().unwrap_or(Rgb::zero()); diff --git a/voxygen/src/scene/math.rs b/voxygen/src/scene/math.rs index f228b33ebe..dcd43c4efd 100644 --- a/voxygen/src/scene/math.rs +++ b/voxygen/src/scene/math.rs @@ -2,7 +2,8 @@ use core::{iter, mem}; use hashbrown::HashMap; use num::traits::Float; pub use vek::{geom::repr_simd::*, mat::repr_simd::column_major::Mat4, ops::*, vec::repr_simd::*}; -//pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, vec::repr_c::*}; +//pub use vek::{geom::repr_c::*, mat::repr_c::column_major::Mat4, ops::*, +// vec::repr_c::*}; pub fn aabb_to_points(bounds: Aabb) -> [Vec3; 8] { [ diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index 345d6d79b3..c69a98aa62 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -3,7 +3,7 @@ mod watcher; pub use self::watcher::BlocksOfInterest; use crate::{ - mesh::{greedy::GreedyMesh, Meshable, terrain::SUNLIGHT}, + mesh::{greedy::GreedyMesh, terrain::SUNLIGHT, Meshable}, render::{ ColLightFmt, ColLightInfo, Consts, FluidPipeline, GlobalModel, Instances, Mesh, Model, RenderError, Renderer, ShadowPipeline, SpriteInstance, SpriteLocals, SpritePipeline, @@ -524,22 +524,35 @@ impl Terrain { .map(|c| c.blocks_of_interest.lights.iter()) .into_iter() .flatten() - .map(move |(lpos, level)| (Vec3::::from(chunk_pos * TerrainChunk::RECT_SIZE.map(|e| e as i32)) + *lpos, level)) + .map(move |(lpos, level)| { + ( + Vec3::::from( + chunk_pos * TerrainChunk::RECT_SIZE.map(|e| e as i32), + ) + *lpos, + level, + ) + }) }) .flatten() - .fold((Vec3::broadcast(0.001), 0.0, 0.0f32), |(bias, total, max), (lpos, level)| { - let rpos = lpos.map(|e| e as f32 + 0.5) - wpos; - let level = (*level as f32 - rpos.magnitude()).max(0.0) / SUNLIGHT as f32; - ( - bias + rpos.try_normalized().unwrap_or_else(Vec3::zero) * level, - total + level, - max.max(level), - ) - }); + .fold( + (Vec3::broadcast(0.001), 0.0, 0.0f32), + |(bias, total, max), (lpos, level)| { + let rpos = lpos.map(|e| e as f32 + 0.5) - wpos; + let level = (*level as f32 - rpos.magnitude()).max(0.0) / SUNLIGHT as f32; + ( + bias + rpos.try_normalized().unwrap_or_else(Vec3::zero) * level, + total + level, + max.max(level), + ) + }, + ); let bias_factor = bias.magnitude() * (1.0 - AMBIANCE) / total.max(0.001); - (bias.try_normalized().unwrap_or_else(Vec3::zero) * bias_factor.powf(0.5), self.glow_at_wpos(wpos.map(|e| e.floor() as i32))) + ( + bias.try_normalized().unwrap_or_else(Vec3::zero) * bias_factor.powf(0.5), + self.glow_at_wpos(wpos.map(|e| e.floor() as i32)), + ) } /// Maintain terrain data. To be called once per tick. @@ -630,21 +643,19 @@ impl Terrain { // be meshed span!(guard, "Add chunks with modified blocks to mesh todo list"); // TODO: would be useful if modified blocks were grouped by chunk - for (&pos, &block) in scene_data - .state - .terrain_changes() - .modified_blocks - .iter() - { - // TODO: Be cleverer about this to avoid remeshing all neighbours. There are a few things that can create - // an 'effect at a distance'. These are as follows: - // - A glowing block is added or removed, thereby causing a lighting recalculation proportional to its glow - // radius. - // - An opaque block that was blocking sunlight from entering a cavity is removed (or added) thereby + for (&pos, &block) in scene_data.state.terrain_changes().modified_blocks.iter() { + // TODO: Be cleverer about this to avoid remeshing all neighbours. There are a + // few things that can create an 'effect at a distance'. These are + // as follows: + // - A glowing block is added or removed, thereby causing a lighting + // recalculation proportional to its glow radius. + // - An opaque block that was blocking sunlight from entering a cavity is + // removed (or added) thereby // changing the way that sunlight propagates into the cavity. // - // We can and should be cleverer about this, but it's non-trivial. For now, just conservatively assume that - // the lighting in all neighbouring chunks is invalidated. Thankfully, this doesn't need to happen often + // We can and should be cleverer about this, but it's non-trivial. For now, just + // conservatively assume that the lighting in all neighbouring + // chunks is invalidated. Thankfully, this doesn't need to happen often // because block modification is unusual in Veloren. // let block_effect_radius = block.get_glow().unwrap_or(0).max(1); let block_effect_radius = crate::mesh::terrain::MAX_LIGHT_DIST; diff --git a/world/src/all.rs b/world/src/all.rs index 40158af578..030952d731 100644 --- a/world/src/all.rs +++ b/world/src/all.rs @@ -1,7 +1,7 @@ -use std::ops::Range; -use enum_iterator::IntoEnumIterator; -use vek::*; use crate::util::math::close; +use enum_iterator::IntoEnumIterator; +use std::ops::Range; +use vek::*; #[derive(Copy, Clone, Debug, IntoEnumIterator)] pub enum ForestKind { @@ -33,7 +33,7 @@ impl ForestKind { ForestKind::Birch => 0.0..0.6, ForestKind::Mangrove => 0.65..1.3, ForestKind::Swamp => 0.5..1.1, - _ => 0.0..0.0 + _ => 0.0..0.0, } } @@ -76,9 +76,11 @@ impl ForestKind { pub fn proclivity(&self, env: &Environment) -> f32 { self.ideal_proclivity() - * close(env.humid, self.humid_range()) - * close(env.temp, self.temp_range()) - * self.near_water_range().map_or(1.0, |near_water_range| close(env.near_water, near_water_range)) + * close(env.humid, self.humid_range()) + * close(env.temp, self.temp_range()) + * self.near_water_range().map_or(1.0, |near_water_range| { + close(env.near_water, near_water_range) + }) } } diff --git a/world/src/block/mod.rs b/world/src/block/mod.rs index 4defa2e087..a1284ac22e 100644 --- a/world/src/block/mod.rs +++ b/world/src/block/mod.rs @@ -1,6 +1,6 @@ use crate::{ column::{ColumnGen, ColumnSample}, - util::{RandomField, Sampler, SmallCache, FastNoise}, + util::{FastNoise, RandomField, Sampler, SmallCache}, IndexRef, }; use common::terrain::{ @@ -121,14 +121,22 @@ impl<'a> BlockGen<'a> { if stone_factor >= 0.5 { if wposf.z as f32 > height - cliff_offset.max(0.0) { - if cliff_offset.max(0.0) > cliff_height - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + 0.5) * (height - grass_depth - wposf.z as f32).mul(0.25).clamped(0.0, 8.0) { + if cliff_offset.max(0.0) + > cliff_height + - (FastNoise::new(37).get(wposf / Vec3::new(6.0, 6.0, 10.0)) * 0.5 + + 0.5) + * (height - grass_depth - wposf.z as f32) + .mul(0.25) + .clamped(0.0, 8.0) + { Some(Block::empty()) } else { let col = Lerp::lerp( col.map(|e| e as f32), col.map(|e| e as f32) * 0.7, (wposf.z as f32 - basement * 0.3).div(2.0).sin() * 0.5 + 0.5, - ).map(|e| e as u8); + ) + .map(|e| e as u8); Some(Block::new(BlockKind::Rock, col)) } } else { @@ -198,7 +206,9 @@ pub struct ZCache<'a> { impl<'a> ZCache<'a> { pub fn get_z_limits(&self) -> (f32, f32) { - let min = self.sample.alt - (self.sample.chaos.min(1.0) * 16.0) - self.sample.cliff_offset.max(0.0); + let min = self.sample.alt + - (self.sample.chaos.min(1.0) * 16.0) + - self.sample.cliff_offset.max(0.0); let min = min - 4.0; let rocks = if self.sample.rock > 0.0 { 12.0 } else { 0.0 }; diff --git a/world/src/canvas.rs b/world/src/canvas.rs index abc6f3a4b7..940ef051db 100644 --- a/world/src/canvas.rs +++ b/world/src/canvas.rs @@ -2,9 +2,9 @@ use crate::{ block::ZCache, column::ColumnSample, index::IndexRef, + land::Land, sim::{SimChunk, WorldSim}, util::Grid, - land::Land, }; use common::{ terrain::{Block, TerrainChunk, TerrainChunkSize}, @@ -48,9 +48,7 @@ impl<'a> CanvasInfo<'a> { pub fn chunks(&self) -> &'a WorldSim { self.chunks } - pub fn land(&self) -> Land<'_> { - Land::from_sim(self.chunks) - } + pub fn land(&self) -> Land<'_> { Land::from_sim(self.chunks) } } pub struct Canvas<'a> { @@ -66,7 +64,11 @@ impl<'a> Canvas<'a> { pub fn info(&mut self) -> CanvasInfo<'a> { self.info } pub fn get(&mut self, pos: Vec3) -> Block { - self.chunk.get(pos - self.wpos()).ok().copied().unwrap_or(Block::empty()) + self.chunk + .get(pos - self.wpos()) + .ok() + .copied() + .unwrap_or(Block::empty()) } pub fn set(&mut self, pos: Vec3, block: Block) { diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 19bac38ed2..45b7be02ef 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -7,10 +7,9 @@ use crate::{ config::CONFIG, sim::WorldSim, site::{namegen::NameGen, Castle, Dungeon, Settlement, Site as WorldSite}, - util::{attempt, seed_expan, MapVec, CARDINALS, NEIGHBORS}, site2, - Index, - Land, + util::{attempt, seed_expan, MapVec, CARDINALS, NEIGHBORS}, + Index, Land, }; use common::{ astar::Astar, @@ -216,9 +215,11 @@ impl Civs { SiteKind::Castle => { WorldSite::castle(Castle::generate(wpos, Some(ctx.sim), &mut rng)) }, - SiteKind::Refactor => { - WorldSite::refactor(site2::Site::generate(&Land::from_sim(&ctx.sim), &mut rng, wpos)) - }, + SiteKind::Refactor => WorldSite::refactor(site2::Site::generate( + &Land::from_sim(&ctx.sim), + &mut rng, + wpos, + )), }); sim_site.site_tmp = Some(site); let site_ref = &index.sites[site]; diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index a24ed76f23..5719b6a5ca 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -272,11 +272,12 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { .rem_euclid(200.0) / 64.0 - 1.0; - let cliff_scale = ((self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) as f32 * 1.5 + 0.75) - + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) as f32 * 0.1) - .clamped(0.0, 1.0).powf(2.0); - let cliff_height = - sim.get_interpolated(wpos, |chunk| chunk.cliff_height)? * cliff_scale; + let cliff_scale = + ((self.sim.gen_ctx.hill_nz.get(wposf.div(128.0).into_array()) as f32 * 1.5 + 0.75) + + self.sim.gen_ctx.hill_nz.get(wposf.div(48.0).into_array()) as f32 * 0.1) + .clamped(0.0, 1.0) + .powf(2.0); + let cliff_height = sim.get_interpolated(wpos, |chunk| chunk.cliff_height)? * cliff_scale; let cliff = if cliff_factor < 0.0 { cliff_factor.abs().powf(1.5) } else { diff --git a/world/src/land.rs b/world/src/land.rs index 2bf8ec6b09..8384251647 100644 --- a/world/src/land.rs +++ b/world/src/land.rs @@ -1,31 +1,31 @@ use crate::sim; -use common::{ - terrain::TerrainChunkSize, - vol::RectVolSize, -}; +use common::{terrain::TerrainChunkSize, vol::RectVolSize}; use vek::*; -/// A wrapper type that may contain a reference to a generated world. If not, default values will be provided. +/// A wrapper type that may contain a reference to a generated world. If not, +/// default values will be provided. pub struct Land<'a> { sim: Option<&'a sim::WorldSim>, } impl<'a> Land<'a> { - pub fn empty() -> Self { - Self { sim: None } - } + pub fn empty() -> Self { Self { sim: None } } - pub fn from_sim(sim: &'a sim::WorldSim) -> Self { - Self { sim: Some(sim) } - } + pub fn from_sim(sim: &'a sim::WorldSim) -> Self { Self { sim: Some(sim) } } pub fn get_alt_approx(&self, wpos: Vec2) -> f32 { - self.sim.and_then(|sim| sim.get_alt_approx(wpos)).unwrap_or(0.0) + self.sim + .and_then(|sim| sim.get_alt_approx(wpos)) + .unwrap_or(0.0) } pub fn get_gradient_approx(&self, wpos: Vec2) -> f32 { self.sim - .and_then(|sim| sim.get_gradient_approx(wpos.map2(TerrainChunkSize::RECT_SIZE, |e, sz| e.div_euclid(sz as i32)))) + .and_then(|sim| { + sim.get_gradient_approx( + wpos.map2(TerrainChunkSize::RECT_SIZE, |e, sz| e.div_euclid(sz as i32)), + ) + }) .unwrap_or(0.0) } diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index 2ee84d558f..64e5d99e58 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -161,7 +161,10 @@ pub fn apply_caves_to(canvas: &mut Canvas, rng: &mut impl Rng) { .mul(45.0) as i32; // Generate stalagtites if there's something for them to hold on to - if canvas.get(Vec3::new(wpos2d.x, wpos2d.y, cave_roof)).is_filled() { + if canvas + .get(Vec3::new(wpos2d.x, wpos2d.y, cave_roof)) + .is_filled() + { for z in cave_roof - stalagtites..cave_roof { canvas.set( Vec3::new(wpos2d.x, wpos2d.y, z), diff --git a/world/src/layer/scatter.rs b/world/src/layer/scatter.rs index 870ba6ad0e..3c3d03ab1b 100644 --- a/world/src/layer/scatter.rs +++ b/world/src/layer/scatter.rs @@ -577,11 +577,15 @@ pub fn apply_scatter_to(canvas: &mut Canvas, rng: &mut impl Rng) { // surface if let Some(solid_end) = (-4..8) .find(|z| { - canvas.get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)).is_solid() + canvas + .get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)) + .is_solid() }) .and_then(|solid_start| { (1..8).map(|z| solid_start + z).find(|z| { - !canvas.get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)).is_solid() + !canvas + .get(Vec3::new(wpos2d.x, wpos2d.y, alt + z)) + .is_solid() }) }) { diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 9198f08bd6..c7b0969d03 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -60,7 +60,14 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { canvas.foreach_col(|canvas, wpos2d, col| { let trees = info.chunks().get_near_trees(wpos2d); - for TreeAttr { pos, seed, scale, forest_kind, inhabited } in trees { + for TreeAttr { + pos, + seed, + scale, + forest_kind, + inhabited, + } in trees + { let tree = if let Some(tree) = tree_cache.entry(pos).or_insert_with(|| { let col = ColumnGen::new(info.chunks()).get((pos, info.index()))?; @@ -127,7 +134,11 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { ForestKind::Giant => { break 'model TreeModel::Procedural( ProceduralTree::generate( - TreeConfig::giant(&mut RandomPerm::new(seed), scale, inhabited), + TreeConfig::giant( + &mut RandomPerm::new(seed), + scale, + inhabited, + ), &mut RandomPerm::new(seed), ), StructureBlock::TemperateLeaves, @@ -184,7 +195,9 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { TreeModel::Structure(s) => s.get(model_pos).ok().copied(), TreeModel::Procedural(t, leaf_block) => Some( match t.is_branch_or_leaves_at(model_pos.map(|e| e as f32 + 0.5)) { - (_, _, true, _) => StructureBlock::Block(BlockKind::Wood, Rgb::new(110, 68, 22)), + (_, _, true, _) => { + StructureBlock::Block(BlockKind::Wood, Rgb::new(110, 68, 22)) + }, (_, _, _, true) => StructureBlock::None, (true, _, _, _) => StructureBlock::Log, (_, true, _, _) => *leaf_block, @@ -204,9 +217,14 @@ pub fn apply_trees_to(canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { ) .map(|block| { // Add lights to the tree - if inhabited && last_block.is_air() && block.kind() == BlockKind::Wood && dynamic_rng.gen_range(0..256) == 0 { + if inhabited + && last_block.is_air() + && block.kind() == BlockKind::Wood + && dynamic_rng.gen_range(0..256) == 0 + { canvas.set(wpos + Vec3::unit_z(), Block::air(SpriteKind::Lantern)); - // Add a snow covering to the block above under certain circumstances + // Add a snow covering to the block above under certain + // circumstances } else if col.snow_cover && ((block.kind() == BlockKind::Leaves && is_leaf_top) || (is_top && block.is_filled())) @@ -423,8 +441,7 @@ impl ProceduralTree { const PHI: f32 = 0.618; const RAD_PER_BRANCH: f32 = f32::consts::TAU * PHI; - let screw = (screw_shift + dist * splits as f32 * RAD_PER_BRANCH).sin() - * x_axis + let screw = (screw_shift + dist * splits as f32 * RAD_PER_BRANCH).sin() * x_axis + (screw_shift + dist * splits as f32 * RAD_PER_BRANCH).cos() * y_axis; // Choose a point close to the branch to act as the target direction for the @@ -488,7 +505,12 @@ impl ProceduralTree { pub fn get_bounds(&self) -> Aabb { self.branches[self.trunk_idx].aabb } // Recursively search for branches or leaves by walking the tree's branch graph. - fn is_branch_or_leaves_at_inner(&self, pos: Vec3, parent: &Branch, branch_idx: usize) -> (bool, bool, bool, bool) { + fn is_branch_or_leaves_at_inner( + &self, + pos: Vec3, + parent: &Branch, + branch_idx: usize, + ) -> (bool, bool, bool, bool) { let branch = &self.branches[branch_idx]; // Always probe the sibling branch, since our AABB doesn't include its bounds // (it's not one of our children) @@ -506,7 +528,8 @@ impl ProceduralTree { let siblings = branch_or_leaves | Vec4::from(this); // Probe the children of this branch - let children = branch.child_idx + let children = branch + .child_idx .map(|idx| Vec4::::from(self.is_branch_or_leaves_at_inner(pos, branch, idx))) .unwrap_or_default(); @@ -521,8 +544,9 @@ impl ProceduralTree { /// position in the tree. #[inline(always)] pub fn is_branch_or_leaves_at(&self, pos: Vec3) -> (bool, bool, bool, bool) { - let (log, leaf, platform, air) = self.is_branch_or_leaves_at_inner(pos, &self.branches[self.trunk_idx], self.trunk_idx); - (log /*& !air*/, leaf & !air, platform & !air, air) + let (log, leaf, platform, air) = + self.is_branch_or_leaves_at_inner(pos, &self.branches[self.trunk_idx], self.trunk_idx); + (log /* & !air */, leaf & !air, platform & !air, air) } } @@ -547,7 +571,11 @@ struct Branch { impl Branch { /// Determine whether there are either branches or leaves at the given /// position in the branch. - pub fn is_branch_or_leaves_at(&self, pos: Vec3, parent: &Branch) -> ((bool, bool, bool, bool), f32) { + pub fn is_branch_or_leaves_at( + &self, + pos: Vec3, + parent: &Branch, + ) -> ((bool, bool, bool, bool), f32) { // fn finvsqrt(x: f32) -> f32 { // let y = f32::from_bits(0x5f375a86 - (x.to_bits() >> 1)); // y * (1.5 - ( x * 0.5 * y * y )) @@ -588,20 +616,32 @@ impl Branch { let stair_thickness = 2.0; let stair_space = 5.0; if self.has_stairs { - let (platform, air) = if pos.z >= self.line.start.z.min(self.line.end.z) - 1.0 && pos.z <= self.line.start.z.max(self.line.end.z) + stair_thickness + stair_space && d2 < (wood_radius + stair_width).powi(2) { + let (platform, air) = if pos.z >= self.line.start.z.min(self.line.end.z) - 1.0 + && pos.z + <= self.line.start.z.max(self.line.end.z) + stair_thickness + stair_space + && d2 < (wood_radius + stair_width).powi(2) + { let rpos = pos.xy() - p; let stretch = 32.0; - let stair_section = ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + pos.z).rem_euclid(stretch); - (stair_section < stair_thickness, stair_section >= stair_thickness && stair_section < stair_thickness + stair_space) // Stairs + let stair_section = + ((rpos.x as f32).atan2(rpos.y as f32) / (f32::consts::PI * 2.0) * stretch + + pos.z) + .rem_euclid(stretch); + ( + stair_section < stair_thickness, + stair_section >= stair_thickness + && stair_section < stair_thickness + stair_space, + ) // Stairs } else { (false, false) }; - let platform = platform || (self.has_stairs - && self.wood_radius > 4.0 - && !air - && d2 < (wood_radius + 10.0).powi(2) - && pos.z % 48.0 < stair_thickness); + let platform = platform + || (self.has_stairs + && self.wood_radius > 4.0 + && !air + && d2 < (wood_radius + 10.0).powi(2) + && pos.z % 48.0 < stair_thickness); (false, false, platform, air) } else { diff --git a/world/src/sim/map.rs b/world/src/sim/map.rs index 7541757361..8ac6747b97 100644 --- a/world/src/sim/map.rs +++ b/world/src/sim/map.rs @@ -166,7 +166,11 @@ pub fn sample_pos( }); let downhill_wpos = downhill.unwrap_or(wpos + TerrainChunkSize::RECT_SIZE.map(|e| e as i32)); - let alt = if is_basement { basement } else { column_rgb_alt.map_or(alt, |(_, alt)| alt) }; + let alt = if is_basement { + basement + } else { + column_rgb_alt.map_or(alt, |(_, alt)| alt) + }; let true_water_alt = (alt.max(water_alt) as f64 - focus.z) / gain as f64; let true_alt = (alt as f64 - focus.z) / gain as f64; diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 258e264f49..39d69b1d81 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -29,22 +29,22 @@ use crate::{ column::ColumnGen, site::Site, util::{ - seed_expan, FastNoise, FastNoise2d, RandomField, RandomPerm, Sampler, StructureGen2d, LOCALITY, - NEIGHBORS, CARDINALS, DHashSet, + seed_expan, DHashSet, FastNoise, FastNoise2d, RandomField, RandomPerm, Sampler, + StructureGen2d, CARDINALS, LOCALITY, NEIGHBORS, }, IndexRef, CONFIG, }; use common::{ assets::{self, AssetExt}, grid::Grid, + lottery::Lottery, + spiral::Spiral2d, store::Id, terrain::{ map::MapConfig, uniform_idx_as_vec2, vec2_as_uniform_idx, BiomeKind, MapSizeLg, TerrainChunkSize, }, vol::RectVolSize, - lottery::Lottery, - spiral::Spiral2d, }; use common_net::msg::WorldMapMsg; use enum_iterator::IntoEnumIterator; @@ -1535,7 +1535,10 @@ impl WorldSim { pos += CARDINALS .iter() .copied() - .max_by_key(|rpos| self.get_gradient_approx(pos + rpos).map_or(0, |g| (g * 1000.0) as i32)) + .max_by_key(|rpos| { + self.get_gradient_approx(pos + rpos) + .map_or(0, |g| (g * 1000.0) as i32) + }) .unwrap(); // Can't fail } else { break; @@ -1563,8 +1566,8 @@ impl WorldSim { // self.get_mut(locs[2].0).unwrap().cliff.0.neighbors |= // 1 << ((to_next_idx as u8 + 4) % 8); - // self.get_mut(locs[1].0).unwrap().cliff.0.offset = Vec2::new(rng.gen_range(-16..17), rng.gen_range(-16..17)); - // } + // self.get_mut(locs[1].0).unwrap().cliff.0.offset = + // Vec2::new(rng.gen_range(-16..17), rng.gen_range(-16..17)); } for cliff in cliffs { let alt = self.get(cliff).map_or(0.0, |c| c.alt); @@ -2076,21 +2079,30 @@ impl WorldSim { let env = Environment { humid: chunk.humidity, temp: chunk.temp, - near_water: if chunk.river.is_lake() || chunk.river.near_river() { 1.0 } else { 0.0 }, + near_water: if chunk.river.is_lake() || chunk.river.near_river() { + 1.0 + } else { + 0.0 + }, }; Some(TreeAttr { pos, seed, scale: 1.0, - forest_kind: *Lottery::from(ForestKind::into_enum_iter() - .enumerate() - .map(|(i, fk)| { - const CLUSTER_SIZE: f64 = 48.0; - let nz = (FastNoise2d::new(i as u32 * 37).get(pos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; - (fk.proclivity(&env) * nz, fk) - }) - .collect::>()) - .choose_seeded(seed), + forest_kind: *Lottery::from( + ForestKind::into_enum_iter() + .enumerate() + .map(|(i, fk)| { + const CLUSTER_SIZE: f64 = 48.0; + let nz = (FastNoise2d::new(i as u32 * 37) + .get(pos.map(|e| e as f64) / CLUSTER_SIZE) + + 1.0) + / 2.0; + (fk.proclivity(&env) * nz, fk) + }) + .collect::>(), + ) + .choose_seeded(seed), inhabited: false, }) }); @@ -2344,7 +2356,11 @@ impl SimChunk { let env = Environment { humid: humidity, temp, - near_water: if river.is_lake() || river.near_river() { 1.0 } else { 0.0 }, + near_water: if river.is_lake() || river.near_river() { + 1.0 + } else { + 0.0 + }, }; ForestKind::into_enum_iter() @@ -2393,7 +2409,5 @@ impl SimChunk { } } - pub fn near_cliffs(&self) -> bool { - self.cliff_height > 0.0 - } + pub fn near_cliffs(&self) -> bool { self.cliff_height > 0.0 } } diff --git a/world/src/site/mod.rs b/world/src/site/mod.rs index a18b4ca1ae..77d6f12428 100644 --- a/world/src/site/mod.rs +++ b/world/src/site/mod.rs @@ -11,12 +11,7 @@ pub use self::{ settlement::Settlement, }; -use crate::{ - column::ColumnSample, - IndexRef, - site2, - Canvas, -}; +use crate::{column::ColumnSample, site2, Canvas, IndexRef}; use common::{ generation::ChunkSupplement, terrain::Block, @@ -118,11 +113,7 @@ impl Site { } } - pub fn apply_to<'a>( - &'a self, - canvas: &mut Canvas, - dynamic_rng: &mut impl Rng, - ) { + pub fn apply_to<'a>(&'a self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { let info = canvas.info(); let get_col = |wpos| info.col(wpos + info.wpos); match &self.kind { diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index 642d83cdce..5431264cf2 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -1,7 +1,7 @@ use super::*; use common::{ - terrain::Block, store::{Id, Store}, + terrain::Block, }; use vek::*; @@ -26,9 +26,11 @@ pub struct Fill { impl Fill { fn contains_at(&self, tree: &Store, prim: Id, pos: Vec3) -> bool { // Custom closure because vek's impl of `contains_point` is inclusive :( - let aabb_contains = |aabb: Aabb, pos: Vec3| (aabb.min.x..aabb.max.x).contains(&pos.x) - && (aabb.min.y..aabb.max.y).contains(&pos.y) - && (aabb.min.z..aabb.max.z).contains(&pos.z); + let aabb_contains = |aabb: Aabb, pos: Vec3| { + (aabb.min.x..aabb.max.x).contains(&pos.x) + && (aabb.min.y..aabb.max.y).contains(&pos.y) + && (aabb.min.z..aabb.max.z).contains(&pos.z) + }; match &tree[prim] { Primitive::Empty => false, @@ -36,15 +38,28 @@ impl Fill { Primitive::Aabb(aabb) => aabb_contains(*aabb, pos), Primitive::Pyramid { aabb, inset } => { let inset = (*inset).max(aabb.size().reduce_min()); - let inner = Aabr { min: aabb.min.xy() - 1 + inset, max: aabb.max.xy() - inset }; - aabb_contains(*aabb, pos) && (inner.projected_point(pos.xy()) - pos.xy()) - .map(|e| e.abs()) - .reduce_max() as f32 / (inset as f32) < 1.0 - ((pos.z - aabb.min.z) as f32 + 0.5) / (aabb.max.z - aabb.min.z) as f32 + let inner = Aabr { + min: aabb.min.xy() - 1 + inset, + max: aabb.max.xy() - inset, + }; + aabb_contains(*aabb, pos) + && (inner.projected_point(pos.xy()) - pos.xy()) + .map(|e| e.abs()) + .reduce_max() as f32 + / (inset as f32) + < 1.0 + - ((pos.z - aabb.min.z) as f32 + 0.5) / (aabb.max.z - aabb.min.z) as f32 }, - Primitive::And(a, b) => self.contains_at(tree, *a, pos) && self.contains_at(tree, *b, pos), - Primitive::Or(a, b) => self.contains_at(tree, *a, pos) || self.contains_at(tree, *b, pos), - Primitive::Xor(a, b) => self.contains_at(tree, *a, pos) ^ self.contains_at(tree, *b, pos), + Primitive::And(a, b) => { + self.contains_at(tree, *a, pos) && self.contains_at(tree, *b, pos) + }, + Primitive::Or(a, b) => { + self.contains_at(tree, *a, pos) || self.contains_at(tree, *b, pos) + }, + Primitive::Xor(a, b) => { + self.contains_at(tree, *a, pos) ^ self.contains_at(tree, *b, pos) + }, } } @@ -65,14 +80,22 @@ impl Fill { Primitive::Empty => return None, Primitive::Aabb(aabb) => *aabb, Primitive::Pyramid { aabb, .. } => *aabb, - Primitive::And(a, b) => or_zip_with(self.get_bounds_inner(tree, *a), self.get_bounds_inner(tree, *b), |a, b| a.intersection(b))?, - Primitive::Or(a, b) | Primitive::Xor(a, b) => - or_zip_with(self.get_bounds_inner(tree, *a), self.get_bounds_inner(tree, *b), |a, b| a.union(b))?, + Primitive::And(a, b) => or_zip_with( + self.get_bounds_inner(tree, *a), + self.get_bounds_inner(tree, *b), + |a, b| a.intersection(b), + )?, + Primitive::Or(a, b) | Primitive::Xor(a, b) => or_zip_with( + self.get_bounds_inner(tree, *a), + self.get_bounds_inner(tree, *b), + |a, b| a.union(b), + )?, }) } pub fn get_bounds(&self, tree: &Store) -> Aabb { - self.get_bounds_inner(tree, self.prim).unwrap_or_else(|| Aabb::new_empty(Vec3::zero())) + self.get_bounds_inner(tree, self.prim) + .unwrap_or_else(|| Aabb::new_empty(Vec3::zero())) } } @@ -82,7 +105,8 @@ pub trait Structure { site: &Site, prim: F, fill: G, - ) {} + ) { + } // Generate a primitive tree and fills for this structure fn render_collect(&self, site: &Site) -> (Store, Vec) { diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index f8a3a6855c..e8f5d333dd 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -3,38 +3,37 @@ mod plot; mod tile; use self::{ + gen::{Fill, Primitive, Structure}, plot::{Plot, PlotKind}, - tile::{TileGrid, Tile, TileKind, HazardKind, TILE_SIZE}, - gen::{Primitive, Fill, Structure}, + tile::{HazardKind, Tile, TileGrid, TileKind, TILE_SIZE}, }; use crate::{ site::SpawnRules, - util::{Grid, attempt, DHashSet, CARDINALS, SQUARE_4, SQUARE_9, LOCALITY}, - Canvas, - Land, + util::{attempt, DHashSet, Grid, CARDINALS, LOCALITY, SQUARE_4, SQUARE_9}, + Canvas, Land, }; use common::{ - terrain::{Block, BlockKind, SpriteKind, TerrainChunkSize}, - vol::RectVolSize, - store::{Id, Store}, astar::Astar, lottery::Lottery, spiral::Spiral2d, + store::{Id, Store}, + terrain::{Block, BlockKind, SpriteKind, TerrainChunkSize}, + vol::RectVolSize, }; use hashbrown::hash_map::DefaultHashBuilder; use rand::prelude::*; use rand_chacha::ChaChaRng; -use vek::*; use std::ops::Range; +use vek::*; -/// Seed a new RNG from an old RNG, thereby making the old RNG indepedent of changing use of the new RNG. The practical -/// effect of this is to reduce the extent to which changes to child generation algorithm produce a 'butterfly effect' -/// on their parent generators, meaning that generators will be less likely to produce entirely different outcomes if -/// some detail of a generation algorithm changes slightly. This is generally good and makes worldgen code easier to -/// maintain and less liable to breaking changes. -fn reseed(rng: &mut impl Rng) -> impl Rng { - ChaChaRng::from_seed(rng.gen::<[u8; 32]>()) -} +/// Seed a new RNG from an old RNG, thereby making the old RNG indepedent of +/// changing use of the new RNG. The practical effect of this is to reduce the +/// extent to which changes to child generation algorithm produce a 'butterfly +/// effect' on their parent generators, meaning that generators will be less +/// likely to produce entirely different outcomes if some detail of a generation +/// algorithm changes slightly. This is generally good and makes worldgen code +/// easier to maintain and less liable to breaking changes. +fn reseed(rng: &mut impl Rng) -> impl Rng { ChaChaRng::from_seed(rng.gen::<[u8; 32]>()) } #[derive(Default)] pub struct Site { @@ -47,15 +46,23 @@ pub struct Site { impl Site { pub fn radius(&self) -> f32 { - ((self.tiles.bounds.min.map(|e| e.abs()).reduce_max() - .max(self.tiles.bounds.max.map(|e| e.abs()).reduce_max()) + 1) * tile::TILE_SIZE as i32) as f32 + ((self + .tiles + .bounds + .min + .map(|e| e.abs()) + .reduce_max() + .max(self.tiles.bounds.max.map(|e| e.abs()).reduce_max()) + + 1) + * tile::TILE_SIZE as i32) as f32 } pub fn spawn_rules(&self, wpos: Vec2) -> SpawnRules { SpawnRules { - trees: SQUARE_9 - .iter() - .all(|&rpos| self.wpos_tile(wpos + rpos * tile::TILE_SIZE as i32).is_empty()), + trees: SQUARE_9.iter().all(|&rpos| { + self.wpos_tile(wpos + rpos * tile::TILE_SIZE as i32) + .is_empty() + }), ..SpawnRules::default() } } @@ -82,7 +89,14 @@ impl Site { } } - pub fn create_road(&mut self, land: &Land, rng: &mut impl Rng, a: Vec2, b: Vec2, w: u16) -> Option> { + pub fn create_road( + &mut self, + land: &Land, + rng: &mut impl Rng, + a: Vec2, + b: Vec2, + w: u16, + ) -> Option> { const MAX_ITERS: usize = 4096; let range = -(w as i32) / 2..w as i32 - w as i32 / 2; let heuristic = |tile: &Vec2| { @@ -95,17 +109,22 @@ impl Site { } (tile.distance_squared(b) as f32).sqrt() }; - let path = Astar::new(MAX_ITERS, a, &heuristic, DefaultHashBuilder::default()).poll( - MAX_ITERS, - &heuristic, - |tile| { let tile = *tile; CARDINALS.iter().map(move |dir| tile + *dir) }, - |a, b| { - let alt_a = land.get_alt_approx(self.tile_center_wpos(*a)); - let alt_b = land.get_alt_approx(self.tile_center_wpos(*b)); - (alt_a - alt_b).abs() / TILE_SIZE as f32 - }, - |tile| *tile == b, - ).into_path()?; + let path = Astar::new(MAX_ITERS, a, &heuristic, DefaultHashBuilder::default()) + .poll( + MAX_ITERS, + &heuristic, + |tile| { + let tile = *tile; + CARDINALS.iter().map(move |dir| tile + *dir) + }, + |a, b| { + let alt_a = land.get_alt_approx(self.tile_center_wpos(*a)); + let alt_b = land.get_alt_approx(self.tile_center_wpos(*b)); + (alt_a - alt_b).abs() / TILE_SIZE as f32 + }, + |tile| *tile == b, + ) + .into_path()?; let plot = self.create_plot(Plot { kind: PlotKind::Road(path.clone()), @@ -134,24 +153,41 @@ impl Site { Some(plot) } - pub fn find_aabr(&mut self, search_pos: Vec2, area_range: Range, min_dims: Extent2) -> Option<(Aabr, Vec2)> { - self.tiles.find_near( - search_pos, - |center, _| self.tiles.grow_aabr(center, area_range.clone(), min_dims) + pub fn find_aabr( + &mut self, + search_pos: Vec2, + area_range: Range, + min_dims: Extent2, + ) -> Option<(Aabr, Vec2)> { + self.tiles.find_near(search_pos, |center, _| { + self.tiles + .grow_aabr(center, area_range.clone(), min_dims) .ok() .filter(|aabr| { - (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.min.y - 1)).is_road()) - || (aabr.min.x..aabr.max.x).any(|x| self.tiles.get(Vec2::new(x, aabr.max.y)).is_road()) - || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.min.x - 1, y)).is_road()) - || (aabr.min.y..aabr.max.y).any(|y| self.tiles.get(Vec2::new(aabr.max.x, y)).is_road()) - }), - ) + (aabr.min.x..aabr.max.x) + .any(|x| self.tiles.get(Vec2::new(x, aabr.min.y - 1)).is_road()) + || (aabr.min.x..aabr.max.x) + .any(|x| self.tiles.get(Vec2::new(x, aabr.max.y)).is_road()) + || (aabr.min.y..aabr.max.y) + .any(|y| self.tiles.get(Vec2::new(aabr.min.x - 1, y)).is_road()) + || (aabr.min.y..aabr.max.y) + .any(|y| self.tiles.get(Vec2::new(aabr.max.x, y)).is_road()) + }) + }) } - pub fn find_roadside_aabr(&mut self, rng: &mut impl Rng, area_range: Range, min_dims: Extent2) -> Option<(Aabr, Vec2)> { - let dir = Vec2::::zero().map(|_| rng.gen_range(-1.0..1.0)).normalized(); + pub fn find_roadside_aabr( + &mut self, + rng: &mut impl Rng, + area_range: Range, + min_dims: Extent2, + ) -> Option<(Aabr, Vec2)> { + let dir = Vec2::::zero() + .map(|_| rng.gen_range(-1.0..1.0)) + .normalized(); let search_pos = if rng.gen() { - self.plot(*self.plazas.choose(rng)?).root_tile + (dir * 4.0).map(|e: f32| e.round() as i32) + self.plot(*self.plazas.choose(rng)?).root_tile + + (dir * 4.0).map(|e: f32| e.round() as i32) } else { if let PlotKind::Road(path) = &self.plot(*self.roads.choose(rng)?).kind { *path.nodes().choose(rng)? + (dir * 1.0).map(|e: f32| e.round() as i32) @@ -167,17 +203,27 @@ impl Site { let pos = attempt(32, || { self.plazas .choose(rng) - .map(|&p| self.plot(p).root_tile + (Vec2::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0)).normalized() * 24.0).map(|e| e as i32)) + .map(|&p| { + self.plot(p).root_tile + + (Vec2::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0)) + .normalized() + * 24.0) + .map(|e| e as i32) + }) .filter(|tile| !self.tiles.get(*tile).is_obstacle()) - .filter(|&tile| self - .plazas - .iter() - .all(|&p| self.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2)) - && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max()) + .filter(|&tile| { + self.plazas + .iter() + .all(|&p| self.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2)) + && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max() + }) }) - .unwrap_or_else(Vec2::zero); + .unwrap_or_else(Vec2::zero); - let aabr = Aabr { min: pos + Vec2::broadcast(-3), max: pos + Vec2::broadcast(4) }; + let aabr = Aabr { + min: pos + Vec2::broadcast(-3), + max: pos + Vec2::broadcast(4), + }; let plaza = self.create_plot(Plot { kind: PlotKind::Plaza, root_tile: pos, @@ -193,7 +239,8 @@ impl Site { let mut already_pathed = vec![plaza]; // One major, one minor road for width in (1..=2).rev() { - if let Some(&p) = self.plazas + if let Some(&p) = self + .plazas .iter() .filter(|p| !already_pathed.contains(p)) .min_by_key(|&&p| self.plot(p).root_tile.distance_squared(pos)) @@ -217,7 +264,9 @@ impl Site { if let Some(kind) = wpos_is_hazard(land, self.tile_wpos(tile)) { for &rpos in &SQUARE_4 { // `get_mut` doesn't increase generation bounds - self.tiles.get_mut(tile - rpos - 1).map(|tile| tile.kind = TileKind::Hazard(kind)); + self.tiles + .get_mut(tile - rpos - 1) + .map(|tile| tile.kind = TileKind::Hazard(kind)); } } }); @@ -235,12 +284,7 @@ impl Site { site.make_plaza(land, &mut rng); - let build_chance = Lottery::from(vec![ - (64.0, 1), - (5.0, 2), - (20.0, 3), - (0.75, 4), - ]); + let build_chance = Lottery::from(vec![(64.0, 1), (5.0, 2), (20.0, 3), (0.75, 4)]); let mut castles = 0; @@ -249,9 +293,21 @@ impl Site { // House 1 => { let size = (2.0 + rng.gen::().powf(8.0) * 3.0).round() as u32; - if let Some((aabr, door_tile)) = attempt(32, || site.find_roadside_aabr(&mut rng, 4..(size + 1).pow(2), Extent2::broadcast(size))) { + if let Some((aabr, door_tile)) = attempt(32, || { + site.find_roadside_aabr( + &mut rng, + 4..(size + 1).pow(2), + Extent2::broadcast(size), + ) + }) { let plot = site.create_plot(Plot { - kind: PlotKind::House(plot::House::generate(land, &mut reseed(&mut rng), &site, door_tile, aabr)), + kind: PlotKind::House(plot::House::generate( + land, + &mut reseed(&mut rng), + &site, + door_tile, + aabr, + )), root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), @@ -267,7 +323,9 @@ impl Site { }, // Guard tower 2 => { - if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(&mut rng, 4..4, Extent2::new(2, 2))) { + if let Some((aabr, _)) = attempt(10, || { + site.find_roadside_aabr(&mut rng, 4..4, Extent2::new(2, 2)) + }) { let plot = site.create_plot(Plot { kind: PlotKind::Castle, root_tile: aabr.center(), @@ -285,28 +343,26 @@ impl Site { 3 => { attempt(10, || { let search_pos = attempt(16, || { - let tile = (Vec2::new( - rng.gen_range(-1.0..1.0), - rng.gen_range(-1.0..1.0), - ).normalized() * rng.gen_range(16.0..48.0)).map(|e| e as i32); + let tile = + (Vec2::new(rng.gen_range(-1.0..1.0), rng.gen_range(-1.0..1.0)) + .normalized() + * rng.gen_range(16.0..48.0)) + .map(|e| e as i32); - if site - .plazas - .iter() - .all(|&p| site.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2)) - && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max() + if site.plazas.iter().all(|&p| { + site.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2) + }) && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max() { Some(tile) } else { None } }) - .unwrap_or_else(Vec2::zero); + .unwrap_or_else(Vec2::zero); - site.tiles.find_near( - search_pos, - |center, _| site.tiles.grow_organic(&mut rng, center, 12..64).ok() - ) + site.tiles.find_near(search_pos, |center, _| { + site.tiles.grow_organic(&mut rng, center, 12..64).ok() + }) }) .map(|(tiles, _)| { for tile in tiles { @@ -319,7 +375,9 @@ impl Site { }, // Castle 4 if castles < 1 => { - if let Some((aabr, _)) = attempt(10, || site.find_roadside_aabr(&mut rng, 16 * 16..18 * 18, Extent2::new(16, 16))) { + if let Some((aabr, _)) = attempt(10, || { + site.find_roadside_aabr(&mut rng, 16 * 16..18 * 18, Extent2::new(16, 16)) + }) { let plot = site.create_plot(Plot { kind: PlotKind::Castle, root_tile: aabr.center(), @@ -337,22 +395,38 @@ impl Site { kind: TileKind::Castle, plot: Some(plot), }; - site.tiles.set(Vec2::new(aabr.min.x, aabr.min.y), tower.clone()); - site.tiles.set(Vec2::new(aabr.max.x - 1, aabr.min.y), tower.clone()); - site.tiles.set(Vec2::new(aabr.min.x, aabr.max.y - 1), tower.clone()); - site.tiles.set(Vec2::new(aabr.max.x - 1, aabr.max.y - 1), tower.clone()); + site.tiles + .set(Vec2::new(aabr.min.x, aabr.min.y), tower.clone()); + site.tiles + .set(Vec2::new(aabr.max.x - 1, aabr.min.y), tower.clone()); + site.tiles + .set(Vec2::new(aabr.min.x, aabr.max.y - 1), tower.clone()); + site.tiles + .set(Vec2::new(aabr.max.x - 1, aabr.max.y - 1), tower.clone()); // Courtyard - site.blit_aabr(Aabr { min: aabr.min + 1, max: aabr.max - 1 } , Tile { - kind: TileKind::Road { a: 0, b: 0, w: 0 }, - plot: Some(plot), - }); + site.blit_aabr( + Aabr { + min: aabr.min + 1, + max: aabr.max - 1, + }, + Tile { + kind: TileKind::Road { a: 0, b: 0, w: 0 }, + plot: Some(plot), + }, + ); // Keep - site.blit_aabr(Aabr { min: aabr.center() - 3, max: aabr.center() + 3 }, Tile { - kind: TileKind::Castle, - plot: Some(plot), - }); + site.blit_aabr( + Aabr { + min: aabr.center() - 3, + max: aabr.center() + 3, + }, + Tile { + kind: TileKind::Castle, + plot: Some(plot), + }, + ); castles += 1; } @@ -384,7 +458,12 @@ impl Site { let tile = self.tiles.get(tpos); let twpos = self.tile_wpos(tpos); let border = TILE_SIZE as i32; - let cols = (-border..TILE_SIZE as i32 + border).map(|y| (-border..TILE_SIZE as i32 + border).map(move |x| (twpos + Vec2::new(x, y), Vec2::new(x, y)))).flatten(); + let cols = (-border..TILE_SIZE as i32 + border) + .map(|y| { + (-border..TILE_SIZE as i32 + border) + .map(move |x| (twpos + Vec2::new(x, y), Vec2::new(x, y))) + }) + .flatten(); match &tile.kind { TileKind::Empty | TileKind::Hazard(_) => {}, @@ -418,15 +497,16 @@ impl Site { // // .filter_map(|line| Some(line?.projected_point(wpos2df))) // // .min_by_key(|p| p.distance_squared(wpos2df) as i32); - // // let is_near_road = nearest_road.map_or(false, |r| r.distance_squared(wpos2df) < 3.0f32.powi(2)); + // // let is_near_road = nearest_road.map_or(false, |r| + // r.distance_squared(wpos2df) < 3.0f32.powi(2)); // // if let Some(nearest_road) = nearest_road // // .filter(|r| r.distance_squared(wpos2df) < 6.0f32.powi(2)) // // { - // // let road_alt = canvas.col(nearest_road.map(|e| e.floor() as i32)).map_or(0, |col| col.alt as i32); - // // (-4..5).for_each(|z| canvas.map( - // // Vec3::new(wpos2d.x, wpos2d.y, road_alt + z), - // // |b| if z > 0 { + // // let road_alt = canvas.col(nearest_road.map(|e| e.floor() as + // i32)).map_or(0, |col| col.alt as i32); // + // (-4..5).for_each(|z| canvas.map( // Vec3::new(wpos2d.x, + // wpos2d.y, road_alt + z), // |b| if z > 0 { // // Block::air(SpriteKind::Empty) // // } else { // // Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)) @@ -562,7 +642,9 @@ impl Site { let tile_aabr = Aabr { min: self.wpos_tile_pos(canvas.wpos()) - 1, - max: self.wpos_tile_pos(canvas.wpos() + TerrainChunkSize::RECT_SIZE.map(|e| e as i32) + 2) + 3, // Round up, uninclusive, border + max: self + .wpos_tile_pos(canvas.wpos() + TerrainChunkSize::RECT_SIZE.map(|e| e as i32) + 2) + + 3, // Round up, uninclusive, border }; // Don't double-generate the same plot per chunk! @@ -621,10 +703,9 @@ fn wpos_is_hazard(land: &Land, wpos: Vec2) -> Option { } } -pub fn aabr_tiles(aabr: Aabr) -> impl Iterator> { +pub fn aabr_tiles(aabr: Aabr) -> impl Iterator> { (0..aabr.size().h) - .map(move |y| (0..aabr.size().w) - .map(move |x| aabr.min + Vec2::new(x, y))) + .map(move |y| (0..aabr.size().w).map(move |x| aabr.min + Vec2::new(x, y))) .flatten() } diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index cb50abbc19..d2af39b252 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -1,8 +1,6 @@ mod house; -pub use self::{ - house::House, -}; +pub use self::house::House; use super::*; use crate::util::DHashSet; diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 8a6455db34..bbba4c149f 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -80,16 +80,22 @@ impl Structure for House { let mut pillars_y = prim(Primitive::Empty); for x in self.tile_aabr.min.x..self.tile_aabr.max.x + 2 { let pillar = prim(Primitive::Aabb(Aabb { - min: site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)).with_z(self.alt), - max: (site.tile_wpos(Vec2::new(x, self.tile_aabr.max.y + 1)) + Vec2::unit_x()).with_z(self.alt + roof), + min: site + .tile_wpos(Vec2::new(x, self.tile_aabr.min.y)) + .with_z(self.alt), + max: (site.tile_wpos(Vec2::new(x, self.tile_aabr.max.y + 1)) + Vec2::unit_x()) + .with_z(self.alt + roof), })); pillars_y = prim(Primitive::Or(pillars_y, pillar)); } let mut pillars_x = prim(Primitive::Empty); for y in self.tile_aabr.min.y..self.tile_aabr.max.y + 2 { let pillar = prim(Primitive::Aabb(Aabb { - min: site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)).with_z(self.alt), - max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x + 1, y)) + Vec2::unit_y()).with_z(self.alt + roof), + min: site + .tile_wpos(Vec2::new(self.tile_aabr.min.x, y)) + .with_z(self.alt), + max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x + 1, y)) + Vec2::unit_y()) + .with_z(self.alt + roof), })); pillars_x = prim(Primitive::Or(pillars_x, pillar)); } @@ -109,8 +115,12 @@ impl Structure for House { let mut windows = prim(Primitive::Empty); for y in self.tile_aabr.min.y..self.tile_aabr.max.y { let window = prim(Primitive::Aabb(Aabb { - min: (site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)) + Vec2::unit_y() * 2).with_z(self.alt + height + 2), - max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y + 1)) + Vec2::new(1, -1)).with_z(self.alt + height + 2 + window_height), + min: (site.tile_wpos(Vec2::new(self.tile_aabr.min.x, y)) + + Vec2::unit_y() * 2) + .with_z(self.alt + height + 2), + max: (site.tile_wpos(Vec2::new(self.tile_aabr.max.x, y + 1)) + + Vec2::new(1, -1)) + .with_z(self.alt + height + 2 + window_height), })); windows = prim(Primitive::Or(windows, window)); } @@ -124,8 +134,12 @@ impl Structure for House { let mut windows = prim(Primitive::Empty); for x in self.tile_aabr.min.x..self.tile_aabr.max.x { let window = prim(Primitive::Aabb(Aabb { - min: (site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)) + Vec2::unit_x() * 2).with_z(self.alt + height + 2), - max: (site.tile_wpos(Vec2::new(x + 1, self.tile_aabr.max.y)) + Vec2::new(-1, 1)).with_z(self.alt + height + 2 + window_height), + min: (site.tile_wpos(Vec2::new(x, self.tile_aabr.min.y)) + + Vec2::unit_x() * 2) + .with_z(self.alt + height + 2), + max: (site.tile_wpos(Vec2::new(x + 1, self.tile_aabr.max.y)) + + Vec2::new(-1, 1)) + .with_z(self.alt + height + 2 + window_height), })); windows = prim(Primitive::Or(windows, window)); } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index f80fac3bec..ea9f0b0f70 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -41,13 +41,15 @@ impl TileGrid { // WILL NOT EXPAND BOUNDS! pub fn get_mut(&mut self, tpos: Vec2) -> Option<&mut Tile> { let tpos = tpos + TILE_RADIUS as i32; - self.zones.get_mut(tpos.map(|e| e.div_euclid(ZONE_SIZE as i32))).and_then(|zone| { - zone.get_or_insert_with(|| { - Grid::populate_from(Vec2::broadcast(ZONE_SIZE as i32), |_| None) + self.zones + .get_mut(tpos.map(|e| e.div_euclid(ZONE_SIZE as i32))) + .and_then(|zone| { + zone.get_or_insert_with(|| { + Grid::populate_from(Vec2::broadcast(ZONE_SIZE as i32), |_| None) + }) + .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) + .map(|tile| tile.get_or_insert_with(|| Tile::empty())) }) - .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) - .map(|tile| tile.get_or_insert_with(|| Tile::empty())) - }) } pub fn set(&mut self, tpos: Vec2, tile: Tile) -> Option { @@ -55,7 +57,11 @@ impl TileGrid { self.get_mut(tpos).map(|t| std::mem::replace(t, tile)) } - pub fn find_near(&self, tpos: Vec2, mut f: impl FnMut(Vec2, &Tile) -> Option) -> Option<(R, Vec2)> { + pub fn find_near( + &self, + tpos: Vec2, + mut f: impl FnMut(Vec2, &Tile) -> Option, + ) -> Option<(R, Vec2)> { const MAX_SEARCH_RADIUS_BLOCKS: u32 = 70; const MAX_SEARCH_CELLS: u32 = ((MAX_SEARCH_RADIUS_BLOCKS / TILE_SIZE) * 2 + 1).pow(2); Spiral2d::new() @@ -64,8 +70,16 @@ impl TileGrid { .find_map(|tpos| (&mut f)(tpos, self.get(tpos)).zip(Some(tpos))) } - pub fn grow_aabr(&self, center: Vec2, area_range: Range, min_dims: Extent2) -> Result, Aabr> { - let mut aabr = Aabr { min: center, max: center + 1 }; + pub fn grow_aabr( + &self, + center: Vec2, + area_range: Range, + min_dims: Extent2, + ) -> Result, Aabr> { + let mut aabr = Aabr { + min: center, + max: center + 1, + }; if !self.get(center).is_empty() { return Err(aabr); @@ -75,27 +89,42 @@ impl TileGrid { for i in 0..32 { if i - last_growth >= 4 { break; - } else if aabr.size().product() + if i % 2 == 0 { aabr.size().h } else { aabr.size().w } > area_range.end as i32 { + } else if aabr.size().product() + + if i % 2 == 0 { + aabr.size().h + } else { + aabr.size().w + } + > area_range.end as i32 + { break; } else { // `center.sum()` to avoid biasing certain directions match (i + center.sum().abs()) % 4 { - 0 if (aabr.min.y..aabr.max.y + 1).all(|y| self.get(Vec2::new(aabr.max.x, y)).is_empty()) => { + 0 if (aabr.min.y..aabr.max.y + 1) + .all(|y| self.get(Vec2::new(aabr.max.x, y)).is_empty()) => + { aabr.max.x += 1; last_growth = i; - }, - 1 if (aabr.min.x..aabr.max.x + 1).all(|x| self.get(Vec2::new(x, aabr.max.y)).is_empty()) => { + } + 1 if (aabr.min.x..aabr.max.x + 1) + .all(|x| self.get(Vec2::new(x, aabr.max.y)).is_empty()) => + { aabr.max.y += 1; last_growth = i; - }, - 2 if (aabr.min.y..aabr.max.y + 1).all(|y| self.get(Vec2::new(aabr.min.x - 1, y)).is_empty()) => { + } + 2 if (aabr.min.y..aabr.max.y + 1) + .all(|y| self.get(Vec2::new(aabr.min.x - 1, y)).is_empty()) => + { aabr.min.x -= 1; last_growth = i; - }, - 3 if (aabr.min.x..aabr.max.x + 1).all(|x| self.get(Vec2::new(x, aabr.min.y - 1)).is_empty()) => { + } + 3 if (aabr.min.x..aabr.max.x + 1) + .all(|x| self.get(Vec2::new(x, aabr.min.y - 1)).is_empty()) => + { aabr.min.y -= 1; last_growth = i; - }, + } _ => {}, } } @@ -111,7 +140,12 @@ impl TileGrid { } } - pub fn grow_organic(&self, rng: &mut impl Rng, center: Vec2, area_range: Range) -> Result>, DHashSet>> { + pub fn grow_organic( + &self, + rng: &mut impl Rng, + center: Vec2, + area_range: Range, + ) -> Result>, DHashSet>> { let mut tiles = DHashSet::default(); let mut open = Vec::new(); @@ -165,26 +199,16 @@ impl Tile { } /// Create a tile that is not associated with any plot. - pub const fn free(kind: TileKind) -> Self { - Self { - kind, - plot: None, - } - } + pub const fn free(kind: TileKind) -> Self { Self { kind, plot: None } } pub fn is_empty(&self) -> bool { self.kind == TileKind::Empty } - pub fn is_road(&self) -> bool { - matches!(self.kind, TileKind::Road { .. }) - } + pub fn is_road(&self) -> bool { matches!(self.kind, TileKind::Road { .. }) } pub fn is_obstacle(&self) -> bool { matches!( self.kind, - TileKind::Hazard(_) - | TileKind::Building - | TileKind::Castle - | TileKind::Wall + TileKind::Hazard(_) | TileKind::Building | TileKind::Castle | TileKind::Wall ) } } diff --git a/world/src/util/math.rs b/world/src/util/math.rs index 857dd8c018..56f91d795a 100644 --- a/world/src/util/math.rs +++ b/world/src/util/math.rs @@ -1,9 +1,10 @@ use std::ops::Range; use vek::*; -/// Return a value between 0 and 1 corresponding to how close to the centre of `range` `x` is. -/// The exact function used is left unspecified, but it shall have the shape of a bell-like curve. -/// This function is required to return `0` (or a value extremely close to `0`) when `x` is outside of `range`. +/// Return a value between 0 and 1 corresponding to how close to the centre of +/// `range` `x` is. The exact function used is left unspecified, but it shall +/// have the shape of a bell-like curve. This function is required to return `0` +/// (or a value extremely close to `0`) when `x` is outside of `range`. pub fn close(x: f32, range: Range) -> f32 { let mean = (range.start + range.end) / 2.0; let width = (range.end - range.start) / 2.0; diff --git a/world/src/util/mod.rs b/world/src/util/mod.rs index 60868f52c3..0a22405bcd 100644 --- a/world/src/util/mod.rs +++ b/world/src/util/mod.rs @@ -1,6 +1,6 @@ pub mod fast_noise; -pub mod math; pub mod map_vec; +pub mod math; pub mod random; pub mod sampler; pub mod seed_expan; From a56866952677e88f5281387aa2b4feb80a5f4892 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 5 Mar 2021 01:52:19 +0000 Subject: [PATCH 71/87] Fixed plazas, buggy willow trees --- world/src/sim/mod.rs | 6 +- world/src/site2/mod.rs | 160 +++++++++++++++------------------------- world/src/site2/tile.rs | 1 + 3 files changed, 63 insertions(+), 104 deletions(-) diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 39d69b1d81..b6733e7dd5 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2098,11 +2098,13 @@ impl WorldSim { .get(pos.map(|e| e as f64) / CLUSTER_SIZE) + 1.0) / 2.0; - (fk.proclivity(&env) * nz, fk) + (fk.proclivity(&env) * nz, Some(fk)) }) + .chain(std::iter::once((0.001, None))) .collect::>(), ) - .choose_seeded(seed), + .choose_seeded(seed) + .as_ref()?, inhabited: false, }) }); diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index e8f5d333dd..2526627fa4 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -138,14 +138,17 @@ impl Site { for (i, &tile) in path.iter().enumerate() { for y in range.clone() { for x in range.clone() { - self.tiles.set(tile + Vec2::new(x, y), Tile { - kind: TileKind::Road { - a: i.saturating_sub(1) as u16, - b: (i + 1).min(path.len() - 1) as u16, - w, - }, - plot: Some(plot), - }); + let tile = tile + Vec2::new(x, y); + if self.tiles.get(tile).is_empty() { + self.tiles.set(tile, Tile { + kind: TileKind::Road { + a: i.saturating_sub(1) as u16, + b: (i + 1).min(path.len() - 1) as u16, + w, + }, + plot: Some(plot), + }); + } } } } @@ -232,7 +235,7 @@ impl Site { }); self.plazas.push(plaza); self.blit_aabr(aabr, Tile { - kind: TileKind::Road { a: 0, b: 0, w: 0 }, + kind: TileKind::Plaza, plot: Some(plaza), }); @@ -466,85 +469,42 @@ impl Site { .flatten(); match &tile.kind { - TileKind::Empty | TileKind::Hazard(_) => {}, - // TileKind::Road => { - // let near_roads = CARDINALS - // .map(|rpos| if self.tiles.get(tpos + rpos) == tile { - // Some(LineSegment2 { - // start: self.tile_center_wpos(tpos).map(|e| e as f32), - // end: self.tile_center_wpos(tpos + rpos).map(|e| e as f32), - // }) - // } else { - // None - // }); + TileKind::Plaza => { + let near_roads = CARDINALS + .iter() + .filter_map(|rpos| if self.tiles.get(tpos + rpos) == tile { + Some(Aabr { + min: self.tile_wpos(tpos).map(|e| e as f32), + max: self.tile_wpos(tpos + 1).map(|e| e as f32), + }) + } else { + None + }); - // let near_roads = CARDINALS - // .iter() - // .filter_map(|rpos| if self.tiles.get(tpos + rpos) == tile { - // Some(Aabr { - // min: self.tile_wpos(tpos).map(|e| e as f32), - // max: self.tile_wpos(tpos + 1).map(|e| e as f32), - // }) - // } else { - // None - // }); + cols.for_each(|(wpos2d, offs)| { + let wpos2df = wpos2d.map(|e| e as f32); + let dist = near_roads + .clone() + .map(|aabr| aabr.distance_to_point(wpos2df)) + .min_by_key(|d| (*d * 100.0) as i32); - // // cols.for_each(|(wpos2d, offs)| { - // // let wpos2df = wpos2d.map(|e| e as f32); - // // let nearest_road = near_roads - // // .iter() - // // .copied() - // // .filter_map(|line| Some(line?.projected_point(wpos2df))) - // // .min_by_key(|p| p.distance_squared(wpos2df) as i32); - - // // let is_near_road = nearest_road.map_or(false, |r| - // r.distance_squared(wpos2df) < 3.0f32.powi(2)); - - // // if let Some(nearest_road) = nearest_road - // // .filter(|r| r.distance_squared(wpos2df) < 6.0f32.powi(2)) - // // { - // // let road_alt = canvas.col(nearest_road.map(|e| e.floor() as - // i32)).map_or(0, |col| col.alt as i32); // - // (-4..5).for_each(|z| canvas.map( // Vec3::new(wpos2d.x, - // wpos2d.y, road_alt + z), // |b| if z > 0 { - // // Block::air(SpriteKind::Empty) - // // } else { - // // Block::new(BlockKind::Rock, Rgb::new(55, 45, 65)) - // // }, - // // )); - // // } - // // }); - - // cols.for_each(|(wpos2d, offs)| { - // let wpos2df = wpos2d.map(|e| e as f32); - - // let dist = near_roads - // .clone() - // .map(|aabr| aabr.distance_to_point(wpos2df).powi(2)) - // .sum::() - // .sqrt(); - - // if dist < 4.0 { - // let mut z = canvas.col(wpos2d).map_or(0, |col| col.alt as i32) + 8; - // for _ in 0..16 { - // let pos = Vec3::new(wpos2d.x, wpos2d.y, z); - // z -= 1; - // if !canvas.get(pos).is_filled() { - // canvas.map(pos, |b| b.with_sprite(SpriteKind::Empty)); - // } else { - // canvas.set(pos, Block::empty()); - // break; - // } - // } - - // for _ in 0..2 { - // let pos = Vec3::new(wpos2d.x, wpos2d.y, z); - // z -= 1; - // canvas.set(pos, Block::new(BlockKind::Rock, Rgb::new(55, 45, 50))); - // } - // } - // }); - // }, + if dist.map_or(false, |d| d <= 3.0) { + let alt = canvas.col(wpos2d).map_or(0, |col| col.alt as i32); + (-8..6).for_each(|z| canvas.map( + Vec3::new(wpos2d.x, wpos2d.y, alt + z), + |b| if z >= 0 { + if b.is_filled() { + Block::empty() + } else { + b.with_sprite(SpriteKind::Empty) + } + } else { + Block::new(BlockKind::Rock, Rgb::new(55, 45, 50)) + }, + )); + } + }); + }, _ => {}, } } @@ -577,23 +537,19 @@ impl Site { .min_by_key(|d| (*d * 100.0) as i32); if dist.map_or(false, |d| d <= 0.75) { - let mut z = canvas.col(wpos2d).map_or(0, |col| col.alt as i32) + 8; - for _ in 0..16 { - let pos = Vec3::new(wpos2d.x, wpos2d.y, z); - z -= 1; - if !canvas.get(pos).is_filled() { - canvas.map(pos, |b| b.with_sprite(SpriteKind::Empty)); + let alt = canvas.col(wpos2d).map_or(0, |col| col.alt as i32); + (-6..4).for_each(|z| canvas.map( + Vec3::new(wpos2d.x, wpos2d.y, alt + z), + |b| if z >= 0 { + if b.is_filled() { + Block::empty() + } else { + b.with_sprite(SpriteKind::Empty) + } } else { - canvas.set(pos, Block::empty()); - break; - } - } - - for _ in 0..2 { - let pos = Vec3::new(wpos2d.x, wpos2d.y, z); - z -= 1; - canvas.set(pos, Block::new(BlockKind::Rock, Rgb::new(55, 45, 50))); - } + Block::new(BlockKind::Rock, Rgb::new(55, 45, 50)) + }, + )); } let tile = self.wpos_tile(wpos2d); diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index ea9f0b0f70..5587c97048 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -178,6 +178,7 @@ pub enum TileKind { Empty, Hazard(HazardKind), Field, + Plaza, Road { a: u16, b: u16, w: u16 }, Building, Castle, From e65e3b52f46e523062b30c7e0a5df9b9aa2bb110 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 5 Mar 2021 02:01:34 +0000 Subject: [PATCH 72/87] Fewer fields --- world/src/site2/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 2526627fa4..b1997708f2 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -287,7 +287,7 @@ impl Site { site.make_plaza(land, &mut rng); - let build_chance = Lottery::from(vec![(64.0, 1), (5.0, 2), (20.0, 3), (0.75, 4)]); + let build_chance = Lottery::from(vec![(64.0, 1), (5.0, 2), (8.0, 3), (0.75, 4)]); let mut castles = 0; From 97141d12a6feb572ac6dccd4f2eadd1da48e1323 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 5 Mar 2021 12:27:05 +0000 Subject: [PATCH 73/87] Better paths --- world/src/site2/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index b1997708f2..a3676dc87c 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -520,8 +520,8 @@ impl Site { if let TileKind::Road { a, b, w } = &tile.kind { if let Some(PlotKind::Road(path)) = tile.plot.map(|p| &self.plot(p).kind) { Some((LineSegment2 { - start: self.tile_center_wpos(path.nodes()[*a as usize]).map(|e| e as f32), - end: self.tile_center_wpos(path.nodes()[*b as usize]).map(|e| e as f32), + start: self.tile_wpos(path.nodes()[*a as usize]).map(|e| e as f32), + end: self.tile_wpos(path.nodes()[*b as usize]).map(|e| e as f32), }, *w)) } else { None From 173a127d5eec4cd1797bd2b1cde82dc6402eb652 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 5 Mar 2021 13:08:50 +0000 Subject: [PATCH 74/87] Better Fill type --- world/src/site2/gen.rs | 33 +++++++++------ world/src/site2/mod.rs | 35 ++++++++-------- world/src/site2/plot/house.rs | 75 ++++++++++++++--------------------- 3 files changed, 69 insertions(+), 74 deletions(-) diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index 5431264cf2..5bb17afd49 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -18,9 +18,8 @@ pub enum Primitive { Xor(Id, Id), } -pub struct Fill { - pub prim: Id, - pub block: Block, +pub enum Fill { + Block(Block), } impl Fill { @@ -63,8 +62,19 @@ impl Fill { } } - pub fn sample_at(&self, tree: &Store, pos: Vec3) -> Option { - Some(self.block).filter(|_| self.contains_at(tree, self.prim, pos)) + pub fn sample_at( + &self, + tree: &Store, + prim: Id, + pos: Vec3, + ) -> Option { + if self.contains_at(tree, prim, pos) { + match self { + Fill::Block(block) => Some(*block), + } + } else { + None + } } fn get_bounds_inner(&self, tree: &Store, prim: Id) -> Option> { @@ -93,26 +103,25 @@ impl Fill { }) } - pub fn get_bounds(&self, tree: &Store) -> Aabb { - self.get_bounds_inner(tree, self.prim) + pub fn get_bounds(&self, tree: &Store, prim: Id) -> Aabb { + self.get_bounds_inner(tree, prim) .unwrap_or_else(|| Aabb::new_empty(Vec3::zero())) } } pub trait Structure { - fn render Id, G: FnMut(Fill)>( + fn render Id, G: FnMut(Id, Fill)>( &self, site: &Site, prim: F, fill: G, - ) { - } + ); // Generate a primitive tree and fills for this structure - fn render_collect(&self, site: &Site) -> (Store, Vec) { + fn render_collect(&self, site: &Site) -> (Store, Vec<(Id, Fill)>) { let mut tree = Store::default(); let mut fills = Vec::new(); - let root = self.render(site, |p| tree.insert(p), |f| fills.push(f)); + let root = self.render(site, |p| tree.insert(p), |p, f| fills.push((p, f))); (tree, fills) } } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index a3676dc87c..f1dcb5cbf0 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -470,16 +470,16 @@ impl Site { match &tile.kind { TileKind::Plaza => { - let near_roads = CARDINALS - .iter() - .filter_map(|rpos| if self.tiles.get(tpos + rpos) == tile { + let near_roads = CARDINALS.iter().filter_map(|rpos| { + if self.tiles.get(tpos + rpos) == tile { Some(Aabr { min: self.tile_wpos(tpos).map(|e| e as f32), max: self.tile_wpos(tpos + 1).map(|e| e as f32), }) } else { None - }); + } + }); cols.for_each(|(wpos2d, offs)| { let wpos2df = wpos2d.map(|e| e as f32); @@ -490,18 +490,19 @@ impl Site { if dist.map_or(false, |d| d <= 3.0) { let alt = canvas.col(wpos2d).map_or(0, |col| col.alt as i32); - (-8..6).for_each(|z| canvas.map( - Vec3::new(wpos2d.x, wpos2d.y, alt + z), - |b| if z >= 0 { - if b.is_filled() { - Block::empty() + (-8..6).for_each(|z| { + canvas.map(Vec3::new(wpos2d.x, wpos2d.y, alt + z), |b| { + if z >= 0 { + if b.is_filled() { + Block::empty() + } else { + b.with_sprite(SpriteKind::Empty) + } } else { - b.with_sprite(SpriteKind::Empty) + Block::new(BlockKind::Rock, Rgb::new(55, 45, 50)) } - } else { - Block::new(BlockKind::Rock, Rgb::new(55, 45, 50)) - }, - )); + }) + }); } }); }, @@ -625,15 +626,15 @@ impl Site { _ => continue, }; - for fill in fills { - let aabb = fill.get_bounds(&prim_tree); + for (prim, fill) in fills { + let aabb = fill.get_bounds(&prim_tree, prim); for x in aabb.min.x..aabb.max.x { for y in aabb.min.y..aabb.max.y { for z in aabb.min.z..aabb.max.z { let pos = Vec3::new(x, y, z); - if let Some(block) = fill.sample_at(&prim_tree, pos) { + if let Some(block) = fill.sample_at(&prim_tree, prim, pos) { canvas.set(pos, block); } } diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index bbba4c149f..352d458b3f 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -47,7 +47,7 @@ impl House { } impl Structure for House { - fn render Id, G: FnMut(Fill)>( + fn render Id, G: FnMut(Id, Fill)>( &self, site: &Site, mut prim: F, @@ -66,14 +66,11 @@ impl Structure for House { min: self.bounds.min.with_z(self.alt - foundations), max: (self.bounds.max + 1).with_z(self.alt + roof), })); - fill(Fill { - prim: outer, - block: Block::new(BlockKind::Rock, Rgb::new(181, 170, 148)), - }); - fill(Fill { - prim: inner, - block: Block::empty(), - }); + fill( + outer, + Fill::Block(Block::new(BlockKind::Rock, Rgb::new(181, 170, 148))), + ); + fill(inner, Fill::Block(Block::empty())); let walls = prim(Primitive::Xor(outer, inner)); // wall pillars @@ -100,10 +97,10 @@ impl Structure for House { pillars_x = prim(Primitive::Or(pillars_x, pillar)); } let pillars = prim(Primitive::And(pillars_x, pillars_y)); - fill(Fill { - prim: pillars, - block: Block::new(BlockKind::Wood, Rgb::new(55, 25, 8)), - }); + fill( + pillars, + Fill::Block(Block::new(BlockKind::Wood, Rgb::new(55, 25, 8))), + ); // For each storey... for i in 0..self.levels + 1 { @@ -124,10 +121,10 @@ impl Structure for House { })); windows = prim(Primitive::Or(windows, window)); } - fill(Fill { - prim: prim(Primitive::And(walls, windows)), - block: Block::air(SpriteKind::Window1).with_ori(2).unwrap(), - }); + fill( + prim(Primitive::And(walls, windows)), + Fill::Block(Block::air(SpriteKind::Window1).with_ori(2).unwrap()), + ); } // Windows y axis { @@ -143,34 +140,22 @@ impl Structure for House { })); windows = prim(Primitive::Or(windows, window)); } - fill(Fill { - prim: prim(Primitive::And(walls, windows)), - block: Block::air(SpriteKind::Window1).with_ori(0).unwrap(), - }); + fill( + prim(Primitive::And(walls, windows)), + Fill::Block(Block::air(SpriteKind::Window1).with_ori(0).unwrap()), + ); } // Floor - fill(Fill { - prim: prim(Primitive::Aabb(Aabb { + fill( + prim(Primitive::Aabb(Aabb { min: self.bounds.min.with_z(self.alt + height), max: (self.bounds.max + 1).with_z(self.alt + height + 1), })), - block: Block::new(BlockKind::Rock, Rgb::new(89, 44, 14)), - }); + Fill::Block(Block::new(BlockKind::Rock, Rgb::new(89, 44, 14))), + ); } - // Corner pillars - // for &rpos in SQUARE_4.iter() { - // let pos = self.bounds.min + (self.bounds.max - self.bounds.min) * rpos; - // fill(Fill { - // prim: prim(Primitive::Aabb(Aabb { - // min: Vec3::new(pos.x - 1, pos.y - 1, self.alt - foundations), - // max: Vec3::new(pos.x + 1, pos.y + 1, self.alt + roof), - // })), - // block: Block::new(BlockKind::Wood, Rgb::new(89, 44, 14)), - // }); - // } - let roof_lip = 2; let roof_height = (self.bounds.min - self.bounds.max) .map(|e| e.abs()) @@ -180,24 +165,24 @@ impl Structure for House { + 1; // Roof - fill(Fill { - prim: prim(Primitive::Pyramid { + fill( + prim(Primitive::Pyramid { aabb: Aabb { min: (self.bounds.min - roof_lip).with_z(self.alt + roof), max: (self.bounds.max + 1 + roof_lip).with_z(self.alt + roof + roof_height), }, inset: roof_height, }), - block: Block::new(BlockKind::Wood, self.roof_color), - }); + Fill::Block(Block::new(BlockKind::Wood, self.roof_color)), + ); // Foundations - fill(Fill { - prim: prim(Primitive::Aabb(Aabb { + fill( + prim(Primitive::Aabb(Aabb { min: (self.bounds.min - 1).with_z(self.alt - foundations), max: (self.bounds.max + 2).with_z(self.alt + 1), })), - block: Block::new(BlockKind::Rock, Rgb::new(31, 33, 32)), - }); + Fill::Block(Block::new(BlockKind::Rock, Rgb::new(31, 33, 32))), + ); } } From 0ede7d3899592bd4f53495b241cc4b047ea6e0f9 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 5 Mar 2021 13:53:55 +0000 Subject: [PATCH 75/87] Brick fill --- world/src/site2/gen.rs | 10 +++++++++- world/src/site2/mod.rs | 15 +++++++++------ world/src/site2/plot/house.rs | 6 +++--- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index 5bb17afd49..f5522d113b 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -1,7 +1,8 @@ use super::*; +use crate::util::{RandomField, Sampler}; use common::{ store::{Id, Store}, - terrain::Block, + terrain::{Block, BlockKind}, }; use vek::*; @@ -20,6 +21,7 @@ pub enum Primitive { pub enum Fill { Block(Block), + Brick(BlockKind, Rgb, u8), } impl Fill { @@ -71,6 +73,12 @@ impl Fill { if self.contains_at(tree, prim, pos) { match self { Fill::Block(block) => Some(*block), + Fill::Brick(bk, col, range) => Some(Block::new( + *bk, + *col + (RandomField::new(13) + .get((pos + Vec3::new(pos.z, pos.z, 0)) / Vec3::new(2, 2, 1)) + % *range as u32) as u8, + )), } } else { None diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index f1dcb5cbf0..9581e140c4 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -98,16 +98,19 @@ impl Site { w: u16, ) -> Option> { const MAX_ITERS: usize = 4096; - let range = -(w as i32) / 2..w as i32 - w as i32 / 2; + let range = -(w as i32) / 2..w as i32 - (w as i32 + 1) / 2; let heuristic = |tile: &Vec2| { + let mut max_cost = (tile.distance_squared(b) as f32).sqrt(); for y in range.clone() { for x in range.clone() { if self.tiles.get(*tile + Vec2::new(x, y)).is_obstacle() { - return 1000.0; + max_cost = max_cost.max(1000.0); + } else if !self.tiles.get(*tile + Vec2::new(x, y)).is_empty() { + max_cost = max_cost.max(25.0); } } } - (tile.distance_squared(b) as f32).sqrt() + max_cost }; let path = Astar::new(MAX_ITERS, a, &heuristic, DefaultHashBuilder::default()) .poll( @@ -488,7 +491,7 @@ impl Site { .map(|aabr| aabr.distance_to_point(wpos2df)) .min_by_key(|d| (*d * 100.0) as i32); - if dist.map_or(false, |d| d <= 3.0) { + if dist.map_or(false, |d| d <= 1.5) { let alt = canvas.col(wpos2d).map_or(0, |col| col.alt as i32); (-8..6).for_each(|z| { canvas.map(Vec3::new(wpos2d.x, wpos2d.y, alt + z), |b| { @@ -521,8 +524,8 @@ impl Site { if let TileKind::Road { a, b, w } = &tile.kind { if let Some(PlotKind::Road(path)) = tile.plot.map(|p| &self.plot(p).kind) { Some((LineSegment2 { - start: self.tile_wpos(path.nodes()[*a as usize]).map(|e| e as f32), - end: self.tile_wpos(path.nodes()[*b as usize]).map(|e| e as f32), + start: self.tile_center_wpos(path.nodes()[*a as usize]).map(|e| e as f32), + end: self.tile_center_wpos(path.nodes()[*b as usize]).map(|e| e as f32), }, *w)) } else { None diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index 352d458b3f..b9a32ce2a7 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -68,7 +68,7 @@ impl Structure for House { })); fill( outer, - Fill::Block(Block::new(BlockKind::Rock, Rgb::new(181, 170, 148))), + Fill::Brick(BlockKind::Rock, Rgb::new(80, 75, 85), 24), ); fill(inner, Fill::Block(Block::empty())); let walls = prim(Primitive::Xor(outer, inner)); @@ -149,8 +149,8 @@ impl Structure for House { // Floor fill( prim(Primitive::Aabb(Aabb { - min: self.bounds.min.with_z(self.alt + height), - max: (self.bounds.max + 1).with_z(self.alt + height + 1), + min: (self.bounds.min + 1).with_z(self.alt + height), + max: self.bounds.max.with_z(self.alt + height + 1), })), Fill::Block(Block::new(BlockKind::Rock, Rgb::new(89, 44, 14))), ); From a54a3da102540924e5f6a6b6e129998a9277cfbf Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 6 Mar 2021 13:25:06 +0000 Subject: [PATCH 76/87] Added tree map icon --- assets/voxygen/element/map/tree.png | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 assets/voxygen/element/map/tree.png diff --git a/assets/voxygen/element/map/tree.png b/assets/voxygen/element/map/tree.png new file mode 100644 index 0000000000..d9ae69a7ed --- /dev/null +++ b/assets/voxygen/element/map/tree.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cc9f52df2fb82ad6419539f73a9e7bf5c815a59baf441d1751762fb4caec119 +size 683 From b6ac4e46fbec78e9e7443f461b8f4ab544cae1f9 Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 6 Mar 2021 15:30:28 +0100 Subject: [PATCH 77/87] tree icon UI works and hover icon --- assets/voxygen/element/map/tree.png | 4 ++-- assets/voxygen/element/map/tree_hover.png | 3 +++ voxygen/src/hud/img_ids.rs | 2 ++ voxygen/src/hud/map.rs | 2 ++ voxygen/src/hud/minimap.rs | 1 + 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 assets/voxygen/element/map/tree_hover.png diff --git a/assets/voxygen/element/map/tree.png b/assets/voxygen/element/map/tree.png index d9ae69a7ed..791e7f167a 100644 --- a/assets/voxygen/element/map/tree.png +++ b/assets/voxygen/element/map/tree.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8cc9f52df2fb82ad6419539f73a9e7bf5c815a59baf441d1751762fb4caec119 -size 683 +oid sha256:ecec258c4376a9aa48ef40dd3e9b32cdbb233677c30081f0ee5bd1407f29307a +size 231 diff --git a/assets/voxygen/element/map/tree_hover.png b/assets/voxygen/element/map/tree_hover.png new file mode 100644 index 0000000000..6cee8c17ae --- /dev/null +++ b/assets/voxygen/element/map/tree_hover.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:441e164e75d4f30ab06bb59e9cae937a81bb085cff4d622f5056e88291dcdf6f +size 274 diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index c82fe87355..c63747e245 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -365,6 +365,8 @@ image_ids! { mmap_site_cave_hover: "voxygen.element.map.cave_hover", mmap_site_cave: "voxygen.element.map.cave", mmap_site_excl: "voxygen.element.map.excl", + mmap_site_tree: "voxygen.element.map.tree", + mmap_site_tree_hover: "voxygen.element.map.tree_hover", // Window Parts window_3: "voxygen.element.frames.window_3", diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index bca1b2ffe9..631986467e 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -528,6 +528,7 @@ impl<'a> Widget for Map<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon, SiteKind::Castle => self.imgs.mmap_site_castle, SiteKind::Cave => self.imgs.mmap_site_cave, + SiteKind::Tree => self.imgs.mmap_site_tree, _ => self.imgs.mmap_site_excl, }) .x_y_position_relative_to( @@ -541,6 +542,7 @@ impl<'a> Widget for Map<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon_hover, SiteKind::Castle => self.imgs.mmap_site_castle_hover, SiteKind::Cave => self.imgs.mmap_site_cave_hover, + SiteKind::Tree => self.imgs.mmap_site_tree_hover, _ => self.imgs.mmap_site_excl, }) .image_color(UI_HIGHLIGHT_0) diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index 401f1b88a9..4d50114c73 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -303,6 +303,7 @@ impl<'a> Widget for MiniMap<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon_bg, SiteKind::Castle => self.imgs.mmap_site_castle_bg, SiteKind::Cave => self.imgs.mmap_site_cave_bg, + SiteKind::Tree => self.imgs.mmap_site_tree, _ => self.imgs.mmap_site_excl, }) .x_y_position_relative_to( From db573f6b2dc5ae91f33296b07709c4c66c6e4c16 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 6 Mar 2021 14:55:42 +0000 Subject: [PATCH 78/87] Turn giant trees into proper sites --- assets/voxygen/i18n/en/hud/map.ron | 4 +- common/net/src/msg/world_msg.rs | 1 + voxygen/src/hud/map.rs | 52 +++++++++++++++++++++++-- voxygen/src/hud/minimap.rs | 2 + voxygen/src/hud/mod.rs | 4 ++ voxygen/src/session.rs | 4 ++ voxygen/src/settings.rs | 2 + world/src/civ/mod.rs | 16 +++++--- world/src/layer/tree.rs | 1 + world/src/lib.rs | 1 + world/src/sim/mod.rs | 24 ++++++------ world/src/site/mod.rs | 23 ++++++++--- world/src/site/tree.rs | 61 ++++++++++++++++++++++++++++++ 13 files changed, 170 insertions(+), 25 deletions(-) create mode 100644 world/src/site/tree.rs diff --git a/assets/voxygen/i18n/en/hud/map.ron b/assets/voxygen/i18n/en/hud/map.ron index ee0db0fe71..024b129386 100644 --- a/assets/voxygen/i18n/en/hud/map.ron +++ b/assets/voxygen/i18n/en/hud/map.ron @@ -9,9 +9,11 @@ "hud.map.difficulty": "Difficulty", "hud.map.towns": "Towns", "hud.map.castles": "Castles", - "hud.map.dungeons": "Dungeons", + "hud.map.dungeons": "Dungeons", "hud.map.caves": "Caves", "hud.map.cave": "Cave", + "hud.map.trees": "Trees", + "hud.map.tree": "Tree", "hud.map.town": "Town", "hud.map.castle": "Castle", "hud.map.dungeon": "Dungeon", diff --git a/common/net/src/msg/world_msg.rs b/common/net/src/msg/world_msg.rs index e0421da899..4a11f715b4 100644 --- a/common/net/src/msg/world_msg.rs +++ b/common/net/src/msg/world_msg.rs @@ -138,4 +138,5 @@ pub enum SiteKind { Dungeon { difficulty: u32 }, Castle, Cave, + Tree, } diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index 631986467e..72f9db6c9f 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -49,6 +49,12 @@ widget_ids! { show_dungeons_img, show_dungeons_box, show_dungeons_text, + show_caves_img, + show_caves_box, + show_caves_text, + show_trees_img, + show_trees_box, + show_trees_text, show_difficulty_img, show_difficulty_box, show_difficulty_text, @@ -57,9 +63,6 @@ widget_ids! { drag_ico, zoom_txt, zoom_ico, - show_caves_img, - show_caves_box, - show_caves_text, } } @@ -117,6 +120,7 @@ pub enum Event { ShowCastles(bool), ShowDungeons(bool), ShowCaves(bool), + ShowTrees(bool), Close, } @@ -143,6 +147,7 @@ impl<'a> Widget for Map<'a> { let show_dungeons = self.global_state.settings.gameplay.map_show_dungeons; let show_castles = self.global_state.settings.gameplay.map_show_castles; let show_caves = self.global_state.settings.gameplay.map_show_caves; + let show_trees = self.global_state.settings.gameplay.map_show_trees; let mut events = Vec::new(); let i18n = &self.localized_strings; // Tooltips @@ -471,6 +476,40 @@ impl<'a> Widget for Map<'a> { .graphics_for(state.ids.show_caves_box) .color(TEXT_COLOR) .set(state.ids.show_caves_text, ui); + // Trees + Image::new(self.imgs.mmap_site_tree) + .down_from(state.ids.show_caves_img, 10.0) + .w_h(20.0, 20.0) + .set(state.ids.show_trees_img, ui); + if Button::image(if show_trees { + self.imgs.checkbox_checked + } else { + self.imgs.checkbox + }) + .w_h(18.0, 18.0) + .hover_image(if show_trees { + self.imgs.checkbox_checked_mo + } else { + self.imgs.checkbox_mo + }) + .press_image(if show_trees { + self.imgs.checkbox_checked + } else { + self.imgs.checkbox_press + }) + .right_from(state.ids.show_trees_img, 10.0) + .set(state.ids.show_trees_box, ui) + .was_clicked() + { + events.push(Event::ShowTrees(!show_trees)); + } + Text::new(i18n.get("hud.map.trees")) + .right_from(state.ids.show_trees_box, 10.0) + .font_size(self.fonts.cyri.scale(14)) + .font_id(self.fonts.cyri.conrod_id) + .graphics_for(state.ids.show_trees_box) + .color(TEXT_COLOR) + .set(state.ids.show_trees_text, ui); // Map icons if state.ids.mmap_site_icons.len() < self.client.sites().len() { state.update(|state| { @@ -512,6 +551,7 @@ impl<'a> Widget for Map<'a> { SiteKind::Dungeon { .. } => i18n.get("hud.map.dungeon"), SiteKind::Castle => i18n.get("hud.map.castle"), SiteKind::Cave => i18n.get("hud.map.cave"), + SiteKind::Tree => i18n.get("hud.map.tree"), }); let (difficulty, desc) = match &site.kind { SiteKind::Town => (0, i18n.get("hud.map.town").to_string()), @@ -522,6 +562,7 @@ impl<'a> Widget for Map<'a> { ), SiteKind::Castle => (0, i18n.get("hud.map.castle").to_string()), SiteKind::Cave => (0, i18n.get("hud.map.cave").to_string()), + SiteKind::Tree => (0, i18n.get("hud.map.tree").to_string()), }; let site_btn = Button::image(match &site.kind { SiteKind::Town => self.imgs.mmap_site_town, @@ -648,6 +689,11 @@ impl<'a> Widget for Map<'a> { dif_img.set(state.ids.site_difs[i], ui) } }, + SiteKind::Tree => { + if show_trees { + dif_img.set(state.ids.site_difs[i], ui) + } + }, } } } diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index 4d50114c73..fd84aa0407 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -325,6 +325,7 @@ impl<'a> Widget for MiniMap<'a> { _ => Color::Rgba(1.0, 1.0, 1.0, 0.0), }, SiteKind::Cave => Color::Rgba(1.0, 1.0, 1.0, 0.0), + SiteKind::Tree => Color::Rgba(1.0, 1.0, 1.0, 0.0), })) .parent(state.ids.grid) .set(state.ids.mmap_site_icons_bgs[i], ui); @@ -333,6 +334,7 @@ impl<'a> Widget for MiniMap<'a> { SiteKind::Dungeon { .. } => self.imgs.mmap_site_dungeon, SiteKind::Castle => self.imgs.mmap_site_castle, SiteKind::Cave => self.imgs.mmap_site_cave, + SiteKind::Tree => self.imgs.mmap_site_tree, _ => self.imgs.mmap_site_excl, }) .middle_of(state.ids.mmap_site_icons_bgs[i]) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 2b4d5af1b4..7efda93209 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -362,6 +362,7 @@ pub enum Event { MapShowDungeons(bool), MapShowCastles(bool), MapShowCaves(bool), + MapShowTrees(bool), AdjustWindowSize([u16; 2]), ChangeFullscreenMode(FullScreenSettings), ToggleParticlesEnabled(bool), @@ -2642,6 +2643,9 @@ impl Hud { map::Event::ShowCaves(map_show_caves) => { events.push(Event::MapShowCaves(map_show_caves)); }, + map::Event::ShowTrees(map_show_trees) => { + events.push(Event::MapShowTrees(map_show_trees)); + }, } } } else { diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs index a7e863c183..4344a54162 100644 --- a/voxygen/src/session.rs +++ b/voxygen/src/session.rs @@ -1266,6 +1266,10 @@ impl PlayState for SessionState { global_state.settings.gameplay.map_show_caves = map_show_caves; global_state.settings.save_to_file_warn(); }, + HudEvent::MapShowTrees(map_show_trees) => { + global_state.settings.gameplay.map_show_trees = map_show_trees; + global_state.settings.save_to_file_warn(); + }, HudEvent::ChangeGamma(new_gamma) => { global_state.settings.graphics.gamma = new_gamma; global_state.settings.save_to_file_warn(); diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 3bea161074..fc33b4007d 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -463,6 +463,7 @@ pub struct GameplaySettings { pub map_show_castles: bool, pub loading_tips: bool, pub map_show_caves: bool, + pub map_show_trees: bool, pub minimap_show: bool, pub minimap_face_north: bool, } @@ -502,6 +503,7 @@ impl Default for GameplaySettings { map_show_castles: true, loading_tips: true, map_show_caves: true, + map_show_trees: true, minimap_show: true, minimap_face_north: false, } diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index 45b7be02ef..c91c720811 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -6,7 +6,7 @@ use self::{Occupation::*, Stock::*}; use crate::{ config::CONFIG, sim::WorldSim, - site::{namegen::NameGen, Castle, Dungeon, Settlement, Site as WorldSite}, + site::{namegen::NameGen, Castle, Dungeon, Settlement, Site as WorldSite, Tree}, site2, util::{attempt, seed_expan, MapVec, CARDINALS, NEIGHBORS}, Index, Land, @@ -106,10 +106,11 @@ impl Civs { for _ in 0..initial_civ_count * 3 { attempt(5, || { - let (kind, size) = match ctx.rng.gen_range(0..8) { - 0 => (SiteKind::Castle, 3), - 1 => (SiteKind::Dungeon, 0), - _ => (SiteKind::Refactor, 5), + let (kind, size) = match ctx.rng.gen_range(0..16) { + 0..=1 => (SiteKind::Castle, 3), + 2..=7 => (SiteKind::Refactor, 6), + 8 => (SiteKind::Tree, 4), + _ => (SiteKind::Dungeon, 0), }; let loc = find_site_loc(&mut ctx, None, size)?; this.establish_site(&mut ctx.reseed(), loc, |place| Site { @@ -151,6 +152,7 @@ impl Civs { SiteKind::Dungeon => (8i32, 2.0), SiteKind::Castle => (16i32, 5.0), SiteKind::Refactor => (0i32, 0.0), + SiteKind::Tree => (12i32, 8.0), }; let (raise, raise_dist): (f32, i32) = match &site.kind { @@ -220,6 +222,9 @@ impl Civs { &mut rng, wpos, )), + SiteKind::Tree => { + WorldSite::tree(Tree::generate(wpos, &Land::from_sim(&ctx.sim), &mut rng)) + }, }); sim_site.site_tmp = Some(site); let site_ref = &index.sites[site]; @@ -899,6 +904,7 @@ pub enum SiteKind { Dungeon, Castle, Refactor, + Tree, } impl Site { diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index c7b0969d03..80b637c990 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -571,6 +571,7 @@ struct Branch { impl Branch { /// Determine whether there are either branches or leaves at the given /// position in the branch. + /// (branch, leaves, stairs, forced_air) pub fn is_branch_or_leaves_at( &self, pos: Vec3, diff --git a/world/src/lib.rs b/world/src/lib.rs index c9ad01cb98..043db27176 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -122,6 +122,7 @@ impl World { }, civ::SiteKind::Castle => world_msg::SiteKind::Castle, civ::SiteKind::Refactor => world_msg::SiteKind::Town, + civ::SiteKind::Tree => world_msg::SiteKind::Tree, }, wpos: site.center * TerrainChunkSize::RECT_SIZE.map(|e| e as i32), } diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index b6733e7dd5..2600672950 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -2109,18 +2109,20 @@ impl WorldSim { }) }); - let giant_trees = std::array::IntoIter::new(self.gen_ctx.big_structure_gen.get(wpos)) - // Don't even consider trees if we aren't close - .filter(move |(pos, _)| pos.distance_squared(wpos) < 512i32.pow(2)) - .map(move |(pos, seed)| TreeAttr { - pos, - seed, - scale: 5.0, - forest_kind: ForestKind::Giant, - inhabited: (seed / 13) % 2 == 0, - }); + // // For testing + // let giant_trees = + // std::array::IntoIter::new(self.gen_ctx.big_structure_gen.get(wpos)) + // // Don't even consider trees if we aren't close + // .filter(move |(pos, _)| pos.distance_squared(wpos) < 512i32.pow(2)) + // .map(move |(pos, seed)| TreeAttr { + // pos, + // seed, + // scale: 5.0, + // forest_kind: ForestKind::Giant, + // inhabited: (seed / 13) % 2 == 0, + // }); - normal_trees.chain(giant_trees) + normal_trees //.chain(giant_trees) } } diff --git a/world/src/site/mod.rs b/world/src/site/mod.rs index 77d6f12428..faf588af3f 100644 --- a/world/src/site/mod.rs +++ b/world/src/site/mod.rs @@ -4,11 +4,12 @@ mod dungeon; pub mod economy; pub mod namegen; mod settlement; +mod tree; // Reexports pub use self::{ block_mask::BlockMask, castle::Castle, dungeon::Dungeon, economy::Economy, - settlement::Settlement, + settlement::Settlement, tree::Tree, }; use crate::{column::ColumnSample, site2, Canvas, IndexRef}; @@ -46,6 +47,7 @@ pub enum SiteKind { Dungeon(Dungeon), Castle(Castle), Refactor(site2::Site), + Tree(tree::Tree), } impl Site { @@ -77,12 +79,20 @@ impl Site { } } + pub fn tree(t: tree::Tree) -> Self { + Self { + kind: SiteKind::Tree(t), + economy: Economy::default(), + } + } + pub fn radius(&self) -> f32 { match &self.kind { SiteKind::Settlement(s) => s.radius(), SiteKind::Dungeon(d) => d.radius(), SiteKind::Castle(c) => c.radius(), SiteKind::Refactor(s) => s.radius(), + SiteKind::Tree(t) => t.radius(), } } @@ -92,6 +102,7 @@ impl Site { SiteKind::Dungeon(d) => d.get_origin(), SiteKind::Castle(c) => c.get_origin(), SiteKind::Refactor(s) => s.origin, + SiteKind::Tree(t) => t.origin, } } @@ -101,6 +112,7 @@ impl Site { SiteKind::Dungeon(d) => d.spawn_rules(wpos), SiteKind::Castle(c) => c.spawn_rules(wpos), SiteKind::Refactor(s) => s.spawn_rules(wpos), + SiteKind::Tree(t) => t.spawn_rules(wpos), } } @@ -109,7 +121,8 @@ impl Site { SiteKind::Settlement(s) => s.name(), SiteKind::Dungeon(d) => d.name(), SiteKind::Castle(c) => c.name(), - SiteKind::Refactor(s) => "Experimental", + SiteKind::Refactor(s) => "Town", + SiteKind::Tree(t) => "Tree", } } @@ -120,9 +133,8 @@ impl Site { SiteKind::Settlement(s) => s.apply_to(canvas.index, canvas.wpos, get_col, canvas.chunk), SiteKind::Dungeon(d) => d.apply_to(canvas.index, canvas.wpos, get_col, canvas.chunk), SiteKind::Castle(c) => c.apply_to(canvas.index, canvas.wpos, get_col, canvas.chunk), - SiteKind::Refactor(s) => { - s.render(canvas, dynamic_rng); - }, + SiteKind::Refactor(s) => s.render(canvas, dynamic_rng), + SiteKind::Tree(t) => t.render(canvas, dynamic_rng), } } @@ -141,6 +153,7 @@ impl Site { SiteKind::Dungeon(d) => d.apply_supplement(dynamic_rng, wpos2d, get_column, supplement), SiteKind::Castle(c) => c.apply_supplement(dynamic_rng, wpos2d, get_column, supplement), SiteKind::Refactor(_) => {}, + SiteKind::Tree(_) => {}, } } } diff --git a/world/src/site/tree.rs b/world/src/site/tree.rs new file mode 100644 index 0000000000..9011b9b90d --- /dev/null +++ b/world/src/site/tree.rs @@ -0,0 +1,61 @@ +use crate::{ + layer::tree::{ProceduralTree, TreeConfig}, + site::SpawnRules, + Canvas, Land, +}; +use common::terrain::{Block, BlockKind}; +use rand::prelude::*; +use vek::*; + +// Temporary, do trees through the new site system later +pub struct Tree { + pub origin: Vec2, + alt: i32, + tree: ProceduralTree, +} + +impl Tree { + pub fn generate(origin: Vec2, land: &Land, rng: &mut impl Rng) -> Self { + Self { + origin, + alt: land.get_alt_approx(origin) as i32, + tree: { + let config = TreeConfig::giant(rng, 4.0, false); + ProceduralTree::generate(config, rng) + }, + } + } + + pub fn radius(&self) -> f32 { 512.0 } + + pub fn spawn_rules(&self, wpos: Vec2) -> SpawnRules { + let trunk_radius = 48i32; + SpawnRules { + trees: wpos.distance_squared(self.origin) > trunk_radius.pow(2), + } + } + + pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { + canvas.foreach_col(|canvas, wpos2d, col| { + let rpos2d = wpos2d - self.origin; + let bounds = self.tree.get_bounds().map(|e| e as i32); + + if !Aabr::from(bounds).contains_point(rpos2d) { + // Skip this column + return; + } + + for z in (bounds.min.z..bounds.max.z + 1).rev() { + let wpos = wpos2d.with_z(self.alt + z); + let rposf = (wpos - self.origin.with_z(self.alt)).map(|e| e as f32 + 0.5); + + let (branch, leaves, _, _) = self.tree.is_branch_or_leaves_at(rposf); + if leaves { + canvas.set(wpos, Block::new(BlockKind::Leaves, Rgb::new(30, 130, 40))); + } else if branch { + canvas.set(wpos, Block::new(BlockKind::Wood, Rgb::new(80, 32, 0))); + } + } + }); + } +} From eff9fc5393046ae6cb8f75fbf707e1a7b70a4835 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 6 Mar 2021 15:39:20 +0000 Subject: [PATCH 79/87] Better giant tree spawn rate --- world/src/civ/mod.rs | 8 ++++---- world/src/site/tree.rs | 10 +++++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index c91c720811..ef45d370c1 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -106,10 +106,10 @@ impl Civs { for _ in 0..initial_civ_count * 3 { attempt(5, || { - let (kind, size) = match ctx.rng.gen_range(0..16) { - 0..=1 => (SiteKind::Castle, 3), - 2..=7 => (SiteKind::Refactor, 6), - 8 => (SiteKind::Tree, 4), + let (kind, size) = match ctx.rng.gen_range(0..64) { + 0..=4 => (SiteKind::Castle, 3), + 5..=28 => (SiteKind::Refactor, 6), + 29..=31 => (SiteKind::Tree, 4), _ => (SiteKind::Dungeon, 0), }; let loc = find_site_loc(&mut ctx, None, size)?; diff --git a/world/src/site/tree.rs b/world/src/site/tree.rs index 9011b9b90d..965e8e0670 100644 --- a/world/src/site/tree.rs +++ b/world/src/site/tree.rs @@ -1,5 +1,6 @@ use crate::{ layer::tree::{ProceduralTree, TreeConfig}, + util::{FastNoise, Sampler}, site::SpawnRules, Canvas, Land, }; @@ -11,6 +12,7 @@ use vek::*; pub struct Tree { pub origin: Vec2, alt: i32, + seed: u32, tree: ProceduralTree, } @@ -19,6 +21,7 @@ impl Tree { Self { origin, alt: land.get_alt_approx(origin) as i32, + seed: rng.gen(), tree: { let config = TreeConfig::giant(rng, 4.0, false); ProceduralTree::generate(config, rng) @@ -36,6 +39,8 @@ impl Tree { } pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { + let nz = FastNoise::new(self.seed); + canvas.foreach_col(|canvas, wpos2d, col| { let rpos2d = wpos2d - self.origin; let bounds = self.tree.get_bounds().map(|e| e as i32); @@ -51,7 +56,10 @@ impl Tree { let (branch, leaves, _, _) = self.tree.is_branch_or_leaves_at(rposf); if leaves { - canvas.set(wpos, Block::new(BlockKind::Leaves, Rgb::new(30, 130, 40))); + let dark = Rgb::new(10, 70, 50).map(|e| e as f32); + let light = Rgb::new(80, 140, 10).map(|e| e as f32); + let leaf_col = Lerp::lerp(dark, light, nz.get(rposf.map(|e| e as f64) * 0.05) * 0.5 + 0.5); + canvas.set(wpos, Block::new(BlockKind::Leaves, leaf_col.map(|e| e as u8))); } else if branch { canvas.set(wpos, Block::new(BlockKind::Wood, Rgb::new(80, 32, 0))); } From f7f7f12a3828d0c66f35f1952e1ae8a5737a2e95 Mon Sep 17 00:00:00 2001 From: Synis Date: Thu, 4 Mar 2021 19:23:13 +0100 Subject: [PATCH 80/87] Basic Castle Wall --- world/src/site2/mod.rs | 21 +++++-- world/src/site2/plot.rs | 5 +- world/src/site2/plot/castle.rs | 101 +++++++++++++++++++++++++++++++++ 3 files changed, 121 insertions(+), 6 deletions(-) create mode 100644 world/src/site2/plot/castle.rs diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 9581e140c4..c41cf921c9 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -329,11 +329,17 @@ impl Site { }, // Guard tower 2 => { - if let Some((aabr, _)) = attempt(10, || { + if let Some((aabr, entrance_tile)) = attempt(10, || { site.find_roadside_aabr(&mut rng, 4..4, Extent2::new(2, 2)) }) { let plot = site.create_plot(Plot { - kind: PlotKind::Castle, + kind: PlotKind::Castle(plot::Castle::generate( + land, + &mut rng, + &site, + entrance_tile, + aabr, + )), root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), @@ -381,11 +387,17 @@ impl Site { }, // Castle 4 if castles < 1 => { - if let Some((aabr, _)) = attempt(10, || { + if let Some((aabr, entrance_tile)) = attempt(10, || { site.find_roadside_aabr(&mut rng, 16 * 16..18 * 18, Extent2::new(16, 16)) }) { let plot = site.create_plot(Plot { - kind: PlotKind::Castle, + kind: PlotKind::Castle(plot::Castle::generate( + land, + &mut rng, + &site, + entrance_tile, + aabr, + )), root_tile: aabr.center(), tiles: aabr_tiles(aabr).collect(), seed: rng.gen(), @@ -626,6 +638,7 @@ impl Site { for plot in plots_to_render { let (prim_tree, fills) = match &self.plots[plot].kind { PlotKind::House(house) => house.render_collect(self), + PlotKind::Castle(castle) => castle.render_collect(self), _ => continue, }; diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index d2af39b252..57b55084ca 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -1,6 +1,7 @@ +mod castle; mod house; -pub use self::house::House; +pub use self::{castle::Castle, house::House}; use super::*; use crate::util::DHashSet; @@ -28,6 +29,6 @@ pub enum PlotKind { Field, House(House), Plaza, - Castle, + Castle(Castle), Road(Path>), } diff --git a/world/src/site2/plot/castle.rs b/world/src/site2/plot/castle.rs new file mode 100644 index 0000000000..93ab1204dd --- /dev/null +++ b/world/src/site2/plot/castle.rs @@ -0,0 +1,101 @@ +use super::*; +use crate::{util::SQUARE_4, Land}; +use common::terrain::{Block, BlockKind, SpriteKind}; +use rand::prelude::*; +use vek::*; + +pub struct Castle { + entrance_tile: Vec2, + tile_aabr: Aabr, + bounds: Aabr, + alt: i32, +} + +impl Castle { + pub fn generate( + land: &Land, + rng: &mut impl Rng, + site: &Site, + entrance_tile: Vec2, + tile_aabr: Aabr, + ) -> Self { + Self { + entrance_tile, + tile_aabr, + bounds: Aabr { + min: site.tile_wpos(tile_aabr.min), + max: site.tile_wpos(tile_aabr.max), + }, + alt: land.get_alt_approx(site.tile_center_wpos(entrance_tile)) as i32, + } + } +} + +impl Structure for Castle { + fn render Id, G: FnMut(Id, Fill)>( + &self, + site: &Site, + mut prim: F, + mut fill: G, + ) { + let wall_height = 24; + let thickness = 12; + let parapet_height = 2; + let parapet_width = 1; + let downwards = 40; + for x in 0..self.tile_aabr.size().w { + for y in 0..self.tile_aabr.size().h { + let tile_pos = self.tile_aabr.min + Vec2::new(x, y); + let wpos_center = site.tile_center_wpos(tile_pos); + let wpos = site.tile_wpos(tile_pos); + match site.tiles.get(tile_pos).kind.clone() { + TileKind::Wall => { + let ori = if x == 0 || x == self.tile_aabr.size().w - 1 { + Vec2::new(1, 0) + } else { + Vec2::new(0, 1) + }; + let wall = prim(Primitive::Aabb(Aabb { + min: wpos.with_z(self.alt), + max: (wpos + 7).with_z(self.alt + wall_height + parapet_height), + })); + let cut_path = prim(Primitive::Aabb(Aabb { + min: Vec3::new( + wpos.x + parapet_width * ori.x, + wpos.y + parapet_width * ori.y, + self.alt + wall_height, + ), + max: Vec3::new( + wpos.x + (7 - parapet_width) * ori.x + 7 * ori.y, + wpos.y + (7 - parapet_width) * ori.y + 7 * ori.x, + self.alt + wall_height + parapet_height, + ), + })); + let cut_sides1 = prim(Primitive::Aabb(Aabb { + min: Vec3::new(wpos.x, wpos.y, self.alt + wall_height + 1), + max: Vec3::new( + wpos.x + 7 * ori.x + ori.y, + wpos.y + 7 * ori.y + ori.x, + self.alt + wall_height + parapet_height, + ), + })); + fill( + prim(Primitive::Xor(wall, cut_path)), + Fill::Block(Block::new(BlockKind::Rock, Rgb::new(33, 33, 33))), + ); + fill(cut_sides1, Fill::Block(Block::air(SpriteKind::Empty))); + }, + _ => { + fill( + prim(Primitive::Aabb(Aabb { + min: wpos_center.with_z(self.alt + 9), + max: (wpos_center + 1).with_z(self.alt + 10), + })), + Fill::Block(Block::new(BlockKind::Rock, Rgb::new(255, 255, 255))), + ); + }, + } + } + } + } +} From c35780d05bc8951c796d3b08820b3cd3074af55b Mon Sep 17 00:00:00 2001 From: Synis Date: Sat, 6 Mar 2021 17:21:03 +0100 Subject: [PATCH 81/87] More work on castles --- world/src/site2/mod.rs | 26 +++-- world/src/site2/plot/castle.rs | 179 ++++++++++++++++++++++++++++----- world/src/site2/tile.rs | 26 ++++- 3 files changed, 196 insertions(+), 35 deletions(-) diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index c41cf921c9..3c6c02f029 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -5,7 +5,7 @@ mod tile; use self::{ gen::{Fill, Primitive, Structure}, plot::{Plot, PlotKind}, - tile::{HazardKind, Tile, TileGrid, TileKind, TILE_SIZE}, + tile::{HazardKind, Tile, TileGrid, TileKind, KeepKind, Ori, TILE_SIZE}, }; use crate::{ site::SpawnRules, @@ -16,8 +16,7 @@ use common::{ astar::Astar, lottery::Lottery, spiral::Spiral2d, - store::{Id, Store}, - terrain::{Block, BlockKind, SpriteKind, TerrainChunkSize}, + store::{Id, Store}, terrain::{Block, BlockKind, SpriteKind, TerrainChunkSize}, vol::RectVolSize, }; use hashbrown::hash_map::DefaultHashBuilder; @@ -405,12 +404,12 @@ impl Site { // Walls site.blit_aabr(aabr, Tile { - kind: TileKind::Wall, + kind: TileKind::Wall(Ori::North), plot: Some(plot), }); let tower = Tile { - kind: TileKind::Castle, + kind: TileKind::Tower, plot: Some(plot), }; site.tiles @@ -441,10 +440,25 @@ impl Site { max: aabr.center() + 3, }, Tile { - kind: TileKind::Castle, + kind: TileKind::Wall(Ori::North), plot: Some(plot), }, ); + site.tiles.set(Vec2::new(aabr.center().x + 2, aabr.center().y + 2), tower.clone()); + site.tiles.set(Vec2::new(aabr.center().x + 2, aabr.center().y - 3), tower.clone()); + site.tiles.set(Vec2::new(aabr.center().x - 3, aabr.center().y + 2), tower.clone()); + site.tiles.set(Vec2::new(aabr.center().x - 3, aabr.center().y - 3), tower.clone()); + + site.blit_aabr( + Aabr { + min: aabr.center() - 2, + max: aabr.center() + 2, + }, + Tile { + kind: TileKind::Keep(tile::KeepKind::Middle), + plot: Some(plot), + }, + ); castles += 1; } diff --git a/world/src/site2/plot/castle.rs b/world/src/site2/plot/castle.rs index 93ab1204dd..0d24e985cb 100644 --- a/world/src/site2/plot/castle.rs +++ b/world/src/site2/plot/castle.rs @@ -43,57 +43,182 @@ impl Structure for Castle { let parapet_height = 2; let parapet_width = 1; let downwards = 40; + + let tower_height = 12; + + let keep_levels = 3; + let keep_level_height = 8; + let keep_height = wall_height + keep_levels * keep_level_height + 1; for x in 0..self.tile_aabr.size().w { for y in 0..self.tile_aabr.size().h { let tile_pos = self.tile_aabr.min + Vec2::new(x, y); let wpos_center = site.tile_center_wpos(tile_pos); let wpos = site.tile_wpos(tile_pos); + let ori = if x == 0 || x == self.tile_aabr.size().w - 1 { + Vec2::new(1, 0) + } else { + Vec2::new(0, 1) + }; + let ori_tower_x = if x == 0 { + Vec2::new(1, 0) + } else { + Vec2::new(0, 0) + }; + let ori_tower_y = if y == 0 { + Vec2::new(0, 1) + } else { + Vec2::new(0, 0) + }; + let ori_tower = ori_tower_x + ori_tower_y; match site.tiles.get(tile_pos).kind.clone() { - TileKind::Wall => { - let ori = if x == 0 || x == self.tile_aabr.size().w - 1 { - Vec2::new(1, 0) - } else { - Vec2::new(0, 1) - }; + TileKind::Wall(orientation) => { let wall = prim(Primitive::Aabb(Aabb { min: wpos.with_z(self.alt), - max: (wpos + 7).with_z(self.alt + wall_height + parapet_height), + max: (wpos + 6).with_z(self.alt + wall_height + parapet_height), })); let cut_path = prim(Primitive::Aabb(Aabb { - min: Vec3::new( - wpos.x + parapet_width * ori.x, - wpos.y + parapet_width * ori.y, - self.alt + wall_height, - ), - max: Vec3::new( - wpos.x + (7 - parapet_width) * ori.x + 7 * ori.y, - wpos.y + (7 - parapet_width) * ori.y + 7 * ori.x, - self.alt + wall_height + parapet_height, - ), + min: (wpos + (parapet_width * ori) as Vec2) + .with_z(self.alt + wall_height), + max: (wpos + + (6 - parapet_width) * ori as Vec2 + + 6 * ori.yx() as Vec2) + .with_z(self.alt + wall_height + parapet_height), })); let cut_sides1 = prim(Primitive::Aabb(Aabb { min: Vec3::new(wpos.x, wpos.y, self.alt + wall_height + 1), max: Vec3::new( - wpos.x + 7 * ori.x + ori.y, - wpos.y + 7 * ori.y + ori.x, + wpos.x + 6 * ori.x + ori.y, + wpos.y + 6 * ori.y + ori.x, self.alt + wall_height + parapet_height, ), })); + let pillar_start = prim(Primitive::Aabb(Aabb { + min: Vec3::new(wpos.x, wpos.y - 1, self.alt), + max: Vec3::new(wpos.x + 1, wpos.y + 7, self.alt + wall_height), + })); + let pillar_end = prim(Primitive::Aabb(Aabb { + min: Vec3::new(wpos.x + 5, wpos.y - 1, self.alt), + max: Vec3::new(wpos.x + 6, wpos.y + 7, self.alt + wall_height), + })); + let pillars = prim(Primitive::Or(pillar_start, pillar_end)); fill( - prim(Primitive::Xor(wall, cut_path)), + prim(Primitive::Or(wall, pillars)), Fill::Block(Block::new(BlockKind::Rock, Rgb::new(33, 33, 33))), ); - fill(cut_sides1, Fill::Block(Block::air(SpriteKind::Empty))); + fill(cut_path, Fill::Block(Block::empty())); + fill(cut_sides1, Fill::Block(Block::empty())); }, - _ => { + TileKind::Tower => { + let tower_lower = prim(Primitive::Aabb(Aabb { + min: wpos.with_z(self.alt), + max: (wpos + 6).with_z(self.alt + wall_height + tower_height), + })); + let tower_lower_inner_x = prim(Primitive::Aabb(Aabb { + min: Vec3::new( + wpos.x + 1 * ori_tower.x, + wpos.y + parapet_width, + self.alt + wall_height, + ), + max: Vec3::new( + wpos.x + 6 + ori_tower.x - 1, + wpos.y + 6 - parapet_width, + self.alt + wall_height + tower_height / 3, + ), + })); + let tower_lower_inner_y = prim(Primitive::Aabb(Aabb { + min: Vec3::new( + wpos.x + parapet_width, + wpos.y + 1 * ori_tower.y, + self.alt + wall_height, + ), + max: Vec3::new( + wpos.x + 6 - parapet_width, + wpos.y + 6 + ori_tower.y - 1, + self.alt + wall_height + tower_height / 3, + ), + })); + let tower_lower_inner = + prim(Primitive::Or(tower_lower_inner_x, tower_lower_inner_y)); fill( - prim(Primitive::Aabb(Aabb { - min: wpos_center.with_z(self.alt + 9), - max: (wpos_center + 1).with_z(self.alt + 10), - })), - Fill::Block(Block::new(BlockKind::Rock, Rgb::new(255, 255, 255))), + prim(Primitive::Xor(tower_lower, tower_lower_inner)), + Fill::Block(Block::new(BlockKind::Rock, Rgb::new(33, 33, 33))), + ); + let tower_upper = prim(Primitive::Aabb(Aabb { + min: Vec3::new( + wpos.x - 1, + wpos.y - 1, + self.alt + wall_height + tower_height - 3 as i32, + ), + max: Vec3::new( + wpos.x + 7, + wpos.y + 7, + self.alt + wall_height + tower_height - 1 as i32, + ), + })); + let tower_upper2 = prim(Primitive::Aabb(Aabb { + min: Vec3::new( + wpos.x - 2, + wpos.y - 2, + self.alt + wall_height + tower_height - 1 as i32, + ), + max: Vec3::new( + wpos.x + 8, + wpos.y + 8, + self.alt + wall_height + tower_height, + ), + })); + + fill( + prim(Primitive::Or(tower_upper, tower_upper2)), + Fill::Block(Block::new(BlockKind::Rock, Rgb::new(33, 33, 33))), + ); + + let roof_lip = 1; + let roof_height = 8 / 2 + roof_lip + 1; + + // Roof + fill( + prim(Primitive::Pyramid { + aabb: Aabb { + min: (wpos - 2 - roof_lip) + .with_z(self.alt + wall_height + tower_height), + max: (wpos + 8 + roof_lip).with_z( + self.alt + wall_height + tower_height + roof_height, + ), + }, + inset: roof_height, + }), + Fill::Block(Block::new(BlockKind::Wood, Rgb::new(116, 20, 20))), ); }, + TileKind::Keep(kind) => { + match kind { + tile::KeepKind::Middle => { + for i in 0..keep_levels + 1 { + let height = keep_level_height * i; + fill( + prim(Primitive::Aabb(Aabb { + min: wpos.with_z(self.alt + height), + max: (wpos + 6).with_z(self.alt + height + 1), + })), + Fill::Block(Block::new( + BlockKind::Rock, + Rgb::new(89, 44, 14), + )), + ); + } + }, + tile::KeepKind::Corner => {}, + tile::KeepKind::Wall(orientation) => { + for i in 0..keep_levels + 1 { + let height = keep_level_height * i; + // TODO clamp value in case of big heights + let window_height = keep_level_height - 3; + } + }, + } + }, + _ => {}, } } } diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 5587c97048..3f82ad5245 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -182,7 +182,9 @@ pub enum TileKind { Road { a: u16, b: u16, w: u16 }, Building, Castle, - Wall, + Wall(Ori), + Tower, + Keep(KeepKind), } #[derive(Clone, PartialEq)] @@ -209,7 +211,7 @@ impl Tile { pub fn is_obstacle(&self) -> bool { matches!( self.kind, - TileKind::Hazard(_) | TileKind::Building | TileKind::Castle | TileKind::Wall + TileKind::Hazard(_) | TileKind::Building | TileKind::Castle | TileKind::Wall(_) ) } } @@ -219,3 +221,23 @@ pub enum HazardKind { Water, Hill { gradient: f32 }, } + +#[derive(Copy, Clone, PartialEq)] +pub enum KeepKind { + Middle, + Corner, + Wall(Ori), +} + +#[repr(u8)] +#[derive(Copy, Clone, PartialEq)] +pub enum Ori { + North = 0, + East = 1, + South = 2, + West = 3, +} + +impl Ori { + pub fn dir(self) -> Vec2 {CARDINALS[self as u8 as usize]} +} From 0cbdc2b1b795f18fda55270f69a7f189a55afa02 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 6 Mar 2021 16:39:02 +0000 Subject: [PATCH 82/87] Better tree names --- assets/voxygen/i18n/en/hud/map.ron | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/voxygen/i18n/en/hud/map.ron b/assets/voxygen/i18n/en/hud/map.ron index 024b129386..8482ecfbc2 100644 --- a/assets/voxygen/i18n/en/hud/map.ron +++ b/assets/voxygen/i18n/en/hud/map.ron @@ -12,8 +12,8 @@ "hud.map.dungeons": "Dungeons", "hud.map.caves": "Caves", "hud.map.cave": "Cave", - "hud.map.trees": "Trees", - "hud.map.tree": "Tree", + "hud.map.trees": "Giant Trees", + "hud.map.tree": "Giant Tree", "hud.map.town": "Town", "hud.map.castle": "Castle", "hud.map.dungeon": "Dungeon", From 911acdd9db169ebc1c7503a1301a288dd89b81e6 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 6 Mar 2021 17:23:03 +0000 Subject: [PATCH 83/87] Fixed clippy warnings and fmt --- common/src/store.rs | 2 + voxygen/src/hud/map.rs | 10 ++--- voxygen/src/hud/minimap.rs | 2 - voxygen/src/scene/terrain.rs | 9 ++--- world/benches/tree.rs | 10 +++-- world/examples/site.rs | 1 - world/src/canvas.rs | 2 +- world/src/civ/mod.rs | 2 +- world/src/column/mod.rs | 8 ++-- world/src/layer/tree.rs | 13 +++--- world/src/lib.rs | 6 ++- world/src/sim/mod.rs | 9 ++--- world/src/site/mod.rs | 12 ++---- world/src/site/tree.rs | 38 +++++++++++++----- world/src/site2/gen.rs | 2 +- world/src/site2/mod.rs | 73 +++++++++++++++++++--------------- world/src/site2/plot.rs | 1 - world/src/site2/plot/castle.rs | 40 +++++++++---------- world/src/site2/plot/house.rs | 6 +-- world/src/site2/tile.rs | 22 +++++----- 20 files changed, 149 insertions(+), 119 deletions(-) diff --git a/common/src/store.rs b/common/src/store.rs index 2b819dd47d..75ce9dc427 100644 --- a/common/src/store.rs +++ b/common/src/store.rs @@ -73,6 +73,8 @@ impl Default for Store { } impl Store { + pub fn is_empty(&self) -> bool { self.len == 0 } + pub fn len(&self) -> usize { self.len } pub fn contains(&self, id: Id) -> bool { diff --git a/voxygen/src/hud/map.rs b/voxygen/src/hud/map.rs index 72f9db6c9f..f7a6c57444 100644 --- a/voxygen/src/hud/map.rs +++ b/voxygen/src/hud/map.rs @@ -570,7 +570,6 @@ impl<'a> Widget for Map<'a> { SiteKind::Castle => self.imgs.mmap_site_castle, SiteKind::Cave => self.imgs.mmap_site_cave, SiteKind::Tree => self.imgs.mmap_site_tree, - _ => self.imgs.mmap_site_excl, }) .x_y_position_relative_to( state.ids.grid, @@ -584,7 +583,6 @@ impl<'a> Widget for Map<'a> { SiteKind::Castle => self.imgs.mmap_site_castle_hover, SiteKind::Cave => self.imgs.mmap_site_cave_hover, SiteKind::Tree => self.imgs.mmap_site_tree_hover, - _ => self.imgs.mmap_site_excl, }) .image_color(UI_HIGHLIGHT_0) .with_tooltip( @@ -605,7 +603,7 @@ impl<'a> Widget for Map<'a> { _ => TEXT_COLOR, }, SiteKind::Cave => TEXT_COLOR, - _ => TEXT_COLOR, + SiteKind::Tree => TEXT_COLOR, }, ); // Only display sites that are toggled on @@ -630,8 +628,10 @@ impl<'a> Widget for Map<'a> { site_btn.set(state.ids.mmap_site_icons[i], ui); } }, - _ => { - site_btn.set(state.ids.mmap_site_icons[i], ui); + SiteKind::Tree => { + if show_trees { + site_btn.set(state.ids.mmap_site_icons[i], ui); + } }, } diff --git a/voxygen/src/hud/minimap.rs b/voxygen/src/hud/minimap.rs index fd84aa0407..ab0d64c9eb 100644 --- a/voxygen/src/hud/minimap.rs +++ b/voxygen/src/hud/minimap.rs @@ -304,7 +304,6 @@ impl<'a> Widget for MiniMap<'a> { SiteKind::Castle => self.imgs.mmap_site_castle_bg, SiteKind::Cave => self.imgs.mmap_site_cave_bg, SiteKind::Tree => self.imgs.mmap_site_tree, - _ => self.imgs.mmap_site_excl, }) .x_y_position_relative_to( state.ids.grid, @@ -335,7 +334,6 @@ impl<'a> Widget for MiniMap<'a> { SiteKind::Castle => self.imgs.mmap_site_castle, SiteKind::Cave => self.imgs.mmap_site_cave, SiteKind::Tree => self.imgs.mmap_site_tree, - _ => self.imgs.mmap_site_excl, }) .middle_of(state.ids.mmap_site_icons_bgs[i]) .w_h(20.0, 20.0) diff --git a/voxygen/src/scene/terrain.rs b/voxygen/src/scene/terrain.rs index c69a98aa62..725141cb1a 100644 --- a/voxygen/src/scene/terrain.rs +++ b/voxygen/src/scene/terrain.rs @@ -515,7 +515,7 @@ impl Terrain { const AMBIANCE: f32 = 0.15; // 0-1, the proportion of light that should illuminate the rear of an object - let (bias, total, max) = Spiral2d::new() + let (bias, total) = Spiral2d::new() .take(9) .map(|rpos| { let chunk_pos = wpos_chunk + rpos; @@ -535,14 +535,13 @@ impl Terrain { }) .flatten() .fold( - (Vec3::broadcast(0.001), 0.0, 0.0f32), - |(bias, total, max), (lpos, level)| { + (Vec3::broadcast(0.001), 0.0), + |(bias, total), (lpos, level)| { let rpos = lpos.map(|e| e as f32 + 0.5) - wpos; let level = (*level as f32 - rpos.magnitude()).max(0.0) / SUNLIGHT as f32; ( bias + rpos.try_normalized().unwrap_or_else(Vec3::zero) * level, total + level, - max.max(level), ) }, ); @@ -643,7 +642,7 @@ impl Terrain { // be meshed span!(guard, "Add chunks with modified blocks to mesh todo list"); // TODO: would be useful if modified blocks were grouped by chunk - for (&pos, &block) in scene_data.state.terrain_changes().modified_blocks.iter() { + for (&pos, &_block) in scene_data.state.terrain_changes().modified_blocks.iter() { // TODO: Be cleverer about this to avoid remeshing all neighbours. There are a // few things that can create an 'effect at a distance'. These are // as follows: diff --git a/world/benches/tree.rs b/world/benches/tree.rs index ba91d76ae5..291c30e792 100644 --- a/world/benches/tree.rs +++ b/world/benches/tree.rs @@ -1,4 +1,5 @@ -use criterion::{black_box, criterion_group, criterion_main, BatchSize, Benchmark, Criterion}; +use criterion::{black_box, criterion_group, criterion_main, BatchSize, Criterion}; +use rand::prelude::*; use veloren_world::layer::tree::{ProceduralTree, TreeConfig}; fn tree(c: &mut Criterion) { @@ -6,7 +7,10 @@ fn tree(c: &mut Criterion) { let mut i = 0; b.iter(|| { i += 1; - black_box(ProceduralTree::generate(TreeConfig::OAK, i)); + black_box(ProceduralTree::generate( + TreeConfig::oak(&mut thread_rng(), 1.0), + &mut thread_rng(), + )); }); }); @@ -15,7 +19,7 @@ fn tree(c: &mut Criterion) { b.iter_batched( || { i += 1; - ProceduralTree::generate(TreeConfig::OAK, i) + ProceduralTree::generate(TreeConfig::oak(&mut thread_rng(), 1.0), &mut thread_rng()) }, |tree| { let bounds = tree.get_bounds(); diff --git a/world/examples/site.rs b/world/examples/site.rs index b55e63026e..a731dcdc52 100644 --- a/world/examples/site.rs +++ b/world/examples/site.rs @@ -1,4 +1,3 @@ -use structopt::StructOpt; use svg_fmt::*; use veloren_world::site2::test_site; diff --git a/world/src/canvas.rs b/world/src/canvas.rs index 940ef051db..f7a8b22300 100644 --- a/world/src/canvas.rs +++ b/world/src/canvas.rs @@ -68,7 +68,7 @@ impl<'a> Canvas<'a> { .get(pos - self.wpos()) .ok() .copied() - .unwrap_or(Block::empty()) + .unwrap_or_else(Block::empty) } pub fn set(&mut self, pos: Vec3, block: Block) { diff --git a/world/src/civ/mod.rs b/world/src/civ/mod.rs index ef45d370c1..628d1536c9 100644 --- a/world/src/civ/mod.rs +++ b/world/src/civ/mod.rs @@ -108,7 +108,7 @@ impl Civs { attempt(5, || { let (kind, size) = match ctx.rng.gen_range(0..64) { 0..=4 => (SiteKind::Castle, 3), - 5..=28 => (SiteKind::Refactor, 6), + // 5..=28 => (SiteKind::Refactor, 6), 29..=31 => (SiteKind::Tree, 4), _ => (SiteKind::Dungeon, 0), }; diff --git a/world/src/column/mod.rs b/world/src/column/mod.rs index 5719b6a5ca..4e13675ff7 100644 --- a/world/src/column/mod.rs +++ b/world/src/column/mod.rs @@ -69,10 +69,10 @@ impl<'a> Sampler<'a> for ColumnGen<'a> { let sim = &self.sim; - let turb = Vec2::new( - sim.gen_ctx.turb_x_nz.get((wposf.div(48.0)).into_array()) as f32, - sim.gen_ctx.turb_y_nz.get((wposf.div(48.0)).into_array()) as f32, - ) * 12.0; + // let turb = Vec2::new( + // sim.gen_ctx.turb_x_nz.get((wposf.div(48.0)).into_array()) as f32, + // sim.gen_ctx.turb_y_nz.get((wposf.div(48.0)).into_array()) as f32, + // ) * 12.0; let wposf_turb = wposf; // + turb.map(|e| e as f64); let chaos = sim.get_interpolated(wpos, |chunk| chunk.chaos)?; diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 80b637c990..5082d1f61e 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -333,7 +333,7 @@ impl TreeConfig { } } - pub fn giant(rng: &mut impl Rng, scale: f32, inhabited: bool) -> Self { + pub fn giant(_rng: &mut impl Rng, scale: f32, inhabited: bool) -> Self { let log_scale = 1.0 + scale.log2().max(0.0); Self { @@ -380,7 +380,6 @@ impl ProceduralTree { 0, None, rng, - true, ); this.trunk_idx = trunk_idx; @@ -391,6 +390,7 @@ impl ProceduralTree { // returning the index and AABB of the branch. This AABB gets propagated // down to the parent and is used later during sampling to cull the branches to // be sampled. + #[allow(clippy::too_many_arguments)] fn add_branch( &mut self, config: &TreeConfig, @@ -401,7 +401,6 @@ impl ProceduralTree { depth: usize, sibling_idx: Option, rng: &mut impl Rng, - has_stairs: bool, ) -> (usize, Aabb) { let end = start + dir * branch_len; let line = LineSegment3 { start, end }; @@ -412,7 +411,10 @@ impl ProceduralTree { 0.0 }; - let has_stairs = /*has_stairs &&*/ config.inhabited && depth < config.max_depth && branch_radius > 6.5 && start.xy().distance(end.xy()) < (start.z - end.z).abs() * 1.5; + let has_stairs = config.inhabited + && depth < config.max_depth + && branch_radius > 6.5 + && start.xy().distance(end.xy()) < (start.z - end.z).abs() * 1.5; let bark_radius = if has_stairs { 5.0 } else { 0.0 } + wood_radius * 0.25; // The AABB that covers this branch, along with wood and leaves that eminate @@ -477,7 +479,6 @@ impl ProceduralTree { depth + 1, child_idx, rng, - has_stairs, ); child_idx = Some(branch_idx); // Parent branches AABBs include the AABBs of child branches to allow for @@ -523,7 +524,7 @@ impl ProceduralTree { // within its AABB if branch.aabb.contains_point(pos) { // Probe this branch - let (this, d2) = branch.is_branch_or_leaves_at(pos, parent); + let (this, _d2) = branch.is_branch_or_leaves_at(pos, parent); let siblings = branch_or_leaves | Vec4::from(this); diff --git a/world/src/lib.rs b/world/src/lib.rs index 043db27176..c3219fe5a5 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -1,6 +1,10 @@ #![deny(unsafe_code)] #![allow(incomplete_features)] -#![allow(clippy::option_map_unit_fn)] +#![allow( + clippy::option_map_unit_fn, + clippy::blocks_in_if_conditions, + clippy::too_many_arguments +)] #![deny(clippy::clone_on_ref_ptr)] #![feature( arbitrary_enum_discriminant, diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 2600672950..9458de6532 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -29,8 +29,8 @@ use crate::{ column::ColumnGen, site::Site, util::{ - seed_expan, DHashSet, FastNoise, FastNoise2d, RandomField, RandomPerm, Sampler, - StructureGen2d, CARDINALS, LOCALITY, NEIGHBORS, + seed_expan, DHashSet, FastNoise, FastNoise2d, RandomField, Sampler, StructureGen2d, + CARDINALS, LOCALITY, NEIGHBORS, }, IndexRef, CONFIG, }; @@ -1570,15 +1570,14 @@ impl WorldSim { // Vec2::new(rng.gen_range(-16..17), rng.gen_range(-16..17)); } for cliff in cliffs { - let alt = self.get(cliff).map_or(0.0, |c| c.alt); Spiral2d::new() .take((4usize * 2 + 1).pow(2)) .for_each(|rpos| { let dist = rpos.map(|e| e as f32).magnitude(); if let Some(c) = self.get_mut(cliff + rpos) { let warp = 1.0 / (1.0 + dist); - c.tree_density *= (1.0 - warp); - c.cliff_height = Lerp::lerp(44.0, 0.0, (-1.0 + dist / 3.5)); + c.tree_density *= 1.0 - warp; + c.cliff_height = Lerp::lerp(44.0, 0.0, -1.0 + dist / 3.5); } }); } diff --git a/world/src/site/mod.rs b/world/src/site/mod.rs index faf588af3f..2f7ed2a7e3 100644 --- a/world/src/site/mod.rs +++ b/world/src/site/mod.rs @@ -12,12 +12,8 @@ pub use self::{ settlement::Settlement, tree::Tree, }; -use crate::{column::ColumnSample, site2, Canvas, IndexRef}; -use common::{ - generation::ChunkSupplement, - terrain::Block, - vol::{BaseVol, ReadVol, RectSizedVol, WriteVol}, -}; +use crate::{column::ColumnSample, site2, Canvas}; +use common::generation::ChunkSupplement; use rand::Rng; use serde::Deserialize; use vek::*; @@ -121,8 +117,8 @@ impl Site { SiteKind::Settlement(s) => s.name(), SiteKind::Dungeon(d) => d.name(), SiteKind::Castle(c) => c.name(), - SiteKind::Refactor(s) => "Town", - SiteKind::Tree(t) => "Tree", + SiteKind::Refactor(_) => "Town", + SiteKind::Tree(_) => "Giant Tree", } } diff --git a/world/src/site/tree.rs b/world/src/site/tree.rs index 965e8e0670..a050dac93c 100644 --- a/world/src/site/tree.rs +++ b/world/src/site/tree.rs @@ -1,7 +1,7 @@ use crate::{ layer::tree::{ProceduralTree, TreeConfig}, - util::{FastNoise, Sampler}, site::SpawnRules, + util::{FastNoise, Sampler}, Canvas, Land, }; use common::terrain::{Block, BlockKind}; @@ -38,7 +38,7 @@ impl Tree { } } - pub fn render(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng) { + pub fn render(&self, canvas: &mut Canvas, _dynamic_rng: &mut impl Rng) { let nz = FastNoise::new(self.seed); canvas.foreach_col(|canvas, wpos2d, col| { @@ -50,18 +50,38 @@ impl Tree { return; } + let mut above = true; for z in (bounds.min.z..bounds.max.z + 1).rev() { let wpos = wpos2d.with_z(self.alt + z); let rposf = (wpos - self.origin.with_z(self.alt)).map(|e| e as f32 + 0.5); let (branch, leaves, _, _) = self.tree.is_branch_or_leaves_at(rposf); - if leaves { - let dark = Rgb::new(10, 70, 50).map(|e| e as f32); - let light = Rgb::new(80, 140, 10).map(|e| e as f32); - let leaf_col = Lerp::lerp(dark, light, nz.get(rposf.map(|e| e as f64) * 0.05) * 0.5 + 0.5); - canvas.set(wpos, Block::new(BlockKind::Leaves, leaf_col.map(|e| e as u8))); - } else if branch { - canvas.set(wpos, Block::new(BlockKind::Wood, Rgb::new(80, 32, 0))); + + if branch || leaves { + if above && col.snow_cover { + canvas.set( + wpos + Vec3::unit_z(), + Block::new(BlockKind::Snow, Rgb::new(255, 255, 255)), + ); + } + + if leaves { + let dark = Rgb::new(10, 70, 50).map(|e| e as f32); + let light = Rgb::new(80, 140, 10).map(|e| e as f32); + let leaf_col = Lerp::lerp( + dark, + light, + nz.get(rposf.map(|e| e as f64) * 0.05) * 0.5 + 0.5, + ); + canvas.set( + wpos, + Block::new(BlockKind::Leaves, leaf_col.map(|e| e as u8)), + ); + } else if branch { + canvas.set(wpos, Block::new(BlockKind::Wood, Rgb::new(80, 32, 0))); + } + + above = true; } } }); diff --git a/world/src/site2/gen.rs b/world/src/site2/gen.rs index f5522d113b..af81fbec7a 100644 --- a/world/src/site2/gen.rs +++ b/world/src/site2/gen.rs @@ -129,7 +129,7 @@ pub trait Structure { fn render_collect(&self, site: &Site) -> (Store, Vec<(Id, Fill)>) { let mut tree = Store::default(); let mut fills = Vec::new(); - let root = self.render(site, |p| tree.insert(p), |p, f| fills.push((p, f))); + self.render(site, |p| tree.insert(p), |p, f| fills.push((p, f))); (tree, fills) } } diff --git a/world/src/site2/mod.rs b/world/src/site2/mod.rs index 3c6c02f029..4587ad2e4f 100644 --- a/world/src/site2/mod.rs +++ b/world/src/site2/mod.rs @@ -5,18 +5,19 @@ mod tile; use self::{ gen::{Fill, Primitive, Structure}, plot::{Plot, PlotKind}, - tile::{HazardKind, Tile, TileGrid, TileKind, KeepKind, Ori, TILE_SIZE}, + tile::{HazardKind, Ori, Tile, TileGrid, TileKind, TILE_SIZE}, }; use crate::{ site::SpawnRules, - util::{attempt, DHashSet, Grid, CARDINALS, LOCALITY, SQUARE_4, SQUARE_9}, + util::{attempt, DHashSet, Grid, CARDINALS, SQUARE_4, SQUARE_9}, Canvas, Land, }; use common::{ astar::Astar, lottery::Lottery, spiral::Spiral2d, - store::{Id, Store}, terrain::{Block, BlockKind, SpriteKind, TerrainChunkSize}, + store::{Id, Store}, + terrain::{Block, BlockKind, SpriteKind, TerrainChunkSize}, vol::RectVolSize, }; use hashbrown::hash_map::DefaultHashBuilder; @@ -62,7 +63,6 @@ impl Site { self.wpos_tile(wpos + rpos * tile::TILE_SIZE as i32) .is_empty() }), - ..SpawnRules::default() } } @@ -193,12 +193,10 @@ impl Site { let search_pos = if rng.gen() { self.plot(*self.plazas.choose(rng)?).root_tile + (dir * 4.0).map(|e: f32| e.round() as i32) + } else if let PlotKind::Road(path) = &self.plot(*self.roads.choose(rng)?).kind { + *path.nodes().choose(rng)? + (dir * 1.0).map(|e: f32| e.round() as i32) } else { - if let PlotKind::Road(path) = &self.plot(*self.roads.choose(rng)?).kind { - *path.nodes().choose(rng)? + (dir * 1.0).map(|e: f32| e.round() as i32) - } else { - unreachable!() - } + unreachable!() }; self.find_aabr(search_pos, area_range, min_dims) @@ -360,14 +358,11 @@ impl Site { * rng.gen_range(16.0..48.0)) .map(|e| e as i32); - if site.plazas.iter().all(|&p| { - site.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2) - }) && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max() - { - Some(tile) - } else { - None - } + Some(tile).filter(|_| { + site.plazas.iter().all(|&p| { + site.plot(p).root_tile.distance_squared(tile) > 20i32.pow(2) + }) && rng.gen_range(0..48) > tile.map(|e| e.abs()).reduce_max() + }) }) .unwrap_or_else(Vec2::zero); @@ -444,21 +439,33 @@ impl Site { plot: Some(plot), }, ); - site.tiles.set(Vec2::new(aabr.center().x + 2, aabr.center().y + 2), tower.clone()); - site.tiles.set(Vec2::new(aabr.center().x + 2, aabr.center().y - 3), tower.clone()); - site.tiles.set(Vec2::new(aabr.center().x - 3, aabr.center().y + 2), tower.clone()); - site.tiles.set(Vec2::new(aabr.center().x - 3, aabr.center().y - 3), tower.clone()); + site.tiles.set( + Vec2::new(aabr.center().x + 2, aabr.center().y + 2), + tower.clone(), + ); + site.tiles.set( + Vec2::new(aabr.center().x + 2, aabr.center().y - 3), + tower.clone(), + ); + site.tiles.set( + Vec2::new(aabr.center().x - 3, aabr.center().y + 2), + tower.clone(), + ); + site.tiles.set( + Vec2::new(aabr.center().x - 3, aabr.center().y - 3), + tower.clone(), + ); site.blit_aabr( - Aabr { - min: aabr.center() - 2, - max: aabr.center() + 2, - }, - Tile { - kind: TileKind::Keep(tile::KeepKind::Middle), - plot: Some(plot), - }, - ); + Aabr { + min: aabr.center() - 2, + max: aabr.center() + 2, + }, + Tile { + kind: TileKind::Keep(tile::KeepKind::Middle), + plot: Some(plot), + }, + ); castles += 1; } @@ -486,7 +493,7 @@ impl Site { self.origin + tile * tile::TILE_SIZE as i32 + tile::TILE_SIZE as i32 / 2 } - pub fn render_tile(&self, canvas: &mut Canvas, dynamic_rng: &mut impl Rng, tpos: Vec2) { + pub fn render_tile(&self, canvas: &mut Canvas, _dynamic_rng: &mut impl Rng, tpos: Vec2) { let tile = self.tiles.get(tpos); let twpos = self.tile_wpos(tpos); let border = TILE_SIZE as i32; @@ -497,6 +504,7 @@ impl Site { }) .flatten(); + #[allow(clippy::single_match)] match &tile.kind { TileKind::Plaza => { let near_roads = CARDINALS.iter().filter_map(|rpos| { @@ -510,7 +518,7 @@ impl Site { } }); - cols.for_each(|(wpos2d, offs)| { + cols.for_each(|(wpos2d, _offs)| { let wpos2df = wpos2d.map(|e| e as f32); let dist = near_roads .clone() @@ -584,6 +592,7 @@ impl Site { let tile = self.wpos_tile(wpos2d); let seed = tile.plot.map_or(0, |p| self.plot(p).seed); + #[allow(clippy::single_match)] match tile.kind { TileKind::Field /*| TileKind::Road*/ => (-4..5).for_each(|z| canvas.map( Vec3::new(wpos2d.x, wpos2d.y, col.alt as i32 + z), diff --git a/world/src/site2/plot.rs b/world/src/site2/plot.rs index 57b55084ca..3b0bcaa1f1 100644 --- a/world/src/site2/plot.rs +++ b/world/src/site2/plot.rs @@ -26,7 +26,6 @@ impl Plot { } pub enum PlotKind { - Field, House(House), Plaza, Castle(Castle), diff --git a/world/src/site2/plot/castle.rs b/world/src/site2/plot/castle.rs index 0d24e985cb..6a185428c5 100644 --- a/world/src/site2/plot/castle.rs +++ b/world/src/site2/plot/castle.rs @@ -1,28 +1,28 @@ use super::*; -use crate::{util::SQUARE_4, Land}; -use common::terrain::{Block, BlockKind, SpriteKind}; +use crate::Land; +use common::terrain::{Block, BlockKind}; use rand::prelude::*; use vek::*; pub struct Castle { - entrance_tile: Vec2, + _entrance_tile: Vec2, tile_aabr: Aabr, - bounds: Aabr, + _bounds: Aabr, alt: i32, } impl Castle { pub fn generate( land: &Land, - rng: &mut impl Rng, + _rng: &mut impl Rng, site: &Site, entrance_tile: Vec2, tile_aabr: Aabr, ) -> Self { Self { - entrance_tile, + _entrance_tile: entrance_tile, tile_aabr, - bounds: Aabr { + _bounds: Aabr { min: site.tile_wpos(tile_aabr.min), max: site.tile_wpos(tile_aabr.max), }, @@ -39,20 +39,20 @@ impl Structure for Castle { mut fill: G, ) { let wall_height = 24; - let thickness = 12; + let _thickness = 12; let parapet_height = 2; let parapet_width = 1; - let downwards = 40; + let _downwards = 40; let tower_height = 12; let keep_levels = 3; let keep_level_height = 8; - let keep_height = wall_height + keep_levels * keep_level_height + 1; + let _keep_height = wall_height + keep_levels * keep_level_height + 1; for x in 0..self.tile_aabr.size().w { for y in 0..self.tile_aabr.size().h { let tile_pos = self.tile_aabr.min + Vec2::new(x, y); - let wpos_center = site.tile_center_wpos(tile_pos); + let _wpos_center = site.tile_center_wpos(tile_pos); let wpos = site.tile_wpos(tile_pos); let ori = if x == 0 || x == self.tile_aabr.size().w - 1 { Vec2::new(1, 0) @@ -71,7 +71,7 @@ impl Structure for Castle { }; let ori_tower = ori_tower_x + ori_tower_y; match site.tiles.get(tile_pos).kind.clone() { - TileKind::Wall(orientation) => { + TileKind::Wall(_ori) => { let wall = prim(Primitive::Aabb(Aabb { min: wpos.with_z(self.alt), max: (wpos + 6).with_z(self.alt + wall_height + parapet_height), @@ -115,7 +115,7 @@ impl Structure for Castle { })); let tower_lower_inner_x = prim(Primitive::Aabb(Aabb { min: Vec3::new( - wpos.x + 1 * ori_tower.x, + wpos.x + ori_tower.x, wpos.y + parapet_width, self.alt + wall_height, ), @@ -128,7 +128,7 @@ impl Structure for Castle { let tower_lower_inner_y = prim(Primitive::Aabb(Aabb { min: Vec3::new( wpos.x + parapet_width, - wpos.y + 1 * ori_tower.y, + wpos.y + ori_tower.y, self.alt + wall_height, ), max: Vec3::new( @@ -147,19 +147,19 @@ impl Structure for Castle { min: Vec3::new( wpos.x - 1, wpos.y - 1, - self.alt + wall_height + tower_height - 3 as i32, + self.alt + wall_height + tower_height - 3i32, ), max: Vec3::new( wpos.x + 7, wpos.y + 7, - self.alt + wall_height + tower_height - 1 as i32, + self.alt + wall_height + tower_height - 1i32, ), })); let tower_upper2 = prim(Primitive::Aabb(Aabb { min: Vec3::new( wpos.x - 2, wpos.y - 2, - self.alt + wall_height + tower_height - 1 as i32, + self.alt + wall_height + tower_height - 1i32, ), max: Vec3::new( wpos.x + 8, @@ -209,11 +209,11 @@ impl Structure for Castle { } }, tile::KeepKind::Corner => {}, - tile::KeepKind::Wall(orientation) => { + tile::KeepKind::Wall(_ori) => { for i in 0..keep_levels + 1 { - let height = keep_level_height * i; + let _height = keep_level_height * i; // TODO clamp value in case of big heights - let window_height = keep_level_height - 3; + let _window_height = keep_level_height - 3; } }, } diff --git a/world/src/site2/plot/house.rs b/world/src/site2/plot/house.rs index b9a32ce2a7..7bc85fc8c0 100644 --- a/world/src/site2/plot/house.rs +++ b/world/src/site2/plot/house.rs @@ -1,11 +1,11 @@ use super::*; -use crate::{util::SQUARE_4, Land}; +use crate::Land; use common::terrain::{Block, BlockKind, SpriteKind}; use rand::prelude::*; use vek::*; pub struct House { - door_tile: Vec2, + _door_tile: Vec2, tile_aabr: Aabr, bounds: Aabr, alt: i32, @@ -22,7 +22,7 @@ impl House { tile_aabr: Aabr, ) -> Self { Self { - door_tile, + _door_tile: door_tile, tile_aabr, bounds: Aabr { min: site.tile_wpos(tile_aabr.min), diff --git a/world/src/site2/tile.rs b/world/src/site2/tile.rs index 3f82ad5245..ef757f9887 100644 --- a/world/src/site2/tile.rs +++ b/world/src/site2/tile.rs @@ -7,6 +7,7 @@ pub const TILE_SIZE: u32 = 6; pub const ZONE_SIZE: u32 = 16; pub const ZONE_RADIUS: u32 = 16; pub const TILE_RADIUS: u32 = ZONE_SIZE * ZONE_RADIUS; +#[allow(dead_code)] pub const MAX_BLOCK_RADIUS: u32 = TILE_SIZE * TILE_RADIUS; pub struct TileGrid { @@ -48,7 +49,7 @@ impl TileGrid { Grid::populate_from(Vec2::broadcast(ZONE_SIZE as i32), |_| None) }) .get_mut(tpos.map(|e| e.rem_euclid(ZONE_SIZE as i32))) - .map(|tile| tile.get_or_insert_with(|| Tile::empty())) + .map(|tile| tile.get_or_insert_with(Tile::empty)) }) } @@ -87,15 +88,14 @@ impl TileGrid { let mut last_growth = 0; for i in 0..32 { - if i - last_growth >= 4 { - break; - } else if aabr.size().product() - + if i % 2 == 0 { - aabr.size().h - } else { - aabr.size().w - } - > area_range.end as i32 + if i - last_growth >= 4 + || aabr.size().product() + + if i % 2 == 0 { + aabr.size().h + } else { + aabr.size().w + } + > area_range.end as i32 { break; } else { @@ -239,5 +239,5 @@ pub enum Ori { } impl Ori { - pub fn dir(self) -> Vec2 {CARDINALS[self as u8 as usize]} + pub fn dir(self) -> Vec2 { CARDINALS[self as u8 as usize] } } From 9910398917d469d7954f9246c442ccde1bc17ff0 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sat, 6 Mar 2021 20:07:46 +0000 Subject: [PATCH 84/87] Fixed snow biome trees --- assets/voxygen/shaders/figure-frag.glsl | 5 ++++- world/src/layer/mod.rs | 1 + world/src/layer/tree.rs | 18 +++++++++--------- world/src/lib.rs | 2 +- world/src/sim/mod.rs | 24 ------------------------ world/src/site/tree.rs | 2 +- 6 files changed, 16 insertions(+), 36 deletions(-) diff --git a/assets/voxygen/shaders/figure-frag.glsl b/assets/voxygen/shaders/figure-frag.glsl index 3b3fd6d84f..53efa597af 100644 --- a/assets/voxygen/shaders/figure-frag.glsl +++ b/assets/voxygen/shaders/figure-frag.glsl @@ -184,7 +184,10 @@ void main() { float ao = f_ao * sqrt(f_ao);//0.25 + f_ao * 0.75; ///*pow(f_ao, 0.5)*/f_ao * 0.85 + 0.15; - vec3 glow = pow(pow(model_glow.w, 2.0) * (max(dot(f_norm, normalize(model_glow.xyz)) * 0.5 + 0.5, 0.0) * 1.0 + max(1.0 - length(model_glow.xyz), 0.0)), 1) * 4 * glow_light(f_pos); + float glow_mag = length(model_glow.xyz); + vec3 glow = pow(model_glow.w, 2) * 4 + * glow_light(f_pos) + * (max(dot(f_norm, model_glow.xyz / glow_mag) * 0.5 + 0.5, 0.0) + max(1.0 - glow_mag, 0.0)); emitted_light += glow; reflected_light *= ao; diff --git a/world/src/layer/mod.rs b/world/src/layer/mod.rs index 64e5d99e58..24c38c3b6a 100644 --- a/world/src/layer/mod.rs +++ b/world/src/layer/mod.rs @@ -305,6 +305,7 @@ pub fn apply_caves_supplement<'a>( } } +#[allow(dead_code)] pub fn apply_coral_to(canvas: &mut Canvas) { let info = canvas.info(); diff --git a/world/src/layer/tree.rs b/world/src/layer/tree.rs index 5082d1f61e..d94c8e417a 100644 --- a/world/src/layer/tree.rs +++ b/world/src/layer/tree.rs @@ -313,21 +313,21 @@ impl TreeConfig { } pub fn pine(rng: &mut impl Rng, scale: f32) -> Self { - let scale = scale * (1.0 + rng.gen::().powi(4)); + let scale = scale * (1.0 + rng.gen::().powi(4) * 0.5); let log_scale = 1.0 + scale.log2().max(0.0); Self { - trunk_len: 24.0 * scale, + trunk_len: 32.0 * scale, trunk_radius: 1.25 * scale, - branch_child_len: 0.4 / scale, + branch_child_len: 0.35 / scale, branch_child_radius: 0.0, - leaf_radius: 1.5 * log_scale..2.0 * log_scale, + leaf_radius: 2.5 * log_scale..2.75 * log_scale, straightness: 0.0, max_depth: 1, - splits: 50.0..70.0, - split_range: 0.15..1.2, + splits: 40.0..50.0, + split_range: 0.165..1.2, branch_len_bias: 0.75, - leaf_vertical_scale: 0.5, + leaf_vertical_scale: 0.3, proportionality: 1.0, inhabited: false, } @@ -443,8 +443,8 @@ impl ProceduralTree { const PHI: f32 = 0.618; const RAD_PER_BRANCH: f32 = f32::consts::TAU * PHI; - let screw = (screw_shift + dist * splits as f32 * RAD_PER_BRANCH).sin() * x_axis - + (screw_shift + dist * splits as f32 * RAD_PER_BRANCH).cos() * y_axis; + let screw = (screw_shift + i as f32 * RAD_PER_BRANCH).sin() * x_axis + + (screw_shift + i as f32 * RAD_PER_BRANCH).cos() * y_axis; // Choose a point close to the branch to act as the target direction for the // branch to grow in let split_factor = diff --git a/world/src/lib.rs b/world/src/lib.rs index c3219fe5a5..0117d899a3 100644 --- a/world/src/lib.rs +++ b/world/src/lib.rs @@ -299,7 +299,7 @@ impl World { layer::apply_trees_to(&mut canvas, &mut dynamic_rng); layer::apply_scatter_to(&mut canvas, &mut dynamic_rng); layer::apply_paths_to(&mut canvas); - layer::apply_coral_to(&mut canvas); + // layer::apply_coral_to(&mut canvas); // Apply site generation sim_chunk diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index 9458de6532..fc05bc8d89 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -1545,30 +1545,6 @@ impl WorldSim { } } - // for locs in cliff_path.windows(3) { - // let to_prev_idx = NEIGHBORS - // .iter() - // .enumerate() - // .find(|(_, dir)| **dir == locs[0].0 - locs[1].0) - // .expect("Track locations must be neighbors") - // .0; - // let to_next_idx = NEIGHBORS - // .iter() - // .enumerate() - // .find(|(_, dir)| **dir == locs[2].0 - locs[1].0) - // .expect("Track locations must be neighbors") - // .0; - - // self.get_mut(locs[0].0).unwrap().cliff.0.neighbors |= - // 1 << ((to_prev_idx as u8 + 4) % 8); - // self.get_mut(locs[1].0).unwrap().cliff.0.neighbors |= - // (1 << (to_prev_idx as u8)) | (1 << (to_next_idx as u8)); - // self.get_mut(locs[2].0).unwrap().cliff.0.neighbors |= - // 1 << ((to_next_idx as u8 + 4) % 8); - - // self.get_mut(locs[1].0).unwrap().cliff.0.offset = - // Vec2::new(rng.gen_range(-16..17), rng.gen_range(-16..17)); } - for cliff in cliffs { Spiral2d::new() .take((4usize * 2 + 1).pow(2)) diff --git a/world/src/site/tree.rs b/world/src/site/tree.rs index a050dac93c..c1c8327cd4 100644 --- a/world/src/site/tree.rs +++ b/world/src/site/tree.rs @@ -81,7 +81,7 @@ impl Tree { canvas.set(wpos, Block::new(BlockKind::Wood, Rgb::new(80, 32, 0))); } - above = true; + above = false; } } }); From 36d20e6990d29abef1de59ef039b2cff0cef39e3 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 7 Mar 2021 12:17:40 +0000 Subject: [PATCH 85/87] Better docs, faster terrain meshing --- assets/voxygen/shaders/include/sky.glsl | 3 +++ voxygen/src/mesh/terrain.rs | 12 +++++------- world/src/sim/mod.rs | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/assets/voxygen/shaders/include/sky.glsl b/assets/voxygen/shaders/include/sky.glsl index ddbb15efbf..b614efbd7f 100644 --- a/assets/voxygen/shaders/include/sky.glsl +++ b/assets/voxygen/shaders/include/sky.glsl @@ -44,9 +44,12 @@ const float UNDERWATER_MIST_DIST = 100.0; const float PERSISTENT_AMBIANCE = 1.0 / 32.0;// 1.0 / 80; // 1.0 / 512; // 0.00125 // 0.1;// 0.025; // 0.1; +// Glow from static light sources // Allowed to be > 1 due to HDR const vec3 GLOW_COLOR = vec3(3.0, 0.9, 0.05); +// Calculate glow from static light sources, + some noise for flickering. +// TODO: Optionally disable the flickering for performance? vec3 glow_light(vec3 pos) { return GLOW_COLOR * (1.0 + (noise_3d(vec3(pos.xy * 0.005, tick.x * 0.5)) - 0.5) * 1.0); } diff --git a/voxygen/src/mesh/terrain.rs b/voxygen/src/mesh/terrain.rs index de08a545a7..d2ab578a6e 100644 --- a/voxygen/src/mesh/terrain.rs +++ b/voxygen/src/mesh/terrain.rs @@ -381,13 +381,11 @@ impl<'a, V: RectRasterableVol + ReadVol + Debug + 'static> let draw_delta = Vec3::new(1, 1, z_start); let get_light = |_: &mut (), pos: Vec3| { - volume.get(range.min + pos).map_or(1.0, |b| { - if b.is_opaque() { - 0.0 - } else { - light(pos + range.min) - } - }) + if flat_get(pos).is_opaque() { + 0.0 + } else { + light(pos + range.min) + } }; let get_glow = |_: &mut (), pos: Vec3| glow(pos + range.min); let get_color = diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index fc05bc8d89..df95fa4ee2 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -23,7 +23,7 @@ pub use self::{ }; use crate::{ - all::*, + all::{Environment, ForestKind, TreeAttr}, block::BlockGen, civ::Place, column::ColumnGen, From e4e512a5d73c54273a06c486959c1534c06e2d98 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 7 Mar 2021 12:27:29 +0000 Subject: [PATCH 86/87] Updated changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35e221fe66..4976a302f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New enemies in 5 lower dungeons - Added on join event in plugins - Item stacking and splitting +- Procedural trees (currently only oaks and pines are procedural) +- Cliffs on steep slopes +- Giant tree sites ### Changed @@ -63,6 +66,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Items can be requested from the counterparty's inventory during trade. - Savanna grasses restricted to savanna, cacti to desert. - Fireworks recursively shoot more fireworks. +- Improved static light rendering and illumination +- Improved the tree spawning model to allow for overlapping forests +- Changed sunlight (and, in general, static light) propagation through blocks to allow for more material properties ### Removed From e42be14a372e93da2b58179477ac42d8c0ba9e89 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 7 Mar 2021 16:55:58 +0000 Subject: [PATCH 87/87] Updated lockfile dependencies --- Cargo.lock | 1995 +++++++++++++++++++++++++--------------------------- 1 file changed, 955 insertions(+), 1040 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 097c0e9674..5cff08740c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,27 +2,27 @@ # It is not intended for manual editing. [[package]] name = "ab_glyph" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a685fe66654266f321a8b572660953f4df36a2135706503a4c89981d76e1a2" +checksum = "65b1f87418ab9d7e1ee2a783aa167767ebeb316d0a9fb10c347aec28a5008acb" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser 0.8.0", + "owned_ttf_parser 0.11.0", ] [[package]] name = "ab_glyph_rasterizer" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2692800d602527d2b8fea50036119c37df74ab565b10e285706a3dcec0ec3e16" +checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" [[package]] name = "addr2line" -version = "0.13.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" +checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" dependencies = [ - "gimli", + "gimli 0.23.0", ] [[package]] @@ -51,29 +51,29 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "ahash" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75b7e6a93ecd6dbd2c225154d0fa7f86205574ecaa6c87429fb5f66ee677c44" +checksum = "796540673305a66d127804eef19ad696f1f204b8c1025aaca4958c17eab32877" dependencies = [ - "getrandom 0.2.0", - "lazy_static", + "getrandom 0.2.2", + "once_cell", "version_check 0.9.2", ] [[package]] name = "aho-corasick" -version = "0.7.13" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" +checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" dependencies = [ "memchr", ] [[package]] name = "alsa" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44581add1add74ade32aca327b550342359ec00191672c23c1caa3d492b85930" +checksum = "eb213f6b3e4b1480a60931ca2035794aa67b73103d254715b1db7b70dcb3c934" dependencies = [ "alsa-sys", "bitflags", @@ -83,9 +83,9 @@ dependencies = [ [[package]] name = "alsa-sys" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5a0559bcd3f7a482690d98be41c08a43e92f669b179433e95ddf5e8b8fd36a3" +checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" dependencies = [ "libc", "pkg-config", @@ -93,12 +93,11 @@ dependencies = [ [[package]] name = "andrew" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1ea80a5089cac999ffd4a91888154076a961d27387b0f7a6cd2d4dddb636b9" +checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" dependencies = [ "bitflags", - "line_drawing", "rusttype 0.9.2", "walkdir 2.3.1", "xdg", @@ -151,7 +150,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -160,15 +159,9 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" dependencies = [ - "num-traits 0.2.14", + "num-traits", ] -[[package]] -name = "arc-swap" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" - [[package]] name = "arr_macro" version = "0.1.3" @@ -186,8 +179,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0609c78bd572f4edc74310dfb63a01f5609d53fa8b4dd7c4d98aef3b3e8d72d1" dependencies = [ "proc-macro-hack", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -198,8 +191,8 @@ checksum = "5a1ae06b5f52588295bfd019b837b6fb1a6914d58ece30b0c43ae439ef08e562" dependencies = [ "proc-macro-error", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -210,9 +203,9 @@ checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" [[package]] name = "arrayvec" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "as-slice" @@ -234,16 +227,16 @@ checksum = "eab1c04a571841102f5345a8fc0f6bb3d31c315dec879b5c6e42e40ce7ffa34e" [[package]] name = "assets_manager" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3593b8ddb9708251c7a57b07c917c77ecc685e804b697366d26fb4af64c9b960" +checksum = "dac94eeee6ebd1165959e440836a452109f9f839d6cfde12974d75a5b4222406" dependencies = [ - "ahash 0.6.2", + "ahash 0.6.3", "bincode", - "crossbeam-channel 0.5.0", + "crossbeam-channel", "log", "notify 4.0.15", - "parking_lot 0.11.0", + "parking_lot 0.11.1", "ron", "serde", "serde_json", @@ -251,9 +244,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "1.6.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" +checksum = "59740d83946db6a5af71ae25ddf9562c2b176b2ca42cf99a455f09f4a220d6b9" dependencies = [ "concurrent-queue", "event-listener", @@ -267,15 +260,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d3a45e77e34375a7923b1e8febb049bb011f064714a8e17a1a616fef01da13d" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "atom" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c86699c3f02778ec07158376991c8f783dd1f2f95c579ffaf0738dc984b2fe2" +checksum = "c9ff149ed9780025acfdb36862d35b28856bb693ceb451259a7164442f22fdc3" [[package]] name = "atty" @@ -309,16 +302,10 @@ dependencies = [ "reqwest", "rust-argon2", "serde", - "url 2.1.1", + "url", "uuid", ] -[[package]] -name = "autocfg" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" - [[package]] name = "autocfg" version = "1.0.1" @@ -327,38 +314,23 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.50" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46254cf2fdcdf1badb5934448c1bcbe046a56537b3987d96c51a7afc5d03f293" +checksum = "9d117600f438b1707d4e4ae15d3595657288f8235a0eb593e80ecc98ab34e1bc" dependencies = [ "addr2line", - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "miniz_oxide 0.4.2", - "object 0.20.0", + "miniz_oxide 0.4.3", + "object 0.23.0", "rustc-demangle", ] [[package]] name = "base-x" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" - -[[package]] -name = "base64" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -dependencies = [ - "byteorder", -] - -[[package]] -name = "base64" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +checksum = "a4521f3e3d031370679b3b140beb36dfe4801b09ac77e30c61941f97df3ef28b" [[package]] name = "base64" @@ -366,6 +338,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + [[package]] name = "bincode" version = "1.3.1" @@ -390,7 +368,7 @@ dependencies = [ "lazycell", "peeking_take_while", "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "regex", "rustc-hash", "shlex", @@ -404,9 +382,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bitvec" -version = "0.21.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23f76a953a42e113af6b4f3481ca32ff0a1ddbdcaa714a2333c956807b74a5f" +checksum = "35a2e31dce162f8f238c3c35a6600f1df4cb30f8929a6c464b0a8118d17c2502" dependencies = [ "funty", "radium", @@ -416,9 +394,9 @@ dependencies = [ [[package]] name = "blake2b_simd" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" +checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", "arrayvec", @@ -433,9 +411,9 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bstr" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931" +checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" dependencies = [ "lazy_static", "memchr", @@ -445,15 +423,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "099e596ef14349721d9016f6b80dd3419ea1bf289ab9b44df8e4dfd3a005d5d9" [[package]] name = "bytemuck" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac" +checksum = "5a4bad0c5981acc24bc09e532f35160f952e35422603f0563cd7a73c2c2e65a0" dependencies = [ "bytemuck_derive", ] @@ -465,15 +443,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e215f8c2f9f79cb53c8335e687ffd07d5bfcb6fe5fc80723762d0be46e7cc54" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "bytes" @@ -495,9 +473,9 @@ checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" [[package]] name = "calloop" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59561a8b3968ba4bda0c46f42e0568507c5d26e94c3b6f2a0c730cbecd83ff3a" +checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" dependencies = [ "log", "nix 0.18.0", @@ -520,9 +498,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.60" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" +checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" dependencies = [ "jobserver", ] @@ -565,22 +543,22 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d021fddb7bd3e734370acfa4a83f34095571d8570c039f1420d77540f68d5772" +checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ "libc", "num-integer", - "num-traits 0.2.14", - "time", + "num-traits", + "time 0.1.43", "winapi 0.3.9", ] [[package]] name = "chunked_transfer" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d29eb15132782371f71da8f947dba48b3717bdb6fa771b9b434d645e40a7193" +checksum = "fff857943da45f546682664a79488be82e69e43c1a7a2307679ab9afb3a66d2e" [[package]] name = "clang-sys" @@ -642,20 +620,21 @@ dependencies = [ [[package]] name = "clipboard_wayland" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "926d872adca0fc88173f8b7532c651e29ce67dc97323f4546c1c8af6610937fb" +checksum = "61bcb8cde0387fde807b9b7af66ce8bd1665ef736e46e6e47fda82ea003e6ade" dependencies = [ - "smithay-clipboard 0.5.2", + "smithay-clipboard", ] [[package]] name = "clipboard_x11" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "137cbd60c42327a8d63e710cee5a4d6a1ac41cdc90449ea2c2c63bd5e186290a" +checksum = "40403aa5220e5cd303d32dc4248cac8aa92bf47e3ae31e0e2481081755a63ff1" dependencies = [ - "xcb", + "thiserror", + "x11rb", ] [[package]] @@ -668,12 +647,12 @@ dependencies = [ ] [[package]] -name = "cloudabi" -version = "0.1.0" +name = "cmake" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" +checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" dependencies = [ - "bitflags", + "cc", ] [[package]] @@ -686,7 +665,7 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation 0.9.1", - "core-graphics 0.22.1", + "core-graphics 0.22.2", "foreign-types", "libc", "objc", @@ -702,7 +681,7 @@ dependencies = [ "block", "cocoa-foundation", "core-foundation 0.9.1", - "core-graphics 0.22.1", + "core-graphics 0.22.2", "foreign-types", "libc", "objc", @@ -744,13 +723,12 @@ dependencies = [ [[package]] name = "combine" -version = "4.3.2" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2809f67365382d65fd2b6d9c22577231b954ed27400efeafbe687bda75abcc0b" +checksum = "cc4369b5e4c0cddf64ad8981c0111e7df4f7078f4d6ba98fb31f2e17c4c57b7e" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "memchr", - "pin-project-lite 0.1.9", ] [[package]] @@ -794,9 +772,9 @@ source = "git+https://gitlab.com/veloren/conrod.git?branch=copypasta_0.7#1ae5193 [[package]] name = "const_fn" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" +checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" [[package]] name = "constant_time_eq" @@ -806,12 +784,29 @@ checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] name = "cookie" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784ad0fbab4f3e9cef09f20e0aea6000ae08d2cb98ac4c0abc53df18803d702f" +dependencies = [ + "percent-encoding", + "time 0.2.25", + "version_check 0.9.2", +] + +[[package]] +name = "cookie_store" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888604f00b3db336d2af898ec3c1d5d0ddf5e6d462220f2ededc33a87ac4bbd5" +checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3" dependencies = [ - "time", - "url 1.7.2", + "cookie", + "idna", + "log", + "publicsuffix", + "serde", + "serde_json", + "time 0.2.25", + "url", ] [[package]] @@ -833,7 +828,7 @@ dependencies = [ "objc", "objc-foundation", "objc_id", - "smithay-clipboard 0.6.1", + "smithay-clipboard", "x11-clipboard", ] @@ -863,7 +858,7 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ - "core-foundation-sys 0.8.1", + "core-foundation-sys 0.8.2", "libc", ] @@ -881,9 +876,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0af3b5e4601de3837c9332e29e0aae47a0d46ebfa246d12b82f564bac233393" +checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" [[package]] name = "core-graphics" @@ -899,9 +894,9 @@ dependencies = [ [[package]] name = "core-graphics" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc239bba52bab96649441699533a68de294a101533b0270b2d65aa402b29a7f9" +checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" dependencies = [ "bitflags", "core-foundation 0.9.1", @@ -956,9 +951,9 @@ dependencies = [ [[package]] name = "cpal" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4919d30839e3924b45b84319997a554db1a56918bc5b2a08a6c29886e65e2dca" +checksum = "05631e2089dfa5d3b6ea1cfbbfd092e2ee5deeb69698911bc976b28b746d3657" dependencies = [ "alsa", "core-foundation-sys 0.6.2", @@ -972,7 +967,7 @@ dependencies = [ "ndk-glue", "nix 0.15.0", "oboe", - "parking_lot 0.9.0", + "parking_lot 0.11.1", "stdweb 0.1.3", "thiserror", "web-sys", @@ -999,10 +994,10 @@ dependencies = [ "cranelift-codegen-meta", "cranelift-codegen-shared", "cranelift-entity", - "gimli", + "gimli 0.22.0", "log", "regalloc", - "smallvec 1.5.1", + "smallvec", "target-lexicon", "thiserror", ] @@ -1040,17 +1035,17 @@ checksum = "b608bb7656c554d0a4cf8f50c7a10b857e80306f6ff829ad6d468a7e2323c8d8" dependencies = [ "cranelift-codegen", "log", - "smallvec 1.5.1", + "smallvec", "target-lexicon", ] [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -1067,7 +1062,7 @@ dependencies = [ "futures", "itertools 0.10.0", "lazy_static", - "num-traits 0.2.14", + "num-traits", "oorandom", "plotters", "rayon", @@ -1098,23 +1093,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd01a6eb3daaafa260f6fc94c3a6c36390abc2080e38e3e34ced87393fb77d80" dependencies = [ "cfg-if 1.0.0", - "crossbeam-channel 0.5.0", + "crossbeam-channel", "crossbeam-deque 0.8.0", - "crossbeam-epoch 0.9.0", + "crossbeam-epoch 0.9.1", "crossbeam-queue", "crossbeam-utils 0.8.1", ] -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - [[package]] name = "crossbeam-channel" version = "0.5.0" @@ -1143,7 +1128,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.0", + "crossbeam-epoch 0.9.1", "crossbeam-utils 0.8.1", ] @@ -1153,7 +1138,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" dependencies = [ - "autocfg 1.0.1", + "autocfg", "cfg-if 0.1.10", "crossbeam-utils 0.7.2", "lazy_static", @@ -1164,15 +1149,15 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f606a85340376eef0d6d8fec399e6d4a544d648386c6645eb6d0653b27d9f" +checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" dependencies = [ "cfg-if 1.0.0", "const_fn", "crossbeam-utils 0.8.1", "lazy_static", - "memoffset 0.5.6", + "memoffset 0.6.1", "scopeguard", ] @@ -1192,7 +1177,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" dependencies = [ - "autocfg 1.0.1", + "autocfg", "cfg-if 0.1.10", "lazy_static", ] @@ -1203,7 +1188,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" dependencies = [ - "autocfg 1.0.1", + "autocfg", "cfg-if 1.0.0", "lazy_static", ] @@ -1218,9 +1203,9 @@ dependencies = [ "crossterm_winapi", "lazy_static", "libc", - "mio 0.7.9", + "mio 0.7.7", "parking_lot 0.10.2", - "signal-hook 0.1.16", + "signal-hook 0.1.17", "winapi 0.3.9", ] @@ -1234,9 +1219,9 @@ dependencies = [ "crossterm_winapi", "lazy_static", "libc", - "mio 0.7.9", - "parking_lot 0.11.0", - "signal-hook 0.1.16", + "mio 0.7.7", + "parking_lot 0.11.1", + "signal-hook 0.1.17", "winapi 0.3.9", ] @@ -1251,9 +1236,9 @@ dependencies = [ [[package]] name = "csv" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00affe7f6ab566df61b4be3ce8cf16bc2576bca0963ceb0955e45d514bf9a279" +checksum = "f9d58633299b24b515ac72a3f869f8b91306a3cec616a602843a383acd6f9e97" dependencies = [ "bstr", "csv-core", @@ -1299,9 +1284,9 @@ dependencies = [ "fnv", "ident_case", "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "strsim 0.9.3", - "syn 1.0.54", + "syn 1.0.60", ] [[package]] @@ -1311,8 +1296,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" dependencies = [ "darling_core", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -1327,13 +1312,13 @@ dependencies = [ [[package]] name = "derivative" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -1360,8 +1345,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -1384,16 +1369,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" -dependencies = [ - "cfg-if 0.1.10", - "dirs-sys", -] - [[package]] name = "dirs" version = "3.0.1" @@ -1403,6 +1378,16 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" version = "0.3.5" @@ -1410,18 +1395,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" dependencies = [ "libc", - "redox_users", + "redox_users 0.3.5", "winapi 0.3.9", ] [[package]] name = "dirs-sys-next" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c60f7b8a8953926148223260454befb50c751d3c50e1c178c4fd1ace4083c9a" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", - "redox_users", + "redox_users 0.4.0", "winapi 0.3.9", ] @@ -1449,7 +1434,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" dependencies = [ - "libloading 0.6.3", + "libloading 0.6.7", ] [[package]] @@ -1485,12 +1470,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "dtoa" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d7ed2934d741c6b37e33e3832298e8850b53fd2d2bea03873375596c7cea4e" - [[package]] name = "either" version = "1.6.1" @@ -1499,9 +1478,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.26" +version = "0.8.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" +checksum = "80df024fbc5ac80f87dfef0d9f5209a252f2a497f7f42944cff24d8253cac065" dependencies = [ "cfg-if 1.0.0", ] @@ -1522,30 +1501,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "enumset" -version = "1.0.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "959a80a2062fedd66ed41d99736212de987b3a8c83a4c2cef243968075256bd1" +checksum = "cf6167d1be7a76696cadccfbdb89e5cb519244a42bab7da5577994579217dcff" dependencies = [ "enumset_derive", - "num-traits 0.2.14", ] [[package]] name = "enumset_derive" -version = "0.5.0" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74bef436ac71820c5cf768d7af9ba33121246b09a00e09a55d94ef8095a875ac" +checksum = "0d8a79bce471eb6165aa8ac86ebc8d788543b741eaa15e8b8486591696207d6c" dependencies = [ "darling", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -1583,7 +1561,7 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5337024b8293bdce5265dc9570ef6e608a34bfacbbc87fe1a5dcb5f1dac2f4e2" dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -1614,15 +1592,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb5acb1045ebbfa222e2c50679e392a71dd77030b78fb0189f2d9c5974400f9" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "fetch_unroll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5c55005e95bbe15f5f72a73b6597d0dc82ddc97ffe2ca097a99dcd591fefbca" +checksum = "c8d44807d562d137f063cbfe209da1c3f9f2fa8375e11166ef495daab7b847f9" dependencies = [ "libflate", "tar", @@ -1631,13 +1609,13 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" +checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.2.5", "winapi 0.3.9", ] @@ -1653,6 +1631,18 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86d4de0081402f5e88cdac65c8dcdcc73118c1a7a465e2a05f0da05843a8ea33" +[[package]] +name = "flate2" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" +dependencies = [ + "cfg-if 1.0.0", + "crc32fast", + "libc", + "miniz_oxide 0.4.3", +] + [[package]] name = "fnv" version = "1.0.7" @@ -1674,6 +1664,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "form_urlencoded" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +dependencies = [ + "matches", + "percent-encoding", +] + [[package]] name = "fsevent" version = "0.4.0" @@ -1712,12 +1712,6 @@ dependencies = [ "libc", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -1742,9 +1736,9 @@ checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" [[package]] name = "futures" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e05b85ec287aac0dc34db7d4a569323df697f9c55b99b15d6b4ef8cde49f613" +checksum = "da9052a1a50244d8d5aa9bf55cbc2fb6f357c86cc52e46c62ed390a7180cf150" dependencies = [ "futures-channel", "futures-core", @@ -1757,9 +1751,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "f2d31b7ec7efab6eefc7c57233bb10b847986139d88cc2f5a02a1ae6871a1846" dependencies = [ "futures-core", "futures-sink", @@ -1767,15 +1761,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" +checksum = "79e5145dde8da7d1b3892dad07a9c98fc04bc39892b1ecc9692cf53e2b780a65" [[package]] name = "futures-executor" -version = "0.3.5" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6bb888be1153d3abeb9006b11b02cf5e9b209fda28693c31ae1e4e012e314" +checksum = "e9e59fdc009a4b3096bf94f740a0f2424c082521f20a9b08c5c07c48d90fd9b9" dependencies = [ "futures-core", "futures-task", @@ -1785,42 +1779,42 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "28be053525281ad8259d47e4de5de657b25e7bac113458555bb4b70bc6870500" [[package]] name = "futures-macro" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +checksum = "c287d25add322d9f9abdcdc5927ca398917996600182178774032e9f8258fedd" dependencies = [ "proc-macro-hack", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "futures-sink" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" +checksum = "caf5c69029bda2e743fddd0582d1083951d65cc9539aebf8812f36c3491342d6" [[package]] name = "futures-task" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" +checksum = "13de07eb8ea81ae445aca7b69f5f7bf15d7bf4912d8ca37d6645c77ae8a58d86" dependencies = [ "once_cell", ] [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "632a8cd0f2a4b3fdea1657f08bde063848c3bd00f9bbf6e256b8be78802e624b" dependencies = [ "futures-channel", "futures-core", @@ -1829,7 +1823,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project 1.0.2", + "pin-project-lite 0.2.4", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -1874,25 +1868,35 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.1.15" +name = "gethostname" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "e692e296bfac1d2533ef168d0b60ff5897b8b70a4009276834014dd8924cc028" dependencies = [ - "cfg-if 0.1.10", + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] @@ -1984,10 +1988,16 @@ dependencies = [ ] [[package]] -name = "git2" -version = "0.13.11" +name = "gimli" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e094214efbc7fdbbdee952147e493b00e99a4e52817492277e98967ae918165" +checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" + +[[package]] +name = "git2" +version = "0.13.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d250f5f82326884bd39c2853577e70a121775db76818ffa452ed1e80de12986" dependencies = [ "bitflags", "libc", @@ -1995,7 +2005,7 @@ dependencies = [ "log", "openssl-probe", "openssl-sys", - "url 2.1.1", + "url", ] [[package]] @@ -2050,12 +2060,12 @@ dependencies = [ "glutin_glx_sys", "glutin_wgl_sys", "lazy_static", - "libloading 0.6.3", + "libloading 0.6.7", "log", "objc", "osmesa-sys", - "parking_lot 0.11.0", - "wayland-client 0.28.1", + "parking_lot 0.11.1", + "wayland-client 0.28.3", "wayland-egl", "winapi 0.3.9", "winit", @@ -2108,26 +2118,26 @@ dependencies = [ [[package]] name = "glyph_brush" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afd3e2cfd503a5218dd56172a8bf7c8655a4a7cf745737c606a6edfeea1b343f" +checksum = "3e3f00b8574a76fb6c50890c48da03946ca50e4372a2778737922666a2238221" dependencies = [ "glyph_brush_draw_cache", "glyph_brush_layout", "log", - "ordered-float 1.1.0", + "ordered-float 2.1.1", "rustc-hash", "twox-hash", ] [[package]] name = "glyph_brush_draw_cache" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cef969a091be5565c2c10b31fd2f115cbeed9f783a27c96ae240ff8ceee067c" +checksum = "ac2c82074cafb68b9e459c50c655f7eedcb92d6ee7166813802934bc6fc29fa3" dependencies = [ "ab_glyph", - "crossbeam-channel 0.5.0", + "crossbeam-channel", "crossbeam-deque 0.8.0", "linked-hash-map", "rayon", @@ -2169,7 +2179,7 @@ dependencies = [ "http", "indexmap", "slab", - "tokio 0.2.24", + "tokio 0.2.25", "tokio-util", "tracing", "tracing-futures", @@ -2177,9 +2187,9 @@ dependencies = [ [[package]] name = "half" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" +checksum = "62aca2aba2d62b4a7f5b33f3712cb1b0692779a56fb510499d5c0aa594daeaf3" [[package]] name = "hash32" @@ -2197,7 +2207,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf" dependencies = [ "ahash 0.3.8", - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -2225,18 +2235,18 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" +checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" +checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c" dependencies = [ "libc", ] @@ -2265,11 +2275,11 @@ checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" [[package]] name = "http" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ - "bytes 0.5.6", + "bytes 1.0.1", "fnv", "itoa", ] @@ -2296,9 +2306,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "httpdate" @@ -2308,9 +2318,9 @@ checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] name = "hyper" -version = "0.13.9" +version = "0.13.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" +checksum = "8a6f157065790a3ed2f88679250419b5cdd96e714a0d65f7797fd337186e96bb" dependencies = [ "bytes 0.5.6", "futures-channel", @@ -2322,9 +2332,9 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 1.0.2", + "pin-project 1.0.5", "socket2", - "tokio 0.2.24", + "tokio 0.2.25", "tower-service", "tracing", "want", @@ -2345,7 +2355,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 1.0.2", + "pin-project 1.0.5", "socket2", "tokio 1.2.0", "tower-service", @@ -2361,10 +2371,10 @@ checksum = "37743cc83e8ee85eacfce90f2f4102030d9ff0a95244098d781e9bee4a90abb6" dependencies = [ "bytes 0.5.6", "futures-util", - "hyper 0.13.9", + "hyper 0.13.10", "log", "rustls 0.18.1", - "tokio 0.2.24", + "tokio 0.2.25", "tokio-rustls", "webpki", ] @@ -2404,7 +2414,7 @@ source = "git+https://github.com/hecrj/iced?rev=8d882d787e6b7fd7c2435f42f82933e2 dependencies = [ "iced_core", "iced_futures", - "num-traits 0.2.14", + "num-traits", "twox-hash", "unicode-segmentation", ] @@ -2440,20 +2450,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.1.5" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "idna" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "de910d521f7cc3135c4de8db1cb910e0b5ed1dc6f57c381cd07e8e661ce10094" dependencies = [ "matches", "unicode-bidi", @@ -2462,26 +2461,26 @@ dependencies = [ [[package]] name = "image" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce04077ead78e39ae8610ad26216aed811996b043d47beed5090db674f9e9b5" +checksum = "293f07a1875fa7e9c5897b51aa68b2d8ed8271b87e1a44cb64b9c3d98aabbc0d" dependencies = [ "bytemuck", "byteorder", "color_quant", "num-iter", "num-rational 0.3.2", - "num-traits 0.2.14", + "num-traits", "png", ] [[package]] name = "indexmap" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" +checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" dependencies = [ - "autocfg 1.0.1", + "autocfg", "hashbrown 0.9.1", "serde", ] @@ -2508,9 +2507,9 @@ dependencies = [ [[package]] name = "inotify" -version = "0.8.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46dd0a94b393c730779ccfd2a872b67b1eb67be3fc33082e733bdb38b5fde4d4" +checksum = "d19f57db1baad9d09e43a3cd76dcf82ebdafd37d75c9498b87762dba77c93f15" dependencies = [ "bitflags", "inotify-sys", @@ -2519,20 +2518,20 @@ dependencies = [ [[package]] name = "inotify-sys" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74a1aa87c59aeff6ef2cc2fa62d41bc43f54952f55652656b18a02fd5e356c0" +checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb" dependencies = [ "libc", ] [[package]] name = "instant" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63312a18f7ea8760cdd0a7c5aac1a619752a246b833545e3e36d1f81f7cd9e66" +checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -2580,9 +2579,9 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jni" @@ -2605,7 +2604,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36bcc950632e48b86da402c5c077590583da5ac0d480103611d5374e7c967a3c" dependencies = [ "cesu8", - "combine 4.3.2", + "combine 4.5.2", "error-chain", "jni-sys", "log", @@ -2629,9 +2628,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" +checksum = "5cfb73131c35423a367daf8cbd24100af0d077668c8c2943f0e7dd775fef0f65" dependencies = [ "wasm-bindgen", ] @@ -2678,9 +2677,9 @@ checksum = "3576a87f2ba00f6f106fdfcd16db1d698d648a26ad8e0573cad8537c3c362d2a" [[package]] name = "lewton" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be42bea7971f4ba0ea1e215730c29bc1ff9bd2a9c10013912f42a8dcf8d77c0d" +checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" dependencies = [ "byteorder", "ogg", @@ -2689,27 +2688,33 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.87" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265d751d31d6780a3f956bb5b8022feba2d94eeee5a84ba64f4212eedca42213" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" [[package]] name = "libflate" -version = "0.1.27" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9135df43b1f5d0e333385cb6e7897ecd1a43d7d11b91ac003f4d2c2d2401fdd" +checksum = "389de7875e06476365974da3e7ff85d55f1972188ccd9f6020dd7c8156e17914" dependencies = [ "adler32", "crc32fast", + "libflate_lz77", "rle-decode-fast", - "take_mut", ] [[package]] -name = "libgit2-sys" -version = "0.12.13+1.0.1" +name = "libflate_lz77" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069eea34f76ec15f2822ccf78fe0cdb8c9016764d0a12865278585a74dbdeae5" +checksum = "3286f09f7d4926fc486334f28d8d2e6ebe4f7f9994494b6dab27ddfad2c9b11b" + +[[package]] +name = "libgit2-sys" +version = "0.12.18+1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da6a42da88fc37ee1ecda212ffa254c25713532980005d5f7c0b0fbe7e6e885" dependencies = [ "cc", "libc", @@ -2731,11 +2736,11 @@ dependencies = [ [[package]] name = "libloading" -version = "0.6.3" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2443d8f0478b16759158b2f66d525991a05491138bc05814ef52a250148ef4f9" +checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "winapi 0.3.9", ] @@ -2758,9 +2763,9 @@ dependencies = [ [[package]] name = "libssh2-sys" -version = "0.2.19" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056" +checksum = "e0186af0d8f171ae6b9c4c90ec51898bad5d08a2d5e470903a50d9ad8959cbee" dependencies = [ "cc", "libc", @@ -2792,20 +2797,11 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "line_drawing" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81902e542483002b103c6424d23e765c2e5a65f732923299053a601bce50ab2" -dependencies = [ - "num-traits 0.1.43", -] - [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" @@ -2818,20 +2814,20 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" +checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", ] [[package]] @@ -2897,25 +2893,24 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.3.3" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] -name = "memmap" -version = "0.7.0" +name = "memmap2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" dependencies = [ "libc", - "winapi 0.3.9", ] [[package]] name = "memmap2" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73be3b7d04a0123e933fea1d50d126cc7196bbc0362c0ce426694f777194eee" +checksum = "04e3e85b970d650e2ae6d70592474087051c11c54da7f7b4949725c5735fbcc6" dependencies = [ "libc", ] @@ -2926,7 +2921,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" dependencies = [ - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -2935,7 +2930,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" dependencies = [ - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -2955,8 +2950,8 @@ checksum = "9753f12909fd8d923f75ae5c3258cae1ed3c8ec052e1b38c93c21a6d157f789c" dependencies = [ "migrations_internals", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -3005,19 +3000,19 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9" +checksum = "0f2d26ec3309788e423cfbf68ad1800f061638098d76a83681af979dc4eda19d" dependencies = [ "adler", - "autocfg 1.0.1", + "autocfg", ] [[package]] name = "mio" -version = "0.6.22" +version = "0.6.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" dependencies = [ "cfg-if 0.1.10", "fuchsia-zircon", @@ -3026,7 +3021,7 @@ dependencies = [ "kernel32-sys", "libc", "log", - "miow 0.2.1", + "miow 0.2.2", "net2", "slab", "winapi 0.2.8", @@ -3034,9 +3029,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.9" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a" +checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" dependencies = [ "libc", "log", @@ -3053,15 +3048,15 @@ checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" dependencies = [ "lazycell", "log", - "mio 0.6.22", + "mio 0.6.23", "slab", ] [[package]] name = "miow" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" dependencies = [ "kernel32-sys", "net2", @@ -3093,16 +3088,17 @@ checksum = "0debeb9fcf88823ea64d64e4a815ab1643f33127d995978e099942ce38f25238" [[package]] name = "native-dialog" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f491dab19c26687b897fcb4ecaa984fc87a7dd5a21d69f48eab41e254116981" +checksum = "b797805fe732ea368a288e73c313952309287b8b775a13530d858b77cfe5c1cd" dependencies = [ "cocoa 0.24.0", - "dirs 3.0.1", + "dirs", "objc", "objc-foundation", "objc_id", "once_cell", + "raw-window-handle", "thiserror", "wfd", "which", @@ -3111,9 +3107,9 @@ dependencies = [ [[package]] name = "ndk" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94dc511dd67c2cf232264be20fb98ad0ea93666727d3f6f75429d53e696d6366" +checksum = "5eb167c1febed0a496639034d0c76b3b74263636045db5489eee52143c246e73" dependencies = [ "jni-sys", "ndk-sys", @@ -3123,9 +3119,9 @@ dependencies = [ [[package]] name = "ndk-glue" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6c938c36cd15ea13d0972fdceb3a03982d49967e5fd7508cf129c5300b66cc" +checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" dependencies = [ "lazy_static", "libc", @@ -3144,21 +3140,21 @@ dependencies = [ "darling", "proc-macro-crate", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "ndk-sys" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de01535c8fca086732bb66c9bc7779d336c44088d42782cd11d5f2a7ace52f7e" +checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" [[package]] name = "net2" -version = "0.2.35" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" +checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" dependencies = [ "cfg-if 0.1.10", "libc", @@ -3203,6 +3199,18 @@ dependencies = [ "libc", ] +[[package]] +name = "nix" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ccba0cfe4fdf15982d1674c69b1fd80bad427d293849982668dfe454bd61f2" +dependencies = [ + "bitflags", + "cc", + "cfg-if 1.0.0", + "libc", +] + [[package]] name = "noise" version = "0.7.0" @@ -3210,7 +3218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82051dd6745d5184c6efb7bc8be14892a7f6d4f3ad6dbf754d1c7d7d5fe24b43" dependencies = [ "rand 0.7.3", - "rand_xorshift 0.2.0", + "rand_xorshift", ] [[package]] @@ -3233,6 +3241,16 @@ dependencies = [ "version_check 0.9.2", ] +[[package]] +name = "nom" +version = "6.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" +dependencies = [ + "memchr", + "version_check 0.9.2", +] + [[package]] name = "notify" version = "4.0.15" @@ -3245,7 +3263,7 @@ dependencies = [ "fsevent-sys 2.0.1", "inotify 0.7.1", "libc", - "mio 0.6.22", + "mio 0.6.23", "mio-extras", "walkdir 2.3.1", "winapi 0.3.9", @@ -3253,44 +3271,32 @@ dependencies = [ [[package]] name = "notify" -version = "5.0.0-pre.3" +version = "5.0.0-pre.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d03607cf88b4b160ba0e9ed425fff3cee3b55ac813f0c685b3a3772da37d0e" +checksum = "58e54552360d7b89a698eca6de3927205a8e03e8080dc13d779de5c7876e098b" dependencies = [ "anymap", "bitflags", - "crossbeam-channel 0.4.4", + "crossbeam-channel", "filetime", "fsevent 2.0.2", "fsevent-sys 3.0.2", - "inotify 0.8.3", + "inotify 0.9.2", "libc", - "mio 0.6.22", - "mio-extras", + "mio 0.7.7", "walkdir 2.3.1", "winapi 0.3.9", ] [[package]] name = "ntapi" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a31937dea023539c72ddae0e3571deadc1414b300483fa7aaec176168cfa9d2" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "num" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" -dependencies = [ - "num-integer", - "num-iter", - "num-traits 0.2.14", -] - [[package]] name = "num" version = "0.2.1" @@ -3302,7 +3308,7 @@ dependencies = [ "num-integer", "num-iter", "num-rational 0.2.4", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3316,7 +3322,7 @@ dependencies = [ "num-integer", "num-iter", "num-rational 0.3.2", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3325,9 +3331,9 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3336,9 +3342,9 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e9a41747ae4633fce5adffb4d2e81ffc5e89593cb19917f8fb2cc5ff76507bf" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3347,8 +3353,8 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" dependencies = [ - "autocfg 1.0.1", - "num-traits 0.2.14", + "autocfg", + "num-traits", ] [[package]] @@ -3357,18 +3363,18 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "747d632c0c558b87dbabbe6a82f3b4ae03720d0646ac5b7b4dae89394be5f2c5" dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] name = "num-derive" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f09b9841adb6b5e1f89ef7087ea636e0fd94b2851f887c1e3eb5d5f8228fab3" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -3377,8 +3383,8 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ - "autocfg 1.0.1", - "num-traits 0.2.14", + "autocfg", + "num-traits", ] [[package]] @@ -3387,9 +3393,9 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3398,10 +3404,10 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-bigint 0.2.6", "num-integer", - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3410,19 +3416,10 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ - "autocfg 1.0.1", + "autocfg", "num-bigint 0.3.1", "num-integer", - "num-traits 0.2.14", -] - -[[package]] -name = "num-traits" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" -dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3431,7 +3428,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" dependencies = [ - "autocfg 1.0.1", + "autocfg", ] [[package]] @@ -3462,8 +3459,8 @@ checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" dependencies = [ "proc-macro-crate", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -3495,12 +3492,6 @@ dependencies = [ "objc", ] -[[package]] -name = "object" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab52be62400ca80aa00285d25253d7f7c437b7375c4de678f5405d3afe82ca5" - [[package]] name = "object" version = "0.22.0" @@ -3512,16 +3503,22 @@ dependencies = [ ] [[package]] -name = "oboe" -version = "0.3.0" +name = "object" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6a13c9fe73346ff3cee5530b8dd9da1ce3e13cb663be210af3938a2a1dd3eab" +checksum = "a9a7ab5d64814df0fe4a4b5ead45ed6c5f181ee3ff04ba344313a6c80446c5d4" + +[[package]] +name = "oboe" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aadc2b0867bdbb9a81c4d99b9b682958f49dbea1295a81d2f646cca2afdd9fc" dependencies = [ "jni 0.14.0", "ndk", "ndk-glue", "num-derive", - "num-traits 0.2.14", + "num-traits", "oboe-sys", ] @@ -3536,9 +3533,9 @@ dependencies = [ [[package]] name = "ogg" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d79f1db9148be9d0e174bb3ac890f6030fcb1ed947267c5a91ee4c91b5a91e15" +checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" dependencies = [ "byteorder", ] @@ -3556,15 +3553,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.7.2" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] name = "oorandom" -version = "11.1.2" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a170cebd8021a008ea92e4db85a72f80b35df514ec664b296fdcbb654eac0b2c" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl-probe" @@ -3574,11 +3571,11 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" [[package]] name = "openssl-sys" -version = "0.9.58" +version = "0.9.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" +checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6" dependencies = [ - "autocfg 1.0.1", + "autocfg", "cc", "libc", "pkg-config", @@ -3587,30 +3584,33 @@ dependencies = [ [[package]] name = "orbclient" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b18f57ab94fbd058e30aa57f712ec423c0bb7403f8493a6c58eef0c36d9402" +checksum = "ee68c3c79e81d82127e0870f94479675774d34c7ad5b55eecb9c320ef9701187" dependencies = [ - "redox_syscall", + "libc", + "raw-window-handle", + "redox_syscall 0.2.5", "sdl2", + "sdl2-sys", ] [[package]] name = "ordered-float" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" +checksum = "3305af35278dd29f46fcdd139e0b1fbfae2153f0e5928b39b035542dd31e37b7" dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] name = "ordered-float" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dacdec97876ef3ede8c50efc429220641a0b11ba0048b4b0c357bccbc47c5204" +checksum = "766f840da25490628d8e63e529cd21c014f6600c6b8517add12a6fa6167a6218" dependencies = [ - "num-traits 0.2.14", + "num-traits", ] [[package]] @@ -3633,11 +3633,11 @@ dependencies = [ [[package]] name = "owned_ttf_parser" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb477c7fd2a3a6e04e1dc6ca2e4e9b04f2df702021dc5a5d1cf078c587dc59f7" +checksum = "948b27637ba56144c62d3415929ef18986b3a383137ebcbe97d9362a968bf997" dependencies = [ - "ttf-parser 0.8.2", + "ttf-parser 0.11.0", ] [[package]] @@ -3650,17 +3650,6 @@ dependencies = [ "libm", ] -[[package]] -name = "parking_lot" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.6.2", - "rustc_version", -] - [[package]] name = "parking_lot" version = "0.10.2" @@ -3673,28 +3662,13 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" +checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" dependencies = [ "instant", - "lock_api 0.4.1", - "parking_lot_core 0.8.0", -] - -[[package]] -name = "parking_lot_core" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.0.3", - "libc", - "redox_syscall", - "rustc_version", - "smallvec 0.6.13", - "winapi 0.3.9", + "lock_api 0.4.2", + "parking_lot_core 0.8.3", ] [[package]] @@ -3704,25 +3678,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" dependencies = [ "cfg-if 0.1.10", - "cloudabi 0.0.3", + "cloudabi", "libc", - "redox_syscall", - "smallvec 1.5.1", + "redox_syscall 0.1.57", + "smallvec", "winapi 0.3.9", ] [[package]] name = "parking_lot_core" -version = "0.8.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" +checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.1.0", + "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", - "smallvec 1.5.1", + "redox_syscall 0.2.5", + "smallvec", "winapi 0.3.9", ] @@ -3732,12 +3705,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" -[[package]] -name = "percent-encoding" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" - [[package]] name = "percent-encoding" version = "2.1.0" @@ -3755,55 +3722,55 @@ dependencies = [ [[package]] name = "pin-project" -version = "0.4.24" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48fad7cfbff853437be7cf54d7b993af21f53be7f0988cbfe4a51535aa77205" +checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" dependencies = [ - "pin-project-internal 0.4.24", + "pin-project-internal 0.4.27", ] [[package]] name = "pin-project" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" +checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" dependencies = [ - "pin-project-internal 1.0.2", + "pin-project-internal 1.0.5", ] [[package]] name = "pin-project-internal" -version = "0.4.24" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c6d293bdd3ca5a1697997854c6cf7855e43fb6a0ba1c47af57a5bcafd158ae" +checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "pin-project-internal" -version = "1.0.2" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" +checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "pin-project-lite" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe74897791e156a0cd8cce0db31b9b2198e67877316bf3086c3acd187f719f0" +checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" [[package]] name = "pin-project-lite" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cf491442e4b033ed1c722cb9f0df5fcfcf4de682466c46469c36bc47dc5548a" +checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" [[package]] name = "pin-utils" @@ -3840,9 +3807,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "plotters" @@ -3850,7 +3817,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45ca0ae5f169d0917a7c7f5a9c1a3d3d9598f18f529dd2b8373ed988efea307a" dependencies = [ - "num-traits 0.2.14", + "num-traits", "plotters-backend", "plotters-svg", "wasm-bindgen", @@ -3874,9 +3841,9 @@ dependencies = [ [[package]] name = "png" -version = "0.16.7" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970" +checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" dependencies = [ "bitflags", "crc32fast", @@ -3894,9 +3861,9 @@ dependencies = [ [[package]] name = "ppv-lite86" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "proc-macro-crate" @@ -3915,8 +3882,8 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", "version_check 0.9.2", ] @@ -3927,7 +3894,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "version_check 0.9.2", ] @@ -3939,9 +3906,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" @@ -3970,7 +3937,7 @@ dependencies = [ "cfg-if 1.0.0", "fnv", "lazy_static", - "parking_lot 0.11.0", + "parking_lot 0.11.1", "regex", "thiserror", ] @@ -3987,13 +3954,26 @@ dependencies = [ "tracing", ] +[[package]] +name = "publicsuffix" +version = "1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" +dependencies = [ + "error-chain", + "idna", + "lazy_static", + "regex", + "url", +] + [[package]] name = "qstring" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" dependencies = [ - "percent-encoding 2.1.0", + "percent-encoding", ] [[package]] @@ -4007,37 +3987,18 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" dependencies = [ "proc-macro2 1.0.24", ] [[package]] name = "radium" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e006811e1fdd12672b0820a7f44c18dde429f367d50cec003d22aa9b3c8ddc" - -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift 0.1.1", - "winapi 0.3.9", -] +checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" [[package]] name = "rand" @@ -4045,7 +4006,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", @@ -4060,20 +4021,10 @@ checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" dependencies = [ "libc", "rand_chacha 0.3.0", - "rand_core 0.6.1", + "rand_core 0.6.2", "rand_hc 0.3.0", ] -[[package]] -name = "rand_chacha" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", -] - [[package]] name = "rand_chacha" version = "0.2.2" @@ -4091,49 +4042,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" dependencies = [ "ppv-lite86", - "rand_core 0.6.1", + "rand_core 0.6.2", ] -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", ] [[package]] name = "rand_core" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" +checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" dependencies = [ - "getrandom 0.2.0", -] - -[[package]] -name = "rand_hc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" -dependencies = [ - "rand_core 0.3.1", + "getrandom 0.2.2", ] [[package]] @@ -4151,60 +4078,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" dependencies = [ - "rand_core 0.6.1", -] - -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.9", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi 0.0.3", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.9", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", + "rand_core 0.6.2", ] [[package]] @@ -4216,17 +4090,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "raw-cpuid" -version = "7.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" -dependencies = [ - "bitflags", - "cc", - "rustc_version", -] - [[package]] name = "raw-window-handle" version = "0.3.3" @@ -4242,7 +4105,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" dependencies = [ - "autocfg 1.0.1", + "autocfg", "crossbeam-deque 0.8.0", "either", "rayon-core", @@ -4254,39 +4117,49 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ - "crossbeam-channel 0.5.0", + "crossbeam-channel", "crossbeam-deque 0.8.0", "crossbeam-utils 0.8.1", "lazy_static", "num_cpus", ] -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" +[[package]] +name = "redox_syscall" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" dependencies = [ - "getrandom 0.1.15", - "redox_syscall", + "getrandom 0.1.16", + "redox_syscall 0.1.57", "rust-argon2", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.2", + "redox_syscall 0.2.5", +] + [[package]] name = "regalloc" version = "0.0.31" @@ -4295,14 +4168,14 @@ checksum = "571f7f397d61c4755285cd37853fe8e03271c243424a907415909379659381c5" dependencies = [ "log", "rustc-hash", - "smallvec 1.5.1", + "smallvec", ] [[package]] name = "regex" -version = "1.3.9" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -4322,9 +4195,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.18" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "region" @@ -4349,18 +4222,18 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.10.8" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e" +checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "bytes 0.5.6", "encoding_rs", "futures-core", "futures-util", "http", "http-body 0.3.1", - "hyper 0.13.9", + "hyper 0.13.10", "hyper-rustls", "ipnet", "js-sys", @@ -4368,27 +4241,27 @@ dependencies = [ "log", "mime", "mime_guess", - "percent-encoding 2.1.0", - "pin-project-lite 0.1.9", + "percent-encoding", + "pin-project-lite 0.2.4", "rustls 0.18.1", "serde", "serde_json", "serde_urlencoded", - "tokio 0.2.24", + "tokio 0.2.25", "tokio-rustls", - "url 2.1.1", + "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.19.0", + "webpki-roots 0.20.0", "winreg", ] [[package]] name = "ring" -version = "0.16.15" +version = "0.16.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "952cd6b98c85bbc30efa1ba5783b8abf12fec8b3287ffa52605b9432313e34e4" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ "cc", "libc", @@ -4418,11 +4291,11 @@ dependencies = [ [[package]] name = "ron" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a58080b7bb83b2ea28c3b7a9a994fd5e310330b7c8ca5258d99b98128ecfe4" +checksum = "064ea8613fb712a19faf920022ec8ddf134984f100090764a4e1d768f3827f1f" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "bitflags", "serde", ] @@ -4435,21 +4308,21 @@ checksum = "84348444bd7ad45729d0c49a4240d7cdc11c9d512c06c5ad1835c1ad4acda6db" [[package]] name = "rust-argon2" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dab61250775933275e84053ac235621dfb739556d5c54a2f2e9313b7cf43a19" +checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "blake2b_simd", "constant_time_eq", - "crossbeam-utils 0.7.2", + "crossbeam-utils 0.8.1", ] [[package]] name = "rustc-demangle" -version = "0.1.16" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" +checksum = "6e3bad0ee36814ca07d7968269dd4b7ec89ec2da10c4bb613928d3077083c232" [[package]] name = "rustc-hash" @@ -4468,11 +4341,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.16.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" +checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" dependencies = [ - "base64 0.10.1", + "base64 0.12.3", "log", "ring", "sct", @@ -4481,11 +4354,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.18.1" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1126dcf58e93cee7d098dbda643b5f92ed724f1f6a63007c1116eed6700c81" +checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "log", "ring", "sct", @@ -4512,7 +4385,7 @@ dependencies = [ "crossbeam-utils 0.7.2", "linked-hash-map", "num_cpus", - "ordered-float 1.1.0", + "ordered-float 1.1.1", "rustc-hash", "stb_truetype", ] @@ -4585,26 +4458,30 @@ dependencies = [ [[package]] name = "sdl2" -version = "0.32.2" +version = "0.34.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d051a07231e303f5f719da78cb6f7394f6d5b54f733aef5b0b447804a83edd7b" +checksum = "fcbb85f4211627a7291c83434d6bbfa723e28dcaa53c7606087e3c61929e4b9c" dependencies = [ "bitflags", "lazy_static", "libc", - "num 0.1.42", - "rand 0.6.5", + "raw-window-handle", "sdl2-sys", ] [[package]] name = "sdl2-sys" -version = "0.32.6" +version = "0.34.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34e71125077d297d57e4c1acfe8981b5bdfbf5a20e7b589abfdcb33bf1127f86" +checksum = "28d81feded049b9c14eceb4a4f6d596a98cebbd59abdba949c5552a015466d33" dependencies = [ "cfg-if 0.1.10", + "cmake", + "flate2", "libc", + "tar", + "unidiff", + "version-compare", ] [[package]] @@ -4624,9 +4501,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.118" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +checksum = "92d5161132722baa40d802cc70b15262b98258453e85e5d1d365c757c73869ae" dependencies = [ "serde_derive", ] @@ -4652,20 +4529,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.118" +version = "1.0.123" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +checksum = "9391c295d64fc0abb2c556bad848f33cb8296276b1ad2677d1ae1ace4f258f31" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "serde_json" -version = "1.0.57" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c" +checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" dependencies = [ "itoa", "ryu", @@ -4679,20 +4556,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "serde_urlencoded" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" dependencies = [ - "dtoa", + "form_urlencoded", "itoa", + "ryu", "serde", - "url 2.1.1", ] [[package]] @@ -4703,9 +4580,9 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sharded-slab" -version = "0.0.9" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06d5a3f5166fb5b42a5439f2eee8b9de149e235961e3eb21c5808fc3ea17ff3e" +checksum = "79c719719ee05df97490f80a45acfc99e5a30ce98a1e4fb67aee422745ae14e3" dependencies = [ "lazy_static", ] @@ -4722,11 +4599,11 @@ dependencies = [ [[package]] name = "shellexpand" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2b22262a9aaf9464d356f656fea420634f78c881c5eebd5ef5e66d8b9bc603" +checksum = "83bdb7831b2d85ddf4a7b148aa19d0587eddbe8671a436b7bd1182eaad0f2829" dependencies = [ - "dirs 2.0.2", + "dirs-next", ] [[package]] @@ -4746,19 +4623,19 @@ dependencies = [ "mopa", "rayon", "shred-derive", - "smallvec 1.5.1", + "smallvec", "tynm", ] [[package]] name = "shred-derive" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f37080f2751fbf091dbdebaa95bd6cf9dbf74ad1d50396b1908518a1747fdf" +checksum = "d5404c36bd155e41a54276ab6aafedad2fb627e5e5849d36ec439c9ddc044a2f" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -4769,20 +4646,20 @@ checksum = "b5752e017e03af9d735b4b069f53b7a7fd90fefafa04d8bd0c25581b0bff437f" [[package]] name = "signal-hook" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604508c1418b99dfe1925ca9224829bb2a8a9a04dda655cc01fcad46f4ab05ed" +checksum = "7e31d442c16f047a671b5a71e2161d6e68814012b7f5379d269ebd915fac2729" dependencies = [ "libc", - "mio 0.7.9", + "mio 0.7.7", "signal-hook-registry", ] [[package]] name = "signal-hook" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8133fd06d2c721d4168f9b76a9a7fd3a0bfc96df58cf7316c7fb9f23bd677f4e" +checksum = "844024c8913df6bfbfeee3061075ccc47216a897ac0b54a683dea3dfe16d19af" dependencies = [ "libc", "signal-hook-registry", @@ -4790,11 +4667,10 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" +checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" dependencies = [ - "arc-swap", "libc", ] @@ -4816,75 +4692,37 @@ dependencies = [ [[package]] name = "smallvec" -version = "0.6.13" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "smallvec" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] name = "smithay-client-toolkit" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562da6f2f0836e144f2e92118b35add58368280556af94f399666ebfd7d1e731" -dependencies = [ - "bitflags", - "byteorder", - "dlib", - "lazy_static", - "log", - "memmap", - "nix 0.18.0", - "wayland-client 0.27.0", - "wayland-cursor 0.27.0", - "wayland-protocols 0.27.0", -] - -[[package]] -name = "smithay-client-toolkit" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ec5c077def8af49f9b5aeeb5fcf8079c638c6615c3a8f9305e2dea601de57f7" +checksum = "316e13a3eb853ce7bf72ad3530dc186cb2005c57c521ef5f4ada5ee4eed74de6" dependencies = [ "andrew", "bitflags", - "byteorder", "calloop", "dlib", "lazy_static", "log", - "memmap", + "memmap2 0.1.0", "nix 0.18.0", - "wayland-client 0.28.1", - "wayland-cursor 0.28.1", - "wayland-protocols 0.28.1", + "wayland-client 0.28.3", + "wayland-cursor 0.28.3", + "wayland-protocols 0.28.3", ] [[package]] name = "smithay-clipboard" -version = "0.5.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e9db50a9b272938b767b731a1291f22f407315def4049db93871e8828034d5" +checksum = "06384dfaf645908220d976ae24ed39f6cf92efecb0225ea0a948e403014de527" dependencies = [ - "smithay-client-toolkit 0.11.0", - "wayland-client 0.27.0", -] - -[[package]] -name = "smithay-clipboard" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0eec3480d929e276b38424c8849575ee1e50003eae1cbdc93ee653147acc42" -dependencies = [ - "smithay-client-toolkit 0.12.0", - "wayland-client 0.28.1", + "smithay-client-toolkit", + "wayland-client 0.28.3", ] [[package]] @@ -4921,8 +4759,8 @@ version = "0.4.1" source = "git+https://github.com/amethyst/specs.git?rev=d4435bdf496cf322c74886ca09dd8795984919b4#d4435bdf496cf322c74886ca09dd8795984919b4" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -4955,6 +4793,15 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "standback" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8" +dependencies = [ + "version_check 0.9.2", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -4999,10 +4846,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "serde", "serde_derive", - "syn 1.0.54", + "syn 1.0.60", ] [[package]] @@ -5013,12 +4860,12 @@ checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" dependencies = [ "base-x", "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "serde", "serde_derive", "serde_json", "sha1", - "syn 1.0.54", + "syn 1.0.60", ] [[package]] @@ -5047,9 +4894,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "structopt" -version = "0.3.18" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33f6461027d7f08a13715659b2948e1602c31a3756aeae9378bfe7518c72e82" +checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" dependencies = [ "clap", "lazy_static", @@ -5058,15 +4905,15 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92e775028122a4b3dd55d58f14fc5120289c69bee99df1d117ae30f84b225c9" +checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" dependencies = [ "heck", "proc-macro-error", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -5094,36 +4941,29 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.54" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "unicode-xid 0.2.1", ] -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - [[package]] name = "tap" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36474e732d1affd3a6ed582781b3683df3d0563714c59c39591e8ff707cf078e" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.30" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489997b7557e9a43e192c527face4feacc78bfbe6eed67fd55c4c9e381cba290" +checksum = "0313546c01d59e29be4f09687bcb4fb6690cec931cc3607b6aec7a0e417f4cc6" dependencies = [ "filetime", "libc", - "redox_syscall", "xattr", ] @@ -5135,14 +4975,14 @@ checksum = "4ee5a98e506fb7231a304c3a1bd7c132a55016cf65001e0282480665870dfcb9" [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "rand 0.7.3", - "redox_syscall", + "rand 0.8.3", + "redox_syscall 0.2.5", "remove_dir_all", "winapi 0.3.9", ] @@ -5167,49 +5007,86 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08" +checksum = "76cc616c6abf8c8928e2fdcc0dbfab37175edd8fb49a4641066ad1364fdab146" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793" +checksum = "9be73a2caec27583d0046ef3796c3794f868a5bc813db689eed00c7631275cd1" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "8018d24e04c95ac8790716a5987d0fec4f8b27249ffa0f7d33f1369bdfb88cbd" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] name = "time" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", "winapi 0.3.9", ] [[package]] -name = "tinytemplate" -version = "1.1.0" +name = "time" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +checksum = "1195b046942c221454c2539395f85413b33383a067449d78aab2b7b052a142f7" +dependencies = [ + "const_fn", + "libc", + "standback", + "stdweb 0.4.20", + "time-macros", + "version_check 0.9.2", + "winapi 0.3.9", +] + +[[package]] +name = "time-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" +dependencies = [ + "proc-macro-hack", + "time-macros-impl", +] + +[[package]] +name = "time-macros-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" +dependencies = [ + "proc-macro-hack", + "proc-macro2 1.0.24", + "quote 1.0.9", + "standback", + "syn 1.0.60", +] + +[[package]] +name = "tinytemplate" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2ada8616fad06a2d0c455adc530de4ef57605a8120cc65da9653e0e9623ca74" dependencies = [ "serde", "serde_json", @@ -5217,15 +5094,24 @@ dependencies = [ [[package]] name = "tinyvec" -version = "0.3.4" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" +checksum = "317cca572a0e89c3ce0ca1f1bdc9369547fe318a683418e42ac8f59d14701023" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" dependencies = [ "bytes 0.5.6", "fnv", @@ -5233,9 +5119,9 @@ dependencies = [ "iovec", "lazy_static", "memchr", - "mio 0.6.22", + "mio 0.6.23", "num_cpus", - "pin-project-lite 0.1.9", + "pin-project-lite 0.1.11", "slab", ] @@ -5245,14 +5131,14 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8190d04c665ea9e6b6a0dc45523ade572c088d2e6566244c1122671dbf4ae3a" dependencies = [ - "autocfg 1.0.1", + "autocfg", "bytes 1.0.1", "libc", "memchr", - "mio 0.7.9", + "mio 0.7.7", "num_cpus", "once_cell", - "pin-project-lite 0.2.5", + "pin-project-lite 0.2.4", "signal-hook-registry", "tokio-macros", "winapi 0.3.9", @@ -5265,8 +5151,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -5277,7 +5163,7 @@ checksum = "e12831b255bcfa39dc0436b01e19fea231a37db570686c06ee72c423479f889a" dependencies = [ "futures-core", "rustls 0.18.1", - "tokio 0.2.24", + "tokio 0.2.25", "webpki", ] @@ -5288,7 +5174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1981ad97df782ab506a1f43bf82c967326960d278acf3bf8279809648c3ff3ea" dependencies = [ "futures-core", - "pin-project-lite 0.2.5", + "pin-project-lite 0.2.4", "tokio 1.2.0", ] @@ -5302,58 +5188,58 @@ dependencies = [ "futures-core", "futures-sink", "log", - "pin-project-lite 0.1.9", - "tokio 0.2.24", + "pin-project-lite 0.1.11", + "tokio 0.2.25", ] [[package]] name = "toml" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] [[package]] name = "tower-service" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.25" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ebdc2bb4498ab1ab5f5b73c5803825e60199229ccba0698170e3be0e7f959f" +checksum = "f7d40a22fd029e33300d8d89a5cc8ffce18bb7c587662f54629e94c9de5487f3" dependencies = [ "cfg-if 1.0.0", "log", - "pin-project-lite 0.2.5", + "pin-project-lite 0.2.4", "tracing-attributes", "tracing-core", ] [[package]] name = "tracing-appender" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa52d56cc0d79ab604e8a022a1cebc4de33cf09dc9933c94353bea2e00d6e88" +checksum = "9965507e507f12c8901432a33e31131222abac31edd90cabbcf85cf544b7127a" dependencies = [ "chrono", - "crossbeam-channel 0.4.4", + "crossbeam-channel", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a9bd1db7706f2373a190b0d067146caa39350c486f3d455b0e33b431f94c07" +checksum = "43f080ea7e4107844ef4766459426fa2d5c1ada2e47edba05dc7fa99d9629f47" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -5371,7 +5257,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" dependencies = [ - "pin-project 0.4.24", + "pin-project 0.4.27", "tracing", ] @@ -5388,9 +5274,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82bb5079aa76438620837198db8a5c529fb9878c730bc2b28179b0241cf04c10" +checksum = "a1fa8f0c8f4c594e4fc9debc1990deab13238077271ba84dd853d54902ee3401" dependencies = [ "ansi_term 0.12.1", "chrono", @@ -5398,8 +5284,9 @@ dependencies = [ "matchers", "regex", "sharded-slab", - "smallvec 1.5.1", + "smallvec", "thread_local", + "tracing", "tracing-core", "tracing-log", ] @@ -5439,7 +5326,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa14b9f5cd7d513bab5accebe8f403df8b1ac22302cac549a6ac99c0a007c84a" dependencies = [ - "num-traits 0.2.14", + "num-traits", "vek 0.11.2", ] @@ -5457,9 +5344,9 @@ checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" [[package]] name = "ttf-parser" -version = "0.8.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d973cfa0e6124166b50a1105a67c85de40bbc625082f35c0f56f84cb1fb0a827" +checksum = "f3e7994fc4aed0ee366a4b0d01562c8a7cd5a5017088bceb6921b0c8c538f34e" [[package]] name = "tui" @@ -5481,18 +5368,20 @@ checksum = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" [[package]] name = "twox-hash" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bfd5b7557925ce778ff9b9ef90e3ade34c524b5ff10e239c69a42d546d2af56" +checksum = "04f8ab788026715fa63b31960869617cba39117e520eb415b0139543e325ab59" dependencies = [ + "cfg-if 0.1.10", "rand 0.7.3", + "static_assertions", ] [[package]] name = "tynm" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367fb781963961b4a90a3362c54b1871caaecb081f011005778242230f39d34e" +checksum = "a4df2caa2dc9c3d1f7641ba981f4cd40ab229775aa7aeb834c9ab2850d50623d" dependencies = [ "nom 5.1.2", ] @@ -5523,18 +5412,18 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.13" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" +checksum = "07fbfce1c8a97d547e8b5334978438d9d6ec8c20e38f56d4a4374d181493eaef" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" +checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" [[package]] name = "unicode-width" @@ -5554,6 +5443,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +[[package]] +name = "unidiff" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a62719acf1933bfdbeb73a657ecd9ecece70b405125267dd549e2e2edc232c" +dependencies = [ + "encoding_rs", + "lazy_static", + "regex", +] + [[package]] name = "unreachable" version = "1.0.0" @@ -5571,58 +5471,50 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "ureq" -version = "0.11.4" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801125e6d1ba6864cf3a5a92cfb2f0b0a3ee73e40602a0cd206ad2f3c040aa96" +checksum = "294b85ef5dbc3670a72e82a89971608a1fcc4ed5c7c5a2895230d31a95f0569b" dependencies = [ - "base64 0.11.0", + "base64 0.13.0", "chunked_transfer", "cookie", - "lazy_static", + "cookie_store", + "log", + "once_cell", "qstring", - "rustls 0.16.0", - "url 2.1.1", + "rustls 0.19.0", + "url", "webpki", - "webpki-roots 0.18.0", + "webpki-roots 0.21.0", ] [[package]] name = "url" -version = "1.7.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" dependencies = [ - "idna 0.1.5", + "form_urlencoded", + "idna", "matches", - "percent-encoding 1.0.1", -] - -[[package]] -name = "url" -version = "2.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" -dependencies = [ - "idna 0.2.0", - "matches", - "percent-encoding 2.1.0", + "percent-encoding", ] [[package]] name = "uuid" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ - "rand 0.7.3", + "getrandom 0.2.2", "serde", ] [[package]] name = "vcpkg" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" +checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" [[package]] name = "vec_map" @@ -5638,7 +5530,7 @@ checksum = "4e44defd4e0c629bdc842e5d180dda428b3abd2c6b0c7e1fced8c718f65d5f77" dependencies = [ "approx 0.3.2", "num-integer", - "num-traits 0.2.14", + "num-traits", "rustc_version", "serde", "static_assertions", @@ -5652,7 +5544,7 @@ checksum = "2657d8704e5e0be82b60157c8dbc71a269273ad766984508fdc54030a0690c4d" dependencies = [ "approx 0.3.2", "num-integer", - "num-traits 0.2.14", + "num-traits", "rustc_version", "static_assertions", ] @@ -5664,7 +5556,7 @@ source = "git+https://gitlab.com/veloren/vek.git?branch=fix_intrinsics2#df6842cc dependencies = [ "approx 0.4.0", "num-integer", - "num-traits 0.2.14", + "num-traits", "rustc_version", "serde", "static_assertions", @@ -5700,7 +5592,7 @@ dependencies = [ "arraygen", "assets_manager", "criterion", - "crossbeam-channel 0.5.0", + "crossbeam-channel", "crossbeam-utils 0.8.1", "csv", "directories-next", @@ -5711,8 +5603,8 @@ dependencies = [ "indexmap", "lazy_static", "num-derive", - "num-traits 0.2.14", - "ordered-float 2.0.1", + "num-traits", + "ordered-float 2.1.1", "rand 0.8.3", "rayon", "ron", @@ -5782,7 +5674,7 @@ dependencies = [ "bytes 1.0.1", "clap", "criterion", - "crossbeam-channel 0.5.0", + "crossbeam-channel", "futures-core", "futures-util", "lazy_static", @@ -5828,8 +5720,8 @@ name = "veloren-plugin-derive" version = "0.1.0" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] @@ -5848,7 +5740,7 @@ version = "0.8.0" dependencies = [ "authc", "chrono", - "crossbeam-channel 0.5.0", + "crossbeam-channel", "diesel", "diesel_migrations", "dotenv", @@ -5890,7 +5782,7 @@ dependencies = [ "lazy_static", "ron", "serde", - "signal-hook 0.2.2", + "signal-hook 0.2.3", "termcolor", "tokio 1.2.0", "tracing", @@ -5942,7 +5834,7 @@ dependencies = [ "num 0.3.1", "num_cpus", "old_school_gfx_glutin_ext", - "ordered-float 2.0.1", + "ordered-float 2.1.1", "rand 0.8.3", "rodio", "ron", @@ -5977,8 +5869,8 @@ dependencies = [ "find_folder", "inline_tweak", "lazy_static", - "libloading 0.6.3", - "notify 5.0.0-pre.3", + "libloading 0.6.7", + "notify 5.0.0-pre.5", "tracing", "vek 0.14.1", "veloren-common", @@ -6001,7 +5893,7 @@ dependencies = [ "minifb", "noise", "num 0.3.1", - "ordered-float 2.0.1", + "ordered-float 2.1.1", "packed_simd_2", "rand 0.8.3", "rand_chacha 0.3.0", @@ -6017,6 +5909,12 @@ dependencies = [ "veloren-common-net", ] +[[package]] +name = "version-compare" +version = "0.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" + [[package]] name = "version_check" version = "0.1.5" @@ -6074,17 +5972,17 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" +checksum = "55c0f7123de74f0dab9b7d00fd614e7b19349cd1e2f5252bbe9b1754b59433be" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "serde", "serde_json", "wasm-bindgen-macro", @@ -6092,26 +5990,26 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" +checksum = "7bc45447f0d4573f3d65720f636bbcc3dd6ce920ed704670118650bcd47764c7" dependencies = [ "bumpalo", "lazy_static", "log", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.18" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" +checksum = "3de431a2910c86679c34283a33f66f4e4abd7e0aec27b6669060148872aadf94" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -6119,38 +6017,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" +checksum = "3b8853882eef39593ad4174dd26fc9865a64e84026d223f63bb2c42affcbba2c" dependencies = [ - "quote 1.0.7", + "quote 1.0.9", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" +checksum = "4133b5e7f2a531fa413b3a1695e925038a05a71cf67e87dafa295cb645a01385" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.68" +version = "0.2.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" +checksum = "dd4945e4943ae02d15c13962b38a5b1e81eadd4b71214eee75af64a4d6a4fd64" [[package]] name = "wasmer" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b1ece7c894857344ae93506686ae36ccd867b4ed55819c06d2316d009098d4" +checksum = "a70cfae554988d904d64ca17ab0e7cd652ee5c8a0807094819c1ea93eb9d6866" dependencies = [ "cfg-if 0.1.10", "indexmap", @@ -6171,15 +6069,14 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc85134b257e5fba5870693441e300b601d08f18833ac4fa6934f0b72afc56d2" +checksum = "6b7732a9cab472bd921d5a0c422f45b3d03f62fa2c40a89e0770cef6d47e383e" dependencies = [ "enumset", - "raw-cpuid", "serde", "serde_bytes", - "smallvec 1.5.1", + "smallvec", "target-lexicon", "thiserror", "wasmer-types", @@ -6189,17 +6086,17 @@ dependencies = [ [[package]] name = "wasmer-compiler-cranelift" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60d68fb05dbe908724901b680070560944d99d04c52c763e98124aa988ac6dd0" +checksum = "48cb9395f094e1d81534f4c5e330ed4cdb424e8df870d29ad585620284f5fddb" dependencies = [ "cranelift-codegen", "cranelift-frontend", - "gimli", + "gimli 0.22.0", "more-asserts", "rayon", "serde", - "smallvec 1.5.1", + "smallvec", "tracing", "wasmer-compiler", "wasmer-types", @@ -6208,26 +6105,26 @@ dependencies = [ [[package]] name = "wasmer-derive" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca24205ffdf2d3b1a9c01219f4f3f0a1382658680abe73bc5b146f941adeeb8e" +checksum = "d8b86dcd2c3efdb8390728a2b56f762db07789aaa5aa872a9dc776ba3a7912ed" dependencies = [ "proc-macro-error", "proc-macro2 1.0.24", - "quote 1.0.7", - "syn 1.0.54", + "quote 1.0.9", + "syn 1.0.60", ] [[package]] name = "wasmer-engine" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed16436a9813d92f434e1d40fdf91b45ca30f351a799f793015359acca86b" +checksum = "efe4667d6bd888f26ae8062a63a9379fa697415b4b4e380f33832e8418fd71b5" dependencies = [ "backtrace", "bincode", "lazy_static", - "memmap2", + "memmap2 0.2.1", "more-asserts", "rustc-demangle", "serde", @@ -6241,9 +6138,9 @@ dependencies = [ [[package]] name = "wasmer-engine-jit" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1e3ca5e34eacd4ab6d9d32edd41b51d2e39cf3d75453611c9c57cee3a64691" +checksum = "26770be802888011b4a3072f2a282fc2faa68aa48c71b3db6252a3937a85f3da" dependencies = [ "bincode", "cfg-if 0.1.10", @@ -6259,14 +6156,14 @@ dependencies = [ [[package]] name = "wasmer-engine-native" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a21d6c5ae0c384ba2f01f598c95b01d4da2eaec3376fb96de2ded38c54143a0" +checksum = "2bb4083a6c69f2cd4b000b82a80717f37c6cc2e536aee3a8ffe9af3edc276a8b" dependencies = [ "bincode", "cfg-if 0.1.10", "leb128", - "libloading 0.6.3", + "libloading 0.6.7", "serde", "tempfile", "tracing", @@ -6280,9 +6177,9 @@ dependencies = [ [[package]] name = "wasmer-object" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e007e73ec7775aecc61045092dabfcff1e9f228129cd129e76a3e6aae26454" +checksum = "abf8e0c12b82ff81ebecd30d7e118be5fec871d6de885a90eeb105df0a769a7b" dependencies = [ "object 0.22.0", "thiserror", @@ -6292,9 +6189,9 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dbba7a95edb61b40daa43079979fc3212234e1645a15b8c527c36decad59fc6" +checksum = "c7f4ac28c2951cd792c18332f03da523ed06b170f5cf6bb5b1bdd7e36c2a8218" dependencies = [ "cranelift-entity", "serde", @@ -6303,9 +6200,9 @@ dependencies = [ [[package]] name = "wasmer-vm" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9acd4d53c004a11fcaff17f2a2528ae8f1748c6d5c4aea7d8bed2d9236f0f" +checksum = "a7635ba0b6d2fd325f588d69a950ad9fa04dddbf6ad08b6b2a183146319bf6ae" dependencies = [ "backtrace", "cc", @@ -6329,18 +6226,18 @@ checksum = "87cc2fe6350834b4e528ba0901e7aa405d78b89dc1fa3145359eb4de0e323fcf" [[package]] name = "wast" -version = "30.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b79907b22f740634810e882d8d1d9d0f9563095a8ab94e786e370242bff5cd2" +checksum = "1d04fe175c7f78214971293e7d8875673804e736092206a3a4544dbc12811c1b" dependencies = [ "leb128", ] [[package]] name = "wat" -version = "1.0.31" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8279a02835bf12e61ed2b3c3cbc6ecf9918762fd97e036917c11a09ec20ca44" +checksum = "7ec9c6ee01ae07a26adadcdfed22c7a97e0b8cbee9c06e0e96076ece5aeb5cfe" dependencies = [ "wast", ] @@ -6355,7 +6252,6 @@ dependencies = [ "downcast-rs", "libc", "nix 0.17.0", - "scoped-tls", "wayland-commons 0.27.0", "wayland-scanner 0.27.0", "wayland-sys 0.27.0", @@ -6363,18 +6259,18 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.28.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c54f9b90b2c044784f91fe22c5619a8a9c681db38492f2fd78ff968cf3f184" +checksum = "bdbdbe01d03b2267809f3ed99495b37395387fde789e0f2ebb78e8b43f75b6d7" dependencies = [ "bitflags", "downcast-rs", "libc", "nix 0.18.0", "scoped-tls", - "wayland-commons 0.28.1", - "wayland-scanner 0.28.1", - "wayland-sys 0.28.1", + "wayland-commons 0.28.3", + "wayland-scanner 0.28.3", + "wayland-sys 0.28.3", ] [[package]] @@ -6385,20 +6281,20 @@ checksum = "e972e9336ad5a9dd861b4e21ff35ad71d3e5c6b4803d65c39913612f851b95f1" dependencies = [ "nix 0.17.0", "once_cell", - "smallvec 1.5.1", + "smallvec", "wayland-sys 0.27.0", ] [[package]] name = "wayland-commons" -version = "0.28.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7602d75560fe6f02cac723609cce658042fe60541b5107999818d29d4dab7cfa" +checksum = "480450f76717edd64ad04a4426280d737fc3d10a236b982df7b1aee19f0e2d56" dependencies = [ "nix 0.18.0", "once_cell", - "smallvec 1.5.1", - "wayland-sys 0.28.1", + "smallvec", + "wayland-sys 0.28.3", ] [[package]] @@ -6414,23 +6310,23 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0446b959c5b5b4b2c11f63112fc7cbeb50ecd9f2c340d2b0ea632875685baf04" +checksum = "d6eb122c160223a7660feeaf949d0100281d1279acaaed3720eb3c9894496e5f" dependencies = [ "nix 0.18.0", - "wayland-client 0.28.1", + "wayland-client 0.28.3", "xcursor", ] [[package]] name = "wayland-egl" -version = "0.28.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ca6190c84bcdc58beccc619bf4866709db32d653255e89da38867f97f90d61" +checksum = "c653507447113c967a1aeee413699acb42d96d6302ec967c6d51930eae8aa7f5" dependencies = [ - "wayland-client 0.28.1", - "wayland-sys 0.28.1", + "wayland-client 0.28.3", + "wayland-sys 0.28.3", ] [[package]] @@ -6447,14 +6343,14 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.28.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d419585bbdb150fb541579cff205c6095a86cd874530e41838d1f18a9569a08" +checksum = "319a82b4d3054dd25acc32d9aee0f84fa95b63bc983fffe4703b6b8d47e01a30" dependencies = [ "bitflags", - "wayland-client 0.28.1", - "wayland-commons 0.28.1", - "wayland-scanner 0.28.1", + "wayland-client 0.28.3", + "wayland-commons 0.28.3", + "wayland-scanner 0.28.3", ] [[package]] @@ -6464,18 +6360,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "030f56009d932bd9400bb472764fea8109be1b0fc482d9cd75496c943ac30328" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "xml-rs", ] [[package]] name = "wayland-scanner" -version = "0.28.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cc091af4b05a435312f7cefe3a26824d2017966a58362ca913f72c3d68e5e2" +checksum = "7010ba5767b3fcd350decc59055390b4ebe6bd1b9279a9feb1f1888987f1133d" dependencies = [ "proc-macro2 1.0.24", - "quote 1.0.7", + "quote 1.0.9", "xml-rs", ] @@ -6485,16 +6381,14 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bdeffbbb474477dfa2acb45ac7479e5fe8f741c64ab032c5d11b94d07edc269" dependencies = [ - "dlib", - "lazy_static", "pkg-config", ] [[package]] name = "wayland-sys" -version = "0.28.1" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5640f53d1fe6eaaa2e77b9ff015fe9a556173ce8388607f941aecfd9b05c73e" +checksum = "6793834e0c35d11fd96a97297abe03d37be627e1847da52e17d7e0e3b51cc099" dependencies = [ "dlib", "lazy_static", @@ -6503,9 +6397,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" +checksum = "c40dc691fc48003eba817c38da7113c15698142da971298003cac3ef175680b3" dependencies = [ "js-sys", "wasm-bindgen", @@ -6513,9 +6407,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.21.3" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab146130f5f790d45f82aeeb09e55a256573373ec64409fc19a6fb82fb1032ae" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ "ring", "untrusted", @@ -6523,18 +6417,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.18.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cd5736df7f12a964a5067a12c62fa38e1bd8080aff1f80bc29be7c80d19ab4" +checksum = "0f20dea7535251981a9670857150d571846545088359b28e4951d350bdaf179f" dependencies = [ "webpki", ] [[package]] name = "webpki-roots" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739" +checksum = "82015b7e0b8bad8185994674a13a93306bea76cf5a16c5a181382fd3a5ec2376" dependencies = [ "webpki", ] @@ -6596,6 +6490,15 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "winapi-wsapoll" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +dependencies = [ + "winapi 0.3.9", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -6604,9 +6507,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "window_clipboard" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b849e24b344ea3535bcda7320b8b7f3560bd2c3692de73153d3c64acc84203e5" +checksum = "37cf16659e398a96f4ab8deff2b9db2ca0c3c5d6c1b59b1d577b7f888f0f03c6" dependencies = [ "clipboard-win 4.0.3", "clipboard_macos", @@ -6623,25 +6526,25 @@ dependencies = [ "bitflags", "cocoa 0.24.0", "core-foundation 0.9.1", - "core-graphics 0.22.1", + "core-graphics 0.22.2", "core-video-sys", "dispatch 0.2.0", "instant", "lazy_static", "libc", "log", - "mio 0.6.22", + "mio 0.6.23", "mio-extras", "ndk", "ndk-glue", "ndk-sys", "objc", - "parking_lot 0.11.0", - "percent-encoding 2.1.0", + "parking_lot 0.11.1", + "percent-encoding", "raw-window-handle", "serde", - "smithay-client-toolkit 0.12.0", - "wayland-client 0.28.1", + "smithay-client-toolkit", + "wayland-client 0.28.3", "winapi 0.3.9", "x11-dl", ] @@ -6701,6 +6604,18 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4122702a684f01cf35cf8e00d0ba513f7c4c7d46f9881d9a699f3de787e61e4" +dependencies = [ + "gethostname", + "nix 0.19.1", + "winapi 0.3.9", + "winapi-wsapoll", +] + [[package]] name = "xattr" version = "0.2.2" @@ -6722,11 +6637,11 @@ dependencies = [ [[package]] name = "xcursor" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a481cfdefd35e1c50073ae33a8000d695c98039544659f5dc5dd71311b0d01" +checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" dependencies = [ - "nom 5.1.2", + "nom 6.1.2", ] [[package]]