Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2006, 4:42:01 PM (19 years ago)
Author:
bottac
Message:

Loadable from .oxw

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/lib/graphics/importer/bsp_file.cc

    r8030 r8081  
    1111   ### File Specific:
    1212   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/
    1318*/
    1419
     
    4348int BspFile::read(const char* name)
    4449{
    45   this->scale = 0.4;
     50  //this->scale = 0.4;
    4651  int offset;
    4752  int size;
     
    592597  int      mipmapLevel = 0;         //!< the maximum mipmap level for this texture
    593598  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
    596600  float sc, scale, temp;
    597601  for(int i = 0; i < 128*128*3 ; i++)
     
    599603  sc =  ((unsigned char *)(&lightMapTexture))[i];
    600604  sc *= 1/255.0;
    601   scale = 1.4;
     605  scale = 2.0;
    602606  if(sc > 1.0f && (temp = (1.0f/sc)) < scale) scale=temp;
    603607  scale*=255.0;
     
    606610    ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc + 75;
    607611  else
    608     ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc;
     612    ((unsigned char *)(&lightMapTexture))[i] = (unsigned char)sc ;
    609613  }
    610614 
     
    982986}
    983987
     988//!TODO: This is a good place to do LittleEndian to BigEndian conversion!
    984989void BspFile::swapAllBspCoordinates()
    985990{
     
    10151020  }
    10161021 
    1017    
    1018  
    1019 
    1020  
    10211022}
    10221023
    10231024void BspFile::swapCoords(int *array)
    10241025{
     1026  if( scale < 1)
     1027  {
    10251028  int sto  =  array[0];
    10261029  array[0] =  array[1] / (int) ( 1/ scale);
    10271030  array[1] = array[2] / (int) (1/scale);
    10281031  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  }
    10291040 
    10301041}
Note: See TracChangeset for help on using the changeset viewer.