diff --git a/agb-image-converter/src/image_loader.rs b/agb-image-converter/src/image_loader.rs index 9126a637..81c8fff8 100644 --- a/agb-image-converter/src/image_loader.rs +++ b/agb-image-converter/src/image_loader.rs @@ -1,6 +1,6 @@ -use std::path; +use std::{ffi::OsStr, path}; -use image::GenericImageView; +use image::{DynamicImage, GenericImageView}; use crate::colour::Colour; @@ -12,7 +12,17 @@ pub(crate) struct Image { impl Image { pub fn load_from_file(image_path: &path::Path) -> Self { - let img = image::open(image_path).expect("Expected image to exist"); + let img = if image_path + .extension() + .is_some_and(|extension| extension == OsStr::new("aseprite")) + { + let ase = + asefile::AsepriteFile::read_file(image_path).expect("failed to read aseprite file"); + DynamicImage::ImageRgba8(ase.frame(0).image()) + } else { + image::open(image_path).expect("Expected image to exist") + }; + Self::load_from_dyn_image(img) } diff --git a/examples/hyperspace-roll/gfx/help-text.png b/examples/hyperspace-roll/gfx/help-text.png deleted file mode 100644 index de6db475..00000000 Binary files a/examples/hyperspace-roll/gfx/help-text.png and /dev/null differ diff --git a/examples/hyperspace-roll/gfx/stars.png b/examples/hyperspace-roll/gfx/stars.png deleted file mode 100644 index 65062d6e..00000000 Binary files a/examples/hyperspace-roll/gfx/stars.png and /dev/null differ diff --git a/examples/hyperspace-roll/gfx/title-screen.png b/examples/hyperspace-roll/gfx/title-screen.png deleted file mode 100644 index cc2c5240..00000000 Binary files a/examples/hyperspace-roll/gfx/title-screen.png and /dev/null differ diff --git a/examples/hyperspace-roll/src/background.rs b/examples/hyperspace-roll/src/background.rs index 85609f85..61035ce1 100644 --- a/examples/hyperspace-roll/src/background.rs +++ b/examples/hyperspace-roll/src/background.rs @@ -6,9 +6,9 @@ use agb::{ use crate::sfx::Sfx; include_background_gfx!(backgrounds, "121105", - stars => "gfx/stars.png", - title => "gfx/title-screen.png", - help => "gfx/help-text.png", + stars => "gfx/stars.aseprite", + title => "gfx/title-screen.aseprite", + help => "gfx/help-text.aseprite", descriptions1 => "gfx/descriptions1.png", descriptions2 => "gfx/descriptions2.png", ); diff --git a/examples/the-purple-night/gfx/background.png b/examples/the-purple-night/gfx/background.png deleted file mode 100644 index 32786957..00000000 Binary files a/examples/the-purple-night/gfx/background.png and /dev/null differ diff --git a/examples/the-purple-night/gfx/boss.png b/examples/the-purple-night/gfx/boss.png deleted file mode 100644 index b17c3a39..00000000 Binary files a/examples/the-purple-night/gfx/boss.png and /dev/null differ diff --git a/examples/the-purple-night/gfx/objects.png b/examples/the-purple-night/gfx/objects.png deleted file mode 100644 index 167e3a2f..00000000 Binary files a/examples/the-purple-night/gfx/objects.png and /dev/null differ diff --git a/examples/the-purple-night/src/lib.rs b/examples/the-purple-night/src/lib.rs index 9be41653..cc861298 100644 --- a/examples/the-purple-night/src/lib.rs +++ b/examples/the-purple-night/src/lib.rs @@ -57,7 +57,7 @@ const SWORDLESS_JUMP: &Tag = TAG_MAP.get("jump swordless"); const SWORDLESS_ATTACK: &Tag = KNIFE_ATTACK; const SWORDLESS_JUMP_ATTACK: &Tag = KNIFE_JUMP_ATTACK; -agb::include_background_gfx!(background, "53269a", background => "gfx/background.png"); +agb::include_background_gfx!(background, "53269a", background => "gfx/background.aseprite"); type Number = FixedNum<8>;