Comments that pointed into the maintainer's private reverse-engineering notes (a note by name, a path, a section or finding id, the analysis's own name for a client function, a process word) now carry the fact itself, cited by the reference client's address, by vmangos file and line, or as "the reference". Nobody outside could follow those pointers. Comment text only, plus the test-assert and log strings that carried the same pointers. No claim changes: a comment the notes have since corrected keeps its wording here, and correcting it is separate work. The two reference generators, `scripts/gen-reference-globals.py` and `scripts/gen-reference-verb-events.py`, named the private notes' layout to find their inputs. They now take the input files as arguments (`--capture`, `--framexml`, `--names`, `--extents`, `--disasm`). Run on the same inputs, both write the committed tables row for row; only the two header lines that named the old environment variable change. Checked per file: - the code is identical: each file with its comments stripped compares equal before and after; a changed string literal is compared under a mask that proves only literal text moved and every literal kept its line count; - no client address the old text cited was dropped; - a second reviewer checked every added address against its derivation; - a detector for the notes' names, paths, ids, function names and process words finds none left; - `scripts/gates.sh` is green. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
43 lines
2.0 KiB
Rust
43 lines
2.0 KiB
Rust
//! Print every render batch's **lighting-relevant material state** — the UNLIT (0x01) / UNFOGGED
|
|
//! (0x02) render flags as our reader resolves them, beside the blend mode and texture.
|
|
//!
|
|
//! `cargo run -p benilla-formats --example batch_lit -- 'Interface\Glues\Models\UI_Tauren\UI_Tauren.m2'`
|
|
//!
|
|
//! Built for B121: a glue scene's ground is a multi-layer stack whose overlay layers are authored
|
|
//! **UNLIT** (drawn fullbright, `colour = c28[0]·E_SH + c28[1]` with `c28[0] = 0`, `0x70c190`),
|
|
//! which is why UI_Tauren can author no ambient-fill light and still show a lit ground in the
|
|
//! reference. The question this answers is the one a grep cannot: whether
|
|
//! the flag survives *our* batch reader's render-flag indexing to the `RenderSubmesh` the material
|
|
//! builder consumes. A batch printed `LIT` here that the asset authors UNLIT is a reader bug; the
|
|
//! asset's own flag table is a separate read (the render-flag array at header 0x84).
|
|
|
|
fn main() -> anyhow::Result<()> {
|
|
let virt = std::env::args()
|
|
.nth(1)
|
|
.ok_or_else(|| anyhow::anyhow!("usage: batch_lit <m2 path>"))?;
|
|
let data = benilla_formats::wow_data().expect("no WoW install found (set $WOW_DATA)");
|
|
let mut chain = benilla_formats::open_chain(&data)?;
|
|
let bytes = chain.read_file(&virt)?;
|
|
let subs = benilla_formats::parse_m2_render_submeshes(&bytes, "", &[])?;
|
|
println!("{virt} — {} batches", subs.len());
|
|
let mut unlit = 0;
|
|
for (i, s) in subs.iter().enumerate() {
|
|
if s.emissive {
|
|
unlit += 1;
|
|
}
|
|
println!(
|
|
" batch {i:2}: {:<5} {:<9} blend={:<9} tex={}",
|
|
if s.emissive { "UNLIT" } else { "lit" },
|
|
if s.fog_policy as u8 == 0 {
|
|
"unfogged?"
|
|
} else {
|
|
""
|
|
},
|
|
format!("{:?}", s.blend),
|
|
s.texture.as_deref().unwrap_or("<none>")
|
|
);
|
|
}
|
|
println!("{unlit} of {} batches are UNLIT (fullbright)", subs.len());
|
|
Ok(())
|
|
}
|