Explorar el Código

TGALoader: fix blue component handling for 16-bit (RGBA5551) images (#22360)

Ithamar R. Adema hace 3 años
padre
commit
fe50e3329c
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      examples/jsm/loaders/TGALoader.js

+ 2 - 2
examples/jsm/loaders/TGALoader.js

@@ -199,10 +199,10 @@ class TGALoader extends DataTextureLoader {
 
 				for ( x = x_start; x !== x_end; x += x_step, i += 2 ) {
 
-					color = image[ i + 0 ] + ( image[ i + 1 ] << 8 ); // Inversed ?
+					color = image[ i + 0 ] + ( image[ i + 1 ] << 8 );
 					imageData[ ( x + width * y ) * 4 + 0 ] = ( color & 0x7C00 ) >> 7;
 					imageData[ ( x + width * y ) * 4 + 1 ] = ( color & 0x03E0 ) >> 2;
-					imageData[ ( x + width * y ) * 4 + 2 ] = ( color & 0x001F ) >> 3;
+					imageData[ ( x + width * y ) * 4 + 2 ] = ( color & 0x001F ) << 3;
 					imageData[ ( x + width * y ) * 4 + 3 ] = ( color & 0x8000 ) ? 0 : 255;
 
 				}