diff --git a/Kconfig.projbuild b/Kconfig.projbuild index c516931..7e989b9 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -4,8 +4,4 @@ config ESPGUI_MENUDISPLAY_ROWS int "Number of rows for MenuDisplays" default 10 -config ESPGUI_ICONS_SWAPBYTES - bool "Swap bytes in icons" - default n - endmenu diff --git a/src/menudisplay.cpp b/src/menudisplay.cpp index a1c3eb7..b1dc11e 100644 --- a/src/menudisplay.cpp +++ b/src/menudisplay.cpp @@ -162,14 +162,8 @@ void MenuDisplay::redraw(TftInterface &tft) if (auto icon = item.selectedIcon()) { -#ifdef CONFIG_ESPGUI_ICONS_SWAPBYTES - tft.setSwapBytes(true); -#endif tft.pushImage(tft.width() - 6 - icon->WIDTH, labelsIter->y() + 1, icon->WIDTH, icon->HEIGHT, icon->buffer); -#ifdef CONFIG_ESPGUI_ICONS_SWAPBYTES - tft.setSwapBytes(false); -#endif } } } @@ -186,15 +180,7 @@ void MenuDisplay::redraw(TftInterface &tft) { auto icon = item.icon(); if (icon) - { -#ifdef CONFIG_ESPGUI_ICONS_SWAPBYTES - tft.setSwapBytes(true); -#endif tft.pushImage(6, labelsIter->y() + 1, icon->WIDTH, icon->HEIGHT, icon->buffer); -#ifdef CONFIG_ESPGUI_ICONS_SWAPBYTES - tft.setSwapBytes(false); -#endif - } else if (*iconsIter) tft.fillRect(6, labelsIter->y() + 1, 24, 24, selected ? TFT_GREY : TFT_BLACK); *iconsIter = icon; diff --git a/src/tftespiimpl.h b/src/tftespiimpl.h index 71646f8..528beca 100644 --- a/src/tftespiimpl.h +++ b/src/tftespiimpl.h @@ -71,9 +71,6 @@ public: void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data) { m_tft.pushImage(x, y, w, h, data); } void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data, uint16_t transparent) { m_tft.pushImage(x, y, w, h, data, transparent); } - void setSwapBytes(bool swap) override { m_tft.setSwapBytes(swap); } - bool getSwapBytes(void) override { return m_tft.getSwapBytes(); } - void startWrite(void) override { m_tft.startWrite(); } void writeColor(uint16_t color, uint32_t len) override { m_tft.writeColor(color, len); } void endWrite(void) override { m_tft.endWrite(); } diff --git a/src/tftinterface.h b/src/tftinterface.h index 42c98f7..1b2dafa 100644 --- a/src/tftinterface.h +++ b/src/tftinterface.h @@ -81,10 +81,6 @@ public: virtual void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data) = 0; virtual void pushImage(int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *data, uint16_t transparent) = 0; - // Swap the byte order for pushImage() and pushPixels() - corrects endianness - virtual void setSwapBytes(bool swap) = 0; - virtual bool getSwapBytes(void) = 0; - // Bare metal functions virtual void startWrite(void) = 0; virtual void writeColor(uint16_t color, uint32_t len) = 0;