Commit Graph

16 Commits

Author SHA1 Message Date
ec9b6cf22b tools: text reports are written with LF line ends on every platform (BUILD-468)
open(path, "w") without newline= turns each \n into \r\n on Windows, so the same JSON report, manifest or assembly
listing was CRLF there and LF elsewhere. 91 text-mode writes (open, os.fdopen, Path.write_text) under tools/, scripts/,
make_game.py and runtime/test/shaders/ now pass newline="\n". tests/test_text_write_line_endings.py reads the source
with ast and fails for a writer that forgets it; CONTRIBUTING.md names the convention.

AI-assisted (Claude), on behalf of dev-ewann.
2026-11-22 14:20:30 +00:00
7fbc618e88 Merge pull request #1443 from pushkarreddyy 2026-11-22 06:38:05 -05:00
15326e84f4 tex_headers: refuse report destinations that overwrite input manifests 2026-11-22 16:59:53 +05:30
f698bf2206 tools: a path outside the console's code page no longer crashes a tool's output
On Windows a redirected stdout uses the console's ANSI code page, and python -I ignores PYTHONUTF8 and
PYTHONIOENCODING, so a caller path with a character outside that code page ended a run with
UnicodeEncodeError as soon as a tool printed it. #1406 fixed make_game.py; every CLI tool in tools/ now starts
its __main__ block the same way (stdout errors="replace").

tests/test_tool_stdout_encoding.py checks every tool's __main__ block and reruns two measured crashes
(analyze_4240_full.py, meshlet_page.py) with a private-use-named input. Found by @abilliontokens.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 11:27:00 +00:00
0848764046 tex_headers: a malformed carve index.json is one ERROR line, not a traceback
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>
2026-11-22 03:47:59 -06:00
638c407735 tex_headers: R11G11B10 and R10G10B10A2 map to GFX10 36/50/54, not 43/44/48
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.
2026-11-22 12:07:10 +05:30
8915480d17 tex_headers: create the --out folder instead of losing a finished scan
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>
2026-11-21 23:45:20 -06:00
fee6c26fa4 Fix DDS cubemap array size 2026-11-21 21:19:09 -05:00
569d4aa33a Textures: decode all 697 TTPF 2D arrays, streaming cubemaps and 3D volumes (ASSET-36) 2026-11-21 21:31:04 -03:00
ba977f5a71 tex_headers.py: check the carve folder and --archives names before scanning
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>
2026-11-22 02:36:38 +03:00
ea80364306 Textures: name the compact rule in the tex_headers module doc 2026-11-21 21:23:48 +00:00
0589fb5a37 Textures: share the compact layout and record the after split 2026-11-21 21:23:48 +00:00
ab5e88950e tools, tests: add stdlib paths for tex_headers and rtti_scan and un-skip CI tests 2026-11-21 17:18:04 -03:00
617bf181ad CI: keep optional numpy out of module imports and pytest collection 2026-11-21 19:30:39 +00:00
9755e72780 test(tools): add DDS synthesis, mip calculations, and GFX10 format mapping tests for tex_headers 2026-11-21 19:08:22 +01:00
db0dc8bd5e Initial commit: Leonida, build-it-yourself PC port groundwork
Shader pipeline (carve, FSSM unpack, gfx1013 disassembly, RDNA2 to SPIR-V),
asset export via rpf9-explorer's Core (submodule), PE loader and shim
skeleton, and make_game.py, which builds from the user's own copy of the game.
No game data, keys or executables are included.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 15:22:16 -05:00