This commit is contained in:
Piotr Siuszko 2025-01-08 11:56:07 +01:00
parent 7fe34786c7
commit a0486df8ae
3 changed files with 7 additions and 6 deletions

View File

@ -11,12 +11,14 @@ basis = ["dep:basis-universal"]
dds = ["dep:image_dds"] dds = ["dep:image_dds"]
[dependencies] [dependencies]
clap = { version = "4", features = ["derive"], optional = true }
bevy_rpack = { default-features = false, path = "../bevy_rpack" } bevy_rpack = { default-features = false, path = "../bevy_rpack" }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1" serde_json = "1"
texture_packer = { version = "0.29", features = ["common"] } texture_packer = { version = "0.29", features = ["common"] }
image = { version = "0.25", features = ["jpeg", "png"] } image = { version = "0.25", features = ["jpeg", "png"] }
glob = { version = "0.3", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
clap = { version = "4", features = ["derive"], optional = true }
basis-universal = { version = "0.3.1", optional = true } basis-universal = { version = "0.3.1", optional = true }
image_dds = { version = "0.6.2", optional = true } image_dds = { version = "0.6.2", optional = true }
glob = { version = "0.3", optional = true }

View File

@ -92,7 +92,7 @@ impl Spritesheet {
}) })
} }
#[cfg(feature = "dds")] #[cfg(all(feature = "dds", not(target_arch = "wasm32")))]
pub fn save_as_dds<R>(&self, output_path: R) pub fn save_as_dds<R>(&self, output_path: R)
where where
R: AsRef<str>, R: AsRef<str>,
@ -112,7 +112,7 @@ impl Spritesheet {
dds.write(&mut writer).unwrap(); dds.write(&mut writer).unwrap();
} }
#[cfg(feature = "basis")] #[cfg(all(feature = "basis", not(target_arch = "wasm32")))]
pub fn save_as_basis<R>(&self, output_path: R) pub fn save_as_basis<R>(&self, output_path: R)
where where
R: AsRef<str>, R: AsRef<str>,

View File

@ -1,7 +1,6 @@
use std::{fmt::Display, io::Write, path::Path};
use clap::{Parser, ValueEnum}; use clap::{Parser, ValueEnum};
use rpack_cli::{ImageFile, Spritesheet}; use rpack_cli::{ImageFile, Spritesheet};
use std::{fmt::Display, io::Write, path::Path};
#[derive(Clone, Debug, Default, Copy, ValueEnum)] #[derive(Clone, Debug, Default, Copy, ValueEnum)]
pub enum SaveImageFormat { pub enum SaveImageFormat {