[Super-tux-commit] supertux/src gameloop.cpp,1.57,1.58 gameloop.h,1.34,1.35 resources.cpp,1.4,1.5 re
Brought to you by:
wkendrick
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27691 Modified Files: gameloop.cpp gameloop.h resources.cpp resources.h scene.cpp scene.h special.cpp world.cpp world.h Log Message: - localized some more variables Index: scene.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- scene.cpp 11 Apr 2004 14:44:19 -0000 1.16 +++ scene.cpp 11 Apr 2004 14:55:59 -0000 1.17 @@ -15,11 +15,8 @@ int score; int distros; -int level; int next_level; int score_multiplier; -bool counting_distros; -int distro_counter; timer_type super_bkgd_timer; // FIXME: Move this into a view class @@ -27,12 +24,6 @@ unsigned int global_frame_counter; -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; Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- world.h 11 Apr 2004 14:44:19 -0000 1.19 +++ world.h 11 Apr 2004 14:55:59 -0000 1.20 @@ -50,8 +50,10 @@ std::vector<Bullet> bullets; std::vector<ParticleSystem*> particle_systems; - static World* current_; + int distro_counter; + bool counting_distros; + static World* current_; public: static World* current() { return current_; } static void set_current(World* w) { current_ = w; } @@ -113,3 +115,7 @@ #endif /*SUPERTUX_WORLD_H*/ +/* Local Variables: */ +/* mode:c++ */ +/* End */ + Index: resources.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- resources.h 11 Apr 2004 00:10:53 -0000 1.1 +++ resources.h 11 Apr 2004 14:55:59 -0000 1.2 @@ -8,6 +8,13 @@ extern texture_type img_flag[2]; extern texture_type img_cloud[2][4]; +extern texture_type img_box_full; +extern texture_type img_box_empty; +extern texture_type img_mints; +extern texture_type img_coffee; +extern texture_type img_super_bkgd; +extern texture_type img_red_glow; + void loadshared(); void unloadshared(); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- gameloop.cpp 11 Apr 2004 14:44:19 -0000 1.57 +++ gameloop.cpp 11 Apr 2004 14:55:59 -0000 1.58 @@ -73,8 +73,9 @@ world->load(filename); } -GameSession::GameSession(const std::string& subset_, int levelnb, int mode) - : subset(subset_) +GameSession::GameSession(const std::string& subset_, int levelnb_, int mode) + : subset(subset_), + levelnb(levelnb_) { init(); @@ -86,8 +87,7 @@ timer_init(&frame_timer, true); st_gl_mode = mode; - level = levelnb; - + /* Init the game: */ world->arrays_free(); world->set_defaults(); @@ -99,7 +99,7 @@ } else { - if(world->load(subset, level) != 0) + if(world->load(subset, levelnb) != 0) exit(1); } @@ -137,7 +137,7 @@ /* Level Intro: */ clearscreen(0, 0, 0); - sprintf(str, "LEVEL %d", level); + sprintf(str, "LEVEL %d", levelnb); text_drawf(&blue_text, str, 0, 200, A_HMIDDLE, A_TOP, 1); sprintf(str, "%s", world->get_level()->name.c_str()); @@ -350,7 +350,7 @@ if (next_level) { /* End of a level! */ - level++; + levelnb++; next_level = 0; if(st_gl_mode != ST_GL_TEST) { @@ -408,7 +408,7 @@ } else { - if(world->get_level()->load(subset, level) != 0) + if(world->get_level()->load(subset, levelnb) != 0) return 0; } Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- special.cpp 11 Apr 2004 13:20:43 -0000 1.10 +++ special.cpp 11 Apr 2004 14:55:59 -0000 1.11 @@ -19,6 +19,7 @@ #include "scene.h" #include "globals.h" #include "player.h" +#include "resources.h" texture_type img_bullet; texture_type img_golden_herring; Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- gameloop.h 11 Apr 2004 14:44:19 -0000 1.34 +++ gameloop.h 11 Apr 2004 14:55:59 -0000 1.35 @@ -50,6 +50,7 @@ // FIXME: Hack for restarting the level std::string subset; + int levelnb; public: GameSession(); Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- world.cpp 11 Apr 2004 14:44:19 -0000 1.17 +++ world.cpp 11 Apr 2004 14:55:59 -0000 1.18 @@ -27,6 +27,7 @@ #include "world.h" #include "level.h" #include "tile.h" +#include "resources.h" texture_type img_distro[4]; Index: scene.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- scene.h 11 Apr 2004 14:44:19 -0000 1.19 +++ scene.h 11 Apr 2004 14:55:59 -0000 1.20 @@ -18,19 +18,16 @@ #define FRAME_RATE 10 // 100 Frames per second (10ms) +// Player stats extern int score; extern int distros; -extern int level; extern int next_level; extern int score_multiplier; -extern bool counting_distros; -extern int distro_counter; extern timer_type super_bkgd_timer; extern float scroll_x; extern unsigned int global_frame_counter; -extern texture_type img_box_full, img_box_empty, img_mints, img_coffee, img_super_bkgd, img_red_glow; extern timer_type time_left; extern double frame_ratio; Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- resources.cpp 11 Apr 2004 14:44:19 -0000 1.4 +++ resources.cpp 11 Apr 2004 14:55:59 -0000 1.5 @@ -13,6 +13,13 @@ texture_type img_flag[2]; texture_type img_cloud[2][4]; +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; + /* Load graphics/sounds shared between all levels: */ void loadshared() { |