From c810b040f875333fb9b1fe5d2269ba08d0c878f2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 12 Jan 2025 00:57:58 +0100 Subject: switch to 32-bit index format --- shared/src/helper.rs | 6 +++--- shared/src/resources.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'shared/src') diff --git a/shared/src/helper.rs b/shared/src/helper.rs index 61e149f..4702aef 100644 --- a/shared/src/helper.rs +++ b/shared/src/helper.rs @@ -104,7 +104,7 @@ impl ReadWrite for Vec { .collect()) } } -impl ReadWrite for Vec<[u16; 3]> { +impl ReadWrite for Vec<[u32; 3]> { fn write(&self, w: &mut dyn Write) -> Result<()> { for e in self { w.write_all(&e[0].to_be_bytes())?; @@ -118,8 +118,8 @@ impl ReadWrite for Vec<[u16; 3]> { r.read_to_end(&mut buf)?; Ok(buf .into_iter() - .array_chunks::<2>() - .map(u16::from_be_bytes) + .array_chunks::<4>() + .map(u32::from_be_bytes) .array_chunks::<3>() .collect()) } diff --git a/shared/src/resources.rs b/shared/src/resources.rs index f422611..9e0e7b8 100644 --- a/shared/src/resources.rs +++ b/shared/src/resources.rs @@ -47,7 +47,7 @@ pub struct EnvironmentPart { #[derive(Debug, Default, Clone)] pub struct MeshPart { pub name: Option, - pub index: Option>>, + pub index: Option>>, pub g_metallic: Option, pub g_roughness: Option, pub g_albedo: Option, @@ -89,7 +89,7 @@ pub struct CollisionPart { pub sh_cylinder: Option<(f32, f32, f32)>, pub sh_capsule: Option<(f32, f32, f32)>, pub sh_convex_hull: Option, - pub sh_mesh: Option<(Resource>, Resource>)>, + pub sh_mesh: Option<(Resource>, Resource>)>, } #[derive(Debug, Default, Clone)] -- cgit v1.2.3-70-g09d2