[texture] Present Canary GPUTEXTUREFORMAT names + metadata; handle XPR5
- Port xenia-canary's complete 64-entry texture-format table (xenos.h enum +
texture_info_formats.inl) into GPU_FORMATS + gpu_format_name()/desc() and
X360TextureFormat::gpu_name()/desc().
- Viewer + CLI `texture info` now show the canonical k_… name, bpp and
compressed flag (e.g. "k_DXT1 (Dxt1) · 4 bpp, compressed"); UnsupportedFormat
now names the format instead of a bare hex code.
- Detect non-XPR2 containers up front: the game ships one XPR5 file
(Common.xpr) alongside 165 XPR2 — report UnsupportedContainer("XPR5")
cleanly instead of a "bad magic" parse error.
- Add a table-integrity test (index==code, spot-checks, decodable-variant
consistency).
Static-RE scan of the 166 resource3d XPRs: only k_DXT1 (145), k_8_8_8_8 (19),
k_DXT5A (1) are used — all already decoded, so this is presentation, not new
decoders.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1993,7 +1993,19 @@ fn apply_loaded_texture(
|
||||
let w = tex.width;
|
||||
let h = tex.height;
|
||||
let mips = tex.mip_levels;
|
||||
let fmt_str = format!("{:?} {}×{} {} mip(s)", tex.format, w, h, mips);
|
||||
// Canary-sourced format name + metadata (GPUTEXTUREFORMAT), e.g.
|
||||
// "k_DXT1 (Dxt1) · 256×256 · 9 mip(s) · 4 bpp, compressed".
|
||||
let d = tex.format.desc();
|
||||
let fmt_str = format!(
|
||||
"{} ({:?}) · {}×{} · {} mip(s) · {} bpp, {}",
|
||||
tex.format.gpu_name(),
|
||||
tex.format,
|
||||
w,
|
||||
h,
|
||||
mips,
|
||||
d.bpp,
|
||||
if d.compressed { "compressed" } else { "uncompressed" },
|
||||
);
|
||||
|
||||
let image = match crate::asset_loader::x360_texture_to_bevy_image(tex) {
|
||||
Ok(img) => img,
|
||||
|
||||
Reference in New Issue
Block a user