aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-assets/src
diff options
context:
space:
mode:
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,
}))
}