aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-assets/src
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-12-01 21:44:16 +0300
committerValentin Popov <valentin@popov.link>2026-12-01 21:44:16 +0300
commit8d775c601f492e8f1e2ec1a28835f1ab3a37b076 (patch)
treea33e243b4ed36befe08be8940a6b813a58847d2d /crates/fparkan-assets/src
parentb48fb2caccc7a72b85f07e6ab652081af57c7855 (diff)
downloadfparkan-8d775c601f492e8f1e2ec1a28835f1ab3a37b076.tar.xz
fparkan-8d775c601f492e8f1e2ec1a28835f1ab3a37b076.zip
feat(ui): show owned buildings on the satellite map
Use the original landscape projection and building sprites. Resolve ownership from live registered objects so a captured building appears at its existing location. Checked the original DLL and verified the factory and storage icons in the stock Field Camp window.
Diffstat (limited to 'crates/fparkan-assets/src')
-rw-r--r--crates/fparkan-assets/src/satellite_map.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/fparkan-assets/src/satellite_map.rs b/crates/fparkan-assets/src/satellite_map.rs
index 9a18f2bd..39af61bf 100644
--- a/crates/fparkan-assets/src/satellite_map.rs
+++ b/crates/fparkan-assets/src/satellite_map.rs
@@ -8,10 +8,11 @@ use fparkan_texm::{decode_mip_rgba8, decode_texm, RgbaImage};
use fparkan_vfs::Vfs;
use std::sync::Arc;
-/// The mission map and compass cut from the original interface texture atlas.
+/// The mission map, compass and contact atlas from the installed game.
pub struct SatelliteMapAssets {
pub background: RgbaImage,
pub compass: RgbaImage,
+ pub icons: RgbaImage,
}
/// Resolves `minimap` through the mission CFG and the compass through the game UI CFG.
@@ -63,9 +64,17 @@ pub fn load_satellite_map(
[number(&icon, "OFFSET_X")?, number(&icon, "OFFSET_Y")?],
[number(&icon, "WIDTH")?, number(&icon, "HEIGHT")?],
)?;
+ let icon_page = pages
+ .payload(EntryId(number(&textures, "ICONS")?))
+ .map_err(|error| error.to_string())?;
+ let icons = texture(icon_page)?;
+ if icons.width != 256 || icons.height != 256 {
+ return Err("unexpected satellite icon atlas dimensions".into());
+ }
Ok(Some(SatelliteMapAssets {
background,
compass,
+ icons,
}))
}