From 0345571851204c21bddd1561d9907f38e8dfaadb Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 26 Mar 2023 12:37:54 -0400 Subject: [PATCH] reorder blit method enums in a different and still arbitrary order --- ggdt/src/graphics/bitmap/indexed/blit.rs | 80 ++++++++++++------------ ggdt/src/graphics/bitmap/rgb/blit.rs | 44 ++++++------- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/ggdt/src/graphics/bitmap/indexed/blit.rs b/ggdt/src/graphics/bitmap/indexed/blit.rs index 2994ca6..9e25e49 100644 --- a/ggdt/src/graphics/bitmap/indexed/blit.rs +++ b/ggdt/src/graphics/bitmap/indexed/blit.rs @@ -10,14 +10,35 @@ use crate::math::rect::Rect; pub enum IndexedBlitMethod { /// Solid blit, no transparency or other per-pixel adjustments. Solid, + SolidBlended { + blend_map: Rc, + }, /// Same as [IndexedBlitMethod::Solid] but the drawn image can also be flipped horizontally /// and/or vertically. SolidFlipped { horizontal_flip: bool, vertical_flip: bool, }, + SolidFlippedBlended { + horizontal_flip: bool, + vertical_flip: bool, + blend_map: Rc, + }, + /// Same as [IndexedBlitMethod::Solid] except that the drawn pixels have their color indices offset + /// by the amount given. + SolidOffset(u8), + /// Combination of [IndexedBlitMethod::SolidFlipped] and [IndexedBlitMethod::SolidOffset]. + SolidFlippedOffset { + horizontal_flip: bool, + vertical_flip: bool, + offset: u8, + }, /// Transparent blit, the specified source color pixels are skipped. Transparent(u8), + TransparentBlended { + transparent_color: u8, + blend_map: Rc, + }, /// Same as [IndexedBlitMethod::Transparent] but the drawn image can also be flipped horizontally /// and/or vertically. TransparentFlipped { @@ -25,6 +46,12 @@ pub enum IndexedBlitMethod { horizontal_flip: bool, vertical_flip: bool, }, + TransparentFlippedBlended { + transparent_color: u8, + horizontal_flip: bool, + vertical_flip: bool, + blend_map: Rc, + }, /// Same as [IndexedBlitMethod::Transparent] except that the visible pixels on the destination are all /// drawn using the same color. TransparentSingle { @@ -38,15 +65,6 @@ pub enum IndexedBlitMethod { vertical_flip: bool, draw_color: u8, }, - /// Same as [IndexedBlitMethod::Solid] except that the drawn pixels have their color indices offset - /// by the amount given. - SolidOffset(u8), - /// Combination of [IndexedBlitMethod::SolidFlipped] and [IndexedBlitMethod::SolidOffset]. - SolidFlippedOffset { - horizontal_flip: bool, - vertical_flip: bool, - offset: u8, - }, /// Same as [IndexedBlitMethod::Transparent] except that the drawn pixels have their color indices /// offset by the amount given. The transparent color check is not affected by the offset and /// is always treated as an absolute palette color index. @@ -65,6 +83,12 @@ pub enum IndexedBlitMethod { scale_x: f32, scale_y: f32, }, + RotoZoomBlended { + angle: f32, + scale_x: f32, + scale_y: f32, + blend_map: Rc, + }, /// Same as [IndexedBlitMethod::RotoZoom] except that the specified source color pixels are skipped. RotoZoomTransparent { angle: f32, @@ -72,6 +96,13 @@ pub enum IndexedBlitMethod { scale_y: f32, transparent_color: u8, }, + RotoZoomTransparentBlended { + angle: f32, + scale_x: f32, + scale_y: f32, + transparent_color: u8, + blend_map: Rc, + }, /// Same as [IndexedBlitMethod::RotoZoom] except that the drawn pixels have their color indices /// offset by the amount given. RotoZoomOffset { @@ -90,37 +121,6 @@ pub enum IndexedBlitMethod { transparent_color: u8, offset: u8, }, - SolidBlended { - blend_map: Rc, - }, - SolidFlippedBlended { - horizontal_flip: bool, - vertical_flip: bool, - blend_map: Rc, - }, - TransparentBlended { - transparent_color: u8, - blend_map: Rc, - }, - TransparentFlippedBlended { - transparent_color: u8, - horizontal_flip: bool, - vertical_flip: bool, - blend_map: Rc, - }, - RotoZoomBlended { - angle: f32, - scale_x: f32, - scale_y: f32, - blend_map: Rc, - }, - RotoZoomTransparentBlended { - angle: f32, - scale_x: f32, - scale_y: f32, - transparent_color: u8, - blend_map: Rc, - }, } impl IndexedBitmap { diff --git a/ggdt/src/graphics/bitmap/rgb/blit.rs b/ggdt/src/graphics/bitmap/rgb/blit.rs index 05a2a2b..b52f9fa 100644 --- a/ggdt/src/graphics/bitmap/rgb/blit.rs +++ b/ggdt/src/graphics/bitmap/rgb/blit.rs @@ -8,14 +8,24 @@ use crate::math::rect::Rect; pub enum RgbaBlitMethod { /// Solid blit, no transparency or other per-pixel adjustments. Solid, + SolidBlended(BlendFunction), /// Same as [RgbaBlitMethod::Solid] but the drawn image can also be flipped horizontally /// and/or vertically. SolidFlipped { horizontal_flip: bool, vertical_flip: bool, }, + SolidFlippedBlended { + horizontal_flip: bool, + vertical_flip: bool, + blend: BlendFunction, + }, /// Transparent blit, the specified source color pixels are skipped. Transparent(u32), + TransparentBlended { + transparent_color: u32, + blend: BlendFunction, + }, /// Same as [RgbaBlitMethod::Transparent] but the drawn image can also be flipped horizontally /// and/or vertically. TransparentFlipped { @@ -23,6 +33,12 @@ pub enum RgbaBlitMethod { horizontal_flip: bool, vertical_flip: bool, }, + TransparentFlippedBlended { + transparent_color: u32, + horizontal_flip: bool, + vertical_flip: bool, + blend: BlendFunction, + }, /// Same as [RgbaBlitMethod::Transparent] except that the visible pixels on the destination are all /// drawn using the same color. TransparentSingle { @@ -43,6 +59,12 @@ pub enum RgbaBlitMethod { scale_x: f32, scale_y: f32, }, + RotoZoomBlended { + angle: f32, + scale_x: f32, + scale_y: f32, + blend: BlendFunction, + }, /// Same as [RgbaBlitMethod::RotoZoom] except that the specified source color pixels are skipped. RotoZoomTransparent { angle: f32, @@ -50,28 +72,6 @@ pub enum RgbaBlitMethod { scale_y: f32, transparent_color: u32, }, - SolidBlended(BlendFunction), - SolidFlippedBlended { - horizontal_flip: bool, - vertical_flip: bool, - blend: BlendFunction, - }, - TransparentBlended { - transparent_color: u32, - blend: BlendFunction, - }, - TransparentFlippedBlended { - transparent_color: u32, - horizontal_flip: bool, - vertical_flip: bool, - blend: BlendFunction, - }, - RotoZoomBlended { - angle: f32, - scale_x: f32, - scale_y: f32, - blend: BlendFunction, - }, RotoZoomTransparentBlended { angle: f32, scale_x: f32,