Changeset 1090 for GTP/trunk/Lib/Geom/shared/GTGeometry/src
- Timestamp:
- 07/06/06 20:20:06 (18 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GTGeometry/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsConstructor.cpp
r1078 r1090 3 3 #include <time.h> 4 4 #include "GeoLodStripsConstructor.h" 5 #include "GeoMeshLoader.h" 5 6 6 7 using namespace Geometry; … … 619 620 int dataCount = this->cDatos.size(); 620 621 int cambiosCount = this->TOTALCAMBIOS; 621 int size= dataCount*sizeof(LODData) + (vertexCount + changesCount + cambiosCount + 4)*sizeof(int); 622 int size = changesCount*sizeof(LODData) + 623 (vertexCount + dataCount + cambiosCount + 4)*sizeof(int) + 624 CHUNK_OVERHEAD_SIZE; 622 625 623 626 FILE *f = fopen(filename.c_str(),"ab"); -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodStripsLibrary.cpp
r1088 r1090 34 34 indices_x_submesh = NULL; 35 35 offsets_x_submesh = NULL; 36 mStripsSubmesh = NULL; 36 37 37 38 // Loads the Level Of Detail file. … … 61 62 if (offsets_x_submesh) 62 63 delete[] offsets_x_submesh; 64 if (mStripsSubmesh) 65 delete[] mStripsSubmesh; 63 66 } 64 67 … … 573 576 mData = lodstripsdata->mData; 574 577 p_changes = lodstripsdata->p_changes; 575 576 577 // Max / Min values for LOD. 578 mLods = int(p_changes.size()); 579 mMaxLod = 0; 580 mMinLod = mLods; 581 582 mPChanges = new SmallInt[mLods]; 583 584 for (unsigned int i = 0; i < mLods; i++) 585 { 586 mPChanges[i] = p_changes[i]; 587 } 588 589 mTotalVertices = int(mFileVertices.size()); 590 mMaxVerticesLOD = mTotalVertices; 591 mTotalStrips = int(mFileStrips.size()); 592 mTotalChanges = int(mFileChangesLOD.size()); 593 594 //Copy the data to the structure we will use 595 CopyVectors2Arrays(); 578 579 mStripsSubmesh = new int [geomesh->mSubMeshCount]; 580 for (int submesh = 0; submesh < geomesh->mSubMeshCount; submesh++) 581 { 582 mStripsSubmesh[submesh]=0; 583 } 584 585 586 // Max / Min values for LOD. 587 mLods = int(p_changes.size()); 588 mMaxLod = 0; 589 mMinLod = mLods; 590 591 mPChanges = new SmallInt[mLods]; 592 593 for (unsigned int i = 0; i < mLods; i++) 594 { 595 mPChanges[i] = p_changes[i]; 596 } 597 598 mTotalVertices = int(mFileVertices.size()); 599 mMaxVerticesLOD = mTotalVertices; 600 mTotalStrips = int(mFileStrips.size()); 601 mTotalChanges = int(mFileChangesLOD.size()); 602 603 //Copy the data to the structure we will use 604 CopyVectors2Arrays(); 596 605 // } 597 606 } … … 618 627 619 628 counter = 0; 629 mStripsSubmesh[target_submesh] = strip_count; 620 630 strip_count = 0; 621 631 target_submesh++; … … 655 665 656 666 counter = 0; 667 mStripsSubmesh[target_submesh] = strip_count; 657 668 strip_count = 0; 658 669 target_submesh++; -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoLodTreeLibrary.cpp
r1083 r1090 7 7 Geometry::LodTreeLibrary::LodTreeLibrary(const LodStripsLibraryData *lodstripsdata, 8 8 const TreeSimplificationSequence *simpseq, 9 Geometry::Mesh *treeGeoMesh ,10 uint32 leafSubMeshID /*9 Geometry::Mesh *treeGeoMesh/*, 10 uint32 leafSubMeshID, 11 11 CREATEVERTEXDATAFUNC vdfun, 12 12 CREATEINDEXDATAFUNC idfun, … … 16 16 trunk = new LodStripsLibrary(lodstripsdata,treeGeoMesh); 17 17 18 // select the first triangle-list submesh as leaves submesh 19 mLeavesSubMesh = -1; 20 for (int i=0; i<treeGeoMesh->mSubMeshCount; i++) 21 { 22 if (treeGeoMesh->mSubMesh[i].mType==GEO_TRIANGLE_LIST) 23 { 24 mLeavesSubMesh=i; 25 break; 26 } 27 } 28 18 29 // Cargar la copa del árbol 19 Geometry::SubMesh * leafsSubMesh = &(treeGeoMesh->mSubMesh[ leafSubMeshID]);30 Geometry::SubMesh * leafsSubMesh = &(treeGeoMesh->mSubMesh[mLeavesSubMesh]); 20 31 foliage = new Foliage(leafsSubMesh,simpseq); 21 32 GoToFoliageLod(1.0f); -
GTP/trunk/Lib/Geom/shared/GTGeometry/src/GeoTreeSimpSequence.cpp
r1078 r1090 2 2 #include <iostream> 3 3 #include <fstream> 4 #include "GeoMeshLoader.h" 4 5 5 6 using namespace Geometry; … … 68 69 unsigned short chunkid = 0xdcba; 69 70 s.WriteData(&chunkid,sizeof(unsigned short),1); 70 unsigned long size = mSteps.size()*8*sizeof(int) ;71 unsigned long size = mSteps.size()*8*sizeof(int) + CHUNK_OVERHEAD_SIZE; 71 72 s.WriteData(&size,sizeof(unsigned long),1); 72 73
Note: See TracChangeset
for help on using the changeset viewer.