X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fscene.cpp;h=4eef38ea78d6b2a065f20c69d907b77bdbec651e;hb=168c326b585555e4ea6d444ad96a83d880d5c7e3;hp=dcdc038af143b1b3d6dbcf8374e47a2e89da3ec0;hpb=29df1d22e0057ae181a51d4aab971963fbda1dbf;p=supertux.git diff --git a/src/scene.cpp b/src/scene.cpp index dcdc038af..4eef38ea7 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -18,143 +18,23 @@ int distros; int level; int next_level; int game_pause; -bool quit; int score_multiplier; int endpos; bool counting_distros; int distro_counter; timer_type super_bkgd_timer; float scroll_x; -int frame; -std::vector bouncy_distros; -std::vector broken_bricks; -std::vector bouncy_bricks; -std::vector bad_guys; -std::vector floating_scores; -std::vector upgrades; -std::vector bullets; -player_type tux; -texture_type img_box_full, img_box_empty, img_mints, img_coffee, img_super_bkgd, img_red_glow; +unsigned int global_frame_counter; + +Player tux; +texture_type img_box_full; +texture_type img_box_empty; +texture_type img_mints; +texture_type img_coffee; +texture_type img_super_bkgd; +texture_type img_red_glow; timer_type time_left; double frame_ratio; -/* Initialize all 'dynamic' arrays */ -void arrays_init(void) -{ -} - -/* Free memory of 'dynamic' arrays */ -void arrays_free(void) -{ -bad_guys.clear(); -bouncy_distros.clear(); -broken_bricks.clear(); -bouncy_bricks.clear(); -floating_scores.clear(); -upgrades.clear(); -bullets.clear(); -} - -void set_defaults(void) -{ - /* Set defaults: */ - - scroll_x = 0; - - score_multiplier = 1; - timer_init(&super_bkgd_timer, true); - - counting_distros = false; - distro_counter = 0; - - endpos = 0; - - /* set current song/music */ - set_current_music(LEVEL_MUSIC); -} - -/* Add score: */ - -void add_score(float x, float y, int s) -{ - /* Add the score: */ - - score += s; - - floating_score_type new_floating_score; - floating_score_init(&new_floating_score,x,y,s); - floating_scores.push_back(new_floating_score); -} - -/* Add a bouncy distro: */ - -void add_bouncy_distro(float x, float y) -{ - - bouncy_distro_type new_bouncy_distro; - bouncy_distro_init(&new_bouncy_distro,x,y); - bouncy_distros.push_back(new_bouncy_distro); -} - - -/* Add broken brick pieces: */ - -void add_broken_brick(float x, float y) -{ - add_broken_brick_piece(x, y, -1, -4); - add_broken_brick_piece(x, y + 16, -1.5, -3); - - add_broken_brick_piece(x + 16, y, 1, -4); - add_broken_brick_piece(x + 16, y + 16, 1.5, -3); -} - - -/* Add a broken brick piece: */ - -void add_broken_brick_piece(float x, float y, float xm, float ym) -{ - broken_brick_type new_broken_brick; - broken_brick_init(&new_broken_brick,x,y,xm,ym); - broken_bricks.push_back(new_broken_brick); -} - - -/* Add a bouncy brick piece: */ - -void add_bouncy_brick(float x, float y) -{ - bouncy_brick_type new_bouncy_brick; - bouncy_brick_init(&new_bouncy_brick,x,y); - bouncy_bricks.push_back(new_bouncy_brick); -} - - -/* Add a bad guy: */ - -void add_bad_guy(float x, float y, BadGuyKind kind) -{ - bad_guy_type new_bad_guy; - badguy_init(&new_bad_guy,x,y,kind); - bad_guys.push_back(new_bad_guy); -} - -/* Add an upgrade: */ - -void add_upgrade(float x, float y, int dir, int kind) -{ - upgrade_type new_upgrade; - upgrade_init(&new_upgrade,x,y,dir,kind); - upgrades.push_back(new_upgrade); -} - -/* Add a bullet: */ - -void add_bullet(float x, float y, float xm, int dir) -{ - bullet_type new_bullet; - bullet_init(&new_bullet,x,y,xm,dir); - bullets.push_back(new_bullet); - - play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER); -} +// EOF //