From 33c09ae5913690a283118574270bb04a6970f639 Mon Sep 17 00:00:00 2001 From: castano Date: Mon, 7 Jan 2008 07:45:27 +0000 Subject: [PATCH] Fix DXT1a support. --- src/nvtt/CompressDXT.cpp | 2 +- src/nvtt/squish/colourset.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nvtt/CompressDXT.cpp b/src/nvtt/CompressDXT.cpp index cc38b8f..010126c 100644 --- a/src/nvtt/CompressDXT.cpp +++ b/src/nvtt/CompressDXT.cpp @@ -241,7 +241,7 @@ void nv::compressDXT1a(const Image * image, const OutputOptions::Private & outpu rgba.init(image, x, y); // Compress color. - squish::ColourSet colours((uint8 *)rgba.colors(), 0); + squish::ColourSet colours((uint8 *)rgba.colors(), squish::kDxt1|squish::kWeightColourByAlpha); squish::WeightedClusterFit fit(&colours, squish::kDxt1); fit.setMetric(compressionOptions.colorWeight.x(), compressionOptions.colorWeight.y(), compressionOptions.colorWeight.z()); fit.Compress(&block); diff --git a/src/nvtt/squish/colourset.cpp b/src/nvtt/squish/colourset.cpp index e66161a..69e1dba 100644 --- a/src/nvtt/squish/colourset.cpp +++ b/src/nvtt/squish/colourset.cpp @@ -27,6 +27,12 @@ namespace squish { +// @@ Add flags: +// - FindColorMatch +// - DXT1a +// - WeightColorByAlpha + + ColourSet::ColourSet( u8 const* rgba, int flags ) : m_count( 0 ), m_transparent( false )