Skip to content

Commit

Permalink
allow palette updates for 64 Bit
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Dec 8, 2023
1 parent 7850cfd commit 1ab5862
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ZeDMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ bool ZeDMD::Open(int width, int height)

void ZeDMD::SetPalette(uint8_t *pPalette)
{
SetPalette(pPalette, 64);
m_paletteChanged = false;
if (memcmp(&m_palette, pPalette, 192))
{
SetPalette(pPalette, 64);
m_paletteChanged = true;
}
}

void ZeDMD::SetPalette(uint8_t* pPalette, int numColors)
Expand Down Expand Up @@ -310,7 +315,7 @@ void ZeDMD::RenderColoredGray6(uint8_t *pFrame, uint8_t *pRotations)
if (!m_usb && !m_wifi)
return;

if (UpdateFrameBuffer8(pFrame))
if (UpdateFrameBuffer8(pFrame) || m_paletteChanged)
{
int width;
int height;
Expand Down
1 change: 1 addition & 0 deletions src/ZeDMD.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ class ZEDMDAPI ZeDMD
bool m_wifi = false;
bool m_downscaling = false;
bool m_upscaling = false;
bool m_paletteChanged = false;

uint8_t *m_pFrameBuffer;
uint8_t *m_pScaledFrameBuffer;
Expand Down

0 comments on commit 1ab5862

Please sign in to comment.