aboutsummaryrefslogtreecommitdiff
path: root/apps/fparkan-game/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'apps/fparkan-game/src/main.rs')
-rw-r--r--apps/fparkan-game/src/main.rs28
1 files changed, 6 insertions, 22 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs
index 2129f82c..ef5ae722 100644
--- a/apps/fparkan-game/src/main.rs
+++ b/apps/fparkan-game/src/main.rs
@@ -25,6 +25,7 @@ mod destruction_effects;
mod effect_materials;
mod factory_menu;
mod frame_rate;
+mod launch_menu;
mod live_factory_scene;
mod model_materials;
mod object_render;
@@ -136,7 +137,7 @@ use fparkan_msh::{
};
#[cfg(test)]
use fparkan_msh::{NodeId, SlotId};
-use fparkan_path::{normalize_relative, PathPolicy, ResourceName};
+use fparkan_path::ResourceName;
use fparkan_platform_winit::{window_native_handles, WinitWindow};
use fparkan_prototype::{unit_component_tree, PROTOTYPE_TYPE_EXTO};
use fparkan_render::{
@@ -240,26 +241,6 @@ fn load_requested_mission(engine: &mut Engine, args: &Args) -> Result<LoadedMiss
}
}
-fn list_missions(vfs: &dyn Vfs) -> Result<Vec<String>, String> {
- let prefix = normalize_relative(b"MISSIONS", PathPolicy::StrictLegacy)
- .expect("constant missions prefix");
- let entries = vfs
- .list(&prefix)
- .map_err(|error| format!("list missions: {error}"))?;
- Ok(entries
- .into_iter()
- .filter(|entry| {
- entry
- .path
- .as_bytes()
- .rsplit(|byte| *byte == b'/')
- .next()
- .is_some_and(|name| name.eq_ignore_ascii_case(b"data.tma"))
- })
- .map(|entry| entry.path.as_str().to_string())
- .collect())
-}
-
/// Camera state used by the interactive world-space preview.
#[derive(Clone, Copy, Debug, PartialEq)]
struct FreeFlightCamera {
@@ -11570,6 +11551,9 @@ impl Args {
)
}
(false, Some(mission)) if !mission.is_empty() => mission,
+ (false, None) if sim_report_ms.is_none() && !viewer && build_scheme.is_none() => {
+ String::new()
+ }
(false, _) => return Err("missing --mission".to_string()),
};
if viewer && sim_report_ms.is_some() {
@@ -11616,7 +11600,7 @@ impl Args {
}
fn usage() -> String {
- "usage: fparkan-game [--root <path>] --list-missions\n fparkan-game [--root <path>] --mission <number|path> --sim-report <seconds>\n fparkan-game [--root <path>] --mission <number|path> [--build-scheme <Unit DAT path> [--build-part OLD=NEW]...] [--viewer] [--frames <n>] [--atmosphere-seconds <seconds>] [--control-clock-ms <u32>] [--validation] [--preview-roots <non-zero n>] [--legacy-camera-capture <path>] [--static-animation-frame <u16>] [--static-material-phase <u16>] [--readback-out <path>] [--readback-sequence-out <directory>]\nWithout --root, game data is read from the working directory.\n--viewer skips mission simulation. Capture, static pose/material and root-limit options select viewer mode. --control-clock-ms replays the scene clock from zero to the selected time over the requested frames; --readback-sequence-out captures each submitted frame and requires that clock.".to_string()
+ "usage: fparkan-game [--root <path>]\n fparkan-game [--root <path>] --list-missions\n fparkan-game [--root <path>] --mission <number|path> --sim-report <seconds>\n fparkan-game [--root <path>] --mission <number|path> [--build-scheme <Unit DAT path> [--build-part OLD=NEW]...] [--viewer] [--frames <n>] [--atmosphere-seconds <seconds>] [--control-clock-ms <u32>] [--validation] [--preview-roots <non-zero n>] [--legacy-camera-capture <path>] [--static-animation-frame <u16>] [--static-material-phase <u16>] [--readback-out <path>] [--readback-sequence-out <directory>]\nWithout --mission, FParkan opens the mission menu. Without --root, game data is read from the working directory.\n--viewer skips mission simulation. Capture, static pose/material and root-limit options select viewer mode. --control-clock-ms replays the scene clock from zero to the selected time over the requested frames; --readback-sequence-out captures each submitted frame and requires that clock.".to_string()
}
#[cfg(test)]