Changeset 1024 for GTP/trunk/Lib/Geom/shared/GeoTool/src
- Timestamp:
- 06/20/06 13:02:00 (19 years ago)
- Location:
- GTP/trunk/Lib/Geom/shared/GeoTool/src
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshLoader.cpp
r989 r1024 427 427 // Gets material name. 428 428 fgets(materialName,255,f); 429 materialName[strlen(materialName) - 1] = '\0'; 429 430 430 431 fread(&useSharedVertices,sizeof(bool),1,f); -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshSaver.cpp
r1017 r1024 215 215 216 216 // Material Name. 217 strcat(geoSubMesh->mMaterialName,"\n"); 217 218 mSerializer->WriteData(geoSubMesh->mMaterialName); 218 219 -
GTP/trunk/Lib/Geom/shared/GeoTool/src/GeoMeshViewUI.cpp
r1017 r1024 25 25 geoMeshView->deactiveLodTree(); 26 26 27 geoMeshView->resetTextures();28 27 BuildLoadTextureSubMeshMenu(); 29 28 … … 1003 1002 } 1004 1003 1005 VertexBuffer *origSubMeshVB=NULL;1006 int orig_numindices=0;1007 Index *orig_indices=NULL;1008 1009 1004 //--------------------------------------------------------------------------- 1010 1005 // Button Process Callback … … 1018 1013 progressBarType = PROCESS; 1019 1014 mProcessBar->position(0); 1020 1021 origSubMeshVB=NULL;1022 1015 1023 1016 // Initialize error flag. … … 1086 1079 else 1087 1080 { 1088 origSubMeshVB=mGeoMesh->mSubMesh[idMeshLeaves].mVertexBuffer->Clone();1089 orig_numindices=mGeoMesh->mSubMesh[idMeshLeaves].mIndexCount;1090 orig_indices=new Index[orig_numindices];1091 for (int i=0; i<orig_numindices; i++)1092 orig_indices[i]=mGeoMesh->mSubMesh[idMeshLeaves].mIndex[i];1093 1094 1081 std::cout << "Simplificando hojas..."; 1095 1082 simplifyLeavesCollapse(); … … 1336 1323 file_name[strlen(file_name) - 4] = '\0'; 1337 1324 1338 mesh_saver->leavesSubMesh=idMeshLeaves;1339 mesh_saver->leavesVB=origSubMeshVB;1340 mesh_saver->numindices=orig_numindices;1341 mesh_saver->indices=orig_indices;1342 1325 mesh_saver->save( mGeoMesh, 1343 1326 strcat(file_name,".mesh")); … … 2502 2485 // Visualize mesh. 2503 2486 geoMeshView->setMesh(mGeoMesh); 2487 2488 // Set textures. 2489 geoMeshView->resetTextures(); 2490 setTextures(); 2504 2491 2505 2492 // Hide right panel. … … 2544 2531 // Free memory. 2545 2532 delete fcho; 2533 } 2534 2535 // Set textures to mesh model. 2536 void GeoMeshViewUI::setTextures() 2537 { 2538 GeoMaterialLoader *loader; 2539 string filename; 2540 string material; 2541 2542 loader = new GeoMaterialLoader(); 2543 2544 // For each submesh. 2545 for (int submesh = 0; submesh < mGeoMesh->mSubMeshCount; submesh++) 2546 { 2547 material = string(mGeoMesh->mSubMesh[submesh].mMaterialName); 2548 2549 if (loader->existsMaterial(material)) 2550 { 2551 // Debug. 2552 cout << "Material " 2553 << material 2554 << " found." 2555 << endl; 2556 2557 filename = loader->getTextureFileName(material); 2558 2559 // Debug. 2560 cout << "File: " 2561 << filename.c_str() 2562 << endl; 2563 2564 geoMeshView->LoadTextureSubMesh(submesh, filename.c_str()); 2565 } 2566 } 2546 2567 } 2547 2568
Note: See TracChangeset
for help on using the changeset viewer.