From a32693507fb244c6bbc90e20a04128017470f839 Mon Sep 17 00:00:00 2001 From: Kevin Schlosser Date: Sun, 22 Dec 2024 21:11:13 -0700 Subject: [PATCH] Adds rotation to SDL driver --- ext_mod/lcd_bus/rotate.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext_mod/lcd_bus/rotate.c b/ext_mod/lcd_bus/rotate.c index 5d818864..ed345057 100644 --- a/ext_mod/lcd_bus/rotate.c +++ b/ext_mod/lcd_bus/rotate.c @@ -119,6 +119,8 @@ void rotate_8bpp(uint8_t *src, uint8_t *dst, rotation_data_t *data) uint32_t src_bytes_per_line = x_end - x_start + 1; uint32_t offset = y_start * src_bytes_per_line + x_start; + uint32_t dst_width_minus_one = dst_width - 1; + switch (data->rotation) { case ROTATION_90: dst_height--; @@ -151,8 +153,6 @@ void rotate_8bpp(uint8_t *src, uint8_t *dst, rotation_data_t *data) // SWAP_XY MIRROR_X case ROTATION_270: - uint32_t dst_width_minus_one = dst_width - 1; - for (uint32_t y=y_start;yrotation) { case ROTATION_90: dst_height--; @@ -217,8 +219,6 @@ void rotate_16bpp(uint16_t *src, uint16_t *dst, rotation_data_t *data) // SWAP_XY MIRROR_X case ROTATION_270: - uint32_t dst_width_minus_one = dst_width - 1; - for (uint32_t y=y_start;yrotation) { case ROTATION_90: dst_height--; @@ -348,8 +350,6 @@ void rotate_32bpp(uint32_t *src, uint32_t *dst, rotation_data_t *data) // SWAP_XY MIRROR_X case ROTATION_270: - uint32_t dst_width_minus_one = dst_width - 1; - for (uint32_t y=y_start;y