Browse Source

Merge pull request #12936 from looeee/FBXLoader_restore_break_condition_to_getString

FBXLoader: Restore break condition to getString
Mr.doob 7 years ago
parent
commit
780c0a1cff
1 changed files with 2 additions and 6 deletions
  1. 2 6
      examples/js/loaders/FBXLoader.js

+ 2 - 6
examples/js/loaders/FBXLoader.js

@@ -3651,12 +3651,8 @@
 		getString: function ( size ) {
 
 			var a = new Uint8Array( this.getUint8Array( size ) );
-
-			// for ( var i = 0; i < size; i ++ ) {
-
-			// 	a[ i ] = this.getUint8();
-
-			// }
+			var nullByte = a.indexOf( 0 );
+			if ( nullByte >= 0 ) a = a.slice( 0, nullByte );
 
 			return THREE.LoaderUtils.decodeText( a );