- tests/test_dds_png_dx10.py: hand-built 2x2 texels with padded row pitch and a one-byte-short payload for
R9G9B9E5_SHAREDEXP (67), B5G6R5 (85), B5G5R5A1 (86), R8G8 SNORM/UINT/SINT (51/50/52),
R8 SNORM/UINT/SINT (63/62/64) and R10G10B10A2 TYPELESS/UINT (23/25, checked against UNORM 24);
these merged without tests.
- tools/tex_headers.py: list DXGI 67 in DXGI and FMT_INFO (4-byte element), so the indexer keeps such
textures and tex_export --png reaches dds_png's decoder instead of "unsupported format" (ecox982745's
finding on #2218). New tests in test_tex_export.py (index -> DDS -> PNG) and test_tex_headers.py.
- tests/test_tex_export.py: the "undecodable format" cases used DXGI 25, which #2320 now decodes; they use
R8G8B8A8_UINT (30) instead. FMT has 57 entries with 67.
- tools/dds_png.py, tools/tex_export.py: one docstring list of the decoded formats instead of the per-PR lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tools/tex_headers.py: read mips from flags at +0x42 (flags >> 16) and preserve b6 at +0x3e.
- tools/tex_headers.py: validate system pointer tag (0x5...) and reject null pointers so all-zero buffers produce empty records.
- tools/tex_headers.py: match texture names by lowercase JOAAT32 hash rather than index position.
- docs/textures.md: wrap lines under 118 chars and label dry cell occupancy as hypothesis.
- tests/test_tex_headers.py: add tests for differing b6/mips offsets, zero buffers, invalid tags, reversed and missing names.
- Add parse_texture_dict_page in tools/tex_headers.py to extract grcTexture descriptors, name hashes, and data offsets from pgDictionary pages.
- Update docs/textures.md resolving the ASSET-274 hypothesis: all 1,313 texture page pairs are keyed by waterfog/waterfog2 joaat32 hashes matching the active world streaming grid cells, with formats strictly matching DXGI enums (0x5f = BC6H_UF16, 0x62 = BC7_UNORM, 0x4d = BC3_UNORM).
- Add synthetic unit tests in tests/test_tex_headers.py for parse_texture_dict_page.
The DDS header describes a single uncompressed row or the top compressed level. Recording the complete payload misstates those layouts when lower mips or multiple slices follow.
scan_archive() read index.json's "files" rows unchecked, so an index of
the wrong shape ({}, {"files": "oops"}, rows without off/head) ended in
a KeyError or TypeError traceback after the carve had finished. main()
now reports it as 'ERROR: cannot read <path>: <reason>' with exit 2, as
gamedata_index.main() does, before writing anything.
Found by @ray3242.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GFX10 format names list channel widths from the top bit, so R11G11B10_FLOAT
(red in bits 10:0) is 10_11_11_FLOAT (36) and R10G10B10A2 is 2_10_10_10 (50,
54), as runtime/src/gfx10_descriptors.h already uses. 11_11_10_FLOAT (43) and
10_10_10_2 (44, 48) have no DXGI twin.
main() opened the output path directly after walking every carved archive, so
naming a file in a folder that does not exist ended the run in a
FileNotFoundError traceback with the results already computed. Create the
parent folder first, as #941/#966 and navmesh_index (#1009) do.
Tests: CliInputTest runs the tool with --out under missing nested folders and
requires exit 0 plus the JSON on disk. Negative control on main: that case
fails; with the change 56/56 pass.
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
A missing carve folder ended in a FileNotFoundError traceback from os.listdir, and an --archives name without
an index.json in a traceback from scan_archive, after earlier archives had already been scanned. A folder with
no carved archive at all wrote an empty textures_index.json. All three are now usage errors (exit 2) and
nothing is written.
Tests: CliInputTest in tests/test_tex_headers.py.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>