Skip to content

Commit

Permalink
+ Update TODO.
Browse files Browse the repository at this point in the history
+ Refit atlas set before saving.
  • Loading branch information
AndreasOM committed Jan 29, 2023
1 parent 991e0c2 commit 801ece5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
5 changes: 3 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@

# TODO

- [ ] Add AtlasSet to handle multiple Atlases

[ ] Use crchelper functions in packer
[ ] Update packages for
[ ] clap
[ ] shader-crusher
[ ] distance-field (as soon as it is release with new image (>0.24.x) dependency)
[ ] distance-field (as soon as it is released with new image (>0.24.x) dependency)
[ ] omt-xcassets: Fix filter
[ ] omt-xcassets: Implement mode fill
[ ] omt-xcassets: Implement mode update
Expand Down Expand Up @@ -60,6 +59,8 @@

#### v0.8.x

- [x] Add AtlasSet to handle multiple Atlases


## 2022

Expand Down
1 change: 1 addition & 0 deletions src/atlas/atlas_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ impl AtlasSet {
}
pub fn with_inputs(mut self, inputs: Vec<&Path>) -> Self {
for input in inputs.iter() {
// println!("{:?}", &input);
self.inputs.push(input.to_path_buf());
}
self
Expand Down
10 changes: 10 additions & 0 deletions src/omt-atlas.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use omt::atlas::AtlasSet;
use std::process;

use clap::{Parser, Subcommand};
Expand Down Expand Up @@ -69,6 +70,13 @@ fn main() -> anyhow::Result<()> {
println!("\t{:?}", i);
}
println!("]");
let mut atlas_set = AtlasSet::default()
.with_border( border )
.with_target_size( size )
.with_inputs( input.iter().map(|p| p.as_path() ).collect() )
;
atlas_set.refit()?;
/*
match Atlas::combine(
&output,
size,
Expand All @@ -77,6 +85,8 @@ fn main() -> anyhow::Result<()> {
&input,
reference_path.as_ref(),
) {
*/
match atlas_set.save( &output, reference_path.as_ref().map(|p| p.as_path() ) ) {
Ok(1) => {
println!("1 atlas created");
process::exit(0);
Expand Down
2 changes: 1 addition & 1 deletion test_atlas.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

cargo run --release --bin omt-atlas -- combine --output Data/test-atlas -s 1024 -b 32 -i Data/green.png Data/red.png Data/blue.png -r Data/
cargo run --release --bin omt-atlas -- combine --output Data/test-atlas -s 1024 -b 32 -i Data/64x64_green.png Data/64x64_red.png Data/64x64_blue.png -r Data/
cargo run --release --bin omt-atlas -- info -i Data/test-atlas
for o in Data/*omtr
do
Expand Down

0 comments on commit 801ece5

Please sign in to comment.