diff options
Diffstat (limited to 'crates/fparkan-assets/src/satellite_map_chrome.rs')
| -rw-r--r-- | crates/fparkan-assets/src/satellite_map_chrome.rs | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/crates/fparkan-assets/src/satellite_map_chrome.rs b/crates/fparkan-assets/src/satellite_map_chrome.rs index 30b41e06..5ae81bea 100644 --- a/crates/fparkan-assets/src/satellite_map_chrome.rs +++ b/crates/fparkan-assets/src/satellite_map_chrome.rs @@ -172,9 +172,7 @@ impl MapChrome { (false, 2) => [255, 128, 128], (false, 3) => [128, 255, 128], (false, 4) => [128, 128, 255], - (true, 2) => [255, 0, 0], - (true, 3) => [0, 255, 0], - (true, 4 | 5) => [0, 0, 255], + (true, size) => building_glyph_tint(size), _ => [255; 3], }; let atlas = if contact.class == 0x8000_0200 { @@ -186,16 +184,7 @@ impl MapChrome { 0x0100_2000 => Some([81, 110]), 0x0100_4000 => Some([65, 110]), 0x0100_8000 | 0x0101_0000 | 0x0102_0000 => Some([49, 110]), - 0x8000_0002 => Some([113, 126]), - 0x8000_0004 => Some([129, 126]), - 0x8000_0008 => Some([81, 110]), - 0x8000_0010 => Some([129, 94]), - 0x8000_0040 => Some([97, 126]), - 0x8000_0200 => Some([148, 27]), - 0x8000_0400 => Some([49, 126]), - 0x8001_0000 | 0x8002_0000 | 0x8004_0000 => Some([65, 126]), - 0x8010_0000 | 0x8020_0000 => Some([81, 126]), - _ => None, + class => building_glyph(class), }; if let Some(glyph) = class.and_then(|[x, y]| atlas_region(atlas, [x, y, 15, 15])) { stamp(image, &glyph, [26, 2, 41, 17], tint); @@ -215,6 +204,31 @@ impl MapChrome { } } +// The list and map readout both call iron3d+0x346a0 for building glyphs. +pub(crate) fn building_glyph(class: u32) -> Option<[u32; 2]> { + Some(match class { + 0x8000_0002 => [113, 126], + 0x8000_0004 => [129, 126], + 0x8000_0008 => [81, 110], + 0x8000_0010 => [129, 94], + 0x8000_0040 => [97, 126], + 0x8000_0200 => [148, 27], + 0x8000_0400 => [49, 126], + 0x8001_0000 | 0x8002_0000 | 0x8004_0000 => [65, 126], + 0x8010_0000 | 0x8020_0000 => [81, 126], + _ => return None, + }) +} + +pub(crate) fn building_glyph_tint(size: u32) -> [u8; 3] { + match size { + 2 => [255, 0, 0], + 3 => [0, 255, 0], + 4 | 5 => [0, 0, 255], + _ => [255; 3], + } +} + fn empty_strip() -> RgbaImage { RgbaImage { width: WIDTH, |
