Check for single color blocks in all compressors.

This commit is contained in:
castano
2008-04-26 09:16:56 +00:00
parent 921ee354c0
commit 15e7125b4b
4 changed files with 56 additions and 13 deletions

View File

@ -481,7 +481,17 @@ void QuickCompress::compressDXT1(const ColorBlock & rgba, BlockDXT1 * dxtBlock)
void QuickCompress::compressDXT1a(const ColorBlock & rgba, BlockDXT1 * dxtBlock)
{
if (!rgba.hasAlpha())
bool hasAlpha = false;
for (uint i = 0; i < 16; i++)
{
if (rgba.color(i).a < 128) {
hasAlpha = true;
break;
}
}
if (!hasAlpha)
{
compressDXT1(rgba, dxtBlock);
}