aboutsummaryrefslogtreecommitdiff
path: root/exporter/src/bin/textures.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-03-15 15:18:40 +0100
committermetamuffin <metamuffin@disroot.org>2025-03-15 15:18:40 +0100
commitd836e24357b81496c61f3cc9195ba36758523578 (patch)
tree0028aee5a453cc761dd39e92430a35c55147537f /exporter/src/bin/textures.rs
parent07fc3656274117c211ca0d6a54926d390a4d9b68 (diff)
downloadunity-tools-d836e24357b81496c61f3cc9195ba36758523578.tar
unity-tools-d836e24357b81496c61f3cc9195ba36758523578.tar.bz2
unity-tools-d836e24357b81496c61f3cc9195ba36758523578.tar.zst
more abstraction around unityfs to read multiple files from a single reader
Diffstat (limited to 'exporter/src/bin/textures.rs')
-rw-r--r--exporter/src/bin/textures.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/exporter/src/bin/textures.rs b/exporter/src/bin/textures.rs
index 2e077fe..a3b6cec 100644
--- a/exporter/src/bin/textures.rs
+++ b/exporter/src/bin/textures.rs
@@ -12,9 +12,8 @@ use unity_tools::{
fn main() -> anyhow::Result<()> {
env_logger::init_from_env("LOG");
- let file = || BufReader::new(File::open(args().nth(1).unwrap()).unwrap());
- let mut fs = UnityFS::open(file())?;
- let mut fs2 = UnityFS::open(file())?;
+ let file = BufReader::new(File::open(args().nth(1).unwrap()).unwrap());
+ let mut fs = UnityFS::open(file)?;
let mut i = 0;
create_dir_all("/tmp/a").unwrap();
@@ -33,7 +32,7 @@ fn main() -> anyhow::Result<()> {
let value = file.read_object(ob)?;
let mut texture = Texture2D::from_value(value)?;
if texture.image_data.is_empty() {
- texture.image_data = texture.stream_data.read(&mut fs2)?;
+ texture.image_data = texture.stream_data.read(&mut fs)?;
}
let path = format!(
"/tmp/a/{}_{i}.png",