From 96f22f8cd43f163ae28ebe0f6c7e07c8c4e4b861 Mon Sep 17 00:00:00 2001 From: castano Date: Wed, 10 Mar 2010 08:49:40 +0000 Subject: [PATCH] Fix isColorNoAlpha, but leave it commented out. --- src/nvimage/ColorBlock.cpp | 7 ++++++- src/nvimage/ColorBlock.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/nvimage/ColorBlock.cpp b/src/nvimage/ColorBlock.cpp index 16cd922..8856654 100644 --- a/src/nvimage/ColorBlock.cpp +++ b/src/nvimage/ColorBlock.cpp @@ -175,6 +175,7 @@ bool ColorBlock::isSingleColor() const return true; } +/* /// Returns true if the block has a single color, ignoring transparent pixels. bool ColorBlock::isSingleColorNoAlpha() const { @@ -182,7 +183,10 @@ bool ColorBlock::isSingleColorNoAlpha() const int i; for(i = 0; i < 16; i++) { - if (m_color[i].a != 0) c = m_color[i]; + if (m_color[i].a != 0) { + c = m_color[i]; + break; + } } Color32 mask(0xFF, 0xFF, 0xFF, 0x00); @@ -198,6 +202,7 @@ bool ColorBlock::isSingleColorNoAlpha() const return true; } +*/ /// Count number of unique colors in this color block. uint ColorBlock::countUniqueColors() const diff --git a/src/nvimage/ColorBlock.h b/src/nvimage/ColorBlock.h index 0588d92..0a79112 100644 --- a/src/nvimage/ColorBlock.h +++ b/src/nvimage/ColorBlock.h @@ -24,7 +24,7 @@ namespace nv void swizzle(uint x, uint y, uint z, uint w); // 0=r, 1=g, 2=b, 3=a, 4=0xFF, 5=0 bool isSingleColor() const; - bool isSingleColorNoAlpha() const; + //bool isSingleColorNoAlpha() const; uint countUniqueColors() const; Color32 averageColor() const; bool hasAlpha() const;