From 733f9d92e0d4e40ed40db42fa6cd11294e49eb7b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 12:12:06 +0400 Subject: feat(ui): show native strategic waypoint cursors Read the animated cursor strips and their hotspots from the installed UI atlas. Use the native Land.map areal flag and chassis selector for both the preview cursor and waypoint input. In stock Two Fortresses, compared one accepted and one rejected map point against the original and checked the return to the cockpit with Vulkan validation. --- crates/fparkan-terrain/src/lib.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'crates/fparkan-terrain') diff --git a/crates/fparkan-terrain/src/lib.rs b/crates/fparkan-terrain/src/lib.rs index 7e2ae588..659acf86 100644 --- a/crates/fparkan-terrain/src/lib.rs +++ b/crates/fparkan-terrain/src/lib.rs @@ -251,6 +251,7 @@ impl TerrainWorld { ); areals.push(RuntimeAreal { id, + logic_flag: areal.logic_flag, polygon: areal .vertices .iter() @@ -427,6 +428,12 @@ impl TerrainWorld { self.areals.len() } + /// Logic flag from the prefix of this logical area in `Land.map`. + #[must_use] + pub fn areal_logic_flag(&self, id: ArealId) -> Option { + self.areals.get(id.0 as usize).map(|areal| areal.logic_flag) + } + /// Returns the midpoint of the boundary edge linking two consecutive areas. /// Links through polygon slots have no boundary midpoint. #[must_use] @@ -974,6 +981,7 @@ impl RuntimeTriangle { #[derive(Clone, Debug)] struct RuntimeAreal { id: ArealId, + logic_flag: u32, polygon: Vec<[f32; 2]>, edge_neighbors: Vec>, } @@ -1280,10 +1288,15 @@ mod tests { #[test] fn locates_areal_and_routes_synthetic_neighbors() { - let map = synthetic_land_map(); + let mut map = synthetic_land_map(); + map.areals[0].logic_flag = 0; + map.areals[1].logic_flag = 1; let world = TerrainWorld::from_land_map(&map).expect("world"); assert_eq!(world.areal_count(), 2); + assert_eq!(world.areal_logic_flag(ArealId(0)), Some(0)); + assert_eq!(world.areal_logic_flag(ArealId(1)), Some(1)); + assert_eq!(world.areal_logic_flag(ArealId(2)), None); assert_eq!( world.route_crossing(ArealId(0), ArealId(1)), Some([1.0, 0.5]) -- cgit v1.2.3