Changeset 7596 in orxonox.OLD for branches/bsp_model/src
- Timestamp:
- May 11, 2006, 3:07:39 PM (19 years ago)
- Location:
- branches/bsp_model/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
r7579 r7596 40 40 * @param name the Name of the *.bsp file 41 41 */ 42 int BspFile::read(c har* name)42 int BspFile::read(const char* name) 43 43 { 44 44 int offset; 45 45 int size; 46 46 struct stat results; 47 name = "/root/data/Kanti175.bsp";47 // name = "/root/data/Kanti175.bsp"; 48 48 49 49 if (stat( name , &results) == 0) { -
branches/bsp_model/src/lib/graphics/importer/bsp_file.h
r7563 r7596 142 142 public: 143 143 BspFile(); 144 int read( char* name );144 int read(const char* name ); 145 145 void build_tree(); 146 146 void load_textures(); -
branches/bsp_model/src/lib/graphics/importer/bsp_manager.cc
r7592 r7596 26 26 #include "world_entities/player.h" 27 27 #include "world_entities/playable.h" 28 #include "util/loading/resource_manager.h" 28 29 // STL Containers 29 30 #include <vector> … … 33 34 34 35 36 35 37 BspManager::BspManager() 36 38 { 37 39 // open a BSP file 38 40 this->bspFile = new BspFile(); 39 this->bspFile->read( "/root/data/Kanti175.bsp");41 this->bspFile->read(ResourceManager::getFullName("test.bsp").c_str()); 40 42 this->bspFile->build_tree(); 41 43 this->root = this->bspFile->get_root(); … … 95 97 if(this->outputFraction != 1.0f || this->outputAllSolid ) this->drawDebugCube(&this->cam); 96 98 97 if (false || viscluster < 0 ) // || (((int *)(this->bspFile->header))[35] == 0 ) || viscluster < 0) //!< if (sizeof(Visdata) == 0)99 if (false || viscluster < 0 || ((int *)(this->bspFile->header))[35] == 0 ) //!< if (sizeof(Visdata) == 0) 98 100 { 99 101 … … 121 123 dMaxs = dir.x*(float)curLeaf.maxs[0] +dir.y*(float)curLeaf.maxs[1] +dir.z*(float)curLeaf.maxs[2] ; 122 124 123 if(dMins < 0.0 && dMaxs <0.0)125 if(dMins < -100.0 && dMaxs < -100.0) 124 126 { 125 //continue;127 continue; 126 128 } 127 129 … … 129 131 // Iterate through all faces 130 132 for (int j = 0; j < curLeaf.n_leaffaces ; ++j) { 131 const int f = ( j + ((leaf *) (this->bspFile->leaves))[i].leafface) % this->bspFile->numFaces; 133 const int g = (j + curLeaf.leafface); 134 const int f = ((int *)this->bspFile->leafFaces)[g]; 132 135 if (f >=0 && !this->isAlreadyVisible(f)) { 133 136 this->alreadyVisible[f] = true; … … 141 144 142 145 } //for 143 } else { 146 } 147 else { 144 148 145 149
Note: See TracChangeset
for help on using the changeset viewer.