From 44ebe5d0bbb874526966b9fe3c51d37ed20c499b Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Wed, 12 Mar 2014 19:41:48 -0400 Subject: [PATCH] Hook ASTC decompressor into the rest of FasTC --- Core/CMakeLists.txt | 2 ++ Core/src/CompressedImage.cpp | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Core/CMakeLists.txt b/Core/CMakeLists.txt index 3af98a6..fbc7036 100644 --- a/Core/CMakeLists.txt +++ b/Core/CMakeLists.txt @@ -79,6 +79,7 @@ ENDIF() INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR} ) +INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/ASTCEncoder/include ) INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/ETCEncoder/include ) INCLUDE_DIRECTORIES( ${FasTC_SOURCE_DIR}/DXTEncoder/include ) @@ -126,6 +127,7 @@ TARGET_LINK_LIBRARIES( FasTCCore ETCEncoder ) TARGET_LINK_LIBRARIES( FasTCCore DXTEncoder ) TARGET_LINK_LIBRARIES( FasTCCore BPTCEncoder ) TARGET_LINK_LIBRARIES( FasTCCore PVRTCEncoder ) +TARGET_LINK_LIBRARIES( FasTCCore ASTCEncoder ) IF( CMAKE_USE_PTHREADS_INIT ) TARGET_LINK_LIBRARIES( FasTCCore ${CMAKE_THREAD_LIBS_INIT} ) diff --git a/Core/src/CompressedImage.cpp b/Core/src/CompressedImage.cpp index 0e47720..63dfa3c 100644 --- a/Core/src/CompressedImage.cpp +++ b/Core/src/CompressedImage.cpp @@ -64,6 +64,7 @@ #include "PVRTCCompressor.h" #include "DXTCompressor.h" #include "ETCCompressor.h" +#include "ASTCCompressor.h" using FasTC::CompressionJob; using FasTC::DecompressionJob; @@ -136,6 +137,9 @@ bool CompressedImage::DecompressImage(unsigned char *outBuf, unsigned int outBuf #endif } else if(m_Format == FasTC::eCompressionFormat_BPTC) { BPTCC::Decompress(dj); + } else if(FasTC::COMPRESSION_FORMAT_ASTC_BEGIN <= m_Format && + FasTC::COMPRESSION_FORMAT_ASTC_END >= m_Format) { + ASTCC::Decompress(dj); } else { const char *errStr = "Have not implemented decompression method."; fprintf(stderr, "%s\n", errStr);