Project Sylpheed never stores a capital ship as a single mesh. Each ship is modelled, then split into destructible parts (hull segments, bridge, engines, integral turrets), each shipped as its own XBG7 resource inside a hidden/resource3d/Stage_SNN.xpr container. The split lets the game hide/replace a part when the player destroys it. Crucially each part keeps its ship-local position, so reconstructing the whole ship is: draw every base part of one id together, untransformed. New `ship` module: Faction (from the e/f/n id prefix — ADAN/TCAF/Neutral), ShipModel, ship_id_of, is_base_part (skips _l/_m/_d LODs, _bNN/_dead/_break destruction geometry, e_rou_ scene nodes), and ships_in_container to group a stage's resources into whole ships. Supporting: - mesh::xbg7_resource_names — list a container's XBG7 resource names (directory walk only, no geometry decode). - Xbg7Model::models_named — decode only the named resources (assemble a ship from its ~8 parts instead of the whole ~300-resource stage). - game_data::Vessel gains `model` (the rou_<id> hull stem) to link stats to the 3D part family. Tests: id/part classification + a disc-gated reconstruction of the ADAN e108 frigate from Stage_S02. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
82 lines
2.2 KiB
Rust
82 lines
2.2 KiB
Rust
//! # sylpheed-formats
|
|
//!
|
|
//! Asset format parsers for Project Sylpheed: Arc of Deception (Xbox 360).
|
|
//!
|
|
//! This crate handles:
|
|
//! - Reading game files from XISO disc images (native only)
|
|
//! - Reading IPFB archives (`*.pak` / `*.pNN`) and the `IDXD` definition objects inside
|
|
//! - Parsing Xbox 360 texture formats (XPR2 containers + DXT de-tiling)
|
|
//! - Parsing mesh formats (to be reverse engineered)
|
|
//! - Parsing audio formats (XMA → standard PCM)
|
|
//!
|
|
//! ## Platform notes
|
|
//! XISO reading is only available on native (Windows/macOS/Linux).
|
|
//! On WASM, assets must be pre-extracted and served over HTTP.
|
|
|
|
pub mod texture;
|
|
pub mod vfs;
|
|
|
|
// IPFB TOC name-hash (path → 32-bit key), recovered from the retail title
|
|
pub mod hash;
|
|
|
|
// IPFB archive (`*.pak` index + `*.pNN` segments) reader
|
|
pub mod pak;
|
|
|
|
// IDXD reflective object (ship / weapon / effect / menu definitions) reader
|
|
pub mod idxd;
|
|
|
|
// IXUD localized string / subtitle table reader
|
|
pub mod ixud;
|
|
|
|
// Embedded font (OTF / TTF / ttcf) metadata
|
|
pub mod font;
|
|
|
|
// T8aD 2D UI/HUD texture
|
|
pub mod t8ad;
|
|
|
|
// RATC nested resource bundle
|
|
pub mod ratc;
|
|
|
|
// LSTA sprite list (inline T8aD frames)
|
|
pub mod lsta;
|
|
|
|
// XISO reading is not available in-browser
|
|
#[cfg(not(target_arch = "wasm32"))]
|
|
pub mod xiso;
|
|
|
|
// Mesh parsing — scaffold for reverse engineering
|
|
pub mod mesh;
|
|
|
|
// Audio parsing — scaffold for XMA handling
|
|
pub mod audio;
|
|
|
|
// Movie cutscene subtitles — the movie → track → text chain.
|
|
pub mod movie_subtitle;
|
|
|
|
// XACT `.slb` sound banks (voice / music) → decodable XMA1 RIFF.
|
|
pub mod slb;
|
|
|
|
// The movie manifest: authoritative movie → subtitle → voice index.
|
|
pub mod movie_manifest;
|
|
|
|
pub mod movie_voice;
|
|
|
|
pub mod game_data;
|
|
|
|
pub mod localization;
|
|
|
|
// Whole-ship assembly from XBG7 part families (capital ships as split parts).
|
|
pub mod ship;
|
|
|
|
/// Re-export the most commonly used types at the crate root.
|
|
pub use font::FontInfo;
|
|
pub use idxd::{IdxdError, IdxdObject};
|
|
pub use ixud::{Cue, Subtitle};
|
|
pub use movie_subtitle::{SubCue, SubLang};
|
|
pub use mesh::{GameMesh, Xbg7Model};
|
|
pub use ratc::RatcChild;
|
|
pub use t8ad::T8adImage;
|
|
pub use pak::{PakArchive, PakEntry, PakError};
|
|
pub use texture::{X360Texture, X360TextureFormat};
|
|
pub use vfs::{GameAssets, VfsError};
|