diff options
author | Kent Mein <mein@cs.umn.edu> | 2008-03-28 17:44:31 +0300 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2008-03-28 17:44:31 +0300 |
commit | 35db540b49abb18f17d9d4c4cf9cbfdeba9ec273 (patch) | |
tree | 3f1eb9443cae8c324756acbe9177fa183fe45810 /source/blender/imbuf/intern/dds/ColorBlock.cpp | |
parent | d32ec4297d92e1eecdc3288b6c7f9630f98e8828 (diff) |
This is patches:
[#8578] imbuf for DDS textures: minor bugs fixed
(syncing with upstream nvidia texture tools)
[#8727] imbuf for DDS textures: fix for DXT5 alpha channel corruption
Submitted by our DDS person, Amorilia
Kent
Diffstat (limited to 'source/blender/imbuf/intern/dds/ColorBlock.cpp')
-rw-r--r-- | source/blender/imbuf/intern/dds/ColorBlock.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.cpp b/source/blender/imbuf/intern/dds/ColorBlock.cpp index 0199d15ada7..761501b1225 100644 --- a/source/blender/imbuf/intern/dds/ColorBlock.cpp +++ b/source/blender/imbuf/intern/dds/ColorBlock.cpp @@ -103,7 +103,7 @@ void ColorBlock::swizzleDXT5n() for(int i = 0; i < 16; i++) { Color32 c = m_color[i]; - m_color[i] = Color32(0, c.g, 0, c.r); + m_color[i] = Color32(0xFF, c.g, 0, c.r); } } @@ -125,6 +125,19 @@ 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; +} /// Count number of unique colors in this color block. uint ColorBlock::countUniqueColors() const |