| 658 | //----------------------------------------------------------------------------- |
| 659 | |
| 660 | S32 TSShape::addObject(const String& objName, S32 subShapeIndex) |
| 661 | { |
| 662 | S32 objIndex = subShapeNumObjects[subShapeIndex]; |
| 663 | |
| 664 | // Add object to subshape |
| 665 | subShapeNumObjects[subShapeIndex]++; |
| 666 | for (S32 i = subShapeIndex + 1; i < subShapeFirstObject.size(); i++) |
| 667 | subShapeFirstObject[i]++; |
| 668 | |
| 669 | TSShape::Object obj; |
| 670 | obj.nameIndex = addName(objName); |
| 671 | obj.nodeIndex = 0; |
| 672 | obj.numMeshes = 0; |
| 673 | obj.startMeshIndex = (objIndex == 0) ? 0 : objects[objIndex-1].startMeshIndex + objects[objIndex-1].numMeshes; |
| 674 | obj.firstDecal = 0; |
| 675 | obj.nextSibling = 0; |
| 676 | objects.insert(objIndex, obj); |
| 677 | |
| 678 | // Add default object state |
| 679 | TSShape::ObjectState state; |
| 680 | state.frameIndex = 0; |
| 681 | state.matFrameIndex = 0; |
| 682 | state.vis = 1.0f; |
| 683 | objectStates.insert(objIndex, state); |
| 684 | |
| 685 | // Fixup sequences |
| 686 | for (S32 i = 0; i < sequences.size(); i++) |
| 687 | sequences[i].baseObjectState++; |
| 688 | |
| 689 | return objIndex; |
| 690 | } |
| 691 | |
| 692 | void TSShape::addMeshToObject(S32 objIndex, S32 meshIndex, TSMesh* mesh) |
| 693 | { |
no test coverage detected