From 13df3c72c6012ea134906e2f59e635ac85dafcfa Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Thu, 15 May 2014 22:02:16 -0400 Subject: [PATCH] Apparently the block layout is different for ASTC... --- ASTCEncoder/src/Decompressor.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ASTCEncoder/src/Decompressor.cpp b/ASTCEncoder/src/Decompressor.cpp index 322e170..afcb0fb 100644 --- a/ASTCEncoder/src/Decompressor.cpp +++ b/ASTCEncoder/src/Decompressor.cpp @@ -1008,6 +1008,16 @@ namespace ASTCC { blockIdx++; } } + + // Flip the image... + uint32 *imgStart = reinterpret_cast(dcj.OutBuf()); + for(uint32 j = 0; j < (dcj.Height() >> 1); j++) { + for(uint32 i = 0; i < dcj.Width(); i++) { + const uint32 rowA = j*dcj.Width(); + const uint32 rowB = (dcj.Height() - j - 1) * dcj.Width(); + std::swap(imgStart[rowA + i], imgStart[rowB + i]); + } + } } } // namespace ASTCC