mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'kyozm/load-structures-from-ron' into 'master'
Load structures from ron files Closes #287 See merge request veloren/veloren!570
This commit is contained in:
commit
4c82610504
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -3662,6 +3662,8 @@ dependencies = [
|
||||
"noise 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.101 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"vek 0.9.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"veloren-common 0.4.0",
|
||||
]
|
||||
|
24
assets/world/manifests/acacias.ron
Normal file
24
assets/world/manifests/acacias.ron
Normal file
@ -0,0 +1,24 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.acacia.1",
|
||||
center: (16, 17, 1)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.acacia.2",
|
||||
center: (5, 6, 1)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.acacia.3",
|
||||
center: (5, 6, 1)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.acacia.4",
|
||||
center: (15, 16, 1)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.acacia.5",
|
||||
center: (19, 18, 1)
|
||||
),
|
||||
]
|
||||
)
|
28
assets/world/manifests/fruit_trees.ron
Normal file
28
assets/world/manifests/fruit_trees.ron
Normal file
@ -0,0 +1,28 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.fruit.1",
|
||||
center: (5, 5, 7)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.fruit.2",
|
||||
center: (6, 6, 7)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.fruit.3",
|
||||
center: (6, 7, 7)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.fruit.4",
|
||||
center: (3, 3, 7)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.fruit.5",
|
||||
center: (6, 8, 7)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.fruit.6",
|
||||
center: (7, 7, 7)
|
||||
),
|
||||
]
|
||||
)
|
36
assets/world/manifests/mangrove_trees.ron
Normal file
36
assets/world/manifests/mangrove_trees.ron
Normal file
@ -0,0 +1,36 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.mangroves.1",
|
||||
center: (18, 18, 8)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.mangroves.2",
|
||||
center: (16, 17, 7)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.mangroves.3",
|
||||
center: (18, 18, 8)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.mangroves.4",
|
||||
center: (18, 16, 8)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.mangroves.5",
|
||||
center: (19, 20, 9)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.mangroves.6",
|
||||
center: (18, 18, 9)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.mangroves.7",
|
||||
center: (18, 17, 9)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.mangroves.8",
|
||||
center: (18, 18, 9)
|
||||
),
|
||||
]
|
||||
)
|
40
assets/world/manifests/oak_stumps.ron
Normal file
40
assets/world/manifests/oak_stumps.ron
Normal file
@ -0,0 +1,40 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.oak_stump.1",
|
||||
center: (15, 18, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.2",
|
||||
center: (15, 18, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.3",
|
||||
center: (16, 20, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.4",
|
||||
center: (18, 21, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.5",
|
||||
center: (18, 18, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.6",
|
||||
center: (16, 21, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.7",
|
||||
center: (20, 19, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.8",
|
||||
center: (22, 20, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_stump.9",
|
||||
center:(26, 26, 10)
|
||||
),
|
||||
]
|
||||
)
|
40
assets/world/manifests/oaks.ron
Normal file
40
assets/world/manifests/oaks.ron
Normal file
@ -0,0 +1,40 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.oak_green.1",
|
||||
center: (15, 18, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.2",
|
||||
center: (15, 18, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.3",
|
||||
center: (16, 20, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.4",
|
||||
center: (18, 21, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.5",
|
||||
center: (18, 18, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.6",
|
||||
center: (16, 21, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.7",
|
||||
center: (20, 19, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.8",
|
||||
center: (22, 20, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.oak_green.9",
|
||||
center:(26, 26, 14)
|
||||
),
|
||||
]
|
||||
)
|
44
assets/world/manifests/palms.ron
Normal file
44
assets/world/manifests/palms.ron
Normal file
@ -0,0 +1,44 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.desert_palm.1",
|
||||
center: (12, 12, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.2",
|
||||
center: (12, 10, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.3",
|
||||
center: (12, 12, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.4",
|
||||
center: (10, 10, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.5",
|
||||
center: (10, 10, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.6",
|
||||
center: (10, 10, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.7",
|
||||
center: (10, 10, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.8",
|
||||
center: (10, 10, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.9",
|
||||
center: (10, 10, 10)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.desert_palm.10",
|
||||
center: (10, 10, 10)
|
||||
),
|
||||
]
|
||||
)
|
36
assets/world/manifests/pines.ron
Normal file
36
assets/world/manifests/pines.ron
Normal file
@ -0,0 +1,36 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.pine_green.1",
|
||||
center: (15, 15, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.pine_green.2",
|
||||
center: (15, 15, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.pine_green.3",
|
||||
center: (17, 15, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.pine_green.4",
|
||||
center: (10, 8, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.pine_green.5",
|
||||
center: (12, 12, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.pine_green.6",
|
||||
center: (11, 10, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.pine_green.7",
|
||||
center: (16, 15, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.pine_green.8",
|
||||
center: (12, 10, 12)
|
||||
),
|
||||
]
|
||||
)
|
12
assets/world/manifests/quirky.ron
Normal file
12
assets/world/manifests/quirky.ron
Normal file
@ -0,0 +1,12 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.structure.natural.tower-ruin",
|
||||
center: (11, 14, 5)
|
||||
),
|
||||
(
|
||||
specifier: "world.structure.natural.witch-hut",
|
||||
center: (10, 13, 9)
|
||||
),
|
||||
]
|
||||
)
|
16
assets/world/manifests/quirky_dry.ron
Normal file
16
assets/world/manifests/quirky_dry.ron
Normal file
@ -0,0 +1,16 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.structure.natural.ribcage-small",
|
||||
center: (7, 13, 4)
|
||||
),
|
||||
(
|
||||
specifier: "world.structure.natural.ribcage-large",
|
||||
center: (13, 19, 8)
|
||||
),
|
||||
(
|
||||
specifier: "world.structure.natural.skull-large",
|
||||
center: (15, 20, 4)
|
||||
),
|
||||
]
|
||||
)
|
36
assets/world/manifests/snow_pines.ron
Normal file
36
assets/world/manifests/snow_pines.ron
Normal file
@ -0,0 +1,36 @@
|
||||
(
|
||||
[
|
||||
(
|
||||
specifier: "world.tree.snow_pine.1",
|
||||
center: (15, 15, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.snow_pine.2",
|
||||
center: (15, 15, 14)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.snow_pine.3",
|
||||
center: (17, 15, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.snow_pine.4",
|
||||
center: (10, 8, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.snow_pine.5",
|
||||
center: (12, 12, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.snow_pine.6",
|
||||
center: (11, 10, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.snow_pine.7",
|
||||
center: (16, 15, 12)
|
||||
),
|
||||
(
|
||||
specifier: "world.tree.snow_pine.8",
|
||||
center: (12, 10, 12)
|
||||
)
|
||||
],
|
||||
)
|
@ -13,6 +13,8 @@ lazy_static = "1.4.0"
|
||||
rand = "0.7.2"
|
||||
rand_chacha = "0.2.1"
|
||||
arr_macro = "0.1.2"
|
||||
serde = "1.0.101"
|
||||
ron = "0.5.1"
|
||||
|
||||
[dev-dependencies]
|
||||
minifb = { git = "https://github.com/emoon/rust_minifb.git" }
|
||||
|
@ -5,8 +5,13 @@ use crate::{
|
||||
util::{RandomPerm, Sampler, SmallCache, UnitChooser},
|
||||
CONFIG,
|
||||
};
|
||||
use common::assets::Asset;
|
||||
use common::{assets, terrain::Structure};
|
||||
use lazy_static::lazy_static;
|
||||
use ron;
|
||||
use serde::Deserialize;
|
||||
use std::fs::File;
|
||||
use std::io::BufReader;
|
||||
use std::sync::Arc;
|
||||
use std::u32;
|
||||
use vek::*;
|
||||
@ -76,394 +81,45 @@ pub fn structure_gen<'a>(
|
||||
})
|
||||
}
|
||||
|
||||
fn st_asset(path: &str, offset: impl Into<Vec3<i32>>) -> Arc<Structure> {
|
||||
assets::load_map(path, |s: Structure| s.with_center(offset.into()))
|
||||
.expect("Failed to load structure asset")
|
||||
#[derive(Deserialize)]
|
||||
struct StructureSpec {
|
||||
specifier: String,
|
||||
center: [i32; 3],
|
||||
}
|
||||
#[derive(Deserialize)]
|
||||
struct StructuresSpec(Vec<StructureSpec>);
|
||||
|
||||
impl Asset for StructuresSpec {
|
||||
const ENDINGS: &'static [&'static str] = &["ron"];
|
||||
fn parse(buf_reader: BufReader<File>) -> Result<Self, assets::Error> {
|
||||
Ok(ron::de::from_reader(buf_reader).expect("Error parsing structure specs"))
|
||||
}
|
||||
}
|
||||
|
||||
fn load_structures(specifier: &str) -> Vec<Arc<Structure>> {
|
||||
let spec = assets::load::<StructuresSpec>(&["world.manifests.", specifier].concat());
|
||||
return spec
|
||||
.unwrap()
|
||||
.0
|
||||
.iter()
|
||||
.map(|sp| {
|
||||
assets::load_map(&sp.specifier[..], |s: Structure| {
|
||||
s.with_center(Vec3::from(sp.center))
|
||||
})
|
||||
.unwrap()
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
pub static ref OAKS: Vec<Arc<Structure>> = vec![
|
||||
// green oaks
|
||||
assets::load_map("world.tree.oak_green.1", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 18, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.2", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 18, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.3", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 20, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.4", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 21, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.5", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 18, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.6", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 21, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.7", |s: Structure| s
|
||||
.with_center(Vec3::new(20, 19, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.8", |s: Structure| s
|
||||
.with_center(Vec3::new(22, 20, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_green.9", |s: Structure| s
|
||||
.with_center(Vec3::new(26, 26, 14)))
|
||||
.unwrap(),
|
||||
];
|
||||
|
||||
pub static ref OAK_STUMPS: Vec<Arc<Structure>> = vec![
|
||||
// oak stumps
|
||||
assets::load_map("world.tree.oak_stump.1", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 18, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.2", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 18, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.3", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 20, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.4", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 21, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.5", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 18, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.6", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 21, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.7", |s: Structure| s
|
||||
.with_center(Vec3::new(20, 19, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.8", |s: Structure| s
|
||||
.with_center(Vec3::new(22, 20, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.oak_stump.9", |s: Structure| s
|
||||
.with_center(Vec3::new(26, 26, 10)))
|
||||
.unwrap(),
|
||||
];
|
||||
|
||||
pub static ref PINES: Vec<Arc<Structure>> = vec![
|
||||
// green pines
|
||||
assets::load_map("world.tree.pine_green.1", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 15, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.pine_green.2", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 15, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.pine_green.3", |s: Structure| s
|
||||
.with_center(Vec3::new(17, 15, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.pine_green.4", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 8, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.pine_green.5", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 12, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.pine_green.6", |s: Structure| s
|
||||
.with_center(Vec3::new(11, 10, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.pine_green.7", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 15, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.pine_green.8", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 10, 12)))
|
||||
.unwrap(),
|
||||
/*
|
||||
// green pines 2
|
||||
assets::load_map("world/tree/pine_green_2/1", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 15, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_green_2/2", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 15, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_green_2/3", |s: Structure| s
|
||||
.with_center(Vec3::new(17, 15, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_green_2/4", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 8, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_green_2/5", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 12, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_green_2/6", |s: Structure| s
|
||||
.with_center(Vec3::new(11, 10, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_green_2/7", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 15, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_green_2/8", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 10, 12)))
|
||||
.unwrap(),
|
||||
// blue pines
|
||||
assets::load_map("world/tree/pine_blue/1", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 15, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_blue/2", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 15, 14)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_blue/3", |s: Structure| s
|
||||
.with_center(Vec3::new(17, 15, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_blue/4", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 8, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_blue/5", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 12, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_blue/6", |s: Structure| s
|
||||
.with_center(Vec3::new(11, 10, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_blue/7", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 15, 12)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/pine_blue/8", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 10, 12)))
|
||||
.unwrap(),
|
||||
*/
|
||||
];
|
||||
/*
|
||||
// temperate small
|
||||
assets::load_map("world/tree/temperate_small/1", |s: Structure| s
|
||||
.with_center(Vec3::new(4, 4, 7)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/temperate_small/2", |s: Structure| s
|
||||
.with_center(Vec3::new(4, 4, 7)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/temperate_small/3", |s: Structure| s
|
||||
.with_center(Vec3::new(4, 4, 7)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/temperate_small/4", |s: Structure| s
|
||||
.with_center(Vec3::new(4, 4, 7)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/temperate_small/5", |s: Structure| s
|
||||
.with_center(Vec3::new(4, 4, 7)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/temperate_small/6", |s: Structure| s
|
||||
.with_center(Vec3::new(4, 4, 7)))
|
||||
.unwrap(),
|
||||
// birch
|
||||
assets::load_map("world/tree/birch/1", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 9, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/2", |s: Structure| s
|
||||
.with_center(Vec3::new(11, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/3", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/4", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/5", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 11, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/6", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 9, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/7", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/8", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 9, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/9", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/10", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 9, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/11", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/birch/12", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 9, 10)))
|
||||
.unwrap(),
|
||||
// poplar
|
||||
assets::load_map("world/tree/poplar/1", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/2", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/3", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/4", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/5", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/6", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/7", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/8", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/9", |s: Structure| s
|
||||
.with_center(Vec3::new(6, 6, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/poplar/10", |s: Structure| s
|
||||
.with_center(Vec3::new(7, 7, 10)))
|
||||
.unwrap(),
|
||||
*/
|
||||
|
||||
pub static ref PALMS: Vec<Arc<Structure>> = vec![
|
||||
// palm trees
|
||||
assets::load_map("world.tree.desert_palm.1", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 12, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.2", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.3", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 12, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.4", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.5", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.6", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.7", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.8", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.9", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.desert_palm.10", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 10)))
|
||||
.unwrap(),
|
||||
];
|
||||
|
||||
pub static ref SNOW_PINES: Vec<Arc<Structure>> = vec![
|
||||
// snow pines
|
||||
st_asset("world.tree.snow_pine.1", (15, 15, 14)),
|
||||
st_asset("world.tree.snow_pine.2", (15, 15, 14)),
|
||||
st_asset("world.tree.snow_pine.3", (17, 15, 12)),
|
||||
st_asset("world.tree.snow_pine.4", (10, 8, 12)),
|
||||
st_asset("world.tree.snow_pine.5", (12, 12, 12)),
|
||||
st_asset("world.tree.snow_pine.6", (11, 10, 12)),
|
||||
st_asset("world.tree.snow_pine.7", (16, 15, 12)),
|
||||
st_asset("world.tree.snow_pine.8", (12, 10, 12)),
|
||||
];
|
||||
|
||||
pub static ref ACACIAS: Vec<Arc<Structure>> = vec![
|
||||
// acias
|
||||
st_asset("world.tree.acacia.1", (16, 17, 1)),
|
||||
st_asset("world.tree.acacia.2", (5, 6, 1)),
|
||||
st_asset("world.tree.acacia.3", (5, 6, 1)),
|
||||
st_asset("world.tree.acacia.4", (15, 16, 1)),
|
||||
st_asset("world.tree.acacia.5", (19, 18, 1)),
|
||||
];
|
||||
|
||||
pub static ref FRUIT_TREES: Vec<Arc<Structure>> = vec![
|
||||
// fruit trees
|
||||
st_asset("world.tree.fruit.1", (5, 5, 7)),
|
||||
st_asset("world.tree.fruit.2", (6, 6, 7)),
|
||||
st_asset("world.tree.fruit.3", (6, 7, 7)),
|
||||
st_asset("world.tree.fruit.4", (3, 3, 7)),
|
||||
st_asset("world.tree.fruit.5", (6, 8, 7)),
|
||||
st_asset("world.tree.fruit.6", (7, 7, 7)),
|
||||
];
|
||||
|
||||
/*
|
||||
// snow birches -> need roots!
|
||||
assets::load_map("world/tree/snow_birch/1", |s: Structure| s
|
||||
.with_center(Vec3::new(12, 9, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/2", |s: Structure| s
|
||||
.with_center(Vec3::new(11, 10, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/3", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/4", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/5", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 11, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/6", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 9, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/7", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 10, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/8", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 9, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/9", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/10", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 9, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/11", |s: Structure| s
|
||||
.with_center(Vec3::new(9, 10, 4)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/snow_birch/12", |s: Structure| s
|
||||
.with_center(Vec3::new(10, 9, 4)))
|
||||
.unwrap(),
|
||||
// willows
|
||||
assets::load_map("world/tree/willow/1", |s: Structure| s
|
||||
.with_center(Vec3::new(15, 14, 1)))
|
||||
.unwrap(),
|
||||
assets::load_map("world/tree/willow/2", |s: Structure| s
|
||||
.with_center(Vec3::new(11, 12, 1)))
|
||||
.unwrap(),
|
||||
];
|
||||
*/
|
||||
|
||||
pub static ref MANGROVE_TREES: Vec<Arc<Structure>> = vec![
|
||||
// oak stumps
|
||||
assets::load_map("world.tree.mangroves.1", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 18, 8)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.mangroves.2", |s: Structure| s
|
||||
.with_center(Vec3::new(16, 17, 7)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.mangroves.3", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 18, 8)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.mangroves.4", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 16, 8)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.mangroves.5", |s: Structure| s
|
||||
.with_center(Vec3::new(19, 20, 9)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.mangroves.6", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 18, 9)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.mangroves.7", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 17, 9)))
|
||||
.unwrap(),
|
||||
assets::load_map("world.tree.mangroves.8", |s: Structure| s
|
||||
.with_center(Vec3::new(18, 18, 9)))
|
||||
.unwrap(),
|
||||
];
|
||||
|
||||
pub static ref QUIRKY: Vec<Arc<Structure>> = vec![
|
||||
st_asset("world.structure.natural.tower-ruin", (11, 14, 5)),
|
||||
st_asset("world.structure.natural.witch-hut", (10, 13, 9)),
|
||||
];
|
||||
|
||||
pub static ref QUIRKY_DRY: Vec<Arc<Structure>> = vec![
|
||||
st_asset("world.structure.natural.ribcage-small", (7, 13, 4)),
|
||||
st_asset("world.structure.natural.ribcage-large", (13, 19, 8)),
|
||||
st_asset("world.structure.natural.skull-large", (15, 20, 4)),
|
||||
];
|
||||
|
||||
|
||||
pub static ref OAKS: Vec<Arc<Structure>> = load_structures("oaks");
|
||||
pub static ref OAK_STUMPS: Vec<Arc<Structure>> = load_structures("oak_stumps");
|
||||
pub static ref PINES: Vec<Arc<Structure>> = load_structures("pines");
|
||||
pub static ref PALMS: Vec<Arc<Structure>> = load_structures("palms");
|
||||
pub static ref SNOW_PINES: Vec<Arc<Structure>> = load_structures("snow_pines");
|
||||
pub static ref ACACIAS: Vec<Arc<Structure>> = load_structures("acacias");
|
||||
pub static ref FRUIT_TREES: Vec<Arc<Structure>> = load_structures("fruit_trees");
|
||||
pub static ref MANGROVE_TREES: Vec<Arc<Structure>> = load_structures("mangrove_trees");
|
||||
pub static ref QUIRKY: Vec<Arc<Structure>> = load_structures("quirky");
|
||||
pub static ref QUIRKY_DRY: Vec<Arc<Structure>> = load_structures("quirky_dry");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user