Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7500 in orxonox.OLD for trunk/src/lib/graphics/importer


Ignore:
Timestamp:
May 3, 2006, 10:51:16 AM (19 years ago)
Author:
patrick
Message:

orxonox: switched variable to constant

Location:
trunk/src/lib/graphics/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/height_map.cc

    r7499 r7500  
    141141                     normalVectorField[i % this->heightMapReference->heightMap->h][w % this->heightMapReference->heightMap->w].z,
    142142                     normalVectorField[i % this->heightMapReference->heightMap->h][w % this->heightMapReference->heightMap->w].x);
    143     model->addTexCoor((float)(yOffset-sampleRate) /(texRate), (float)(i %this->heightMapReference->heightMap->h)/(texRate));
     143    model->addTexCoor((float)(yOffset-sampleRate) /(HM_TEX_RATE), (float)(i %this->heightMapReference->heightMap->h)/(HM_TEX_RATE));
    144144    model->addColor(r/255.0f, g/255.0f, b/255.0f);
    145145
     
    170170                       normalVectorField[i % this->heightMapReference->heightMap->h][j % this->heightMapReference->heightMap->w].z,
    171171                       normalVectorField[i % this->heightMapReference->heightMap->h][j % this->heightMapReference->heightMap->w].x);
    172       model->addTexCoor((float)(j) /(texRate), (float)(i %this->heightMapReference->heightMap->h)/(texRate));
     172      model->addTexCoor((float)(j) /(HM_TEX_RATE), (float)(i %this->heightMapReference->heightMap->h)/(HM_TEX_RATE));
    173173      model->addColor(r/255.0f, g/255.0f, b/255.0f);
    174174      //PRINTF(0)("TexCoord:  %f %f \n",(float)j / 100.0, (float)(i %this->heightMapReference->h)/100.0);
     
    180180                     normalVectorField[i % this->heightMapReference->heightMap->h][w % this->heightMapReference->heightMap->w].z,
    181181                     normalVectorField[i% this->heightMapReference->heightMap->h][w % this->heightMapReference->heightMap->w].x);
    182     model->addTexCoor((float)(j2+sampleRate) /(texRate), (float)(i %this->heightMapReference->heightMap->h)/(texRate));
     182    model->addTexCoor((float)(j2+sampleRate) /(HM_TEX_RATE), (float)(i %this->heightMapReference->heightMap->h)/(HM_TEX_RATE));
    183183    model->addColor(r/255.0f, g/255.0f, b/255.0f);
    184184  }
     
    217217                     normalVectorField[i % this->heightMapReference->heightMap->h][j % this->heightMapReference->heightMap->w].z,
    218218                     normalVectorField[i % this->heightMapReference->heightMap->h][j % this->heightMapReference->heightMap->w].x);
    219     model->addTexCoor((float)j /(texRate), (float)((i - sampleRate) %this->heightMapReference->heightMap->h)/(texRate));
     219    model->addTexCoor((float)j /(HM_TEX_RATE), (float)((i - sampleRate) %this->heightMapReference->heightMap->h)/(HM_TEX_RATE));
    220220    model->addColor(r/255.0f, g/255.0f, b/255.0f);
    221221  }
     
    241241                     normalVectorField[i % this->heightMapReference->heightMap->h][j% this->heightMapReference->heightMap->w].z,
    242242                     normalVectorField[i%this->heightMapReference->heightMap->h][j%this->heightMapReference->heightMap->w].x);
    243     model->addTexCoor((float)j /(texRate), (float)(i %this->heightMapReference->heightMap->h)/(texRate));
     243    model->addTexCoor((float)j /(HM_TEX_RATE), (float)(i %this->heightMapReference->heightMap->h)/(HM_TEX_RATE));
    244244    model->addColor(r/255.0f, g/255.0f, b/255.0f);
    245245  }
     
    263263                     normalVectorField[i%this->heightMapReference->heightMap->h][j%this->heightMapReference->heightMap->w].z,
    264264                     normalVectorField[i%this->heightMapReference->heightMap->h][j%this->heightMapReference->heightMap->w].x);
    265     model->addTexCoor((float)j /(texRate), (float)((i+ sampleRate) %this->heightMapReference->heightMap->h)/(texRate));
     265    model->addTexCoor((float)j /(HM_TEX_RATE), (float)((i+ sampleRate) %this->heightMapReference->heightMap->h)/(HM_TEX_RATE));
    266266    model->addColor(r/255.0f, g/255.0f, b/255.0f);
    267267  }
     
    286286                     normalVectorField[i%this->heightMapReference->heightMap->h][j%this->heightMapReference->heightMap->w].z,
    287287                     normalVectorField[i%this->heightMapReference->heightMap->h][j%this->heightMapReference->heightMap->w].x);
    288     model->addTexCoor((float)j /(texRate), (float)(i %this->heightMapReference->heightMap->h)/(texRate));
     288    model->addTexCoor((float)j /(HM_TEX_RATE), (float)(i %this->heightMapReference->heightMap->h)/(HM_TEX_RATE));
    289289    model->addColor(r/255.0f, g/255.0f, b/255.0f);
    290290  }
     
    385385  delete colorMap;
    386386
    387   for(int i=0;i <    heightMap->h/tileSize ; i++)
    388   {
    389     for(int j = 0; j < heightMap->w/ tileSize; j++)
     387  for(int i=0;i <    heightMap->h/HM_TILE_SIZE ; i++)
     388  {
     389    for(int j = 0; j < heightMap->w/ HM_TILE_SIZE; j++)
    390390    {
    391391      delete tiles [i][j];
    392392    }
    393393  }
    394   for(int i=0;i <    heightMap->h/tileSize ; i++)
     394  for(int i=0;i <    heightMap->h/HM_TILE_SIZE ; i++)
    395395    delete[] tiles[i];
    396396  delete[] tiles;
     
    444444{
    445445  // create a dynamicly sized 2D-array for tiles
    446   this->tiles =  new Tile**[this->heightMap->h / this->tileSize];
    447 
    448   for( int i = 0;i < heightMap->h / tileSize; i++)
    449     this->tiles [i]= new Tile*[this->heightMap->w / this->tileSize];
     446  this->tiles =  new Tile**[this->heightMap->h / HM_TILE_SIZE];
     447
     448  for( int i = 0;i < heightMap->h / HM_TILE_SIZE; i++)
     449    this->tiles [i]= new Tile*[this->heightMap->w / HM_TILE_SIZE];
    450450
    451451  // setup arrays
    452   for( int i = 0; i < this->heightMap->h / this->tileSize; i++)  {
    453     for( int j = 0; j < this->heightMap->w / this->tileSize; j++) {
    454       this->tiles[i][j] = new Tile( i * tileSize ,  j * tileSize , (i+1) * tileSize, (j+1) * tileSize , this);
     452  for( int i = 0; i < this->heightMap->h / HM_TILE_SIZE; i++)  {
     453    for( int j = 0; j < this->heightMap->w / HM_TILE_SIZE; j++) {
     454      this->tiles[i][j] = new Tile( i * HM_TILE_SIZE ,  j * HM_TILE_SIZE , (i+1) * HM_TILE_SIZE, (j+1) * HM_TILE_SIZE , this);
    455455    }
    456456  }
     
    467467
    468468  int i_min = 0;
    469   int i_max = (heightMap->h )/ tileSize;
     469  int i_max = (heightMap->h )/ HM_TILE_SIZE;
    470470  int j_min = 0;
    471   int j_max= (heightMap->w  ) / tileSize;
     471  int j_max= (heightMap->w  ) / HM_TILE_SIZE;
    472472
    473473
  • trunk/src/lib/graphics/importer/height_map.h

    r7499 r7500  
    2020
    2121
    22 #define texRate      32
    23 #define texRatef     4.0f
    24 #define tileSize     64
     22#define HM_TEX_RATE      32
     23#define HM_TILE_SIZE     64
    2524
    2625//!< define the LOD level distances. later this could be dynamicaly adjusted
Note: See TracChangeset for help on using the changeset viewer.