[Super-tux-commit] supertux/src defines.h,1.37,1.38 leveleditor.cpp,1.116,1.117 setup.cpp,1.82,1.83
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-05-14 16:02:59
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31278/src Modified Files: defines.h leveleditor.cpp setup.cpp tile.cpp world.cpp Log Message: First try to switch to 800x600. Unfortanely, the game crashes when drawing the tiles. I committed this in the hope that somebody fixes it. :D Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- defines.h 12 May 2004 17:56:33 -0000 1.37 +++ defines.h 14 May 2004 16:02:40 -0000 1.38 @@ -48,6 +48,11 @@ DYING_FALLING = 2 }; +/* Screen-related stuff */ + +#define VISIBLE_TILES_X 25 +#define VISIBLE_TILES_Y 19 + /* Sizes: */ #define SMALL 0 Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- leveleditor.cpp 14 May 2004 14:04:48 -0000 1.116 +++ leveleditor.cpp 14 May 2004 16:02:40 -0000 1.117 @@ -952,8 +952,8 @@ /* clearscreen(current_level.bkgd_red, current_level.bkgd_green, current_level.bkgd_blue); */ - for (y = 0; y < 16 && y < (unsigned)le_world->get_level()->height; ++y) - for (x = 0; x < 20; ++x) + for (y = 0; y < VISIBLE_TILES_Y && y < (unsigned)le_world->get_level()->height; ++y) + for (x = 0; x < (unsigned)VISIBLE_TILES_X-80; ++x) { if(active_tm == TM_BG) Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- setup.cpp 14 May 2004 02:44:34 -0000 1.82 +++ setup.cpp 14 May 2004 16:02:41 -0000 1.83 @@ -64,8 +64,8 @@ /* Screen proprities: */ /* Don't use this to test for the actual screen sizes. Use screen->w/h instead! */ -#define SCREEN_W 640 -#define SCREEN_H 480 +#define SCREEN_W 800 +#define SCREEN_H 600 /* Local function prototypes: */ Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- world.cpp 13 May 2004 10:03:17 -0000 1.85 +++ world.cpp 14 May 2004 16:02:41 -0000 1.86 @@ -196,20 +196,25 @@ (*p)->draw(scroll_x, 0, 0); } +fprintf(stderr, "level->height: %i\n", level->height); +fprintf(stderr, "scroll_x: %i\n", scroll_x); +fprintf(stderr, "scroll_y: %i\n", scroll_y); /* Draw background: */ - for (y = 0; y < 16 && y < level->height; ++y) + for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) { - for (x = 0; x < 21; ++x) +fprintf(stderr, "drawing row: %i\n", y); + for (x = 0; x < VISIBLE_TILES_X; ++x) { +fprintf(stderr, "x: %i\n", x); Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32), level->bg_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]); } } /* Draw interactive tiles: */ - for (y = 0; y < 16 && y < level->height; ++y) + for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) { - for (x = 0; x < 21; ++x) + for (x = 0; x < VISIBLE_TILES_X; ++x) { Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32), level->ia_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]); @@ -241,9 +246,9 @@ broken_bricks[i]->draw(); /* Draw foreground: */ - for (y = 0; y < 16 && y < level->height; ++y) + for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) { - for (x = 0; x < 21; ++x) + for (x = 0; x < VISIBLE_TILES_X; ++x) { Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32), level->fg_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]); @@ -312,10 +317,10 @@ /* the space that it takes for the screen to start scrolling, regarding */ /* screen bounds (in pixels) */ -// should be higher than screen->w/2 (320) -#define X_SPACE (400-16) -// should be less than screen->h/2 (240) -#define Y_SPACE 200 +// should be higher than screen->w/2 (400) +#define X_SPACE (500-16) +// should be less than screen->h/2 (300) +#define Y_SPACE 250 // the time it takes to move the camera (in ms) #define CHANGE_DIR_SCROLL_SPEED 2000 Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- tile.cpp 6 May 2004 19:55:39 -0000 1.20 +++ tile.cpp 14 May 2004 16:02:41 -0000 1.21 @@ -185,6 +185,8 @@ void Tile::draw(float x, float y, unsigned int c, Uint8 alpha) { +fprintf(stderr, "x: %i\n", x); +fprintf(stderr, "y: %i\n", y); if (c != 0) { Tile* ptile = TileManager::instance()->get(c); |