diff options
| author | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-12-02 18:57:36 +0300 |
| commit | 1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4 (patch) | |
| tree | 9ef8276c399e238a2a692862de09f54bf5dcee65 /crates/fparkan-runtime/src/hero_look.rs | |
| parent | 077bead07a76908ac4e0e2b84de3940256cf6fd1 (diff) | |
| download | fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.tar.xz fparkan-1fd51e5bbcfb4d5590fbc1ded8308fc40f6158f4.zip | |
feat(ui): enable manual control from the bunker list
Use the active Control camera record and its separate CPT origin and direction for the fixed turret. The original hand control opens the cockpit, its two weapon slots and aim tracks while leaving the operator at the command post.
Verified from the stock Two Fortresses start against the GOG cockpit with Vulkan validation. The licensed tests cover the native camera pose, mounted weapon selection and stationary bunker and operator.
Diffstat (limited to 'crates/fparkan-runtime/src/hero_look.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/hero_look.rs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/crates/fparkan-runtime/src/hero_look.rs b/crates/fparkan-runtime/src/hero_look.rs index d671f2b7..2e923d20 100644 --- a/crates/fparkan-runtime/src/hero_look.rs +++ b/crates/fparkan-runtime/src/hero_look.rs @@ -16,11 +16,19 @@ pub(super) struct HeroLook { impl HeroLook { pub(super) fn load(vfs: &dyn Vfs) -> Self { + Self::load_profile(vfs, b"hero.tbl", "CICLS_UNKNOWN", "MCMD_ANGLE_Z") + } + + pub(super) fn load_fixed_turret(vfs: &dyn Vfs) -> Self { + Self::load_profile(vfs, b"m1.tbl", "CICLS_TURRET", "MCMD_ANGLE_X") + } + + fn load_profile(vfs: &dyn Vfs, table_name: &[u8], yaw_class: &str, yaw_command: &str) -> Self { let read = |name: &[u8]| { let path = normalize_relative(name, PathPolicy::StrictLegacy).ok()?; vfs.read(&path).ok() }; - let table_bytes = read(b"hero.tbl"); + let table_bytes = read(table_name); let settings_bytes = read(b"Iron_3D.ini"); let table = String::from_utf8_lossy(table_bytes.as_deref().unwrap_or_default()); let settings = String::from_utf8_lossy(settings_bytes.as_deref().unwrap_or_default()); @@ -29,8 +37,8 @@ impl HeroLook { &table, "SCAN_NULL", "SCAN_MOUSE_X", - "CICLS_UNKNOWN", - "MCMD_ANGLE_Z", + yaw_class, + yaw_command, "MAN_WRAP", ) .unwrap_or(0.15), |
