Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FBXLoader: Remove workaround for Safari 9. #25241

Merged
merged 2 commits into from
Jan 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions examples/jsm/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3811,19 +3811,15 @@ class BinaryReader {

getString( size ) {

// note: safari 9 doesn't support Uint8Array.indexOf; create intermediate array instead
let a = [];
const start = this.offset;
let a = new Uint8Array( this.dv.buffer, start, size );

for ( let i = 0; i < size; i ++ ) {

a[ i ] = this.getUint8();

}
this.skip( size );

const nullByte = a.indexOf( 0 );
if ( nullByte >= 0 ) a = a.slice( 0, nullByte );
if ( nullByte >= 0 ) a = new Uint8Array( this.dv.buffer, start, nullByte );

return this._textDecoder.decode( new Uint8Array( a ) );
return this._textDecoder.decode( a );

}

Expand Down