Merge branch 'xacrimon/named-rng-wgen' into 'master'

Use named generator in worldgen

See merge request veloren/veloren!381
This commit is contained in:
Forest Anderson 2019-07-30 21:40:29 +00:00
commit 0107cc96f5
3 changed files with 6 additions and 3 deletions

1
Cargo.lock generated
View File

@ -2953,6 +2953,7 @@ dependencies = [
"minifb 0.12.0 (git+https://github.com/emoon/rust_minifb.git)",
"noise 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"vek 0.9.8 (registry+https://github.com/rust-lang/crates.io-index)",
"veloren-common 0.2.0",
]

View File

@ -11,6 +11,7 @@ noise = "0.5.1"
fxhash = "0.2.1"
lazy_static = "1.3.0"
rand = "0.7.0"
rand_chacha = "0.2.1"
[dev-dependencies]
minifb = { git = "https://github.com/emoon/rust_minifb.git" }

View File

@ -15,7 +15,8 @@ use common::{
vol::VolSize,
};
use noise::{BasicMulti, HybridMulti, MultiFractal, NoiseFn, RidgedMulti, Seedable, SuperSimplex};
use rand::{rngs::StdRng, Rng, SeedableRng};
use rand::{Rng, SeedableRng};
use rand_chacha::ChaChaRng;
use std::ops::{Add, Div, Mul, Neg, Sub};
use vek::*;
@ -49,7 +50,7 @@ pub struct WorldSim {
pub(crate) locations: Vec<Location>,
pub(crate) gen_ctx: GenCtx,
pub rng: StdRng,
pub rng: ChaChaRng,
}
impl WorldSim {
@ -93,7 +94,7 @@ impl WorldSim {
chunks,
locations: Vec::new(),
gen_ctx,
rng: StdRng::from_seed([
rng: ChaChaRng::from_seed([
(seed >> 0) as u8,
0,
0,