# HG changeset patch # User alfadur # Date 1676522013 -10800 # Node ID 0710feb75c99e8ff54da7883361e20b5589efd22 # Parent 5289ab63853d2a361d1b734bcb8861e878797511 expand theme definition diff -r 5289ab63853d -r 0710feb75c99 rust/mapgen/src/theme.rs --- a/rust/mapgen/src/theme.rs Fri Jan 27 06:22:22 2023 +0300 +++ b/rust/mapgen/src/theme.rs Thu Feb 16 07:33:33 2023 +0300 @@ -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 {