mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'xacrimon/named-rng-wgen' into 'master'
Use named generator in worldgen See merge request veloren/veloren!381
This commit is contained in:
commit
0107cc96f5
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -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",
|
||||
]
|
||||
|
@ -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" }
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user