diff --git a/crates/rpack_cli/Cargo.toml b/crates/rpack_cli/Cargo.toml index 8d5a912..da2ef38 100644 --- a/crates/rpack_cli/Cargo.toml +++ b/crates/rpack_cli/Cargo.toml @@ -15,7 +15,7 @@ basis = ["dep:basis-universal"] dds = ["dep:image_dds"] [dependencies] -bevy_rpack = { default-features = false, path = "../bevy_rpack" } +bevy_rpack = { default-features = false, path = "../bevy_rpack", version = "0.1" } serde = { version = "1", features = ["derive"] } serde_json = "1" texture_packer = { version = "0.29", features = ["common"] } @@ -27,4 +27,4 @@ clap = { version = "4", features = ["derive"], optional = true } basis-universal = { version = "0.3.1", optional = true } image_dds = { version = "0.7", optional = true } glob = { version = "0.3", optional = true } -anyhow = "1" \ No newline at end of file +anyhow = "1" diff --git a/crates/rpack_cli/src/commands.rs b/crates/rpack_cli/src/commands.rs index ca4ca22..dbecc94 100644 --- a/crates/rpack_cli/src/commands.rs +++ b/crates/rpack_cli/src/commands.rs @@ -44,8 +44,10 @@ pub enum Commands { #[clap(short, long)] source_paths: Vec, /// Size of the padding between frames in pixel. Default value is `2` + #[clap(short, long)] texture_padding: Option, /// Size of the padding on the outer edge of the packed image in pixel. Default value is `0`. + #[clap(short, long)] border_padding: Option, }, /// Generates a tilemap from config diff --git a/crates/rpack_cli/src/lib.rs b/crates/rpack_cli/src/lib.rs index 62c475a..62c17b2 100644 --- a/crates/rpack_cli/src/lib.rs +++ b/crates/rpack_cli/src/lib.rs @@ -307,12 +307,16 @@ pub struct TilemapGenerationConfig { pub asset_patterns: Vec, pub output_path: String, /// Image format, png by default + #[serde(skip_serializing_if = "Option::is_none", default)] pub format: Option, /// Size of the tilemap texture. Default value is `2048`. + #[serde(skip_serializing_if = "Option::is_none", default)] pub size: Option, /// Size of the padding between frames in pixel. Default value is `2` + #[serde(skip_serializing_if = "Option::is_none", default)] pub texture_padding: Option, /// Size of the padding on the outer edge of the packed image in pixel. Default value is `0`. + #[serde(skip_serializing_if = "Option::is_none", default)] pub border_padding: Option, #[serde(skip)] pub working_dir: Option, @@ -354,6 +358,7 @@ impl TilemapGenerationConfig { println!("{}", p); glob::glob(&p).expect("Wrong pattern for assets").flatten() }) + .filter(|e| e.is_file()) .collect(); file_paths.sort(); let prefix = get_common_prefix(&file_paths);