aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/fparkan-game/src/satellite_map.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/apps/fparkan-game/src/satellite_map.rs b/apps/fparkan-game/src/satellite_map.rs
index c74e893a..b7512623 100644
--- a/apps/fparkan-game/src/satellite_map.rs
+++ b/apps/fparkan-game/src/satellite_map.rs
@@ -131,8 +131,8 @@ impl SatelliteMap {
|| (Vec::new(), Vec::new()),
|((engine, cockpit, selected), extent)| {
(
- satellite_contacts::owned_buildings(engine, cockpit, extent).collect(),
- satellite_contacts::owned_units(engine, cockpit, extent, selected).collect(),
+ satellite_contacts::visible_buildings(engine, cockpit, extent).collect(),
+ satellite_contacts::visible_units(engine, cockpit, extent, selected).collect(),
)
},
);
@@ -185,10 +185,11 @@ fn paint_unit(layer: &mut RgbaImage, unit: &satellite_contacts::UnitContact) {
from = point;
}
let radius = if unit.cross { 2 } else { 1 };
+ let [r, g, b] = unit.tint;
for dy in -radius..=radius {
for dx in -radius..=radius {
if !unit.cross || dx == 0 || dy == 0 {
- paint_unit_pixel(layer, unit.pixel, [dx, dy], [128, 128, 255, 255]);
+ paint_unit_pixel(layer, unit.pixel, [dx, dy], [r, g, b, 255]);
}
}
}
@@ -275,8 +276,8 @@ fn paint_building(
}
let retained = u32::from(layer.rgba8[dst + 3]) * (255 - alpha) / 255;
let coverage = alpha + retained;
- for (axis, tint) in [128, 128, 255].into_iter().enumerate() {
- let source = u32::from(atlas.rgba8[src + axis]) * tint / 255;
+ for (axis, tint) in building.tint.into_iter().enumerate() {
+ let source = u32::from(atlas.rgba8[src + axis]) * u32::from(tint) / 255;
let under = u32::from(layer.rgba8[dst + axis]);
layer.rgba8[dst + axis] = ((source * alpha + under * retained) / coverage) as u8;
}