From b3d2b95b8dd5e4578e2889845809fe7c21c5886b Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 00:31:29 +0400 Subject: feat(ui): show cockpit altitude above mission sea level --- apps/fparkan-game/src/weapon_hud.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'apps/fparkan-game/src/weapon_hud.rs') diff --git a/apps/fparkan-game/src/weapon_hud.rs b/apps/fparkan-game/src/weapon_hud.rs index 68144b28..93db51db 100644 --- a/apps/fparkan-game/src/weapon_hud.rs +++ b/apps/fparkan-game/src/weapon_hud.rs @@ -242,18 +242,6 @@ fn paint(image: &mut VulkanStaticTexture, sprite: &RgbaImage, left: u32, top: u3 } fn paint_pixel(image: &mut VulkanStaticTexture, x: u32, y: u32, source: &[u8]) { - let alpha = u32::from(source[3]); - if alpha == 0 { - return; - } let start = ((y * WIDTH + x) * 4) as usize; - let pixel = &mut image.rgba8[start..start + 4]; - let under = (u32::from(pixel[3]) * (255 - alpha) + 127) / 255; - let combined = alpha + under; - for index in 0..3 { - pixel[index] = - ((u32::from(source[index]) * alpha + u32::from(pixel[index]) * under + combined / 2) - / combined) as u8; - } - pixel[3] = combined as u8; + super::mission_overlay::source_over(&mut image.rgba8[start..start + 4], source); } -- cgit v1.2.3