diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 00:14:54 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 00:14:54 +0300 |
| commit | 3efc5ba5d3389da168b00f8fe47d3478821e5d7f (patch) | |
| tree | 8b222a05c28944eb05e815198872ae5f514db3b0 /apps/fparkan-game/src/altimeter_hud.rs | |
| parent | 752d34af83acf9a818e22c621fb034913079acff (diff) | |
| download | fparkan-3efc5ba5d3389da168b00f8fe47d3478821e5d7f.tar.xz fparkan-3efc5ba5d3389da168b00f8fe47d3478821e5d7f.zip | |
feat(ui): restore the original cockpit radar dial
Use the mirrored source atlas halves and show the installed sensor range with the original font. The stock Fireline cockpit reads 300 and the Two Fortresses cockpit reads 400. The range query agrees with the original libraries for both inactive and missing devices.
Diffstat (limited to 'apps/fparkan-game/src/altimeter_hud.rs')
| -rw-r--r-- | apps/fparkan-game/src/altimeter_hud.rs | 40 |
1 files changed, 8 insertions, 32 deletions
diff --git a/apps/fparkan-game/src/altimeter_hud.rs b/apps/fparkan-game/src/altimeter_hud.rs index 48114bf1..9a7b4865 100644 --- a/apps/fparkan-game/src/altimeter_hud.rs +++ b/apps/fparkan-game/src/altimeter_hud.rs @@ -1,16 +1,11 @@ use super::{ append_environment_gradient_material, append_environment_range, environment_vertex, mission_overlay::source_over, quad_indices, screen_tl_quad_vertices_pixels, - world_pipeline_state, DirectoryVfs, EnvironmentGpuRange, LegacyBlendMode, LegacyDepthMode, + world_pipeline_state, EnvironmentGpuRange, LegacyBlendMode, LegacyDepthMode, StaticPreviewScene, VulkanSmokeRenderer, VulkanStaticMesh, VulkanStaticTexture, }; -use fparkan_assets::{ - game_font::{load_layout_font, BitmapFont}, - ui_sprite::load_ui_page, - RgbaImage, -}; +use fparkan_assets::{game_font::BitmapFont, RgbaImage}; use fparkan_runtime::cockpit_altimeter::Altimeter; -use std::path::Path; const LEFT: u32 = 221; const TOP: u32 = 347; @@ -28,37 +23,18 @@ pub(super) struct AltimeterHud { } impl AltimeterHud { - pub(super) fn load(root: &Path, preview: &mut StaticPreviewScene) -> Result<Self, String> { - let vfs = DirectoryVfs::new(root); - let page = load_ui_page(&vfs, "page6")?; - let icons = load_ui_page(&vfs, "ui_menu3")?; - if [page.width, page.height, icons.width, icons.height] != [256; 4] { - return Err("unexpected native altimeter atlas dimensions".into()); - } - let font = load_layout_font(&vfs)?; + pub(super) fn load( + page: RgbaImage, + icons: RgbaImage, + font: BitmapFont, + preview: &mut StaticPreviewScene, + ) -> Result<Self, String> { let mut backing = VulkanStaticTexture { width: WIDTH, height: HEIGHT, rgba8: vec![0; (WIDTH * HEIGHT * 4) as usize], mip_levels: Vec::new(), }; - // The gauge bracket and number well are part of the mirrored radar frame. - blit( - &mut backing, - &page, - [228, 52, 21, 63], - [227, 379], - true, - WHITE, - ); - blit( - &mut backing, - &page, - [219, 115, 36, 14], - [221, 442], - true, - WHITE, - ); // iron3d+0x3f6a0 and +0x3ff00 select and position the altitude icon. blit( &mut backing, |
