mirror of https://github.com/Leinnan/rpack.git
Serialization fixes
This commit is contained in:
parent
b6395891bc
commit
c7a56c6060
|
|
@ -15,7 +15,7 @@ basis = ["dep:basis-universal"]
|
||||||
dds = ["dep:image_dds"]
|
dds = ["dep:image_dds"]
|
||||||
|
|
||||||
[dependencies]
|
[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 = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
texture_packer = { version = "0.29", features = ["common"] }
|
texture_packer = { version = "0.29", features = ["common"] }
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,10 @@ pub enum Commands {
|
||||||
#[clap(short, long)]
|
#[clap(short, long)]
|
||||||
source_paths: Vec<String>,
|
source_paths: Vec<String>,
|
||||||
/// Size of the padding between frames in pixel. Default value is `2`
|
/// Size of the padding between frames in pixel. Default value is `2`
|
||||||
|
#[clap(short, long)]
|
||||||
texture_padding: Option<u32>,
|
texture_padding: Option<u32>,
|
||||||
/// Size of the padding on the outer edge of the packed image in pixel. Default value is `0`.
|
/// Size of the padding on the outer edge of the packed image in pixel. Default value is `0`.
|
||||||
|
#[clap(short, long)]
|
||||||
border_padding: Option<u32>,
|
border_padding: Option<u32>,
|
||||||
},
|
},
|
||||||
/// Generates a tilemap from config
|
/// Generates a tilemap from config
|
||||||
|
|
|
||||||
|
|
@ -307,12 +307,16 @@ pub struct TilemapGenerationConfig {
|
||||||
pub asset_patterns: Vec<String>,
|
pub asset_patterns: Vec<String>,
|
||||||
pub output_path: String,
|
pub output_path: String,
|
||||||
/// Image format, png by default
|
/// Image format, png by default
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub format: Option<SaveImageFormat>,
|
pub format: Option<SaveImageFormat>,
|
||||||
/// Size of the tilemap texture. Default value is `2048`.
|
/// Size of the tilemap texture. Default value is `2048`.
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub size: Option<u32>,
|
pub size: Option<u32>,
|
||||||
/// Size of the padding between frames in pixel. Default value is `2`
|
/// Size of the padding between frames in pixel. Default value is `2`
|
||||||
|
#[serde(skip_serializing_if = "Option::is_none", default)]
|
||||||
pub texture_padding: Option<u32>,
|
pub texture_padding: Option<u32>,
|
||||||
/// Size of the padding on the outer edge of the packed image in pixel. Default value is `0`.
|
/// 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<u32>,
|
pub border_padding: Option<u32>,
|
||||||
#[serde(skip)]
|
#[serde(skip)]
|
||||||
pub working_dir: Option<PathBuf>,
|
pub working_dir: Option<PathBuf>,
|
||||||
|
|
@ -354,6 +358,7 @@ impl TilemapGenerationConfig {
|
||||||
println!("{}", p);
|
println!("{}", p);
|
||||||
glob::glob(&p).expect("Wrong pattern for assets").flatten()
|
glob::glob(&p).expect("Wrong pattern for assets").flatten()
|
||||||
})
|
})
|
||||||
|
.filter(|e| e.is_file())
|
||||||
.collect();
|
.collect();
|
||||||
file_paths.sort();
|
file_paths.sort();
|
||||||
let prefix = get_common_prefix(&file_paths);
|
let prefix = get_common_prefix(&file_paths);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue