Changeset 8904 in orxonox.OLD for branches/single_player_map/src/lib/graphics
- Timestamp:
- Jun 29, 2006, 1:40:35 PM (19 years ago)
- Location:
- branches/single_player_map/src/lib/graphics/importer
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/single_player_map/src/lib/graphics/importer/bsp_file.cc
r8894 r8904 46 46 BspFile::BspFile() 47 47 {} 48 49 BspFile::~ BspFile() 50 { 51 delete [] nodes; 52 delete [] leaves; 53 delete [] planes; 54 delete [] bspModels; 55 delete [] leafFaces; 56 delete [] faces; 57 delete [] leafBrushes; 58 delete [] brushes; 59 delete [] brushSides; 60 delete [] vertice; 61 delete [] meshverts; 62 delete [] visData; 63 delete [] textures; 64 delete [] patchVertice; 65 delete [] patchIndexes; 66 // delete [] patchTrianglesPerRow; 67 delete [] lightMaps; 68 69 for(int i = 0; i < this->numPatches; ++i) delete this->VertexArrayModels[i]; 70 // delete [] VertexArrayModels; 71 72 for(int i = 0; i < this->numTextures; ++i) 73 { 74 delete this->Materials[i].mat; 75 //delete this->Materials[i].aviMat; 76 } 77 delete [] this->Materials; 78 //delete [] testSurf; 79 80 81 82 } 48 83 49 84 /** … … 294 329 this->patchVertice = new char[8*8*44*(this->numPatches+10)]; 295 330 this->patchIndexes = new char[7*8*2*4*(this->numPatches+10)]; 296 this->patchRowIndexes = new int*[7*4*this->numPatches];331 // this->patchRowIndexes = new int*[7*4*this->numPatches]; Not needed? 297 332 this->patchTrianglesPerRow = new char[7*4*this->numPatches]; 298 333 this->VertexArrayModels = new VertexArrayModel*[this->numPatches]; … … 464 499 465 500 if(File(absFileName).exists()) { 466 PRINTF( 0)("BSP FILE: gefunden . \n");501 PRINTF(4)("BSP FILE: gefunden . \n"); 467 502 this->Materials[i] = this->loadAVI(fileName); 468 503 continue; … … 553 588 } 554 589 555 PRINTF(0)("BSP FILE: Textur %s nicht gefunden . \n", &this->textures[8+72*i]);590 PRINTF(0)("BSP FILE: Texture %s not found.",&this->textures[8+ 72*i] ); 556 591 // Default Material 557 592 this->Materials[i].mat = new Material(); … … 1012 1047 Face->meshvert = patchOffset -sz; //3*(patchOffset-sz)*level1*level1; 1013 1048 Face->n_meshverts = sz; 1014 PRINTF( 4)("BSP FILE: sz: %i. \n", sz);1015 PRINTF( 4)("BSP FILE: Face->meshvert %i . \n", Face->meshvert);1049 PRINTF(0)("BSP FILE: sz: %i. \n", sz); 1050 PRINTF(0)("BSP FILE: Face->meshvert %i . \n", Face->meshvert); 1016 1051 1017 1052 //Face->n_meshverts = sz; -
branches/single_player_map/src/lib/graphics/importer/bsp_file.h
r8490 r8904 151 151 public: 152 152 BspFile(); 153 ~BspFile(); 153 154 int read(const char* name ); 154 155 void build_tree(); … … 183 184 184 185 int** patchRowIndexes; 185 VertexArrayModel** VertexArrayModels; 186 VertexArrayModel** VertexArrayModels; 186 187 int patchOffset; 187 188 -
branches/single_player_map/src/lib/graphics/importer/bsp_manager.cc
r8894 r8904 77 77 } */ 78 78 79 void BspManager::load(const char* fileName, float scale) 79 BspManager::~BspManager() 80 { 81 if(this->bspFile) 82 delete this->bspFile; 83 } 84 85 int BspManager::load(const char* fileName, float scale) 80 86 { 81 87 // open a BSP file 88 89 82 90 this->bspFile = new BspFile(); 83 91 this->bspFile->scale = scale; 84 this->bspFile->read(ResourceManager::getFullName(fileName).c_str()); 92 if(this->bspFile->read(ResourceManager::getFullName(fileName).c_str()) == -1) 93 return -1; 85 94 this->bspFile->build_tree(); 86 95 this->root = this->bspFile->get_root(); … … 88 97 89 98 this->outputFraction = 1.0f; 99 100 return 0; 90 101 } 91 102 /* -
branches/single_player_map/src/lib/graphics/importer/bsp_manager.h
r8724 r8904 41 41 class WorldEntity; 42 42 43 44 // Obsolete 43 45 struct BspCollisionEvent 44 46 { … … 54 56 55 57 BspManager(const char* fileName, float scale = 0.4f); 56 void load(const char* fileName, float scale); 58 59 // Deconstructor 60 ~BspManager(); 61 62 57 63 58 64 // Functions 65 int load(const char* fileName, float scale); 59 66 const void draw(); 60 67 const void tick(float time);
Note: See TracChangeset
for help on using the changeset viewer.