aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/lib.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-11-14 04:07:29 +0300
committerValentin Popov <valentin@popov.link>2026-11-14 04:07:29 +0300
commit9b06d97af705cb5616c76273aef9291538bf07ae (patch)
treee3dc92e36e97fce1401b69657f3801b2b5ce9c6a /crates/fparkan-runtime/src/lib.rs
parent12ecb0b5feb47391ba181e1afc92d5b4b6296cb2 (diff)
downloadfparkan-9b06d97af705cb5616c76273aef9291538bf07ae.tar.xz
fparkan-9b06d97af705cb5616c76273aef9291538bf07ae.zip
feat(game): render mission objects from live world poses
Diffstat (limited to 'crates/fparkan-runtime/src/lib.rs')
-rw-r--r--crates/fparkan-runtime/src/lib.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/crates/fparkan-runtime/src/lib.rs b/crates/fparkan-runtime/src/lib.rs
index 3122ff14..198357f3 100644
--- a/crates/fparkan-runtime/src/lib.rs
+++ b/crates/fparkan-runtime/src/lib.rs
@@ -2259,7 +2259,7 @@ pub fn frame(engine: &mut Engine, queue_time_ms: u32) -> Result<FrameResult, Eng
/// Coverage entries for the subsystems still absent from the mission loop.
pub const SIMULATION_COVERAGE: &str =
- "sim_coverage research_startup_gate_stub=1 mission_handlers_stub=1 unit_behavior_stub=1";
+ "sim_coverage research_startup_gate_stub=1 mission_handlers_stub=1 unit_behavior_stub=1 render_object_lifecycle_stub=1 render_winding_change_stub=1";
/// Totals from a headless mission coverage run.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
@@ -2538,6 +2538,12 @@ pub fn loaded_mission_object_drafts(engine: &Engine) -> Option<&[MissionObjectDr
.map(|state| state.object_drafts.as_slice())
}
+/// Finds the live handle of an object placed by the mission.
+#[must_use]
+pub fn mission_object_handle(engine: &Engine, id: OriginalObjectId) -> Option<ObjectHandle> {
+ handle_by_original_id(&engine.world, id)
+}
+
/// Camera point of the single unambiguous starting hero in a mission.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct StartingCockpit {
@@ -2570,7 +2576,7 @@ pub fn starting_cockpit(engine: &Engine) -> Option<StartingCockpit> {
if heroes.next().is_some() {
return None;
}
- let handle = handle_by_original_id(&engine.world, hero.original_id?)?;
+ let handle = mission_object_handle(engine, hero.original_id?)?;
let mut points = mission
.mission_assets
.object_component_controls