diff options
author | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:56 -0500 |
commit | c07901e29ed545bbb02e3bddf148fe1104b94e9f (patch) | |
tree | f1ada64ce834acd7d92a425efb96c4b86bcf16b1 /linden/indra/newview/llpolymesh.cpp | |
parent | Second Life viewer sources 1.15.0.2 (diff) | |
download | meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.zip meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.gz meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.bz2 meta-impy-c07901e29ed545bbb02e3bddf148fe1104b94e9f.tar.xz |
Second Life viewer sources 1.15.1.3
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llpolymesh.cpp | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/linden/indra/newview/llpolymesh.cpp b/linden/indra/newview/llpolymesh.cpp index cf94142..1edb8f5 100644 --- a/linden/indra/newview/llpolymesh.cpp +++ b/linden/indra/newview/llpolymesh.cpp | |||
@@ -301,6 +301,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
301 | if (numRead != 1) | 301 | if (numRead != 1) |
302 | { | 302 | { |
303 | llerrs << "can't read HasWeights flag from " << fileName << llendl; | 303 | llerrs << "can't read HasWeights flag from " << fileName << llendl; |
304 | return FALSE; | ||
304 | } | 305 | } |
305 | if (!isLOD()) | 306 | if (!isLOD()) |
306 | { | 307 | { |
@@ -315,6 +316,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
315 | if (numRead != 1) | 316 | if (numRead != 1) |
316 | { | 317 | { |
317 | llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl; | 318 | llerrs << "can't read HasDetailTexCoords flag from " << fileName << llendl; |
319 | return FALSE; | ||
318 | } | 320 | } |
319 | 321 | ||
320 | //---------------------------------------------------------------- | 322 | //---------------------------------------------------------------- |
@@ -326,6 +328,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
326 | if (numRead != 3) | 328 | if (numRead != 3) |
327 | { | 329 | { |
328 | llerrs << "can't read Position from " << fileName << llendl; | 330 | llerrs << "can't read Position from " << fileName << llendl; |
331 | return FALSE; | ||
329 | } | 332 | } |
330 | setPosition( position ); | 333 | setPosition( position ); |
331 | 334 | ||
@@ -338,6 +341,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
338 | if (numRead != 3) | 341 | if (numRead != 3) |
339 | { | 342 | { |
340 | llerrs << "can't read RotationAngles from " << fileName << llendl; | 343 | llerrs << "can't read RotationAngles from " << fileName << llendl; |
344 | return FALSE; | ||
341 | } | 345 | } |
342 | 346 | ||
343 | U8 rotationOrder; | 347 | U8 rotationOrder; |
@@ -346,6 +350,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
346 | if (numRead != 1) | 350 | if (numRead != 1) |
347 | { | 351 | { |
348 | llerrs << "can't read RotationOrder from " << fileName << llendl; | 352 | llerrs << "can't read RotationOrder from " << fileName << llendl; |
353 | return FALSE; | ||
349 | } | 354 | } |
350 | 355 | ||
351 | rotationOrder = 0; | 356 | rotationOrder = 0; |
@@ -364,6 +369,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
364 | if (numRead != 3) | 369 | if (numRead != 3) |
365 | { | 370 | { |
366 | llerrs << "can't read Scale from " << fileName << llendl; | 371 | llerrs << "can't read Scale from " << fileName << llendl; |
372 | return FALSE; | ||
367 | } | 373 | } |
368 | setScale( scale ); | 374 | setScale( scale ); |
369 | 375 | ||
@@ -384,6 +390,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
384 | if (numRead != 1) | 390 | if (numRead != 1) |
385 | { | 391 | { |
386 | llerrs << "can't read NumVertices from " << fileName << llendl; | 392 | llerrs << "can't read NumVertices from " << fileName << llendl; |
393 | return FALSE; | ||
387 | } | 394 | } |
388 | 395 | ||
389 | allocateVertexData( numVertices ); | 396 | allocateVertexData( numVertices ); |
@@ -396,6 +403,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
396 | if (numRead != numVertices) | 403 | if (numRead != numVertices) |
397 | { | 404 | { |
398 | llerrs << "can't read Coordinates from " << fileName << llendl; | 405 | llerrs << "can't read Coordinates from " << fileName << llendl; |
406 | return FALSE; | ||
399 | } | 407 | } |
400 | 408 | ||
401 | //---------------------------------------------------------------- | 409 | //---------------------------------------------------------------- |
@@ -406,6 +414,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
406 | if (numRead != numVertices) | 414 | if (numRead != numVertices) |
407 | { | 415 | { |
408 | llerrs << " can't read Normals from " << fileName << llendl; | 416 | llerrs << " can't read Normals from " << fileName << llendl; |
417 | return FALSE; | ||
409 | } | 418 | } |
410 | 419 | ||
411 | //---------------------------------------------------------------- | 420 | //---------------------------------------------------------------- |
@@ -416,6 +425,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
416 | if (numRead != numVertices) | 425 | if (numRead != numVertices) |
417 | { | 426 | { |
418 | llerrs << " can't read Binormals from " << fileName << llendl; | 427 | llerrs << " can't read Binormals from " << fileName << llendl; |
428 | return FALSE; | ||
419 | } | 429 | } |
420 | 430 | ||
421 | 431 | ||
@@ -427,6 +437,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
427 | if (numRead != numVertices) | 437 | if (numRead != numVertices) |
428 | { | 438 | { |
429 | llerrs << "can't read TexCoords from " << fileName << llendl; | 439 | llerrs << "can't read TexCoords from " << fileName << llendl; |
440 | return FALSE; | ||
430 | } | 441 | } |
431 | 442 | ||
432 | //---------------------------------------------------------------- | 443 | //---------------------------------------------------------------- |
@@ -439,6 +450,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
439 | if (numRead != numVertices) | 450 | if (numRead != numVertices) |
440 | { | 451 | { |
441 | llerrs << "can't read DetailTexCoords from " << fileName << llendl; | 452 | llerrs << "can't read DetailTexCoords from " << fileName << llendl; |
453 | return FALSE; | ||
442 | } | 454 | } |
443 | } | 455 | } |
444 | 456 | ||
@@ -452,6 +464,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
452 | if (numRead != numVertices) | 464 | if (numRead != numVertices) |
453 | { | 465 | { |
454 | llerrs << "can't read Weights from " << fileName << llendl; | 466 | llerrs << "can't read Weights from " << fileName << llendl; |
467 | return FALSE; | ||
455 | } | 468 | } |
456 | } | 469 | } |
457 | } | 470 | } |
@@ -465,6 +478,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
465 | if (numRead != 1) | 478 | if (numRead != 1) |
466 | { | 479 | { |
467 | llerrs << "can't read NumFaces from " << fileName << llendl; | 480 | llerrs << "can't read NumFaces from " << fileName << llendl; |
481 | return FALSE; | ||
468 | } | 482 | } |
469 | allocateFaceData( numFaces ); | 483 | allocateFaceData( numFaces ); |
470 | 484 | ||
@@ -482,6 +496,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
482 | if (numRead != 3) | 496 | if (numRead != 3) |
483 | { | 497 | { |
484 | llerrs << "can't read Face[" << i << "] from " << fileName << llendl; | 498 | llerrs << "can't read Face[" << i << "] from " << fileName << llendl; |
499 | return FALSE; | ||
485 | } | 500 | } |
486 | if (mReferenceData) | 501 | if (mReferenceData) |
487 | { | 502 | { |
@@ -538,6 +553,7 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
538 | if (numRead != 1) | 553 | if (numRead != 1) |
539 | { | 554 | { |
540 | llerrs << "can't read NumSkinJoints from " << fileName << llendl; | 555 | llerrs << "can't read NumSkinJoints from " << fileName << llendl; |
556 | return FALSE; | ||
541 | } | 557 | } |
542 | allocateJointNames( numSkinJoints ); | 558 | allocateJointNames( numSkinJoints ); |
543 | } | 559 | } |
@@ -547,11 +563,13 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
547 | //---------------------------------------------------------------- | 563 | //---------------------------------------------------------------- |
548 | for (i=0; i < numSkinJoints; i++) | 564 | for (i=0; i < numSkinJoints; i++) |
549 | { | 565 | { |
550 | char jointName[64]; /*Flawfinder: ignore*/ | 566 | char jointName[64+1]; |
551 | numRead = fread(jointName, sizeof(jointName), 1, fp); | 567 | numRead = fread(jointName, sizeof(jointName)-1, 1, fp); |
568 | jointName[sizeof(jointName)-1] = '\0'; // ensure nul-termination | ||
552 | if (numRead != 1) | 569 | if (numRead != 1) |
553 | { | 570 | { |
554 | llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl; | 571 | llerrs << "can't read Skin[" << i << "].Name from " << fileName << llendl; |
572 | return FALSE; | ||
555 | } | 573 | } |
556 | 574 | ||
557 | std::string *jn = &mJointNames[i]; | 575 | std::string *jn = &mJointNames[i]; |
@@ -561,7 +579,8 @@ BOOL LLPolyMeshSharedData::loadMesh( const char *fileName ) | |||
561 | //------------------------------------------------------------------------- | 579 | //------------------------------------------------------------------------- |
562 | // look for morph section | 580 | // look for morph section |
563 | //------------------------------------------------------------------------- | 581 | //------------------------------------------------------------------------- |
564 | char morphName[64]; /*Flawfinder: ignore*/ | 582 | char morphName[64+1]; |
583 | morphName[sizeof(morphName)-1] = '\0'; // ensure nul-termination | ||
565 | while(fread(&morphName, sizeof(char), 64, fp) == 64) | 584 | while(fread(&morphName, sizeof(char), 64, fp) == 64) |
566 | { | 585 | { |
567 | if (!strcmp(morphName, "End Morphs")) | 586 | if (!strcmp(morphName, "End Morphs")) |
@@ -991,6 +1010,13 @@ BOOL LLPolySkeletalDistortionInfo::parseXml(LLXmlTreeNode* node) | |||
991 | 1010 | ||
992 | LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton"); | 1011 | LLXmlTreeNode* skeletalParam = node->getChildByName("param_skeleton"); |
993 | 1012 | ||
1013 | if (NULL == skeletalParam) | ||
1014 | { | ||
1015 | llwarns << "Failed to getChildByName(\"param_skeleton\")" | ||
1016 | << llendl; | ||
1017 | return FALSE; | ||
1018 | } | ||
1019 | |||
994 | for( LLXmlTreeNode* bone = skeletalParam->getFirstChild(); bone; bone = skeletalParam->getNextChild() ) | 1020 | for( LLXmlTreeNode* bone = skeletalParam->getFirstChild(); bone; bone = skeletalParam->getNextChild() ) |
995 | { | 1021 | { |
996 | if (bone->hasName("bone")) | 1022 | if (bone->hasName("bone")) |