Removed engine flare transparency

master
Mark 2024-01-07 12:38:02 -08:00
parent 1e07632e39
commit 49f4473963
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
6 changed files with 21 additions and 7 deletions

View File

@ -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)
----------------------------------

2
assets

@ -1 +1 @@
Subproject commit 607aea5630a0c1ccadacd1cf207394b5dc86147e
Subproject commit 95558076be1819b10d5a56c62274cdf7f61ea9a8

View File

@ -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 }]

View File

@ -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,

View File

@ -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,

View File

@ -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(());