Skip to content

Commit

Permalink
Update DDSLoader.js
Browse files Browse the repository at this point in the history
Clean up.
  • Loading branch information
Mugen87 authored Dec 2, 2024
1 parent afc9206 commit 036cd0d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/jsm/loaders/DDSLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ class DDSLoader extends CompressedTextureLoader {
return byteArray;

}

const FOURCC_DXT1 = fourCCToInt32( 'DXT1' );
const FOURCC_DXT3 = fourCCToInt32( 'DXT3' );
const FOURCC_DXT5 = fourCCToInt32( 'DXT5' );
Expand Down Expand Up @@ -264,15 +264,15 @@ class DDSLoader extends CompressedTextureLoader {
blockBytes = 64;
dds.format = RGBAFormat;

} else if( header[ off_RGBBitCount ] === 24
} else if ( header[ off_RGBBitCount ] === 24
&& header[ off_RBitMask ] & 0xff0000
&& header[ off_GBitMask ] & 0xff00
&& header[ off_BBitMask ] & 0xff ) {

isRGBUncompressed = true;
blockBytes = 64;
dds.format = RGBAFormat;

} else {

console.error( 'THREE.DDSLoader.parse: Unsupported FourCC code ', int32ToFourCC( fourCC ) );
Expand Down Expand Up @@ -327,11 +327,11 @@ class DDSLoader extends CompressedTextureLoader {
byteArray = loadARGBMip( buffer, dataOffset, width, height );
dataLength = byteArray.length;

} else if( isRGBUncompressed ) {
} else if ( isRGBUncompressed ) {

byteArray = loadRGBMip( buffer, dataOffset, width, height );
dataLength = width * height * 3;

} else {

dataLength = Math.max( 4, width ) / 4 * Math.max( 4, height ) / 4 * blockBytes;
Expand Down

0 comments on commit 036cd0d

Please sign in to comment.