浏览代码

fix LGTM Errors

Gero3 6 年之前
父节点
当前提交
68080d3af0
共有 1 个文件被更改,包括 13 次插入5 次删除
  1. 13 5
      examples/js/loaders/AWDLoader.js

+ 13 - 5
examples/js/loaders/AWDLoader.js

@@ -49,6 +49,8 @@ THREE.AWDLoader = ( function () {
 
 		this.id = 0;
 		this.data = null;
+		this.namespace = 0;
+		this.flags = 0;
 
 	}
 
@@ -167,7 +169,7 @@ THREE.AWDLoader = ( function () {
 		parseNextBlock: function () {
 
 			var assetData,
-				ns, type, len, block,
+				block,
 				blockId = this.readU32(),
 				ns = this.readU8(),
 				type = this.readU8(),
@@ -233,6 +235,8 @@ THREE.AWDLoader = ( function () {
 			this._blocks[ blockId ] = block = new Block();
 			block.data = assetData;
 			block.id = blockId;
+			block.namespace = ns;
+			block.flags = flags;
 
 
 		},
@@ -401,7 +405,8 @@ THREE.AWDLoader = ( function () {
 
 			while ( methods_parsed < num_methods ) {
 
-				var method_type = this.readU16();
+				// read method_type before 
+				this.readU16();
 				this.parseProperties( null );
 				this.parseUserAttributes();
 
@@ -454,7 +459,9 @@ THREE.AWDLoader = ( function () {
 				var url = this.readUTFBytes( data_len );
 				console.log( url );
 
-				asset = this.loadTexture( url );
+				asset = this.loadTexture(url);
+				asset.userData = {};
+				asset.userData.name = name;
 
 			} else {
 				// embed texture not supported
@@ -487,8 +494,9 @@ THREE.AWDLoader = ( function () {
 		parseSkeleton: function () {
 
 			// Array<Bone>
-			var name = this.readUTF(),
-				num_joints = this.readU16(),
+			//
+			this.readUTF();
+			var	num_joints = this.readU16(),
 				skeleton = [],
 				joints_parsed = 0;