Files
fparkan/crates/rsli
Valentin Popov efab61a45c
Some checks failed
Test / Lint (push) Failing after 1m12s
Test / Test (push) Has been skipped
Test / Render parity (push) Has been skipped
feat(render-core): add default UV scale and refactor UV mapping logic
- 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.
2026-02-19 09:46:23 +00:00
..

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.

Поддерживаемые методы упаковки

  • 0x000 None
  • 0x020 XorOnly
  • 0x040 Lzss
  • 0x060 XorLzss
  • 0x080 LzssHuffman
  • 0x0A0 XorLzssHuffman
  • 0x100 Deflate

Модель ошибок

Типизированные ошибки без паник в 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