[Super-tux-commit] supertux/src gameloop.cpp,1.32,1.33 level.cpp,1.20,1.21 level.h,1.15,1.16 leveled
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-03-27 00:49:50
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3934 Modified Files: gameloop.cpp level.cpp level.h leveleditor.cpp Log Message: - removed dn_tilemap - fixed broken level_change() function to draw only on one map, not all at once Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- level.cpp 25 Mar 2004 19:10:00 -0000 1.20 +++ level.cpp 27 Mar 2004 00:38:47 -0000 1.21 @@ -224,12 +224,6 @@ for(y = 0; y < plevel->width; ++y) plevel->fg_tiles[i][y] = (unsigned int) '.'; plevel->fg_tiles[i][plevel->width] = (unsigned int) '\0'; - - plevel->dn_tiles[i] = (unsigned int*) malloc((plevel->width+1)*sizeof(unsigned int)); - plevel->dn_tiles[i][plevel->width] = (unsigned int) '\0'; - for(y = 0; y < plevel->width; ++y) - plevel->dn_tiles[i][y] = (unsigned int) '.'; - plevel->dn_tiles[i][plevel->width] = (unsigned int) '\0'; } } @@ -389,7 +383,6 @@ for(int i = 0; i < 15; ++i) { - plevel->dn_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); plevel->ia_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); plevel->bg_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); plevel->fg_tiles[i] = (unsigned int*) calloc((plevel->width +1) , sizeof(unsigned int) ); @@ -502,15 +495,6 @@ } fprintf( fi,")\n"); - fprintf(fi," (dynamic-tm "); - - for(y = 0; y < 15; ++y) - { - for(i = 0; i < plevel->width; ++i) - fprintf(fi," %d ", plevel->dn_tiles[y][i]); - } - - fprintf( fi,")\n"); fprintf(fi," (foreground-tm "); for(y = 0; y < 15; ++y) @@ -536,8 +520,6 @@ for(i=0; i < 15; ++i) free(plevel->ia_tiles[i]); for(i=0; i < 15; ++i) - free(plevel->dn_tiles[i]); - for(i=0; i < 15; ++i) free(plevel->fg_tiles[i]); plevel->name.clear(); @@ -637,7 +619,6 @@ if(new_width < 21) new_width = 21; tilemap_change_size((unsigned int***)&plevel->ia_tiles,new_width,plevel->width); - tilemap_change_size((unsigned int***)&plevel->dn_tiles,new_width,plevel->width); tilemap_change_size((unsigned int***)&plevel->bg_tiles,new_width,plevel->width); tilemap_change_size((unsigned int***)&plevel->fg_tiles,new_width,plevel->width); plevel->width = new_width; @@ -657,14 +638,15 @@ { switch(tm) { - case 0: + case TM_BG: plevel->bg_tiles[yy][xx] = c; - case 1: + break; + case TM_IA: plevel->ia_tiles[yy][xx] = c; - case 2: - plevel->dn_tiles[yy][xx] = c; - case 4: + break; + case TM_FG: plevel->fg_tiles[yy][xx] = c; + break; } } } Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- level.h 25 Mar 2004 11:36:05 -0000 1.15 +++ level.h 27 Mar 2004 00:38:47 -0000 1.16 @@ -42,10 +42,9 @@ #define LEVEL_NAME_MAX 20 -enum { +enum TileMapType { TM_BG, TM_IA, - TM_DN, TM_FG }; @@ -64,7 +63,6 @@ std::string particle_system; unsigned int* bg_tiles[15]; /* Tiles in the background */ unsigned int* ia_tiles[15]; /* Tiles which can interact in the game (solids for example)*/ - unsigned int* dn_tiles[15]; /* Dynamic tiles (bad guys and moving platforms for example)*/ unsigned int* fg_tiles[15]; /* Tiles in the foreground */ int time_left; int bkgd_red; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- gameloop.cpp 26 Mar 2004 23:53:31 -0000 1.32 +++ gameloop.cpp 27 Mar 2004 00:38:47 -0000 1.33 @@ -477,7 +477,7 @@ void game_draw(void) { -int y,x; + int y,x; /* Draw screen: */ if (tux.dying && (global_frame_counter % 4) == 0) @@ -518,7 +518,6 @@ } /* Draw interactive tiles: */ - for (y = 0; y < 15; ++y) { for (x = 0; x < 21; ++x) @@ -529,7 +528,6 @@ } /* (Bouncy bricks): */ - for (unsigned int i = 0; i < bouncy_bricks.size(); ++i) bouncy_brick_draw(&bouncy_bricks[i]); @@ -548,13 +546,12 @@ upgrade_draw(&upgrades[i]); for (unsigned int i = 0; i < bouncy_distros.size(); ++i) - bouncy_distro_draw(&bouncy_distros[i]); + bouncy_distro_draw(&bouncy_distros[i]); for (unsigned int i = 0; i < broken_bricks.size(); ++i) broken_brick_draw(&broken_bricks[i]); /* Draw foreground: */ - for (y = 0; y < 15; ++y) { for (x = 0; x < 21; ++x) Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- leveleditor.cpp 26 Mar 2004 23:53:31 -0000 1.20 +++ leveleditor.cpp 27 Mar 2004 00:38:47 -0000 1.21 @@ -118,24 +118,6 @@ static int le_selection_mode; static SDL_Event event; -void le_activate_bad_guys(void) -{ - int x,y; - - /* Activate bad guys: */ - - /* as oposed to the gameloop.c func, this one doesn't remove - the badguys from tiles */ - - for (y = 0; y < 15; ++y) - for (x = 0; x < le_current_level->width; ++x) - if (le_current_level->dn_tiles[y][x] >= '0' && le_current_level->dn_tiles[y][x] <= '9') - add_bad_guy(x * 32, y * 32, static_cast<BadGuyKind>(le_current_level->dn_tiles[y][x] - '0')); - - - -} - void le_set_defaults() { if(le_current_level != NULL) @@ -241,7 +223,6 @@ le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); - le_activate_bad_guys(); show_menu = true; } break; @@ -273,7 +254,6 @@ le_update_buttons(le_current_level->theme.c_str()); le_set_defaults(); level_load_gfx(le_current_level); - le_activate_bad_guys(); menu_item_change_input(&subset_new_menu->item[2],""); show_menu = true; break; @@ -659,8 +639,6 @@ level_free_gfx(); level_load_gfx(le_current_level); - - le_activate_bad_guys(); } void le_quit(void) @@ -1383,7 +1361,6 @@ arrays_init(); level_load_gfx(le_current_level); loadshared(); - le_activate_bad_guys(); } void le_showhelp() |