diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-10 20:49:28 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-10 20:49:28 +0100 |
commit | cb46b760ae8d4aeaa0e92a9c313927ffdef27873 (patch) | |
tree | 6558cb19352b13ee3006fc1574ca82271e5a2398 /world/src/main.rs | |
parent | 3ac853862b5965c1ebfb10b12fb35cf5c671232f (diff) | |
download | weareserver-cb46b760ae8d4aeaa0e92a9c313927ffdef27873.tar weareserver-cb46b760ae8d4aeaa0e92a9c313927ffdef27873.tar.bz2 weareserver-cb46b760ae8d4aeaa0e92a9c313927ffdef27873.tar.zst |
fix interleaved vertex arrays
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index c90ff0c..72e7df2 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -18,7 +18,7 @@ pub mod mesh; pub mod physics; -use anyhow::{Result, bail}; +use anyhow::Result; use clap::Parser; use gltf::{Gltf, image::Source, import_buffers}; use image::{ImageReader, codecs::webp::WebPEncoder}; @@ -221,8 +221,15 @@ fn load_texture( File::open(path)?.read_to_end(&mut buf)?; Image(buf) } - _ => { - bail!("texture is external and has no mime type") + gltf::image::Source::Uri { + uri, + mime_type: None, + } => { + info!("{name} texture is {uri:?} and has no type"); + let path = path.join(uri); + let mut buf = Vec::new(); + File::open(path)?.read_to_end(&mut buf)?; + Image(buf) } }; |