Fix a few bugs.

This commit is contained in:
Pavel Krajcevski 2014-02-04 12:55:47 -05:00
parent d1f7501584
commit a530ae937e
3 changed files with 7 additions and 5 deletions

View file

@ -87,8 +87,8 @@ namespace FasTC {
template<typename OtherPixelType>
void ConvertTo(Image<OtherPixelType> &other) const {
for(uint32 j = 0; j < other.GetWidth(); j++) {
for(uint32 i = 0; i < other.GetHeight(); i++) {
for(uint32 j = 0; j < other.GetHeight(); j++) {
for(uint32 i = 0; i < other.GetWidth(); i++) {
other(i, j).Unpack((*this)(i, j).Pack());
}
}

View file

@ -60,8 +60,8 @@ namespace ETCC {
uint32 blocksX = cj.Width() / 4;
uint32 blocksY = cj.Height() / 4;
for(uint32 j = 0; j < blocksX; j++) {
for(uint32 i = 0; i < blocksY; i++) {
for(uint32 j = 0; j < blocksY; j++) {
for(uint32 i = 0; i < blocksX; i++) {
uint32 pixels[16];
uint32 blockIdx = j*blocksX + i;
rg_etc1::unpack_etc1_block(cj.InBuf() + blockIdx * 8, pixels);

View file

@ -103,6 +103,7 @@ class IntLoader {
class BigEndianIntLoader : public IntLoader {
public:
BigEndianIntLoader() { }
virtual uint32 ReadInt(const uint8 *data) const {
uint32 ret = 0;
ret |= data[0];
@ -117,10 +118,11 @@ static const BigEndianIntLoader gBEldr;
class LittleEndianIntLoader : public IntLoader {
public:
LittleEndianIntLoader() { }
virtual uint32 ReadInt(const uint8 *data) const {
uint32 ret = 0;
ret |= data[3];
for(uint32 i = 3; i >= 0; i--) {
for(int32 i = 3; i >= 0; i--) {
ret <<= 8;
ret |= data[i];
}