Browse Source

Merge pull request #12945 from looeee/FBXLoader_cleanup_binaryparser

FBXLoader: Removed unused Binary Reader methods
Mr.doob 7 năm trước cách đây
mục cha
commit
266395a28f
1 tập tin đã thay đổi với 7 bổ sung107 xóa
  1. 7 107
      examples/js/loaders/FBXLoader.js

+ 7 - 107
examples/js/loaders/FBXLoader.js

@@ -3215,7 +3215,7 @@
 
 
 		parseProperty: function ( reader ) {
 		parseProperty: function ( reader ) {
 
 
-			var type = reader.getChar();
+			var type = reader.getString(1);
 
 
 			switch ( type ) {
 			switch ( type ) {
 
 
@@ -3370,28 +3370,6 @@
 
 
 		},
 		},
 
 
-		getInt8: function () {
-
-			var value = this.dv.getInt8( this.offset );
-			this.offset += 1;
-			return value;
-
-		},
-
-		getInt8Array: function ( size ) {
-
-			var a = [];
-
-			for ( var i = 0; i < size; i ++ ) {
-
-				a.push( this.getInt8() );
-
-			}
-
-			return a;
-
-		},
-
 		getUint8: function () {
 		getUint8: function () {
 
 
 			var value = this.dv.getUint8( this.offset );
 			var value = this.dv.getUint8( this.offset );
@@ -3400,20 +3378,6 @@
 
 
 		},
 		},
 
 
-		getUint8Array: function ( size ) {
-
-			var a = [];
-
-			for ( var i = 0; i < size; i ++ ) {
-
-				a.push( this.getUint8() );
-
-			}
-
-			return a;
-
-		},
-
 		getInt16: function () {
 		getInt16: function () {
 
 
 			var value = this.dv.getInt16( this.offset, this.littleEndian );
 			var value = this.dv.getInt16( this.offset, this.littleEndian );
@@ -3422,42 +3386,6 @@
 
 
 		},
 		},
 
 
-		getInt16Array: function ( size ) {
-
-			var a = [];
-
-			for ( var i = 0; i < size; i ++ ) {
-
-				a.push( this.getInt16() );
-
-			}
-
-			return a;
-
-		},
-
-		getUint16: function () {
-
-			var value = this.dv.getUint16( this.offset, this.littleEndian );
-			this.offset += 2;
-			return value;
-
-		},
-
-		getUint16Array: function ( size ) {
-
-			var a = [];
-
-			for ( var i = 0; i < size; i ++ ) {
-
-				a.push( this.getUint16() );
-
-			}
-
-			return a;
-
-		},
-
 		getInt32: function () {
 		getInt32: function () {
 
 
 			var value = this.dv.getInt32( this.offset, this.littleEndian );
 			var value = this.dv.getInt32( this.offset, this.littleEndian );
@@ -3488,20 +3416,6 @@
 
 
 		},
 		},
 
 
-		getUint32Array: function ( size ) {
-
-			var a = [];
-
-			for ( var i = 0; i < size; i ++ ) {
-
-				a.push( this.getUint32() );
-
-			}
-
-			return a;
-
-		},
-
 		// JavaScript doesn't support 64-bit integer so calculate this here
 		// JavaScript doesn't support 64-bit integer so calculate this here
 		// 1 << 32 will return 1 so using multiply operation instead here.
 		// 1 << 32 will return 1 so using multiply operation instead here.
 		// There's a possibility that this method returns wrong value if the value
 		// There's a possibility that this method returns wrong value if the value
@@ -3576,20 +3490,6 @@
 
 
 		},
 		},
 
 
-		getUint64Array: function ( size ) {
-
-			var a = [];
-
-			for ( var i = 0; i < size; i ++ ) {
-
-				a.push( this.getUint64() );
-
-			}
-
-			return a;
-
-		},
-
 		getFloat32: function () {
 		getFloat32: function () {
 
 
 			var value = this.dv.getFloat32( this.offset, this.littleEndian );
 			var value = this.dv.getFloat32( this.offset, this.littleEndian );
@@ -3642,15 +3542,16 @@
 
 
 		},
 		},
 
 
-		getChar: function () {
+		getString: function ( size ) {
 
 
-			return String.fromCharCode( this.getUint8() );
+			var a = new Uint8Array( size );
 
 
-		},
+			for ( var i = 0; i < size; i ++ ) {
 
 
-		getString: function ( size ) {
+				a[ i ] = this.getUint8();
+
+			}
 
 
-			var a = new Uint8Array( this.getUint8Array( size ) );
 			var nullByte = a.indexOf( 0 );
 			var nullByte = a.indexOf( 0 );
 			if ( nullByte >= 0 ) a = a.slice( 0, nullByte );
 			if ( nullByte >= 0 ) a = a.slice( 0, nullByte );
 
 
@@ -3762,7 +3663,6 @@
 
 
 	}
 	}
 
 
-	// Converts ArrayBuffer to String.
 	function convertArrayBufferToString( buffer, from, to ) {
 	function convertArrayBufferToString( buffer, from, to ) {
 
 
 		if ( from === undefined ) from = 0;
 		if ( from === undefined ) from = 0;