diff -r 772a43d88e6b -r 2146cb7be36f rust/mapgen/src/theme.rs --- a/rust/mapgen/src/theme.rs Fri Mar 10 11:42:25 2023 +0100 +++ b/rust/mapgen/src/theme.rs Tue Aug 22 08:35:46 2023 +0200 @@ -1,3 +1,4 @@ +use integral_geometry::{Point, Rect}; use png::{ColorType, Decoder, DecodingError}; use std::{ fs::{read_dir, File}, @@ -109,9 +110,70 @@ } } +#[derive(Default)] +struct Color(u8, u8, u8, u8); + +pub struct LandObjectOverlay { + texture: ThemeSprite, + offset: Point, +} + +pub struct LandObject { + texture: ThemeSprite, + inland_rects: Vec, + outland_rects: Vec, + anchors: Vec, + overlays: Vec, +} + +pub struct LandSpray { + texture: ThemeSprite, + count: u16, +} + +#[derive(Default)] +pub struct ThemeColors { + border: Color, +} + +pub struct Flakes { + texture: ThemeSprite, + frames_count: u16, + frame_ticks: u16, + velocity: u16, + fall_speed: u16, +} + +#[derive(Default)] +pub struct Water { + top_color: Color, + bottom_color: Color, + opacity: u8, +} + +#[derive(Default)] +pub struct ThemeParts { + water: Water, + flakes: Option, + music: String, + sky: Color, + tint: Color, +} + +#[derive(Default)] pub struct Theme { + border_color: Color, + clouds_count: u16, + flatten_flakes: bool, land_texture: Option, border_texture: Option, + land_objects: Vec, + spays: Vec, + use_ice: bool, + use_snow: bool, + music: String, + normal_parts: ThemeParts, + sd_parts: ThemeParts, } impl Theme { @@ -145,10 +207,7 @@ impl Theme { pub fn new() -> Self { - Theme { - land_texture: None, - border_texture: None, - } + Default::default() } pub fn load(path: &Path) -> Result {