Decode and present four more PAK item types in the pack browser's detail
pane. All content is decoded off-thread in build_pak_rows and attached to
each PakRow, then rendered with egui's own texture facilities — the Bevy
texture pipeline and egui's global font system are untouched.
formats crate (Bevy-free, reusable by CLI):
- ixud: parse IXUD localized-string tables as subtitle cue lists (UTF-16BE
pool, SUBTITLE header + (text, timecode) pairs -> Vec<Cue{start,end,text}>).
- font: OTF/TTF/ttcf metadata (family / faces / glyphs) via ttf-parser.
viewer:
- PakRow gains `content: PakContent` (Subtitle | Font | Png | Text | None);
classify_content fills it for IXUD / fonts / PNG / xml+text within the
existing decode budget. Font samples are pre-rasterized off-thread with
ab_glyph into an image (ImageRgba) — ab_glyph returns Option/Result at every
step, so a bad font yields no sample instead of panicking (the earlier
egui set_fonts approach crashed the app on atlas rebuild).
- draw_pak_browser dispatches on content: subtitle cue table, font metadata +
sample image, PNG image, scrollable text; else the existing IDXD detail.
Borrow-split PakView instead of cloning the (now heavy) rows each frame;
one hash-keyed egui texture cache serves both PNG and font-sample images.
Subtitle<->movie auto-matching is deferred: movie filenames don't hash to the
IXUD keys and no cross-reference table was found (the link is an internal
MSG_DEMO id), so the movie player gets no subtitle track yet.
Tests: ixud unit tests; disc tests for the real English subtitle track
(cues + timecodes), eng/deu localization, font metadata, and off-thread
rasterization of the real font.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
59 lines
1.7 KiB
TOML
59 lines
1.7 KiB
TOML
[package]
|
|
name = "sylpheed-viewer"
|
|
description = "Bevy-based asset viewer for Project Sylpheed: Arc of Deception"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
authors.workspace = true
|
|
|
|
# Native binary entry point
|
|
[[bin]]
|
|
name = "sylpheed-viewer"
|
|
path = "src/main.rs"
|
|
|
|
# Library crate — also serves as the WASM entry point
|
|
[lib]
|
|
name = "sylpheed_viewer"
|
|
path = "src/lib.rs"
|
|
# cdylib is required for wasm-bindgen to produce a .wasm file
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[dependencies]
|
|
sylpheed-formats = { workspace = true }
|
|
|
|
bevy = { workspace = true, features = [
|
|
"bevy_asset",
|
|
"bevy_color",
|
|
"bevy_core_pipeline",
|
|
"bevy_pbr",
|
|
"bevy_render",
|
|
"bevy_window",
|
|
"bevy_winit",
|
|
"multi_threaded",
|
|
"png",
|
|
# Required for TonyMcMapFace tonemapping (default Camera3d tonemapper)
|
|
"tonemapping_luts",
|
|
# Linux display backends
|
|
"x11",
|
|
"wayland",
|
|
] }
|
|
bevy_egui = { workspace = true }
|
|
futures = { workspace = true }
|
|
|
|
thiserror = { workspace = true }
|
|
tracing = { workspace = true }
|
|
|
|
[features]
|
|
# Enable Bevy dynamic linking for faster incremental recompiles in dev
|
|
dev = ["bevy/dynamic_linking"]
|
|
|
|
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
|
tracing-subscriber = { workspace = true }
|
|
rfd = { workspace = true }
|
|
# Audio for the WMV video player (pulls cpal → alsa on Linux).
|
|
rodio = { workspace = true }
|
|
# PNG decode for pak image entries (pure Rust; Bevy already pulls it in).
|
|
image = { version = "0.25", default-features = false, features = ["png"] }
|
|
# Off-thread rasterization of embedded-font samples (avoids egui's global fonts).
|
|
ab_glyph = "0.2"
|