Changeset 10314 in orxonox.OLD for trunk/src/lib/graphics/importer/bsp
- Timestamp:
- Jan 24, 2007, 12:45:39 AM (18 years ago)
- Location:
- trunk/src/lib/graphics/importer/bsp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/importer/bsp/bsp_file.cc
r10033 r10314 430 430 char fileName [500]; 431 431 char ext [500]; 432 struct stat results;433 432 434 433 … … 660 659 int errorCode = 0; //!< the error code for the texture loading functions 661 660 unsigned int lightMap; //!< the OpenGL texture handle 662 int mipmapLevel = 0; //!< the maximum mipmap level for this texture663 int mipmapWidth = 0; //!< the width of the mipmap664 int mipmapHight = 0; //!< the height of the mipmap3661 //int mipmapLevel = 0; //!< the maximum mipmap level for this texture 662 //int mipmapWidth = 0; //!< the width of the mipmap 663 //int mipmapHight = 0; //!< the height of the mipmap3 665 664 float sc, scale, temp; 666 665 for(int i = 0; i < 128*128*3 ; i++) … … 1101 1100 { 1102 1101 int sto = array[0]; 1103 array[0] = scale * array[1] ;1104 array[1] = scale * array[2];1105 array[2] = scale * sto ;1102 array[0] = (int) scale * array[1] ; 1103 array[1] = (int) scale * array[2]; 1104 array[2] = (int) scale * sto ; 1106 1105 } 1107 1106 -
trunk/src/lib/graphics/importer/bsp/bsp_manager.cc
r10076 r10314 298 298 }//else 299 299 300 301 // now sort the transparent faces in the right order 302 int size = this->trasparent.size(); 303 304 // bubble sort 305 bool hasSwapped = true; 306 Vector v1, v2; 307 308 while( hasSwapped) 309 { 310 hasSwapped = false; 311 312 for( int i = 0; i < size - 1; i++) 313 { 314 // sorting test 315 face& fac1 = (this->bspFile->faces)[this->trasparent[i]]; 316 face& fac2 = (this->bspFile->faces)[this->trasparent[i+1]]; 317 318 // get center of face 1 319 const BspVertex* curVertex = (BspVertex *) this->bspFile->vertice; 320 321 // assign the values of the vertices 322 v1(curVertex[fac1.vertex].position[0], curVertex[fac1.vertex].position[1], curVertex[fac1.vertex].position[2]); 323 v2(curVertex[fac2.vertex].position[0], curVertex[fac2.vertex].position[1], curVertex[fac2.vertex].position[2]); 324 // relativly to observer 325 v1 = this->cam - v1; 326 v2 = this->cam - v2; 327 328 // swap if necessary 329 if( v1 > v2) 330 { 331 // swap elements 332 int tmp = this->trasparent[i+1]; 333 this->trasparent[i+1] = this->trasparent[i]; 334 this->trasparent[i] = tmp; 335 336 hasSwapped = true; 337 } 338 } 339 } 340 341 342 343 // draw all solid faces 300 344 while(!this->opal.empty()) { 301 this->draw_face(this->opal.front()); 302 this->opal.pop_front(); 303 } 345 this->draw_face(this->opal.back()); // front() 346 this->opal.pop_back(); // pop_back() 347 } 348 349 // draw all transparent faces 304 350 while(!this->trasparent.empty()) { 305 351 this->draw_face(this->trasparent.back()); -
trunk/src/lib/graphics/importer/bsp/bsp_manager.h
r10033 r10314 128 128 bool * alreadyVisible; 129 129 // Deques to store the visible faces 130 ::std:: deque<int> trasparent; //!< the ones with transparancy go here131 ::std:: deque<int> opal; //!< the others here.130 ::std::vector<int> trasparent; //!< the ones with transparancy go here 131 ::std::vector<int> opal; //!< the others here. 132 132 133 133 Vector out; //!< Stores collision coordinates
Note: See TracChangeset
for help on using the changeset viewer.