mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Reenabling prefab structures.
This has barely any impact on anything but dungeons. Could probably be sped up further but not a big deal.
This commit is contained in:
@ -1833,3 +1833,33 @@ pub struct ColumnSample/*<'a>*/ {
|
|||||||
/* pub chunk: &'a SimChunk, */
|
/* pub chunk: &'a SimChunk, */
|
||||||
// pub chunk: core::marker::PhantomData<&'a SimChunk>,
|
// pub chunk: core::marker::PhantomData<&'a SimChunk>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub const DEFAULT_COLUMN_SAMPLE: ColumnSample = ColumnSample {
|
||||||
|
alt: 0.0,
|
||||||
|
riverless_alt: 0.0,
|
||||||
|
basement: 0.0,
|
||||||
|
chaos: 0.0,
|
||||||
|
water_level: 0.0,
|
||||||
|
// warp_factor: 0.0,
|
||||||
|
surface_color: Rgb::new(0.0, 0.0, 0.0),
|
||||||
|
sub_surface_color: Rgb::new(0.0, 0.0, 0.0),
|
||||||
|
tree_density: 0.0,
|
||||||
|
// forest_kind: ForestKind,
|
||||||
|
// marble: 0.0,
|
||||||
|
// marble_mid: 0.0,
|
||||||
|
// marble_small: 0.0,
|
||||||
|
rock_density: 0.0,
|
||||||
|
temp: 0.0,
|
||||||
|
humidity: 0.0,
|
||||||
|
spawn_rate: 0.0,
|
||||||
|
stone_col: Rgb::new(0, 0, 0),
|
||||||
|
water_dist: None,
|
||||||
|
gradient: 0.0,
|
||||||
|
path: None,
|
||||||
|
cave: None,
|
||||||
|
snow_cover: false,
|
||||||
|
cliff_offset: 0.0,
|
||||||
|
cliff_height: 0.0,
|
||||||
|
// water_vel: Vec3::new(0.0, 0.0, 0.0),
|
||||||
|
ice_depth: 0.0,
|
||||||
|
};
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::{
|
use crate::{
|
||||||
block::block_from_structure,
|
block::block_from_structure,
|
||||||
|
column::DEFAULT_COLUMN_SAMPLE,
|
||||||
site2::util::Dir,
|
site2::util::Dir,
|
||||||
util::{RandomField, Sampler},
|
util::{RandomField, Sampler},
|
||||||
CanvasInfo,
|
CanvasInfo,
|
||||||
@ -692,7 +693,7 @@ impl<'a, 'b, F: Filler> FillFn<'a, 'b, F> {
|
|||||||
// we probably need an evaluator for the primitive tree that gets which point is queried at
|
// we probably need an evaluator for the primitive tree that gets which point is queried at
|
||||||
// leaf nodes given an input point to make Translate/Rotate work generally
|
// leaf nodes given an input point to make Translate/Rotate work generally
|
||||||
pub fn prefab(&self, p: &'static PrefabStructure, tr: Vec3<i32>, seed: u32) -> impl Fill + Copy + 'b {
|
pub fn prefab(&self, p: &'static PrefabStructure, tr: Vec3<i32>, seed: u32) -> impl Fill + Copy + 'b {
|
||||||
let col_sample = None;/*/*if let Some(col_sample) = */self.canvas_info.col(self.canvas_info.wpos)/* {
|
/* let col_sample = None;/*/*if let Some(col_sample) = */self.canvas_info.col(self.canvas_info.wpos)/* {
|
||||||
col_sample
|
col_sample
|
||||||
} else {
|
} else {
|
||||||
// Don't draw--technically we should probably not assume this much about
|
// Don't draw--technically we should probably not assume this much about
|
||||||
@ -700,10 +701,11 @@ impl<'a, 'b, F: Filler> FillFn<'a, 'b, F> {
|
|||||||
//
|
//
|
||||||
// FIXME: Fix this for alternate fillers if it turns out to matter.
|
// FIXME: Fix this for alternate fillers if it turns out to matter.
|
||||||
return
|
return
|
||||||
}*/*/;
|
}*/*/; */
|
||||||
let index = self.canvas_info.index;
|
let index = self.canvas_info.index;
|
||||||
let p_bounds = p.get_bounds().center().xy();
|
let p_bounds = p.get_bounds().center().xy();
|
||||||
let calendar = self.canvas_info.calendar();
|
let calendar = self.canvas_info.calendar();
|
||||||
|
static COLUMN_SAMPLE: ColumnSample = DEFAULT_COLUMN_SAMPLE;
|
||||||
|
|
||||||
FillVar(move |pos| {
|
FillVar(move |pos| {
|
||||||
p.get(pos - tr).ok().and_then(|&sb| {
|
p.get(pos - tr).ok().and_then(|&sb| {
|
||||||
@ -713,7 +715,7 @@ impl<'a, 'b, F: Filler> FillFn<'a, 'b, F> {
|
|||||||
pos - tr,
|
pos - tr,
|
||||||
p_bounds,
|
p_bounds,
|
||||||
seed,
|
seed,
|
||||||
col_sample?,
|
&/*col_sample?*/COLUMN_SAMPLE,
|
||||||
Block::air,
|
Block::air,
|
||||||
calendar,
|
calendar,
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user