Remove ultra-retarded swapBytes
This commit is contained in:
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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(); }
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user