mirror of
https://github.com/louis-e/arnis.git
synced 2026-02-20 07:54:43 -05:00
More floor variations
This commit is contained in:
@@ -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())]
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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%
|
||||
|
||||
Reference in New Issue
Block a user