Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8748 in orxonox.OLD for branches/terrain/src/lib/graphics/importer


Ignore:
Timestamp:
Jun 23, 2006, 5:07:04 PM (18 years ago)
Author:
ponder
Message:

Small changes to help debug

Location:
branches/terrain/src/lib/graphics/importer/terrain
Files:
3 edited

Legend:

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

    r8745 r8748  
    2626        heightfield.pitch = tmpData->pitch;
    2727        int dataSize = heightfield.pitch*heightfield.height;
    28         heightfield.data = new UByte[dataSize];
    29         memcpy( heightfield.data, tmpData->pixels, sizeof(UByte)*dataSize );
     28        heightfield.data = new Uint8[dataSize];
     29        memcpy( heightfield.data, tmpData->pixels, sizeof(Uint8)*dataSize );
    3030        SDL_FreeSurface( tmpData );
    3131        //TODO: Perform some checks... size, bits and so on
     
    323323inline Uint8 getAlpha( const SDL_Surface *_s, int _x, int _y )
    324324{
    325         printf( "getalpha: %d, %d\n", _x, _y );
    326325    int bpp = _s->format->BytesPerPixel;
    327326    Uint8 *p = (Uint8 *)_s->pixels + _y*_s->pitch + _x * bpp;
  • branches/terrain/src/lib/graphics/importer/terrain/terrain.h

    r8747 r8748  
    165165                 * Creates the quad tree structure for fast culling of the terrain pages.
    166166                 */             
    167                 pTerrainQuad createQuadTree( int _x0, int _z0, int _x1, int _z1, int _depth = 0 );
     167                pTerrainQuad createQuadTree( int _x0, int _z0,
     168                        int _x1, int _z1, int _depth = 0 );
    168169               
    169170                /**
     
    206207inline float Terrain::getAltitude( int _x, int _z ) const
    207208{
    208         if ( _x < 0 || _x > heightfield.width || _z < 0 || _z > heightfield.height )
     209        if ( _x < 0 || _x >= heightfield.width || _z < 0 || _z >= heightfield.height ) {
    209210                return 0.0f;
     211                printf( "outside!\n" );
     212        }       
    210213        return heightfield.data[heightfield.pitch*_z+_x]/255.0f;       
    211214}
  • branches/terrain/src/lib/graphics/importer/terrain/terrain_page.cc

    r8745 r8748  
    783783                        hasfull = true;
    784784        }       
    785         printf( "setting layer %d vis to %d\n", _lv ); 
    786785        layerVisibility[_layer] = _lv; 
    787786}
Note: See TracChangeset for help on using the changeset viewer.