diff --git a/TODO.md b/TODO.md index ee94aee..25f2cf8 100644 --- a/TODO.md +++ b/TODO.md @@ -15,7 +15,6 @@ - incremental? - Higher texture limit (16 x 8096 x 8096 isn't enough) - GPU limits? (texture size, texture number) - - Engine flares shouldn't be centered - Particles when a ship is damaged (events) ---------------------------------- diff --git a/assets b/assets index 607aea5..9555807 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit 607aea5630a0c1ccadacd1cf207394b5dc86147e +Subproject commit 95558076be1819b10d5a56c62274cdf7f61ea9a8 diff --git a/content/ship.toml b/content/ship.toml index 164bca1..1b88b35 100644 --- a/content/ship.toml +++ b/content/ship.toml @@ -13,7 +13,7 @@ space.outfit = 200 space.engine = 50 space.weapon = 50 -engines = [{ x = 0.0, y = -1.05, size = 50.0 }] +engines = [{ x = 0.0, y = -1, size = 25.0 }] guns = [{ x = 0.0, y = 1 }, { x = 0.1, y = 0.80 }, { x = -0.1, y = 0.80 }] diff --git a/crates/gameobject/src/outfits.rs b/crates/gameobject/src/outfits.rs index b9eb6a7..80edd1a 100644 --- a/crates/gameobject/src/outfits.rs +++ b/crates/gameobject/src/outfits.rs @@ -197,7 +197,7 @@ impl<'a> OutfitSet { .map(|p| ObjectSubSprite { pos: Point3 { x: p.pos.x, - y: p.pos.y, + y: p.pos.y - p.size / 2.0, z: 1.0, }, sprite: *s, diff --git a/crates/packer/src/atlasset.rs b/crates/packer/src/atlasset.rs index 3223376..ffb74f3 100644 --- a/crates/packer/src/atlasset.rs +++ b/crates/packer/src/atlasset.rs @@ -90,6 +90,21 @@ impl AtlasSet { let image_dim = img.dimensions(); + /* + TODO: seperate CLI argument to check these. + don't check this every run,because sometimes it's necessary. (for animated sprites!) + let mut transparent_border = true; + for (x, y, c) in img.pixels() { + if (x == 0 || y == 0 || x == img.width() - 1 || y == img.height() - 1) && c[3] != 0 { + transparent_border = false; + break; + } + } + if transparent_border { + println!("[WARNING] {} wastes space with a transmparent border",); + } + */ + let dim = [ image_dim.0 + 2 * self.image_margin, image_dim.1 + 2 * self.image_margin, diff --git a/crates/packer/src/main.rs b/crates/packer/src/main.rs index b0a888d..e8cfa7e 100644 --- a/crates/packer/src/main.rs +++ b/crates/packer/src/main.rs @@ -64,7 +64,7 @@ fn main() -> Result<()> { } // Create atlas set - let mut atlas_set = AtlasSet::new(8192, 8192, 16, &asset_root, 2); + let mut atlas_set = AtlasSet::new(8192, 8192, 16, &asset_root, 1); let total = files.len(); let mut i = 0; let mut peak_efficiency = 0f64; @@ -88,8 +88,8 @@ fn main() -> Result<()> { println!("Saving files..."); atlas_set.save_files( - |x| PathBuf::from(format!("atlas-{x:0.2}.bmp")), - &PathBuf::from("spriteatlas.toml"), + |x| PathBuf::from(format!("cache/atlas-{x:0.2}.bmp")), + &PathBuf::from("cache/spriteatlas.toml"), )?; return Ok(());