diff --git a/agb-image-converter/src/config.rs b/agb-image-converter/src/config.rs index 075a9f7d..7379a6d5 100644 --- a/agb-image-converter/src/config.rs +++ b/agb-image-converter/src/config.rs @@ -28,7 +28,6 @@ pub(crate) trait Config { pub(crate) trait Image { fn filename(&self) -> String; - fn transparent_colour(&self) -> Option; fn tilesize(&self) -> TileSize; fn colours(&self) -> Colours; } @@ -65,7 +64,7 @@ impl Config for ConfigV1 { return Some(*colour); } - self.images() + self.image .values() .flat_map(|image| image.transparent_colour()) .next() @@ -85,12 +84,6 @@ impl Image for ImageV1 { self.filename.clone() } - fn transparent_colour(&self) -> Option { - self.transparent_colour - .as_ref() - .map(|colour| colour.parse().unwrap()) - } - fn tilesize(&self) -> TileSize { self.tile_size.into() } @@ -104,6 +97,14 @@ impl Image for ImageV1 { } } +impl ImageV1 { + fn transparent_colour(&self) -> Option { + self.transparent_colour + .as_ref() + .map(|colour| colour.parse().unwrap()) + } +} + #[derive(Deserialize, Clone, Copy)] pub enum TileSizeV1 { #[serde(rename = "8x8")]