- Timestamp:
- 04/30/07 08:16:31 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshSaver.cpp
r2127 r2341 181 181 if (geoMesh->hasSkeleton) 182 182 { 183 strcat(geoMesh->mSkeletonName,"\n"); 184 183 185 // Write skeleton link 184 186 writeSkeletonLink(geoMesh->mSkeletonName); … … 199 201 writeMeshBounds(geoMesh); 200 202 203 // Write submesh name table. 204 writeSubMeshNameTable(geoMesh); 205 201 206 /* 202 207 // Write LOD data if any … … 212 217 writeBoundsInfo(pMesh); 213 218 LogManager::getSingleton().logMessage("Bounds information exported."); 214 215 // Write submesh name table216 LogManager::getSingleton().logMessage("Exporting submesh name table...");217 writeSubMeshNameTable(pMesh);218 LogManager::getSingleton().logMessage("Submesh name table exported.");219 219 220 220 // Write edge lists … … 414 414 415 415 // Write the vertex declaration header. 416 writeChunkHeader( 416 writeChunkHeader(M_GEOMETRY_VERTEX_DECLARATION,size); 417 417 418 418 // Debug. … … 425 425 // Positions. 426 426 // Write the vertex element header for position. 427 writeChunkHeader( 427 writeChunkHeader(M_GEOMETRY_VERTEX_ELEMENT,size); 428 428 429 429 // Debug. … … 448 448 // Normals. 449 449 // Write the vertex element header for position. 450 writeChunkHeader( 450 writeChunkHeader(M_GEOMETRY_VERTEX_ELEMENT,size); 451 451 452 452 // Debug. … … 528 528 529 529 // Write the vertex buffer header. 530 writeChunkHeader( 530 writeChunkHeader(M_GEOMETRY_VERTEX_BUFFER, size); 531 531 532 532 // Debug. … … 613 613 writeFloats(geoMesh->mMeshBounds.maxZ,1); 614 614 writeFloats(geoMesh->mMeshBounds.radius,1); 615 } 616 617 //------------------------------------------------------------------------- 618 // Write submesh name table. 619 //------------------------------------------------------------------------- 620 void GeoMeshSaver::writeSubMeshNameTable(Mesh *geoMesh) 621 { 622 size_t size; 623 size_t names_size; 624 625 // Size of the names of the submeshes. 626 names_size = 0; 627 628 // For each submesh. 629 for (size_t i = 0; i < geoMesh->mSubMeshCount; i++) 630 { 631 names_size = strlen(geoMesh->mSubMesh[i].mName); 632 } 633 634 size = CHUNK_OVERHEAD_SIZE 635 + 636 names_size 637 + 638 (CHUNK_OVERHEAD_SIZE + sizeof(short)) * geoMesh->mSubMeshCount; 639 640 writeChunkHeader(M_SUBMESH_NAME_TABLE, (unsigned long)size); 641 642 // For each submesh. 643 for (size_t i = 0; i < geoMesh->mSubMeshCount; i++) 644 { 645 size = CHUNK_OVERHEAD_SIZE 646 + 647 sizeof(short) 648 + 649 strlen(geoMesh->mSubMesh[i].mName); 650 651 writeChunkHeader(M_SUBMESH_NAME_TABLE_ELEMENT, (unsigned long)size); 652 653 writeShorts(i, 1); 654 655 strcat(geoMesh->mSubMesh[i].mName,"\n"); 656 mSerializer->WriteData(geoMesh->mSubMesh[i].mName); 657 } 615 658 } 616 659 … … 751 794 752 795 writeString(mesh_version); 753 754 796 } 755 797
Note: See TracChangeset
for help on using the changeset viewer.