Skip to content

Conversation

06wj
Copy link
Contributor

@06wj 06wj commented Dec 12, 2018

According to the KTX specification

  • Use DataView to read header data, DataView native support for bigEndian and littleEndian data reading.
  • The header data should be Uint32.

@Mugen87
Copy link
Collaborator

Mugen87 commented Dec 12, 2018

this.bytesOfKeyValueData = oppositeEndianess ? this.switchEndainness( header[ 12 ] ) : header[ 12 ]; // the amount of space after the header for meta-data
// load the reset of the header in native 32 bit uint
var dataSize = Uint32Array.BYTES_PER_ELEMENT;
var headerDataView = new DataView(this.arrayBuffer, 12, 13 * dataSize);
Copy link
Collaborator

@Mugen87 Mugen87 Dec 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor code style issue. Please add a space after/before parens like so:

new DataView( this.arrayBuffer, 12, 13 * dataSize );

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it.

@mrdoob mrdoob added this to the r100 milestone Dec 13, 2018
@mrdoob mrdoob merged commit 030c805 into mrdoob:dev Dec 13, 2018
@mrdoob
Copy link
Owner

mrdoob commented Dec 13, 2018

Thanks!

@06wj 06wj deleted the patch_ktx branch December 13, 2018 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants