diff --git a/ChangeLog b/ChangeLog index 6d962e9..96ee295 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +NVIDIA Texture Tools version 2.0.8 + * ColorBlock::isSingleColor compares only RGB channels. Fixes issue 115. + NVIDIA Texture Tools version 2.0.7 * Output correct exit codes. Fixes issue 92. * Fix thread-safety errors. Fixes issue 90. diff --git a/src/nvimage/ColorBlock.cpp b/src/nvimage/ColorBlock.cpp index fac8859..847b885 100644 --- a/src/nvimage/ColorBlock.cpp +++ b/src/nvimage/ColorBlock.cpp @@ -113,15 +113,18 @@ void ColorBlock::splatY() /// Returns true if the block has a single color. bool ColorBlock::isSingleColor() const { - for(int i = 1; i < 16; i++) - { - if (m_color[0] != m_color[i]) - { - return false; - } - } - - return true; + Color32 mask(0xFF, 0xFF, 0xFF, 0x00); + uint u = m_color[0].u & mask.u; + + for (int i = 1; i < 16; i++) + { + if (u != (m_color[i].u & mask.u)) + { + return false; + } + } + + return true; } /// Count number of unique colors in this color block.