Dirty on Luminance change (#727)

This commit is contained in:
Michael Miller
2023-07-17 18:56:30 -07:00
committed by GitHub
parent 978b62f841
commit 46b24fec9a

View File

@@ -74,9 +74,16 @@ public:
protected: protected:
uint8_t _luminance; uint8_t _luminance;
void setLuminance(uint8_t luminance) bool setLuminance(uint8_t luminance)
{ {
_luminance = luminance; bool different = (_luminance != luminance);
if (different)
{
_luminance = luminance;
}
return different;
} }
uint8_t getLuminance() const uint8_t getLuminance() const
@@ -135,7 +142,10 @@ public:
// does NOT affect current pixel data as there is no safe way // does NOT affect current pixel data as there is no safe way
// to reconstruct the original color values after being // to reconstruct the original color values after being
// modified with both luminance and gamma without storing them // modified with both luminance and gamma without storing them
Shader.setLuminance(luminance); if (Shader.setLuminance(luminance))
{
this->Dirty();
}
} }
uint8_t GetLuminance() const uint8_t GetLuminance() const