diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 01:17:56 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 01:17:56 +0300 |
| commit | b8f6c1e8e169bc8d8ff0f85de1e3ddd478026e3d (patch) | |
| tree | 32590dc403bb21bea05d0a61bc273e6f3ca8dd81 /apps/fparkan-game/src/mission_overlay.rs | |
| parent | eab46d9be33596b6c689a7a34b90837a89400a89 (diff) | |
| download | fparkan-b8f6c1e8e169bc8d8ff0f85de1e3ddd478026e3d.tar.xz fparkan-b8f6c1e8e169bc8d8ff0f85de1e3ddd478026e3d.zip | |
feat(ui): render current messages in the native cockpit pager
Diffstat (limited to 'apps/fparkan-game/src/mission_overlay.rs')
| -rw-r--r-- | apps/fparkan-game/src/mission_overlay.rs | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/apps/fparkan-game/src/mission_overlay.rs b/apps/fparkan-game/src/mission_overlay.rs index e191aed5..7c8c54d6 100644 --- a/apps/fparkan-game/src/mission_overlay.rs +++ b/apps/fparkan-game/src/mission_overlay.rs @@ -11,21 +11,7 @@ use fparkan_runtime::{ }; use std::path::Path; -/// Source-over composition for original sprite texels and their alpha masks. -pub(super) fn source_over(pixel: &mut [u8], source: &[u8]) { - let alpha = u32::from(source[3]); - if alpha == 0 { - return; - } - 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; -} +pub(super) use fparkan_assets::ui_sprite::source_over; #[derive(Default)] pub(super) struct MissionOverlay { |
