More floor variations

This commit is contained in:
louis-e
2025-07-13 15:54:40 +02:00
parent d53af0a3f4
commit 97fe4e264b
5 changed files with 11 additions and 7 deletions

View File

@@ -613,7 +613,7 @@ pub fn get_random_floor_block() -> Block {
use rand::Rng;
let mut rng = rand::thread_rng();
let floor_options = [GRAY_CONCRETE, LIGHT_GRAY_CONCRETE]; // TODO: add more
let floor_options = [WHITE_CONCRETE, GRAY_CONCRETE, LIGHT_GRAY_CONCRETE, POLISHED_ANDESITE, SMOOTH_STONE, STONE_BRICKS, MUD_BRICKS, OAK_PLANKS];
floor_options[rng.gen_range(0..floor_options.len())]
}

View File

@@ -109,8 +109,6 @@ pub fn generate_buildings(
let mut is_tall_building = false;
let mut rng = rand::thread_rng();
let use_vertical_windows = rng.gen_bool(0.7);
let use_accent_lines = rng.gen_bool(0.2);
let use_vertical_accent = !use_accent_lines && rng.gen_bool(0.1);
let use_accent_roof_line = rng.gen_bool(0.25);
// Random accent block selection for this building
@@ -176,6 +174,11 @@ pub fn generate_buildings(
}
}
// Determine accent line usage based on whether building has multiple floors
let has_multiple_floors = building_height > 6;
let use_accent_lines = has_multiple_floors && rng.gen_bool(0.2);
let use_vertical_accent = has_multiple_floors && !use_accent_lines && rng.gen_bool(0.1);
if let Some(amenity_type) = element.tags.get("amenity") {
if amenity_type == "shelter" {
let roof_block: Block = STONE_BRICK_SLAB;

View File

@@ -134,7 +134,7 @@ impl Ground {
pub fn generate_ground_data(args: &Args) -> Ground {
if args.terrain {
emit_gui_progress_update(5.0, "Fetching elevation...");
emit_gui_progress_update(10.0, "Fetching elevation...");
let ground = Ground::new_enabled(
&args.bbox,
args.scale,

View File

@@ -169,7 +169,7 @@ pub fn parse_osm_data(
debug: bool,
) -> (Vec<ProcessedElement>, XZBBox) {
println!("{} Parsing data...", "[2/6]".bold());
emit_gui_progress_update(10.0, "Parsing data...");
emit_gui_progress_update(5.0, "Parsing data...");
// Deserialize the JSON data into the OSMData structure
let data = parse_raw_osm_data(json_data).expect("Failed to parse OSM data");

View File

@@ -21,8 +21,9 @@ pub fn is_running_with_gui() -> bool {
/// This code manages a multi-step process with a progress bar indicating the overall completion.
/// The progress updates are mapped to specific steps in the pipeline:
///
/// [1/6] Fetching data... - Starts at: 0% / Completes at: 10%
/// [2/6] Parsing data... - Starts at: 10% / Completes at: 20%
/// [1/6] Fetching data... - Starts at: 0% / Completes at: 5%
/// [2/6] Parsing data... - Starts at: 5% / Completes at: 10%
/// [2/6] Fetching elevation data... - Starts at: 10% / Completes at: 20%
/// [3/6] Transforming map... - Starts at: 20% / Completes at: 40%
/// [4/6] Processing data... - Starts at: 40% / Completes at: 70%
/// [5/6] Generating ground layer... - Starts at: 70% / Completes at: 90%