Merge branch 'master' into DecompressASTC

This commit is contained in:
Pavel Krajcevski 2014-11-03 15:57:50 -05:00
commit da6d6e5106
6 changed files with 15 additions and 7 deletions

View File

@ -71,7 +71,6 @@ int main(int argc, char **argv) {
ImageFile imgf (argv[1]);
if(!imgf.Load()) {
fprintf(stderr, "Error loading file: %s\n", argv[1]);
return 1;
}

View File

@ -53,6 +53,7 @@
#define _CRT_SECURE_NO_WARNINGS
#define WIN32_LEAN_AND_MEAN
#include <algorithm>
#include <cassert>
#include <cstdlib>
#include <cstdio>

View File

@ -62,6 +62,8 @@ IF(MSVC)
SET(MSVC_VERSION_STRING vc100)
ELSEIF(MSVC11)
SET(MSVC_VERSION_STRING vc110)
ELSEIF(MSVC12)
SET(MSVC_VERSION_STRING vc120)
ELSEIF(MSVC90)
SET(MSVC_VERSION_STRING vc90)
ELSEIF(MSVC80)

View File

@ -95,7 +95,9 @@ public:
}
~FileStreamImpl() {
fclose(m_FilePtr);
if (0 != m_FilePtr) {
fclose(m_FilePtr);
}
}
void IncreaseReferenceCount() { m_ReferenceCount++; }

View File

@ -209,29 +209,33 @@ FasTC::Image<> *ImageLoader::LoadImage() {
for(uint32 i = 0; i < aw; i++) {
unsigned int redVal = GetChannelForPixel(i, j, 0);
if(redVal == INT_MAX)
if(redVal == INT_MAX) {
return NULL;
}
unsigned int greenVal = redVal;
unsigned int blueVal = redVal;
if(GetGreenChannelPrecision() > 0) {
greenVal = GetChannelForPixel(i, j, 1);
if(greenVal == INT_MAX)
if(greenVal == INT_MAX) {
return NULL;
}
}
if(GetBlueChannelPrecision() > 0) {
blueVal = GetChannelForPixel(i, j, 2);
if(blueVal == INT_MAX)
if(blueVal == INT_MAX) {
return NULL;
}
}
unsigned int alphaVal = 0xFF;
if(GetAlphaChannelPrecision() > 0) {
alphaVal = GetChannelForPixel(i, j, 3);
if(alphaVal == INT_MAX)
if(alphaVal == INT_MAX) {
return NULL;
}
}
// Red channel

@ -1 +1 @@
Subproject commit 4feeeb6550851ba3541c3f9505c76018e665667e
Subproject commit 6d9f6ba0f9ebec0f6735b1f29527ea5835ef3572