From 289bcc9d444e02db2f0210ed3eff360294b7062c Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 28 Sep 2013 22:39:27 -0400 Subject: [PATCH] Make the block index for the stat function the pointer reinterpreted as an integer. This way we know exactly what block it is because we simply need to sort the stats in the output log. --- BPTCEncoder/src/BC7Compressor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index 3c65f79..648360c 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -1545,13 +1545,13 @@ namespace BC7C { class BlockLogger { public: - BlockLogger(uint32 blockIdx, std::ostream &os) + BlockLogger(uint64 blockIdx, std::ostream &os) : m_BlockIdx(blockIdx), m_Stream(os) { } template friend std::ostream &operator<<(const BlockLogger &bl, const T &v); - uint32 m_BlockIdx; + uint64 m_BlockIdx; std::ostream &m_Stream; }; @@ -1738,7 +1738,7 @@ namespace BC7C { const uint32 *pixelBuf = reinterpret_cast(inBuf); if(logStream) { - uint32 blockIdx = (j/4) * (cj.width/4) + (i/4); + uint64 blockIdx = reinterpret_cast(pixelBuf); CompressBC7Block(pixelBuf, outBuf, BlockLogger(blockIdx, *logStream)); } else { CompressBC7Block(pixelBuf, outBuf);