mirror of
				https://github.com/yuzu-emu/FasTC.git
				synced 2025-11-04 14:15:00 +00:00 
			
		
		
		
	Fix a few bugs.
This commit is contained in:
		
							parent
							
								
									d1f7501584
								
							
						
					
					
						commit
						a530ae937e
					
				| 
						 | 
				
			
			@ -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());
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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];
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue