From 3efc5ba5d3389da168b00f8fe47d3478821e5d7f Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Wed, 2 Dec 2026 01:14:54 +0400 Subject: 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. --- apps/fparkan-game/src/altimeter_hud.rs | 40 +++++++--------------------------- 1 file changed, 8 insertions(+), 32 deletions(-) (limited to 'apps/fparkan-game/src/altimeter_hud.rs') 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 { - 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 { 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, -- cgit v1.2.3