- Introduced a constant `DEFAULT_UV_SCALE` for UV scaling. - Refactored UV mapping in `build_render_mesh` to use the new constant. - Simplified `compute_bounds` functions by extracting common logic into `compute_bounds_impl`. test(render-core): add tests for rendering with empty and multi-node models - Added tests to verify behavior when building render meshes from models with no slots and multiple nodes. - Ensured UV scaling is correctly applied in tests. feat(render-demo): add FOV argument and improve error handling - Added a `--fov` command-line argument to set the field of view. - Enhanced error messages for texture resolution failures. - Updated MVP computation to use the new FOV parameter. fix(rsli): improve error handling in LZH decompression - Added checks to prevent out-of-bounds access in LZH decoding logic. refactor(texm): streamline texture parsing and decoding tests - Created a helper function `build_texm_payload` for constructing test payloads. - Added tests for various texture formats including RGB565, RGB556, ARGB4444, and Luminance Alpha. - Improved error handling for invalid TEXM headers and mip bounds.
rsli
Rust-библиотека для чтения архивов формата RsLi.
Что умеет
- Открытие библиотеки из файла (
open_path,open_path_with). - Дешифрование таблицы записей (XOR stream cipher).
- Поддержка AO-трейлера и media overlay (
allow_ao_trailer). - Поддержка quirk для Deflate
EOF+1(allow_deflate_eof_plus_one). - Поиск по имени (
find, c приведением запроса к uppercase). - Загрузка данных:
load,load_into,load_packed,unpack,load_fast.
Поддерживаемые методы упаковки
0x000None0x020XorOnly0x040Lzss0x060XorLzss0x080LzssHuffman0x0A0XorLzssHuffman0x100Deflate
Модель ошибок
Типизированные ошибки без паник в production-коде (InvalidMagic, UnsupportedVersion, EntryTableOutOfBounds, PackedSizePastEof, DeflateEofPlusOneQuirkRejected, UnsupportedMethod, и др.).
Покрытие тестами
Реальные файлы
- Рекурсивный прогон по
testdata/rsli/**. - Сейчас в наборе: 2 архива.
- На реальных данных подтверждены и проходят byte-to-byte проверки методы:
0x040(LZSS)0x100(Deflate)- Для каждого архива проверяется:
load/load_into/load_packed/unpack/load_fast;find;- пересборка и сравнение byte-to-byte.
Синтетические тесты
Из-за отсутствия реальных файлов для части методов добавлены синтетические архивы и тесты:
- Методы:
0x000,0x020,0x060,0x080,0x0A0.- Спецкейсы формата:
- AO trailer + overlay;
- Deflate
EOF+1(оба режима: accepted/rejected);
- некорректные заголовки/таблицы/смещения/методы.
Быстрый запуск тестов
cargo test -p rsli -- --nocapture