Changeset 8081 in orxonox.OLD for branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
- Timestamp:
- Jun 1, 2006, 4:42:01 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/bsp_model/src/lib/graphics/importer/bsp_file.cc
r8030 r8081 11 11 ### File Specific: 12 12 main-programmer: bottac@ee.ethz.ch 13 14 Inspired by: 15 Rendering Q3 Maps by Morgan McGuire http://graphics.cs.brown.edu/games/quake/quake3.html 16 Unofficial Quake 3 Map Specs by Kekoa Proudfoot http://graphics.stanford.edu/~kekoa/q3/ 17 Quake 3 Collision Detection by Nathan Ostgard http://www.devmaster.net/articles/quake3collision/ 13 18 */ 14 19 … … 43 48 int BspFile::read(const char* name) 44 49 { 45 this->scale = 0.4;50 //this->scale = 0.4; 46 51 int offset; 47 52 int size; … … 592 597 int mipmapLevel = 0; //!< the maximum mipmap level for this texture 593 598 int mipmapWidth = 0; //!< the width of the mipmap 594 int mipmapHight = 0; //!< the height of the mipmap 595 599 int mipmapHight = 0; //!< the height of the mipmap3 596 600 float sc, scale, temp; 597 601 for(int i = 0; i < 128*128*3 ; i++) … … 599 603 sc = ((unsigned char *)(&lightMapTexture))[i]; 600 604 sc *= 1/255.0; 601 scale = 1.4;605 scale = 2.0; 602 606 if(sc > 1.0f && (temp = (1.0f/sc)) < scale) scale=temp; 603 607 scale*=255.0; … … 606 610 ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc + 75; 607 611 else 608 ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc ;612 ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc ; 609 613 } 610 614 … … 982 986 } 983 987 988 //!TODO: This is a good place to do LittleEndian to BigEndian conversion! 984 989 void BspFile::swapAllBspCoordinates() 985 990 { … … 1015 1020 } 1016 1021 1017 1018 1019 1020 1021 1022 } 1022 1023 1023 1024 void BspFile::swapCoords(int *array) 1024 1025 { 1026 if( scale < 1) 1027 { 1025 1028 int sto = array[0]; 1026 1029 array[0] = array[1] / (int) ( 1/ scale); 1027 1030 array[1] = array[2] / (int) (1/scale); 1028 1031 array[2] = sto / (int) (1/scale); 1032 } 1033 else 1034 { 1035 int sto = array[0]; 1036 array[0] = scale * array[1] ; 1037 array[1] = scale * array[2]; 1038 array[2] = scale * sto ; 1039 } 1029 1040 1030 1041 }
Note: See TracChangeset
for help on using the changeset viewer.