Skip to content

Commit f626651

Browse files
Fixed bug with indexing
1 parent de66987 commit f626651

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

examples/js/loaders/KTXLoader.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,15 @@ var KhronosTextureContainer = ( function () {
137137
for ( var level = 0; level < mipmapCount; level ++ ) {
138138

139139
var imageSize = new Int32Array( this.arrayBuffer, dataOffset, 1 )[ 0 ]; // size per face, since not supporting array cubemaps
140-
dataOffset += imageSize + 4; // size of the image + 4 for the imageSize field
140+
dataOffset += 4; // size of the image + 4 for the imageSize field
141141

142142
for ( var face = 0; face < this.numberOfFaces; face ++ ) {
143143

144-
var byteArray = new Uint8Array( this.arrayBuffer, dataOffset + 4, imageSize );
144+
var byteArray = new Uint8Array( this.arrayBuffer, dataOffset, imageSize );
145145

146146
mipmaps.push( { "data": byteArray, "width": width, "height": height } );
147-
147+
148+
dataOffset += imageSize;
148149
dataOffset += 3 - ( ( imageSize + 3 ) % 4 ); // add padding for odd sized image
149150

150151
}

0 commit comments

Comments
 (0)