use embedded_graphics_core::pixelcolor::Rgb565;
use crate::pipeline::effects::{DitherConfig, FogConfig};
use super::light_levels::LightLevels;
use super::palette::PaletteMode;
use super::sky::SkyConfig;
use super::stipple::StippleMode;
use super::texture_lod::TextureMapping;
use super::tint::ScreenTint;
#[derive(Debug, Clone, Copy)]
pub struct RetroStyle {
pub fog: Option<FogConfig>,
pub dither: Option<DitherConfig>,
pub vertex_snap_bits: u8,
pub texture_mapping: TextureMapping,
pub light_levels: LightLevels,
pub stipple_mode: StippleMode,
pub screen_tint: Option<ScreenTint>,
pub palette_mode: PaletteMode,
pub sky: Option<SkyConfig>,
}
impl Default for RetroStyle {
fn default() -> Self {
Self::modern()
}
}
impl RetroStyle {
#[must_use]
pub const fn modern() -> Self {
Self {
fog: None,
dither: None,
vertex_snap_bits: 0,
texture_mapping: TextureMapping::PerspectiveCorrect,
light_levels: LightLevels::Linear,
stipple_mode: StippleMode::Off,
screen_tint: None,
palette_mode: PaletteMode::Off,
sky: None,
}
}
#[must_use]
pub const fn doom_walkable() -> Self {
Self {
fog: None,
dither: Some(DitherConfig { intensity: 20 }),
vertex_snap_bits: 0,
texture_mapping: TextureMapping::Affine,
light_levels: LightLevels::Doom32,
stipple_mode: StippleMode::Off,
screen_tint: None,
palette_mode: PaletteMode::Rgb332,
sky: Some(SkyConfig::retro_blue()),
}
}
#[must_use]
pub fn psx() -> Self {
Self {
fog: Some(FogConfig::new(Rgb565::new(2, 2, 4), 6.0, 20.0)),
dither: Some(DitherConfig::new(72)),
vertex_snap_bits: 6,
texture_mapping: TextureMapping::Affine,
light_levels: LightLevels::Linear,
stipple_mode: StippleMode::Off,
screen_tint: None,
palette_mode: PaletteMode::Rgb332,
sky: Some(SkyConfig::retro_blue()),
}
}
}