Skip to content

Commit 8cb903d

Browse files
authored
RGBMLoader: Fix alerts in UPNG.js. (mrdoob#22578)
1 parent 5a18e62 commit 8cb903d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/jsm/loaders/RGBMLoader.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ UPNG.toRGBA8.decodeImage = function ( data, w, h, out ) {
251251
}
252252
else if ( depth == 16 ) for ( var x = 0; x < w; x ++ ) {
253253

254-
var gr = data[ off + ( x << 1 ) ], al = ( rs( data, off + ( x << i ) ) == tr ) ? 0 : 255; bf32[ to + x ] = ( al << 24 ) | ( gr << 16 ) | ( gr << 8 ) | gr;
254+
var gr = data[ off + ( x << 1 ) ], al = ( rs( data, off + ( x << 1 ) ) == tr ) ? 0 : 255; bf32[ to + x ] = ( al << 24 ) | ( gr << 16 ) | ( gr << 8 ) | gr;
255255

256256
}
257257

@@ -397,7 +397,7 @@ UPNG.decode = function ( buff ) {
397397

398398
}
399399

400-
//else { log("unknown chunk type", type, len); }
400+
//else { console.log("unknown chunk type", type, len); out.tabs[type]=data.slice(offset,offset+len); }
401401
offset += len;
402402
bin.readUint( data, offset ); offset += 4;
403403

@@ -406,7 +406,7 @@ UPNG.decode = function ( buff ) {
406406
if ( foff != 0 ) {
407407

408408
var fr = out.frames[ out.frames.length - 1 ];
409-
fr.data = UPNG.decode._decompress( out, fd.slice( 0, foff ), fr.rect.width, fr.rect.height ); foff = 0;
409+
fr.data = UPNG.decode._decompress( out, fd.slice( 0, foff ), fr.rect.width, fr.rect.height );
410410

411411
}
412412

@@ -819,7 +819,7 @@ UPNG.decode._filterZero = function ( data, out, off, w, h ) {
819819
var bpp = UPNG.decode._getBPP( out ), bpl = Math.ceil( w * bpp / 8 ), paeth = UPNG.decode._paeth;
820820
bpp = Math.ceil( bpp / 8 );
821821

822-
var i = 0, di = 1, type = data[ off ], x = 0;
822+
var i, di, type = data[ off ], x = 0;
823823

824824
if ( type > 1 ) data[ off ] = [ 0, 0, 1 ][ type - 2 ];
825825
if ( type == 3 ) for ( x = bpp; x < bpl; x ++ ) data[ x + 1 ] = ( data[ x + 1 ] + ( data[ x + 1 - bpp ] >>> 1 ) ) & 255;

0 commit comments

Comments
 (0)