- Timestamp:
- 02/19/07 09:16:59 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoMeshSaver.cpp
r1526 r2127 1 /*======================================================================== ==1 /*======================================================================== 2 2 * (C) 2005 Universitat Jaume I 3 *======================================================================== ==3 *======================================================================== 4 4 * PROYECT: GAME TOOLS 5 *======================================================================= ===*/5 *=======================================================================*/ 6 6 /* CONTENT: 7 7 * 8 8 * 9 9 * @file GeoMeshSaver.cpp 10 *======================================================================= ===*/10 *=======================================================================*/ 11 11 #include <GeoMeshSaver.h> 12 12 … … 14 14 using namespace std; 15 15 16 //------------------------------------------------------------------------- --16 //------------------------------------------------------------------------- 17 17 // Public: 18 //------------------------------------------------------------------------- --19 20 //------------------------------------------------------------------------- --18 //------------------------------------------------------------------------- 19 20 //------------------------------------------------------------------------- 21 21 // Constructors. 22 //------------------------------------------------------------------------- --22 //------------------------------------------------------------------------- 23 23 GeoMeshSaver::GeoMeshSaver() 24 24 { … … 29 29 } 30 30 31 //------------------------------------------------------------------------- --32 // Destr oyer.33 //------------------------------------------------------------------------- --31 //------------------------------------------------------------------------- 32 // Destructor. 33 //------------------------------------------------------------------------- 34 34 GeoMeshSaver::~GeoMeshSaver() 35 35 { … … 37 37 } 38 38 39 //------------------------------------------------------------------------- --39 //------------------------------------------------------------------------- 40 40 // Saves a Mesh into a file. 41 //------------------------------------------------------------------------- --41 //------------------------------------------------------------------------- 42 42 size_t GeoMeshSaver::save(Mesh *geoMesh, const char *fileNameMesh) 43 43 { … … 147 147 } 148 148 149 //------------------------------------------ 149 //------------------------------------------------------------------------- 150 150 // Private: 151 //------------------------------------------ 152 151 //------------------------------------------------------------------------- 152 153 //------------------------------------------------------------------------- 153 154 // Write the main mesh. 155 //------------------------------------------------------------------------- 154 156 void GeoMeshSaver::writeMesh(Mesh *geoMesh) 155 157 { … … 226 228 }// End write mesh. 227 229 230 //------------------------------------------------------------------------- 228 231 // Write a submesh. 232 //------------------------------------------------------------------------- 229 233 void GeoMeshSaver::writeSubMesh(SubMesh *geoSubMesh) 230 234 { … … 345 349 } 346 350 351 //------------------------------------------------------------------------- 347 352 // Write the submesh operation chunk and data. 353 //------------------------------------------------------------------------- 348 354 void GeoMeshSaver::writeSubMeshOperation(const SubMesh *geoSubMesh) 349 355 { … … 374 380 } 375 381 382 //------------------------------------------------------------------------- 376 383 // Write geometry. 384 //------------------------------------------------------------------------- 377 385 void GeoMeshSaver::writeGeometry(VertexBuffer *vertexBuffer) 378 386 { … … 581 589 } 582 590 591 //------------------------------------------------------------------------- 583 592 // Write Mesh Bounds. 593 //------------------------------------------------------------------------- 584 594 void GeoMeshSaver::writeMeshBounds(Mesh *geoMesh) 585 595 { … … 605 615 } 606 616 617 //------------------------------------------------------------------------- 607 618 // Calculate the mesh size in bytes. 619 //------------------------------------------------------------------------- 608 620 size_t GeoMeshSaver::calcMeshSize(const Mesh *geoMesh) 609 621 { … … 650 662 } 651 663 664 //------------------------------------------------------------------------- 652 665 // Calc the size in bytes for the submesh. 666 //------------------------------------------------------------------------- 653 667 size_t GeoMeshSaver::calcSubMeshSize(const SubMesh *geoSubMesh) 654 668 { … … 677 691 } 678 692 693 //------------------------------------------------------------------------- 679 694 // Calculate the geometry size in bytes. 695 //------------------------------------------------------------------------- 680 696 size_t GeoMeshSaver::calcGeometrySize(const VertexBuffer* vertexBuffer) 681 697 { … … 709 725 } 710 726 727 //------------------------------------------------------------------------- 711 728 // Calculate the skeleton link size in bytes. 729 //------------------------------------------------------------------------- 712 730 size_t GeoMeshSaver::calcSkeletonLinkSize(const Mesh *geoMesh) 713 731 { … … 723 741 } 724 742 743 //------------------------------------------------------------------------- 725 744 // Write the file header. 745 //------------------------------------------------------------------------- 726 746 void GeoMeshSaver::writeFileHeader(void) 727 747 { … … 734 754 } 735 755 756 //------------------------------------------------------------------------- 736 757 // Write a header chunk given. 758 //------------------------------------------------------------------------- 737 759 void GeoMeshSaver::writeChunkHeader(unsigned short id, 738 760 unsigned long size) … … 742 764 } 743 765 766 //------------------------------------------------------------------------- 744 767 // Write integers into the file. 768 //------------------------------------------------------------------------- 745 769 void GeoMeshSaver::writeInts(unsigned long id, 746 770 unsigned long count) … … 749 773 } 750 774 775 //------------------------------------------------------------------------- 751 776 // Write shorts into the file 777 //------------------------------------------------------------------------- 752 778 void GeoMeshSaver::writeShorts(unsigned short id, 753 779 unsigned long count) … … 756 782 } 757 783 784 //------------------------------------------------------------------------- 758 785 // Write float into the file. 786 //------------------------------------------------------------------------- 759 787 void GeoMeshSaver::writeFloats(float id, 760 788 unsigned long count) … … 763 791 } 764 792 793 //------------------------------------------------------------------------- 765 794 // Write a string into the file. 795 //------------------------------------------------------------------------- 766 796 void GeoMeshSaver::writeString(const String &string) 767 797 { … … 769 799 } 770 800 801 //------------------------------------------------------------------------- 771 802 // Write booleans into the file. 803 //------------------------------------------------------------------------- 772 804 void GeoMeshSaver::writeBools( const bool id, 773 805 unsigned long count) … … 776 808 } 777 809 810 //------------------------------------------------------------------------- 811 // Write skeleton filename. 812 //------------------------------------------------------------------------- 778 813 void GeoMeshSaver::writeSkeletonLink(const String& skelName) 779 814 { … … 788 823 } 789 824 825 //------------------------------------------------------------------------- 826 // Write bones assignmets. 827 //------------------------------------------------------------------------- 790 828 void GeoMeshSaver::writeMeshBoneAssignment(const VertexBoneAssignment& assign) 791 829 { … … 802 840 } 803 841 842 //------------------------------------------------------------------------- 843 // Write bones assignmets. 844 //------------------------------------------------------------------------- 804 845 void GeoMeshSaver::writeSubMeshBoneAssignment(const VertexBoneAssignment& assign) 805 846 { … … 816 857 } 817 858 859 //------------------------------------------------------------------------- 818 860 // unnormalize geometry model. 861 //------------------------------------------------------------------------- 819 862 void GeoMeshSaver::unnormalizeModel(Mesh *geoMesh) 820 863 { … … 859 902 continue; 860 903 } 861 904 862 905 // For each index of the strip. 863 906 for (size_t i = 0; i < vertex_buffer->mVertexCount; i++)
Note: See TracChangeset
for help on using the changeset viewer.