mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Remove the definition of transparent colour from image
This commit is contained in:
parent
89af366b7a
commit
1a51b3b502
|
@ -28,7 +28,6 @@ pub(crate) trait Config {
|
||||||
|
|
||||||
pub(crate) trait Image {
|
pub(crate) trait Image {
|
||||||
fn filename(&self) -> String;
|
fn filename(&self) -> String;
|
||||||
fn transparent_colour(&self) -> Option<Colour>;
|
|
||||||
fn tilesize(&self) -> TileSize;
|
fn tilesize(&self) -> TileSize;
|
||||||
fn colours(&self) -> Colours;
|
fn colours(&self) -> Colours;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +64,7 @@ impl Config for ConfigV1 {
|
||||||
return Some(*colour);
|
return Some(*colour);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.images()
|
self.image
|
||||||
.values()
|
.values()
|
||||||
.flat_map(|image| image.transparent_colour())
|
.flat_map(|image| image.transparent_colour())
|
||||||
.next()
|
.next()
|
||||||
|
@ -85,12 +84,6 @@ impl Image for ImageV1 {
|
||||||
self.filename.clone()
|
self.filename.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transparent_colour(&self) -> Option<Colour> {
|
|
||||||
self.transparent_colour
|
|
||||||
.as_ref()
|
|
||||||
.map(|colour| colour.parse().unwrap())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn tilesize(&self) -> TileSize {
|
fn tilesize(&self) -> TileSize {
|
||||||
self.tile_size.into()
|
self.tile_size.into()
|
||||||
}
|
}
|
||||||
|
@ -104,6 +97,14 @@ impl Image for ImageV1 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ImageV1 {
|
||||||
|
fn transparent_colour(&self) -> Option<Colour> {
|
||||||
|
self.transparent_colour
|
||||||
|
.as_ref()
|
||||||
|
.map(|colour| colour.parse().unwrap())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Deserialize, Clone, Copy)]
|
#[derive(Deserialize, Clone, Copy)]
|
||||||
pub enum TileSizeV1 {
|
pub enum TileSizeV1 {
|
||||||
#[serde(rename = "8x8")]
|
#[serde(rename = "8x8")]
|
||||||
|
|
Loading…
Reference in a new issue