Fix issue 115.

This commit is contained in:
castano 2010-03-10 08:08:44 +00:00
parent 78a97985fe
commit d566f66ce9
2 changed files with 15 additions and 9 deletions

View File

@ -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.

View File

@ -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.