From efab61a45c8837d3c2aaec464d8f6243fecb7a38 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 19 Feb 2026 09:46:23 +0000 Subject: 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. --- crates/rsli/src/parse.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/rsli/src/parse.rs') diff --git a/crates/rsli/src/parse.rs b/crates/rsli/src/parse.rs index 9a916dc..db593e2 100644 --- a/crates/rsli/src/parse.rs +++ b/crates/rsli/src/parse.rs @@ -100,12 +100,12 @@ pub fn parse_library(bytes: Arc<[u8]>, opts: OpenOptions) -> Result { .ok_or(Error::IntegerOverflow)?; } else { return Err(Error::DeflateEofPlusOneQuirkRejected { - id: u32::try_from(idx).expect("entry count validated at parse"), + id: u32::try_from(idx).map_err(|_| Error::IntegerOverflow)?, }); } } else { return Err(Error::PackedSizePastEof { - id: u32::try_from(idx).expect("entry count validated at parse"), + id: u32::try_from(idx).map_err(|_| Error::IntegerOverflow)?, offset: effective_offset_u64, packed_size: packed_size_declared, file_len: file_len_u64, @@ -118,7 +118,7 @@ pub fn parse_library(bytes: Arc<[u8]>, opts: OpenOptions) -> Result { .ok_or(Error::IntegerOverflow)?; if available_end > bytes.len() { return Err(Error::EntryDataOutOfBounds { - id: u32::try_from(idx).expect("entry count validated at parse"), + id: u32::try_from(idx).map_err(|_| Error::IntegerOverflow)?, offset: effective_offset_u64, size: packed_size_declared, file_len: file_len_u64, -- cgit v1.2.3