mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add 'col' and 'wpos2d' parameters to 'new_method2'
This commit is contained in:
parent
dea6ebfff0
commit
217ce74187
@ -92,7 +92,7 @@ fn new_method1(riverless_alt: f32, alt: f32, water_dist: f32) -> (f32, i32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Rename
|
//TODO: Rename
|
||||||
fn new_method2(block_kind: BlockKind, color: Rgb<u8>) -> Block {
|
fn new_method2(col: &ColumnSample, wpos2d: Vec2<i32>, block_kind: BlockKind, color: Rgb<u8>) -> Block {
|
||||||
let noisy_color = |color: Rgb<u8>, factor: u32| {
|
let noisy_color = |color: Rgb<u8>, factor: u32| {
|
||||||
let surface_z = col.riverless_alt.floor() as i32;
|
let surface_z = col.riverless_alt.floor() as i32;
|
||||||
let nz = RandomField::new(0).get(Vec3::new(wpos2d.x, wpos2d.y, surface_z));
|
let nz = RandomField::new(0).get(Vec3::new(wpos2d.x, wpos2d.y, surface_z));
|
||||||
@ -113,10 +113,10 @@ fn new_method4(canvas: &mut Canvas, wpos2d: Vec2<i32>, col: &ColumnSample, path_
|
|||||||
let _ = canvas.set(
|
let _ = canvas.set(
|
||||||
Vec3::new(wpos2d.x, wpos2d.y, surface_z + z),
|
Vec3::new(wpos2d.x, wpos2d.y, surface_z + z),
|
||||||
if bridge_offset >= 2.0 && path_dist >= 3.0 || z < -1 {
|
if bridge_offset >= 2.0 && path_dist >= 3.0 || z < -1 {
|
||||||
new_method2(BlockKind::Rock, info.index().colors.layer.bridge.into())
|
new_method2(col, wpos2d, BlockKind::Rock, info.index().colors.layer.bridge.into())
|
||||||
} else {
|
} else {
|
||||||
new_method2(
|
new_method2(
|
||||||
BlockKind::Earth,
|
col, wpos2d, BlockKind::Earth,
|
||||||
path.surface_color(col.sub_surface_color.map(|e| (e * 255.0) as u8)),
|
path.surface_color(col.sub_surface_color.map(|e| (e * 255.0) as u8)),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user