Remove the last remnants of the site circle and cave map drawing code

This commit is contained in:
Christof Petig 2020-11-23 19:54:56 +01:00
parent 11f9d71fde
commit 49d7c40bec
3 changed files with 4 additions and 21 deletions

View File

@ -72,7 +72,6 @@ fn main() {
sample_pos( sample_pos(
config, config,
sampler, sampler,
index,
samples, samples,
uniform_idx_as_vec2(map_size_lg, posi), uniform_idx_as_vec2(map_size_lg, posi),
) )

View File

@ -1,7 +1,7 @@
use crate::{ use crate::{
column::ColumnSample, column::ColumnSample,
sim::{RiverKind, WorldSim}, sim::{RiverKind, WorldSim},
IndexRef, CONFIG, CONFIG,
}; };
use common::{ use common::{
terrain::{ terrain::{
@ -71,7 +71,6 @@ pub fn sample_wpos(config: &MapConfig, sampler: &WorldSim, wpos: Vec2<i32>) -> f
pub fn sample_pos( pub fn sample_pos(
config: &MapConfig, config: &MapConfig,
sampler: &WorldSim, sampler: &WorldSim,
_index: IndexRef,
samples: Option<&[Option<ColumnSample>]>, samples: Option<&[Option<ColumnSample>]>,
pos: Vec2<i32>, pos: Vec2<i32>,
) -> MapSample { ) -> MapSample {
@ -102,8 +101,6 @@ pub fn sample_pos(
river_kind, river_kind,
spline_derivative, spline_derivative,
is_path, is_path,
//_is_cave,
//_near_site,
) = sampler ) = sampler
.get(pos) .get(pos)
.map(|sample| { .map(|sample| {
@ -118,13 +115,6 @@ pub fn sample_pos(
sample.river.river_kind, sample.river.river_kind,
sample.river.spline_derivative, sample.river.spline_derivative,
sample.path.0.is_way(), sample.path.0.is_way(),
// sample.cave.0.is_way(),
// sample.sites.iter().any(|site| {
// index.sites[*site]
// .get_origin()
// .distance_squared(pos * TerrainChunkSize::RECT_SIZE.x as i32)
// < 64i32.pow(2)
//}),
) )
}) })
.unwrap_or(( .unwrap_or((
@ -138,8 +128,6 @@ pub fn sample_pos(
None, None,
Vec2::zero(), Vec2::zero(),
false, false,
// false,
// false,
)); ));
let humidity = humidity.min(1.0).max(0.0); let humidity = humidity.min(1.0).max(0.0);
@ -247,13 +235,9 @@ pub fn sample_pos(
), ),
}; };
// TODO: Make principled. // TODO: Make principled.
let rgb = /*if near_site { let rgb = if is_path {
Rgb::new(0x57, 0x39, 0x33)
} else*/ if is_path {
Rgb::new(0x37, 0x29, 0x23) Rgb::new(0x37, 0x29, 0x23)
} /* else if is_cave { } else {
Rgb::new(0x37, 0x37, 0x37)
} */ else {
rgb rgb
}; };

View File

@ -1476,7 +1476,7 @@ impl WorldSim {
map_config.is_shaded = false; map_config.is_shaded = false;
map_config.generate( map_config.generate(
|pos| sample_pos(&map_config, self, index, Some(&samples_data), pos), |pos| sample_pos(&map_config, self, Some(&samples_data), pos),
|pos| sample_wpos(&map_config, self, pos), |pos| sample_wpos(&map_config, self, pos),
|pos, (r, g, b, _a)| { |pos, (r, g, b, _a)| {
// We currently ignore alpha and replace it with the height at pos, scaled to // We currently ignore alpha and replace it with the height at pos, scaled to