diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-01 23:31:29 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-01 23:31:29 +0300 |
| commit | b3d2b95b8dd5e4578e2889845809fe7c21c5886b (patch) | |
| tree | 97c106a587c350cb82f05fc20c477c3e89f6aba9 /apps/fparkan-game/src/weapon_hud.rs | |
| parent | c3e2add9a189879b5e800344e07645af591a2cbd (diff) | |
| download | fparkan-b3d2b95b8dd5e4578e2889845809fe7c21c5886b.tar.xz fparkan-b3d2b95b8dd5e4578e2889845809fe7c21c5886b.zip | |
feat(ui): show cockpit altitude above mission sea level
Diffstat (limited to 'apps/fparkan-game/src/weapon_hud.rs')
| -rw-r--r-- | apps/fparkan-game/src/weapon_hud.rs | 14 |
1 files changed, 1 insertions, 13 deletions
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); } |
