summaryrefslogtreecommitdiff
path: root/world/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'world/src/main.rs')
-rw-r--r--world/src/main.rs13
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)
}
};