GRAPHICS: Return flag if palette was updated for the palette lookup
This commit is contained in:
parent
1edcbcb53e
commit
c87c02c5ae
2 changed files with 7 additions and 3 deletions
|
@ -32,14 +32,16 @@ PaletteLookup::PaletteLookup(const byte *palette, uint len) {
|
|||
memcpy(_palette, palette, len * 3);
|
||||
}
|
||||
|
||||
void PaletteLookup::setPalette(const byte *palette, uint len) {
|
||||
bool PaletteLookup::setPalette(const byte *palette, uint len) {
|
||||
// Check if the passed palette matched the one we have
|
||||
if (len == _paletteSize && !memcmp(_palette, palette, len * 3))
|
||||
return;
|
||||
return false;
|
||||
|
||||
_paletteSize = len;
|
||||
memcpy(_palette, palette, len * 3);
|
||||
_colorHash.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
byte PaletteLookup::findBestColor(byte cr, byte cg, byte cb) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue