Skip to content

Commit 54050ed

Browse files
authored
Merge pull request #16824 from gero3/AWDLoaderLGTM
AWDLoader: Fix LGTM Errors
2 parents cc0f656 + 71e457a commit 54050ed

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

examples/js/loaders/AWDLoader.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ THREE.AWDLoader = ( function () {
4949

5050
this.id = 0;
5151
this.data = null;
52+
this.namespace = 0;
53+
this.flags = 0;
5254

5355
}
5456

@@ -167,7 +169,7 @@ THREE.AWDLoader = ( function () {
167169
parseNextBlock: function () {
168170

169171
var assetData,
170-
ns, type, len, block,
172+
block,
171173
blockId = this.readU32(),
172174
ns = this.readU8(),
173175
type = this.readU8(),
@@ -233,6 +235,8 @@ THREE.AWDLoader = ( function () {
233235
this._blocks[ blockId ] = block = new Block();
234236
block.data = assetData;
235237
block.id = blockId;
238+
block.namespace = ns;
239+
block.flags = flags;
236240

237241

238242
},
@@ -401,7 +405,8 @@ THREE.AWDLoader = ( function () {
401405

402406
while ( methods_parsed < num_methods ) {
403407

404-
var method_type = this.readU16();
408+
// read method_type before
409+
this.readU16();
405410
this.parseProperties( null );
406411
this.parseUserAttributes();
407412

@@ -455,6 +460,8 @@ THREE.AWDLoader = ( function () {
455460
console.log( url );
456461

457462
asset = this.loadTexture( url );
463+
asset.userData = {};
464+
asset.userData.name = name;
458465

459466
} else {
460467
// embed texture not supported
@@ -487,8 +494,9 @@ THREE.AWDLoader = ( function () {
487494
parseSkeleton: function () {
488495

489496
// Array<Bone>
490-
var name = this.readUTF(),
491-
num_joints = this.readU16(),
497+
//
498+
this.readUTF();
499+
var num_joints = this.readU16(),
492500
skeleton = [],
493501
joints_parsed = 0;
494502

examples/jsm/loaders/AWDLoader.js

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ var AWDLoader = ( function () {
6363

6464
this.id = 0;
6565
this.data = null;
66+
this.namespace = 0;
67+
this.flags = 0;
6668

6769
}
6870

@@ -181,7 +183,7 @@ var AWDLoader = ( function () {
181183
parseNextBlock: function () {
182184

183185
var assetData,
184-
ns, type, len, block,
186+
block,
185187
blockId = this.readU32(),
186188
ns = this.readU8(),
187189
type = this.readU8(),
@@ -247,6 +249,8 @@ var AWDLoader = ( function () {
247249
this._blocks[ blockId ] = block = new Block();
248250
block.data = assetData;
249251
block.id = blockId;
252+
block.namespace = ns;
253+
block.flags = flags;
250254

251255

252256
},
@@ -415,7 +419,8 @@ var AWDLoader = ( function () {
415419

416420
while ( methods_parsed < num_methods ) {
417421

418-
var method_type = this.readU16();
422+
// read method_type before
423+
this.readU16();
419424
this.parseProperties( null );
420425
this.parseUserAttributes();
421426

@@ -468,7 +473,9 @@ var AWDLoader = ( function () {
468473
var url = this.readUTFBytes( data_len );
469474
console.log( url );
470475

471-
asset = this.loadTexture( url );
476+
asset = this.loadTexture(url);
477+
asset.userData = {};
478+
asset.userData.name = name;
472479

473480
} else {
474481
// embed texture not supported
@@ -501,8 +508,9 @@ var AWDLoader = ( function () {
501508
parseSkeleton: function () {
502509

503510
// Array<Bone>
504-
var name = this.readUTF(),
505-
num_joints = this.readU16(),
511+
//
512+
this.readUTF();
513+
var num_joints = this.readU16(),
506514
skeleton = [],
507515
joints_parsed = 0;
508516

0 commit comments

Comments
 (0)