From 35db540b49abb18f17d9d4c4cf9cbfdeba9ec273 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 28 Mar 2008 14:44:31 +0000 Subject: 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 --- source/blender/imbuf/intern/dds/ColorBlock.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'source/blender/imbuf/intern/dds/ColorBlock.cpp') 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 -- cgit v1.2.3