Diffstat (limited to 'noncore/games/sfcave-sdl/terrain.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/games/sfcave-sdl/terrain.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/noncore/games/sfcave-sdl/terrain.cpp b/noncore/games/sfcave-sdl/terrain.cpp index c001a56..b243f45 100644 --- a/noncore/games/sfcave-sdl/terrain.cpp +++ b/noncore/games/sfcave-sdl/terrain.cpp @@ -49,2 +49,3 @@ void Terrain :: initTerrain() SDL_FillRect( terrainSurface, 0, 0 ); + // Draw Terrain into surface @@ -93,3 +94,2 @@ void Terrain :: moveTerrain( int amountToMove ) -// printf( "offset - %d, speed - %d\n", offset, speed ); if ( offset >= segSize ) @@ -197,3 +197,2 @@ void Terrain :: drawTerrain( SDL_Surface *screen ) dst.h = sHeight; -// dst.h = maxHeight; @@ -206,18 +205,2 @@ void Terrain :: drawTerrain( SDL_Surface *screen ) stars->draw( screen ); - -// dst.y = sHeight - maxHeight; -// dst2.y = sHeight - maxHeight; -// SDL_BlitSurface(terrainSurface, &dst, screen, &dst2 ); - -/* - for ( int i = 0 ; i < MAPSIZE ; ++i ) - { - int x1 = (i*segSize) - (offset*speed); - int x2 = ((i+1)*segSize)-(offset*speed); - if ( x2 >= sWidth ) - x2 = sWidth-1; - aalineRGBA( screen, x1, mapTop[i], x2, mapTop[i+1], 0, 220, 0, 255 ); - aalineRGBA( screen, x1, mapBottom[i], x2, mapBottom[i+1], 0, 220, 0, 255 ); - } -*/ } @@ -228,2 +211,3 @@ bool Terrain :: checkCollision( int x, int y, int h ) return true; + // First get segment that matches x @@ -249,3 +233,3 @@ void go() { - /* Initialize SDL */ + // Initialize SDL if ( SDL_Init(SDL_INIT_VIDEO) < 0 ) |