# HG changeset patch # User unC0Rr # Date 1737923394 -3600 # Node ID 288df7b85efca38ae446d6d81b41cac7f3825e69 # Parent a73830f5c5cc73a160b527ddc135573eb7a9f189 Fix inversion parameters being disregarded diff -r a73830f5c5cc -r 288df7b85efc rust/landgen/src/wavefront_collapse/generator.rs --- a/rust/landgen/src/wavefront_collapse/generator.rs Sun Jan 26 20:51:38 2025 +0100 +++ b/rust/landgen/src/wavefront_collapse/generator.rs Sun Jan 26 21:29:54 2025 +0100 @@ -56,6 +56,8 @@ pub size: Size, pub tiles: Vec, pub edges: NonStrictComplexEdgesDescription, + pub can_invert: bool, + pub is_negative: bool, pub wrap: bool, } diff -r a73830f5c5cc -r 288df7b85efc rust/lib-hwengine-future/src/lib.rs --- a/rust/lib-hwengine-future/src/lib.rs Sun Jan 26 20:51:38 2025 +0100 +++ b/rust/lib-hwengine-future/src/lib.rs Sun Jan 26 21:29:54 2025 +0100 @@ -108,11 +108,17 @@ let mut map_gen = MapGenerator::::new(data_path); map_gen.import_yaml_templates(&yaml_templates); - let params = LandGenerationParameters::new(0u16, 0x8000u16, feature_size, false, false); let template = map_gen .get_template(template_type, &mut random_numbers_gen) .expect("Error reading wfc templates file") .clone(); + let (zero, basic) = + if template.is_negative || (template.can_invert && random_numbers_gen.get_random(2) == 0) { + (0x8000u16, 0u16) + } else { + (0u16, 0x8000u16) + }; + let params = LandGenerationParameters::new(zero, basic, feature_size, false, false); let landgen = map_gen.build_generator(template); let collision = landgen.generate_land(¶ms, &mut random_numbers_gen); let size = collision.size().size(); diff -r a73830f5c5cc -r 288df7b85efc rust/mapgen/src/template/wavefront_collapse.rs --- a/rust/mapgen/src/template/wavefront_collapse.rs Sun Jan 26 20:51:38 2025 +0100 +++ b/rust/mapgen/src/template/wavefront_collapse.rs Sun Jan 26 21:29:54 2025 +0100 @@ -100,6 +100,8 @@ .map(|TileDescriptionHelper(t)| t.clone()) .collect(), wrap: desc.wrap, + can_invert: desc.can_invert, + is_negative: desc.is_negative, edges: NonStrictComplexEdgesDescription { top, right,