mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-08 06:35:33 +00:00
Finish the hooking up of the compression library to the core library
This commit is contained in:
parent
b9350e3876
commit
213d98f985
|
@ -13,6 +13,6 @@ ADD_EXECUTABLE(
|
||||||
${SOURCES}
|
${SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES( tc BPTCEncoder )
|
||||||
TARGET_LINK_LIBRARIES( tc TexCompIO )
|
TARGET_LINK_LIBRARIES( tc TexCompIO )
|
||||||
TARGET_LINK_LIBRARIES( tc TexCompCore )
|
TARGET_LINK_LIBRARIES( tc TexCompCore )
|
||||||
TARGET_LINK_LIBRARIES( tc BPTCEncoder )
|
|
||||||
|
|
|
@ -9,8 +9,12 @@ SET( HEADERS
|
||||||
"include/CompressedImage.h"
|
"include/CompressedImage.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES( ${TexC_BINARY_DIR}/IO/include )
|
INCLUDE_DIRECTORIES( ${TexC_SOURCE_DIR}/BPTCEncoder/include )
|
||||||
|
INCLUDE_DIRECTORIES( ${TexC_BINARY_DIR}/BPTCEncoder/include )
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES( ${TexC_SOURCE_DIR}/IO/include )
|
INCLUDE_DIRECTORIES( ${TexC_SOURCE_DIR}/IO/include )
|
||||||
|
INCLUDE_DIRECTORIES( ${TexC_BINARY_DIR}/IO/include )
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES( ${TexC_SOURCE_DIR}/Core/include )
|
INCLUDE_DIRECTORIES( ${TexC_SOURCE_DIR}/Core/include )
|
||||||
|
|
||||||
ADD_LIBRARY( TexCompCore
|
ADD_LIBRARY( TexCompCore
|
||||||
|
@ -19,3 +23,4 @@ ADD_LIBRARY( TexCompCore
|
||||||
)
|
)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES( TexCompCore TexCompIO )
|
TARGET_LINK_LIBRARIES( TexCompCore TexCompIO )
|
||||||
|
TARGET_LINK_LIBRARIES( TexCompCore BPTCEncoder )
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#include "BC7Compressor.h"
|
||||||
#include "TexComp.h"
|
#include "TexComp.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -10,6 +11,18 @@ SCompressionSettings:: SCompressionSettings()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
static CompressionFunc ChooseFuncFromSettings(const SCompressionSettings &s) {
|
static CompressionFunc ChooseFuncFromSettings(const SCompressionSettings &s) {
|
||||||
|
switch(s.format) {
|
||||||
|
case eCompressionFormat_BPTC:
|
||||||
|
{
|
||||||
|
if(s.bUseSIMD) {
|
||||||
|
return BC7C::CompressImageBC7SIMD;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return BC7C::CompressImageBC7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,6 +180,10 @@ bool ImageFile::LoadImage(const unsigned char *rawImageData) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Read the image data!
|
||||||
|
if(!loader->ReadData())
|
||||||
|
return false;
|
||||||
|
|
||||||
m_Width = loader->GetWidth();
|
m_Width = loader->GetWidth();
|
||||||
m_Height = loader->GetHeight();
|
m_Height = loader->GetHeight();
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,8 @@ ImageLoaderPNG::~ImageLoaderPNG() {
|
||||||
bool ImageLoaderPNG::ReadData() {
|
bool ImageLoaderPNG::ReadData() {
|
||||||
|
|
||||||
const int kNumSigBytesToRead = 8;
|
const int kNumSigBytesToRead = 8;
|
||||||
if(!png_sig_cmp(m_RawData, 0, kNumSigBytesToRead)) {
|
const int numSigNoMatch = png_sig_cmp(m_RawData, 0, kNumSigBytesToRead);
|
||||||
|
if(numSigNoMatch) {
|
||||||
ReportError("Incorrect PNG signature");
|
ReportError("Incorrect PNG signature");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue