aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/weapon_hud.rs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/fparkan-game/src/weapon_hud.rs')
-rw-r--r--apps/fparkan-game/src/weapon_hud.rs14
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);
}