super-tux-commit Mailing List for Super Tux (Page 74)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Ricardo C. <rm...@us...> - 2004-05-07 23:10:21
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25019/src Modified Files: level.cpp level.h player.cpp world.cpp Log Message: Added horizontal auto scrolling! Hope you like it ;) Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- player.cpp 4 May 2004 13:58:59 -0000 1.83 +++ player.cpp 7 May 2004 23:09:53 -0000 1.84 @@ -27,6 +27,8 @@ #include "sprite.h" #include "screen.h" +#define AUTOSCROLL_DEAD_INTERVAL 300 + Surface* tux_life; Sprite* smalltux_gameover; @@ -721,7 +723,7 @@ bool Player::is_dead() { - if(base.y > screen->h) + if(base.y > screen->h || base.x < scroll_x - AUTOSCROLL_DEAD_INTERVAL) // last condition can happen in auto-scrolling return true; else return false; @@ -754,6 +756,15 @@ if(base.x < scroll_x) // can happen if back scrolling is disabled base.x = scroll_x; + + if(base.x == scroll_x) + if(issolid(base.x, base.y) || issolid(base.x, base.y+32)) + kill(KILL); + + if(base.x + base.width > scroll_x + screen->w) + base.x = scroll_x + screen->w - base.width; + + } // EOF // Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- level.cpp 6 May 2004 20:02:26 -0000 1.65 +++ level.cpp 7 May 2004 23:09:52 -0000 1.66 @@ -237,6 +237,7 @@ time_left = 100; gravity = 10.; back_scrolling = false; + hor_autoscroll_speed = 0; bkgd_speed = 2; bkgd_top.red = 0; bkgd_top.green = 0; @@ -316,6 +317,9 @@ back_scrolling = false; reader.read_bool("back_scrolling", &back_scrolling); + hor_autoscroll_speed = 0; + reader.read_float("hor_autoscroll_speed", &hor_autoscroll_speed); + bkgd_speed = 2; reader.read_int("bkgd_speed", &bkgd_speed); @@ -561,6 +565,7 @@ fprintf(fi," (back_scrolling #t)\n"); else fprintf(fi," (back_scrolling #f)\n"); + fprintf(fi," (hor_autoscroll_speed %2.1f)\n", hor_autoscroll_speed); fprintf(fi," (gravity %2.1f)\n", gravity); fprintf(fi," (background-tm "); Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- world.cpp 6 May 2004 18:49:52 -0000 1.67 +++ world.cpp 7 May 2004 23:09:53 -0000 1.68 @@ -318,6 +318,12 @@ /* This functions takes cares of the scrolling */ void World::scrolling(double frame_ratio) { + if(level->hor_autoscroll_speed) + { + scroll_x += level->hor_autoscroll_speed * frame_ratio; + return; + } + int tux_pos_x = (int)(tux.base.x + (tux.base.width/2)); if (level->back_scrolling || debug_mode) Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- level.h 3 May 2004 23:06:19 -0000 1.45 +++ level.h 7 May 2004 23:09:52 -0000 1.46 @@ -90,6 +90,7 @@ int start_pos_y; float gravity; bool back_scrolling; + float hor_autoscroll_speed; std::vector<BadGuyData> badguy_data; |
From: Ricardo C. <rm...@us...> - 2004-05-07 23:09:13
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24846 Modified Files: TODO Log Message: This is working fine now, right? Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- TODO 7 May 2004 21:24:58 -0000 1.38 +++ TODO 7 May 2004 23:09:04 -0000 1.39 @@ -14,7 +14,6 @@ [H] background in underground levels scrolls far too slow, makes them hardly playable, since once too easily get focused on the background instead of the playfield -[H] The scrollstart position still isn't the same as before the changes. [H] Frame ratio code has been changed and so the animation may need tuning. Somebody do some testing and change the definitions regarding this. [M] When aborting a level, lives and score should remain the same as they |
From: Ingo R. <gr...@us...> - 2004-05-07 23:06:04
|
Update of /cvsroot/super-tux/supertux/data/music In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23672 Added Files: supertux-2.ogg Log Message: - another piece from ZhayTee --- NEW FILE: supertux-2.ogg --- (This appears to be a binary file; contents omitted.) |
From: Ingo R. <gr...@us...> - 2004-05-07 21:43:32
|
Update of /cvsroot/super-tux/supertux/data/music In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8241 Added Files: supertux-1.ogg Log Message: - piece of music from ZhayTee --- NEW FILE: supertux-1.ogg --- (This appears to be a binary file; contents omitted.) |
From: Ingo R. <gr...@us...> - 2004-05-07 21:25:07
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4933 Modified Files: TODO Log Message: new issue Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- TODO 7 May 2004 21:14:42 -0000 1.37 +++ TODO 7 May 2004 21:24:58 -0000 1.38 @@ -11,6 +11,9 @@ H: high priority L: low priority +[H] background in underground levels scrolls far too slow, makes them + hardly playable, since once too easily get focused on the + background instead of the playfield [H] The scrollstart position still isn't the same as before the changes. [H] Frame ratio code has been changed and so the animation may need tuning. Somebody do some testing and change the definitions regarding this. |
From: Ingo R. <gr...@us...> - 2004-05-07 21:14:52
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3038 Modified Files: TODO Log Message: added new issue Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- TODO 4 May 2004 23:39:40 -0000 1.36 +++ TODO 7 May 2004 21:14:42 -0000 1.37 @@ -17,6 +17,8 @@ [M] When aborting a level, lives and score should remain the same as they were before. Solution: make more dependency between the game engine and worldmap or just backup those variables before starting a level. +[L] intro doesn't seamlessly wrap around, might be due to the new + scrolling code or due to the worldmap doing the drawing [L] Backscroll is really messed up right now :) [L] change lispreader to throw exceptions instead of simply assert() on syntax error |
From: Tobias Gl??er <to...@us...> - 2004-05-07 20:48:34
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29140/src Modified Files: collision.cpp leveleditor.cpp title.cpp type.h world.h Log Message: major changes to the leveleditor internals, there are a few bugs expected to appear, but this had to be made! Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- world.h 4 May 2004 15:38:58 -0000 1.36 +++ world.h 7 May 2004 20:48:22 -0000 1.37 @@ -39,7 +39,6 @@ { private: typedef std::list<BadGuy*> BadGuys; - BadGuys bad_guys; BadGuys bad_guys_to_add; Level* level; Player tux; @@ -52,6 +51,7 @@ static World* current_; public: + BadGuys bad_guys; std::vector<BouncyDistro*> bouncy_distros; std::vector<BrokenBrick*> broken_bricks; std::vector<BouncyBrick*> bouncy_bricks; @@ -68,7 +68,7 @@ World(const std::string& filename); World(const std::string& subset, int level_nr); - World(); + World() {}; ~World(); Level* get_level() { return level; } Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- title.cpp 5 May 2004 16:07:20 -0000 1.78 +++ title.cpp 7 May 2004 20:48:22 -0000 1.79 @@ -147,7 +147,7 @@ { if (contrib_subset_menu->get_item_by_id(index).kind == MN_ACTION) { - std::cout << "Sarting level: " << index << std::endl; + std::cout << "Starting level: " << index << std::endl; GameSession session(current_contrib_subset, index, ST_GL_PLAY); session.run(); player_status.reset(); Index: type.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/type.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- type.h 3 May 2004 23:06:19 -0000 1.16 +++ type.h 7 May 2004 20:48:22 -0000 1.17 @@ -1,5 +1,5 @@ // $Id$ -// +// // SuperTux // Copyright (C) 2004 Tobias Glaesser <tob...@gm...> // @@ -12,7 +12,7 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA @@ -43,32 +43,32 @@ { public: -GameObject() {}; -virtual ~GameObject() {}; -virtual void action(double frame_ratio) = 0; -virtual void draw() = 0; -virtual std::string type() = 0; -/* Draw ignoring the scroll_x value. FIXME: Hack? Should be discussed. @tobgle*/ -void draw_on_screen(float x = -1, float y = -1) -{ - base_type btmp = base; - if(x != -1 || y != -1) - { - btmp = base; - if(x != -1) - base.x = x; - if(y != -1) - base.y = y; - } - float tmp = scroll_x; - scroll_x = 0; draw(); - scroll_x = tmp; - base = btmp; -}; + GameObject() {}; + virtual ~GameObject() {}; + virtual void action(double frame_ratio) = 0; + virtual void draw() = 0; + virtual std::string type() = 0; + /* Draw ignoring the scroll_x value. FIXME: Hack? Should be discussed. @tobgle*/ + void draw_on_screen(float x = -1, float y = -1) + { + base_type btmp = base; + if(x != -1 || y != -1) + { + btmp = base; + if(x != -1) + base.x = x; + if(y != -1) + base.y = y; + } + float tmp = scroll_x; + scroll_x = 0; draw(); + scroll_x = tmp; + base = btmp; + }; void move_to(float x, float y) { base.x = x; base.y = y; }; -base_type base; -base_type old_base; + base_type base; + base_type old_base; }; struct string_list_type Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/collision.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- collision.cpp 29 Apr 2004 13:54:21 -0000 1.21 +++ collision.cpp 7 May 2004 20:48:21 -0000 1.22 @@ -44,6 +44,9 @@ bool collision_object_map(const base_type& base) { + if(!World::current()) + return false; + const Level& level = *World::current()->get_level(); TileManager& tilemanager = *TileManager::instance(); Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- leveleditor.cpp 6 May 2004 20:02:27 -0000 1.91 +++ leveleditor.cpp 7 May 2004 20:48:21 -0000 1.92 @@ -82,9 +82,9 @@ void update_subset_settings_menu(); void save_subset_settings_menu(); -static Level* le_current_level; +/*static Level* le_current_level;*/ -struct LevelEditorWorld +/*struct LevelEditorWorld { std::vector<BadGuy> bad_guys; void arrays_free(void) @@ -94,7 +94,7 @@ void add_bad_guy(float x, float y, BadGuyKind kind) { - bad_guys.push_back(BadGuy(x,y,kind, false /* stay_on_platform */)); + bad_guys.push_back(BadGuy(x,y,kind, false /* stay_on_platform * /)); } void activate_bad_guys() @@ -106,7 +106,7 @@ add_bad_guy(i->x, i->y, i->kind); } } -}; +};*/ struct TileOrObject { @@ -131,7 +131,7 @@ static bool show_minimap; static int pos_x, cursor_x, cursor_y, fire; static int le_level; -static LevelEditorWorld le_world; +static World* le_world; static LevelSubset* le_level_subset; static int le_show_grid; static int le_frame; @@ -174,17 +174,6 @@ static SDL_Event event; TileMapType active_tm; -void le_set_defaults() -{ - if(le_current_level != NULL) - { - /* Set defaults: */ - - if(le_current_level->time_left == 0) - le_current_level->time_left = 255; - } -} - int leveleditor(char* filename) { int last_time, now_time, i; @@ -235,13 +224,13 @@ select_objects_menu->set_pos(screen->w - 64,82,-0.5,0.5); } - if(le_current_level != NULL) + if(le_world != NULL) { /* making events results to be in order */ if(pos_x < 0) pos_x = 0; - if(pos_x > (le_current_level->width * 32) - screen->w) - pos_x = (le_current_level->width * 32) - screen->w; + if(pos_x > (le_world->get_level()->width * 32) - screen->w) + pos_x = (le_world->get_level()->width * 32) - screen->w; /* draw the level */ le_drawlevel(); @@ -350,17 +339,8 @@ le_level_subset->load(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; le_level = 1; - le_world.arrays_free(); - delete le_current_level; - le_current_level = new Level; - if(le_current_level->load(le_level_subset->name, le_level) != 0) - { - le_quit(); - return 1; - } - le_set_defaults(); - le_current_level->load_gfx(); - le_world.activate_bad_guys(); + delete le_world; + le_world = new World; subset_new_menu->get_item_by_id(MNID_SUBSETNAME).change_input(""); Menu::set_current(subset_settings_menu); @@ -411,17 +391,10 @@ le_level_subset->load(filename); leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; le_level = 1; - le_world.arrays_free(); - delete le_current_level; - le_current_level = new Level; - if(le_current_level->load(le_level_subset->name, le_level) != 0) - { - le_quit(); - return 1; - } - le_set_defaults(); - le_current_level->load_gfx(); - le_world.activate_bad_guys(); + delete le_world; + le_world = new World(filename,le_level); + + //GameSession* session = new GameSession(datadir + "/levels/" + le_level_subset->name + "/level1.stl", 0, ST_GL_DEMO_GAME); Menu::set_current(NULL); @@ -431,7 +404,7 @@ void le_init_menus() { int i; - + leveleditor_menu = new Menu(); subset_load_menu = new Menu(); subset_new_menu = new Menu(); @@ -566,6 +539,8 @@ level_subsets = dsubdirs("/levels", "info"); le_level_subset = new LevelSubset; + le_world = NULL; + active_tm = TM_IA; le_show_grid = true; scroll_x = 0; @@ -574,7 +549,6 @@ done = 0; le_frame = 0; /* support for frames in some tiles, like waves and bad guys */ le_level_changed = false; - le_current_level = NULL; le_mouse_pressed[LEFT] = false; le_mouse_pressed[RIGHT] = false; @@ -624,8 +598,8 @@ char str[80]; int i; - level_settings_menu->get_item_by_id(MNID_NAME).change_input(le_current_level->name.c_str()); - level_settings_menu->get_item_by_id(MNID_AUTHOR).change_input(le_current_level->author.c_str()); + level_settings_menu->get_item_by_id(MNID_NAME).change_input(le_world->get_level()->name.c_str()); + level_settings_menu->get_item_by_id(MNID_AUTHOR).change_input(le_world->get_level()->author.c_str()); string_list_copy(level_settings_menu->get_item_by_id(MNID_SONG).list, dfiles("music/",NULL, "-fast")); string_list_copy(level_settings_menu->get_item_by_id(MNID_BGIMG).list, dfiles("images/background",NULL, NULL)); @@ -634,32 +608,32 @@ string_list_add_item(level_settings_menu->get_item_by_id(MNID_PARTICLE).list,"snow"); string_list_add_item(level_settings_menu->get_item_by_id(MNID_PARTICLE).list,"clouds"); - if((i = string_list_find(level_settings_menu->get_item_by_id(MNID_SONG).list,le_current_level->song_title.c_str())) != -1) + if((i = string_list_find(level_settings_menu->get_item_by_id(MNID_SONG).list,le_world->get_level()->song_title.c_str())) != -1) level_settings_menu->get_item_by_id(MNID_SONG).list->active_item = i; - if((i = string_list_find(level_settings_menu->get_item_by_id(MNID_BGIMG).list,le_current_level->bkgd_image.c_str())) != -1) + if((i = string_list_find(level_settings_menu->get_item_by_id(MNID_BGIMG).list,le_world->get_level()->bkgd_image.c_str())) != -1) level_settings_menu->get_item_by_id(MNID_BGIMG).list->active_item = i; - if((i = string_list_find(level_settings_menu->get_item_by_id(MNID_PARTICLE).list,le_current_level->particle_system.c_str())) != -1) + if((i = string_list_find(level_settings_menu->get_item_by_id(MNID_PARTICLE).list,le_world->get_level()->particle_system.c_str())) != -1) level_settings_menu->get_item_by_id(MNID_PARTICLE).list->active_item = i; - sprintf(str,"%d",le_current_level->width); + sprintf(str,"%d",le_world->get_level()->width); level_settings_menu->get_item_by_id(MNID_LENGTH).change_input(str); - sprintf(str,"%d",le_current_level->time_left); + sprintf(str,"%d",le_world->get_level()->time_left); level_settings_menu->get_item_by_id(MNID_TIME).change_input(str); - sprintf(str,"%2.0f",le_current_level->gravity); + sprintf(str,"%2.0f",le_world->get_level()->gravity); level_settings_menu->get_item_by_id(MNID_GRAVITY).change_input(str); - sprintf(str,"%d",le_current_level->bkgd_speed); + sprintf(str,"%d",le_world->get_level()->bkgd_speed); level_settings_menu->get_item_by_id(MNID_BGSPEED).change_input(str); - sprintf(str,"%d",le_current_level->bkgd_top.red); + sprintf(str,"%d",le_world->get_level()->bkgd_top.red); level_settings_menu->get_item_by_id(MNID_TopRed).change_input(str); - sprintf(str,"%d",le_current_level->bkgd_top.green); + sprintf(str,"%d",le_world->get_level()->bkgd_top.green); level_settings_menu->get_item_by_id(MNID_TopGreen).change_input(str); - sprintf(str,"%d",le_current_level->bkgd_top.blue); + sprintf(str,"%d",le_world->get_level()->bkgd_top.blue); level_settings_menu->get_item_by_id(MNID_TopBlue).change_input(str); - sprintf(str,"%d",le_current_level->bkgd_bottom.red); + sprintf(str,"%d",le_world->get_level()->bkgd_bottom.red); level_settings_menu->get_item_by_id(MNID_BottomRed).change_input(str); - sprintf(str,"%d",le_current_level->bkgd_bottom.green); + sprintf(str,"%d",le_world->get_level()->bkgd_bottom.green); level_settings_menu->get_item_by_id(MNID_BottomGreen).change_input(str); - sprintf(str,"%d",le_current_level->bkgd_bottom.blue); + sprintf(str,"%d",le_world->get_level()->bkgd_bottom.blue); level_settings_menu->get_item_by_id(MNID_BottomBlue).change_input(str); } @@ -674,37 +648,37 @@ int i; i = false; - le_current_level->name = level_settings_menu->get_item_by_id(MNID_NAME).input; - le_current_level->author = level_settings_menu->get_item_by_id(MNID_AUTHOR).input; + le_world->get_level()->name = level_settings_menu->get_item_by_id(MNID_NAME).input; + le_world->get_level()->author = level_settings_menu->get_item_by_id(MNID_AUTHOR).input; - if(le_current_level->bkgd_image.compare(string_list_active(level_settings_menu->get_item_by_id(MNID_BGIMG).list)) != 0) + if(le_world->get_level()->bkgd_image.compare(string_list_active(level_settings_menu->get_item_by_id(MNID_BGIMG).list)) != 0) { - le_current_level->bkgd_image = string_list_active(level_settings_menu->get_item_by_id(MNID_BGIMG).list); + le_world->get_level()->bkgd_image = string_list_active(level_settings_menu->get_item_by_id(MNID_BGIMG).list); i = true; } - if(le_current_level->particle_system.compare(string_list_active(level_settings_menu->get_item_by_id(MNID_PARTICLE).list)) != 0) + if(le_world->get_level()->particle_system.compare(string_list_active(level_settings_menu->get_item_by_id(MNID_PARTICLE).list)) != 0) { - le_current_level->particle_system = string_list_active(level_settings_menu->get_item_by_id(MNID_PARTICLE).list); + le_world->get_level()->particle_system = string_list_active(level_settings_menu->get_item_by_id(MNID_PARTICLE).list); } if(i) { - le_current_level->load_gfx(); + le_world->get_level()->load_gfx(); } - le_current_level->song_title = string_list_active(level_settings_menu->get_item_by_id(MNID_SONG).list); + le_world->get_level()->song_title = string_list_active(level_settings_menu->get_item_by_id(MNID_SONG).list); - le_current_level->change_size(atoi(level_settings_menu->get_item_by_id(MNID_LENGTH).input)); - le_current_level->time_left = atoi(level_settings_menu->get_item_by_id(MNID_BGIMG).input); - le_current_level->gravity = atof(level_settings_menu->get_item_by_id(MNID_GRAVITY).input); - le_current_level->bkgd_speed = atoi(level_settings_menu->get_item_by_id(MNID_BGSPEED).input); - le_current_level->bkgd_top.red = atoi(level_settings_menu->get_item_by_id(MNID_TopRed).input); - le_current_level->bkgd_top.green = atoi(level_settings_menu->get_item_by_id(MNID_TopGreen).input); - le_current_level->bkgd_top.blue = atoi(level_settings_menu->get_item_by_id(MNID_TopBlue).input); - le_current_level->bkgd_bottom.red = atoi(level_settings_menu->get_item_by_id(MNID_BottomRed).input); - le_current_level->bkgd_bottom.green = atoi(level_settings_menu->get_item_by_id(MNID_BottomGreen).input); - le_current_level->bkgd_bottom.blue = atoi(level_settings_menu->get_item_by_id(MNID_BottomBlue).input); + le_world->get_level()->change_size(atoi(level_settings_menu->get_item_by_id(MNID_LENGTH).input)); + le_world->get_level()->time_left = atoi(level_settings_menu->get_item_by_id(MNID_BGIMG).input); + le_world->get_level()->gravity = atof(level_settings_menu->get_item_by_id(MNID_GRAVITY).input); + le_world->get_level()->bkgd_speed = atoi(level_settings_menu->get_item_by_id(MNID_BGSPEED).input); + le_world->get_level()->bkgd_top.red = atoi(level_settings_menu->get_item_by_id(MNID_TopRed).input); + le_world->get_level()->bkgd_top.green = atoi(level_settings_menu->get_item_by_id(MNID_TopGreen).input); + le_world->get_level()->bkgd_top.blue = atoi(level_settings_menu->get_item_by_id(MNID_TopBlue).input); + le_world->get_level()->bkgd_bottom.red = atoi(level_settings_menu->get_item_by_id(MNID_BottomRed).input); + le_world->get_level()->bkgd_bottom.green = atoi(level_settings_menu->get_item_by_id(MNID_BottomGreen).input); + le_world->get_level()->bkgd_bottom.blue = atoi(level_settings_menu->get_item_by_id(MNID_BottomBlue).input); } void save_subset_settings_menu() @@ -716,23 +690,8 @@ void le_goto_level(int levelnb) { - le_world.arrays_free(); - - le_current_level->cleanup(); - if(le_current_level->load(le_level_subset->name.c_str(), levelnb) != 0) - { - le_current_level->load(le_level_subset->name.c_str(), le_level); - } - else - { - le_level = levelnb; - } - - le_set_defaults(); - - le_current_level->load_gfx(); - - le_world.activate_bad_guys(); + delete le_world; + le_world = new World(le_level_subset->name, levelnb); } void le_quit(void) @@ -766,8 +725,6 @@ delete le_objects_bt; delete le_tilemap_panel; - delete le_current_level; - le_current_level = 0; delete le_level_subset; le_level_subset = 0; @@ -785,31 +742,31 @@ void le_drawminimap() { - if(le_current_level == NULL) + if(le_world == NULL) return; int mini_tile_width; - if(screen->w - 64 > le_current_level->width * 4) + if(screen->w - 64 > le_world->get_level()->width * 4) mini_tile_width = 4; - else if(screen->w - 64 > le_current_level->width * 2) + else if(screen->w - 64 > le_world->get_level()->width * 2) mini_tile_width = 2; else mini_tile_width = 1; - int left_offset = (screen->w - 64 - le_current_level->width*mini_tile_width) / 2; + int left_offset = (screen->w - 64 - le_world->get_level()->width*mini_tile_width) / 2; for (int y = 0; y < 15; ++y) - for (int x = 0; x < le_current_level->width; ++x) + for (int x = 0; x < le_world->get_level()->width; ++x) { - Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_current_level->bg_tiles[y][x]); + Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_world->get_level()->bg_tiles[y][x]); - Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_current_level->ia_tiles[y][x]); + Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_world->get_level()->ia_tiles[y][x]); - Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_current_level->fg_tiles[y][x]); + Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_world->get_level()->fg_tiles[y][x]); } - fillrect(left_offset, 0, le_current_level->width*mini_tile_width, 15*4, 200, 200, 200, 128); + fillrect(left_offset, 0, le_world->get_level()->width*mini_tile_width, 15*4, 200, 200, 200, 128); fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 19*mini_tile_width, 2, 200, 200, 200, 200); fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 2, 15*4, 200, 200, 200, 200); @@ -823,7 +780,7 @@ int x,y; char str[80]; - if(le_current_level != NULL) + if(le_world != NULL) { /* draw a grid (if selected) */ if(le_show_grid) @@ -872,7 +829,7 @@ le_current.obj->draw_on_screen(cursor_x,cursor_y); } - if(le_current_level != NULL) + if(le_world != NULL) { le_save_level_bt->draw(); le_exit_bt->draw(); @@ -915,21 +872,21 @@ void le_drawlevel() { - unsigned int y,x,i,s; + unsigned int y,x,s; Uint8 a; /* Draw the real background */ - if(le_current_level->bkgd_image[0] != '\0') + if(le_world->get_level()->bkgd_image[0] != '\0') { - s = (int)((float)pos_x * ((float)le_current_level->bkgd_speed/60.)) % screen->w; - le_current_level->img_bkgd->draw_part(s,0,0,0, - le_current_level->img_bkgd->w - s - 32, le_current_level->img_bkgd->h); - le_current_level->img_bkgd->draw_part(0,0,screen->w - s - 32 ,0,s, - le_current_level->img_bkgd->h); + s = (int)((float)pos_x * ((float)le_world->get_level()->bkgd_speed/60.)) % screen->w; + le_world->get_level()->img_bkgd->draw_part(s,0,0,0, + le_world->get_level()->img_bkgd->w - s - 32, le_world->get_level()->img_bkgd->h); + le_world->get_level()->img_bkgd->draw_part(0,0,screen->w - s - 32 ,0,s, + le_world->get_level()->img_bkgd->h); } else { - drawgradient(le_current_level->bkgd_top, le_current_level->bkgd_bottom); + drawgradient(le_world->get_level()->bkgd_top, le_world->get_level()->bkgd_bottom); } if(le_current.IsTile()) @@ -954,36 +911,36 @@ else a = 128; - Tile::draw(32*x - fmodf(pos_x, 32), y * 32, le_current_level->bg_tiles[y][x + (int)(pos_x / 32)],a); + Tile::draw(32*x - fmodf(pos_x, 32), y * 32, le_world->get_level()->bg_tiles[y][x + (int)(pos_x / 32)],a); if(active_tm == TM_IA) a = 255; else a = 128; - Tile::draw(32*x - fmodf(pos_x, 32), y * 32, le_current_level->ia_tiles[y][x + (int)(pos_x / 32)],a); + Tile::draw(32*x - fmodf(pos_x, 32), y * 32, le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)],a); if(active_tm == TM_FG) a = 255; else a = 128; - Tile::draw(32*x - fmodf(pos_x, 32), y * 32, le_current_level->fg_tiles[y][x + (int)(pos_x / 32)],a); + Tile::draw(32*x - fmodf(pos_x, 32), y * 32, le_world->get_level()->fg_tiles[y][x + (int)(pos_x / 32)],a); /* draw whats inside stuff when cursor is selecting those */ /* (draw them all the time - is this the right behaviour?) */ - if(TileManager::instance()->get(le_current_level->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images.size() > 0) - TileManager::instance()->get(le_current_level->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images[0]->draw( x * 32 - ((int)pos_x % 32), y*32); + if(TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images.size() > 0) + TileManager::instance()->get(le_world->get_level()->ia_tiles[y][x + (int)(pos_x / 32)])->editor_images[0]->draw( x * 32 - ((int)pos_x % 32), y*32); } /* Draw the Bad guys: */ - for (i = 0; i < le_world.bad_guys.size(); ++i) + for (std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); it != le_world->bad_guys.end(); ++it) { /* to support frames: img_bsod_left[(frame / 5) % 4] */ scroll_x = pos_x; - le_world.bad_guys[i].draw(); + (*it)->draw(); } @@ -992,6 +949,23 @@ largetux.walk_right->draw( 100 - pos_x, 240); } +void le_change_object_properties(GameObject *pobj) +{ +Menu* object_properties_menu = new Menu(); + + object_properties_menu->additem(MN_LABEL,pobj->type() + " Properties",0,0); + object_properties_menu->additem(MN_HL,"",0,0); + /*object_properties_menu->additem(MN_TEXTFIELD,"Title",0,0,MNID_SUBSETTITLE); + object_properties_menu->additem(MN_TEXTFIELD,"Description",0,0,MNID_SUBSETDESCRIPTION); + object_properties_menu->additem(MN_HL,"",0,0); + object_properties_menu->additem(MN_ACTION,"Save Changes",0,0,MNID_SUBSETSAVECHANGES);*/ + object_properties_menu->additem(MN_HL,"",0,0); + object_properties_menu->additem(MN_BACK,"Apply",0,0); + +delete object_properties_menu; +} + + void le_checkevents() { SDLKey key; @@ -1075,7 +1049,7 @@ pos_x = cursor_x; break; case SDLK_END: - cursor_x = (le_current_level->width * 32) - 32; + cursor_x = (le_world->get_level()->width * 32) - 32; pos_x = cursor_x; break; case SDLK_F9: @@ -1161,7 +1135,7 @@ } } - if(le_current_level != NULL) + if(le_world != NULL) { if(event.type == SDL_KEYDOWN || event.type == SDL_KEYUP || ((event.type == SDL_MOUSEBUTTONDOWN || SDL_MOUSEMOTION) && (event.motion.x > screen->w-64 && event.motion.x < screen->w && event.motion.y > 0 && event.motion.y < screen->h))) @@ -1177,7 +1151,7 @@ le_testlevel(); le_save_level_bt->event(event); if(le_save_level_bt->get_state() == BUTTON_CLICKED) - le_current_level->save(le_level_subset->name.c_str(),le_level); + le_world->get_level()->save(le_level_subset->name.c_str(),le_level); le_exit_bt->event(event); if(le_exit_bt->get_state() == BUTTON_CLICKED) { @@ -1383,8 +1357,8 @@ { BadGuy* pbadguy = dynamic_cast<BadGuy*>(le_current.obj); - le_world.bad_guys.push_back(BadGuy(cursor_x+scroll_x, cursor_y,pbadguy->kind,false)); - le_current_level->badguy_data.push_back(&le_world.bad_guys.back()); + le_world->bad_guys.push_back(new BadGuy(cursor_x+scroll_x, cursor_y,pbadguy->kind,false)); + le_world->get_level()->badguy_data.push_back(le_world->bad_guys.back()); } } le_mouse_clicked[LEFT] = false; @@ -1471,7 +1445,7 @@ void le_change(float x, float y, int tm, unsigned int c) { - if(le_current_level != NULL) + if(le_world != NULL) { int xx,yy; int x1, x2, y1, y2; @@ -1482,7 +1456,7 @@ switch(le_selection_mode) { case CURSOR: - le_current_level->change(x,y,tm,c); + le_world->get_level()->change(x,y,tm,c); base_type cursor_base; cursor_base.x = x; @@ -1491,11 +1465,11 @@ cursor_base.height = 32; /* if there is a bad guy over there, remove it */ - for(i = 0; i < le_world.bad_guys.size(); ++i) - if(rectcollision(cursor_base,le_world.bad_guys[i].base)) + for(std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); it != le_world->bad_guys.end(); ++it) + if(rectcollision(cursor_base,(*it)->base)) { - le_world.bad_guys.erase(le_world.bad_guys.begin() + i); - le_current_level->badguy_data.erase(le_current_level->badguy_data.begin() + i); + le_world->bad_guys.erase(le_world->bad_guys.begin(),it); + le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); } break; @@ -1527,25 +1501,25 @@ y2 /= 32; /* if there is a bad guy over there, remove it */ - for(std::vector<BadGuy>::iterator i = le_world.bad_guys.begin(); - i != le_world.bad_guys.end(); /* will be at end of loop */) + for(std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); + it != le_world->bad_guys.end(); /* will be at end of loop */) { - if(i->base.x/32 >= x1 && i->base.x/32 <= x2 - && i->base.y/32 >= y1 && i->base.y/32 <= y2) + if((*it)->base.x/32 >= x1 && (*it)->base.x/32 <= x2 + && (*it)->base.y/32 >= y1 && (*it)->base.y/32 <= y2) { - i = le_world.bad_guys.erase(i); + it = le_world->bad_guys.erase(it); continue; } else { - ++i; + ++it; } } for(xx = x1; xx <= x2; xx++) for(yy = y1; yy <= y2; yy++) { - le_current_level->change(xx*32, yy*32, tm, c); + le_world->get_level()->change(xx*32, yy*32, tm, c); } break; @@ -1557,7 +1531,7 @@ void le_testlevel() { - le_current_level->save("test", le_level); + le_world->get_level()->save("test", le_level); GameSession session("test",le_level, ST_GL_TEST); session.run(); @@ -1566,9 +1540,9 @@ music_manager->halt_music(); Menu::set_current(NULL); - le_world.arrays_free(); + /*delete le_world.arrays_free(); le_current_level->load_gfx(); - le_world.activate_bad_guys(); + le_world.activate_bad_guys();*/ } void le_showhelp() |
From: Ricardo C. <rm...@us...> - 2004-05-07 13:47:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2529/src Modified Files: globals.cpp globals.h setup.cpp Log Message: Added support for silver's Benjamin font. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -u -d -r1.74 -r1.75 --- setup.cpp 7 May 2004 00:30:43 -0000 1.74 +++ setup.cpp 7 May 2004 13:46:50 -0000 1.75 @@ -583,6 +583,7 @@ black_text = new Text(datadir + "/images/status/letters-black.png", TEXT_TEXT, 16,18); gold_text = new Text(datadir + "/images/status/letters-gold.png", TEXT_TEXT, 16,18); + silver_text = new Text(datadir + "/images/status/letters-silver.png", TEXT_TEXT, 16,18); blue_text = new Text(datadir + "/images/status/letters-blue.png", TEXT_TEXT, 16,18); red_text = new Text(datadir + "/images/status/letters-red.png", TEXT_TEXT, 16,18); green_text = new Text(datadir + "/images/status/letters-green.png", TEXT_TEXT, 16,18); @@ -609,6 +610,7 @@ /* Free global images: */ delete black_text; delete gold_text; + delete silver_text; delete white_text; delete blue_text; delete red_text; Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- globals.cpp 7 May 2004 00:30:43 -0000 1.19 +++ globals.cpp 7 May 2004 13:46:50 -0000 1.20 @@ -40,6 +40,7 @@ SDL_Surface * screen; Text* black_text; Text* gold_text; +Text* silver_text; Text* blue_text; Text* red_text; Text* green_text; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- globals.h 7 May 2004 00:30:43 -0000 1.29 +++ globals.h 7 May 2004 13:46:50 -0000 1.30 @@ -49,6 +49,7 @@ extern SDL_Surface * screen; extern Text* black_text; extern Text* gold_text; +extern Text* silver_text; extern Text* white_text; extern Text* white_small_text; extern Text* white_big_text; |
From: Ricardo C. <rm...@us...> - 2004-05-07 13:45:43
|
Update of /cvsroot/super-tux/supertux/data/images/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2130/data/images/status Modified Files: letters-black.png letters-blue.png letters-gold.png letters-green.png letters-red.png letters-white-big.png letters-white.png letters-white-small.png Added Files: letters-silver.png Log Message: Replaced letters by Benjamin's hand-written ones. Index: letters-gold.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-gold.png,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsh8rgHR and /tmp/cvsJHEAVr differ Index: letters-white-small.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white-small.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsHiaIJQ and /tmp/cvsLvHuAs differ --- NEW FILE: letters-silver.png --- (This appears to be a binary file; contents omitted.) Index: letters-black.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-black.png,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsIFjr1Z and /tmp/cvsAxgQWB differ Index: letters-white.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvs3lKfwc and /tmp/cvsp5qlBO differ Index: letters-blue.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-blue.png,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsvAYumD and /tmp/cvshVFAHf differ Index: letters-red.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-red.png,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsrw9o3M and /tmp/cvstf3Rup differ Index: letters-green.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-green.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsVhBFSQ and /tmp/cvsjahNst differ Index: letters-white-big.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white-big.png,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 Binary files /tmp/cvs5Kj09x and /tmp/cvsQ3b5db differ |
From: Ricardo C. <rm...@us...> - 2004-05-07 13:44:22
|
Update of /cvsroot/super-tux/supertux/data/images/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1937/data/images/status Modified Files: back.png Log Message: Replaced current back icon with Benjamin's one. It's so much better. Index: back.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/back.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsO0ot8f and /tmp/cvsSM8PjT differ |
From: Ricardo C. <rm...@us...> - 2004-05-07 13:43:44
|
Update of /cvsroot/super-tux/supertux/data/images/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1735/data/images/status Removed Files: back.xcf Log Message: File moved. --- back.xcf DELETED --- |
From: Ricardo C. <rm...@us...> - 2004-05-07 13:43:06
|
Update of /cvsroot/super-tux/supertux/data/images/status/old In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1503/data/images/status/old Added Files: back.png back.xcf Log Message: Moved back button to an old dir. --- NEW FILE: back.xcf --- (This appears to be a binary file; contents omitted.) --- NEW FILE: back.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-05-07 13:42:23
|
Update of /cvsroot/super-tux/supertux/data/images/status/old In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1351/data/images/status/old Log Message: Directory /cvsroot/super-tux/supertux/data/images/status/old added to the repository |
From: Tobias Gl??er <to...@us...> - 2004-05-07 10:56:48
|
Update of /cvsroot/super-tux/supertux/data/images/icons In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31941/data/images/icons Added Files: objects.png objects.xcf Log Message: added (I forgot to add them, shame on me) --- NEW FILE: objects.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: objects.xcf --- (This appears to be a binary file; contents omitted.) |
From: Ingo R. <gr...@us...> - 2004-05-07 10:09:20
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23612 Modified Files: NEWS Log Message: added news Index: NEWS =================================================================== RCS file: /cvsroot/super-tux/supertux/NEWS,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- NEWS 2 May 2004 22:40:37 -0000 1.7 +++ NEWS 7 May 2004 10:09:10 -0000 1.8 @@ -1,3 +1,11 @@ +Super Tux 0.1.1 (...) +===================== + * new handwritten font + * endseq bug squished + * build in leveledior + * support for g++-2.95 + + Super Tux 0.1.0 (3 May 04) ========================== * completly new graphics @@ -15,6 +23,7 @@ * Win32 port * config file support + Super Tux 0.0.6 (16 Mar 04) =========================== * Game Save/Load. @@ -24,4 +33,5 @@ * Bugfixes (Timer related and many others). * 2 new levels (Tux in Sky and Mondo). + # EOF # |
From: Ricardo C. <rm...@us...> - 2004-05-07 00:30:55
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32149/src Modified Files: globals.cpp globals.h setup.cpp Log Message: Added support for Benjamin's green fonts. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- setup.cpp 6 May 2004 21:39:47 -0000 1.73 +++ setup.cpp 7 May 2004 00:30:43 -0000 1.74 @@ -585,6 +585,7 @@ gold_text = new Text(datadir + "/images/status/letters-gold.png", TEXT_TEXT, 16,18); blue_text = new Text(datadir + "/images/status/letters-blue.png", TEXT_TEXT, 16,18); red_text = new Text(datadir + "/images/status/letters-red.png", TEXT_TEXT, 16,18); + green_text = new Text(datadir + "/images/status/letters-green.png", TEXT_TEXT, 16,18); white_text = new Text(datadir + "/images/status/letters-white.png", TEXT_TEXT, 16,18); white_small_text = new Text(datadir + "/images/status/letters-white-small.png", TEXT_TEXT, 8,9); white_big_text = new Text(datadir + "/images/status/letters-white-big.png", TEXT_TEXT, 20,23); @@ -611,6 +612,7 @@ delete white_text; delete blue_text; delete red_text; + delete green_text; delete white_small_text; delete white_big_text; delete yellow_nums; Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- globals.cpp 5 May 2004 16:07:19 -0000 1.18 +++ globals.cpp 7 May 2004 00:30:43 -0000 1.19 @@ -42,6 +42,7 @@ Text* gold_text; Text* blue_text; Text* red_text; +Text* green_text; Text* yellow_nums; Text* white_text; Text* white_small_text; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/globals.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- globals.h 5 May 2004 16:07:19 -0000 1.28 +++ globals.h 7 May 2004 00:30:43 -0000 1.29 @@ -54,6 +54,7 @@ extern Text* white_big_text; extern Text* blue_text; extern Text* red_text; +extern Text* green_text; extern Text* yellow_nums; extern MouseCursor * mouse_cursor; |
From: Ricardo C. <rm...@us...> - 2004-05-07 00:22:54
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30829/src Modified Files: menu.cpp Log Message: Replaced - by _ for the flickering input cursor. This is now possible thankfull to Benjamin's fonts. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -u -d -r1.65 -r1.66 --- menu.cpp 30 Apr 2004 11:40:55 -0000 1.65 +++ menu.cpp 7 May 2004 00:22:28 -0000 1.66 @@ -214,7 +214,7 @@ char str[1024]; if(input_flickering) - sprintf(str,"%s-",input); + sprintf(str,"%s_",input); else sprintf(str,"%s ",input); |
From: Ricardo C. <rm...@us...> - 2004-05-07 00:20:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30477/src Modified Files: text.cpp Log Message: Support for Benjamin's fonts. Index: text.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/text.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- text.cpp 29 Apr 2004 00:15:11 -0000 1.19 +++ text.cpp 7 May 2004 00:20:29 -0000 1.20 @@ -101,14 +101,18 @@ { for( i = 0, j = 0; i < len; ++i,++j) { - if( text[i] >= 'A' && text[i] <= 'Z') - pchars->draw_part((int)(text[i] - 'A')*w, 0, x+(j*w), y, w, h, 255, update); - else if( text[i] >= 'a' && text[i] <= 'z') - pchars->draw_part((int)(text[i] - 'a')*w, h, x+(j*w), y, w, h, 255, update); - else if ( text[i] >= '!' && text[i] <= '9') - pchars->draw_part((int)(text[i] - '!')*w, h*2, x+(j*w), y, w, h, 255, update); - else if ( text[i] == '?') - pchars->draw_part(25*w, h*2, x+(j*w), y, w, h, 255, update); + if( text[i] >= ' ' && text[i] <= '/') + pchars->draw_part((int)(text[i] - ' ')*w, 0 , x+(j*w), y, w, h, 255, update); + else if( text[i] >= '0' && text[i] <= '?') + pchars->draw_part((int)(text[i] - '0')*w, h*1, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= '@' && text[i] <= 'O') + pchars->draw_part((int)(text[i] - '@')*w, h*2, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= 'P' && text[i] <= '_') + pchars->draw_part((int)(text[i] - 'P')*w, h*3, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= '`' && text[i] <= 'o') + pchars->draw_part((int)(text[i] - '`')*w, h*4, x+(j*w), y, w, h, 255, update); + else if ( text[i] >= 'p' && text[i] <= '~') + pchars->draw_part((int)(text[i] - 'p')*w, h*5, x+(j*w), y, w, h, 255, update); else if ( text[i] == '\n') { y += h + 2; |
From: Ricardo C. <rm...@us...> - 2004-05-07 00:20:13
|
Update of /cvsroot/super-tux/supertux/data/images/status In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30297/data/images/status Modified Files: letters-black.png letters-blue.png letters-gold.png letters-red.png letters-white-big.png letters-white.png letters-white-small.png Added Files: letters-green.png Log Message: Replaced fonts by Atari Benjamin's ones. This are very similiar, but they make possible to use more characters! Index: letters-gold.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-gold.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsvXIRkt and /tmp/cvszghK3q differ Index: letters-black.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-black.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsmHezDS and /tmp/cvsV9l6lR differ Index: letters-white.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsNMcO93 and /tmp/cvstaSo12 differ Index: letters-blue.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-blue.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsFICsW6 and /tmp/cvsTolCA6 differ Index: letters-white-small.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white-small.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsYl0gcf and /tmp/cvsVabgUe differ --- NEW FILE: letters-green.png --- (This appears to be a binary file; contents omitted.) Index: letters-white-big.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-white-big.png,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvs6f9Csk and /tmp/cvs49BRlk differ Index: letters-red.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/status/letters-red.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsUtA6gr and /tmp/cvsDPeMer differ |
From: Ricardo C. <rm...@us...> - 2004-05-06 21:39:57
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32622/src Modified Files: defines.h setup.cpp Log Message: Moved SCREEN_W and SCREEN_H to setup.cpp to avoid ppl using them. Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- defines.h 4 May 2004 20:57:01 -0000 1.31 +++ defines.h 6 May 2004 21:39:47 -0000 1.32 @@ -48,11 +48,6 @@ DYING_FALLING = 2 }; -/* 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 - /* Sizes: */ #define SMALL 0 Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- setup.cpp 6 May 2004 15:09:47 -0000 1.72 +++ setup.cpp 6 May 2004 21:39:47 -0000 1.73 @@ -62,6 +62,11 @@ #define DATA_PREFIX "./data/" #endif +/* 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 + /* Local function prototypes: */ void seticon(void); |
From: Ingo R. <gr...@us...> - 2004-05-06 20:32:51
|
Update of /cvsroot/super-tux/supertux/data/images/background In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18552 Modified Files: ocean.png Log Message: - improved background by Christopher A. Webber Index: ocean.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/background/ocean.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsiGDpho and /tmp/cvsPfpY0S differ |
From: Ingo R. <gr...@us...> - 2004-05-06 20:02:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12077 Modified Files: level.cpp leveleditor.cpp Log Message: - made supertux g++295 friendly Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- level.cpp 3 May 2004 23:06:19 -0000 1.64 +++ level.cpp 6 May 2004 20:02:26 -0000 1.65 @@ -626,10 +626,10 @@ } reset_points.clear(); - name.clear(); - author.clear(); - song_title.clear(); - bkgd_image.clear(); + name = ""; + author = ""; + song_title = ""; + bkgd_image = ""; badguy_data.clear(); } Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- leveleditor.cpp 6 May 2004 19:55:39 -0000 1.90 +++ leveleditor.cpp 6 May 2004 20:02:27 -0000 1.91 @@ -298,7 +298,7 @@ cur_tilegroup = select_tilegroup_menu->get_item_by_id(it).text; Menu::set_current(0); - cur_objects.clear(); + cur_objects = ""; } break; @@ -313,7 +313,7 @@ if(it >= 0) { cur_objects = select_objects_menu->get_item_by_id(it).text; - cur_tilegroup.clear(); + cur_tilegroup = ""; Menu::set_current(0); } @@ -1253,14 +1253,14 @@ } } - cur_objects.clear(); + cur_objects = ""; break; case BUTTON_WHEELDOWN: it = tilegroups_map.find(cur_tilegroup); if(it == tilegroups_map.begin()) { cur_tilegroup = tilegroups_map.rbegin()->first; - cur_objects.clear(); + cur_objects = ""; break; } if(--it != --tilegroups_map.begin()) @@ -1268,7 +1268,7 @@ else cur_tilegroup = tilegroups_map.rbegin()->first; - cur_objects.clear(); + cur_objects = ""; break; default: break; @@ -1287,7 +1287,7 @@ if(it == objects_map.end()) { cur_objects = objects_map.begin()->first; - cur_tilegroup.clear(); + cur_tilegroup = ""; break; } if(++it != objects_map.end()) @@ -1295,14 +1295,14 @@ else cur_objects = objects_map.begin()->first; - cur_tilegroup.clear(); + cur_tilegroup = ""; break; case BUTTON_WHEELDOWN: it = objects_map.find(cur_objects); if(it == objects_map.begin()) { cur_objects = objects_map.rbegin()->first; - cur_tilegroup.clear(); + cur_tilegroup = ""; break; } if(--it != --objects_map.begin()) @@ -1310,7 +1310,7 @@ else cur_objects = objects_map.rbegin()->first; - cur_tilegroup.clear(); + cur_tilegroup = ""; break; break; default: |
From: Tobias Gl??er <to...@us...> - 2004-05-06 19:55:53
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10473/src Modified Files: button.cpp leveleditor.cpp tile.cpp tile.h Log Message: TileGroups are placed in a set now. BUTTON_WHEELUP and BUTTON_WHEELDOWN fixes. Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- tile.h 5 May 2004 22:04:48 -0000 1.17 +++ tile.h 6 May 2004 19:55:39 -0000 1.18 @@ -21,6 +21,7 @@ #ifndef TILE_H #define TILE_H +#include <set> #include <map> #include <vector> #include "texture.h" @@ -85,6 +86,11 @@ struct TileGroup { + friend bool operator<(const TileGroup& lhs, const TileGroup& rhs) + { return lhs.name < rhs.name; }; + friend bool operator>(const TileGroup& lhs, const TileGroup& rhs) + { return lhs.name > rhs.name; }; + std::string name; std::vector<int> tiles; }; @@ -97,7 +103,7 @@ std::vector<Tile*> tiles; static TileManager* instance_ ; - static std::vector<TileGroup>* tilegroups_; + static std::set<TileGroup>* tilegroups_; void load_tileset(std::string filename); std::string current_tileset; @@ -106,7 +112,7 @@ static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); } static void destroy_instance() { delete instance_; instance_ = 0; } - static std::vector<TileGroup>* tilegroups() { return tilegroups_ ? tilegroups_ : tilegroups_ = new std::vector<TileGroup>; } + static std::set<TileGroup>* tilegroups() { return tilegroups_ ? tilegroups_ : tilegroups_ = new std::set<TileGroup>; } Tile* get(unsigned int id) { if(id < tiles.size()) { Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- button.cpp 5 May 2004 20:05:09 -0000 1.26 +++ button.cpp 6 May 2004 19:55:39 -0000 1.27 @@ -131,17 +131,18 @@ show_info = true; return; } - else if(event.button.button == 4) /* Mouse wheel up. */ + else if(event.type == SDL_MOUSEBUTTONUP && event.button.button == 4) /* Mouse wheel up. */ { state = BUTTON_WHEELUP; return; } - else if(event.button.button == 5) /* Mouse wheel down. */ + else if(event.type == SDL_MOUSEBUTTONUP && event.button.button == 5) /* Mouse wheel down. */ { state = BUTTON_WHEELDOWN; return; } + if(event.button.button == SDL_BUTTON_LEFT) if(event.type == SDL_MOUSEBUTTONDOWN) state = BUTTON_PRESSED; else @@ -176,14 +177,15 @@ int Button::get_state() { int rstate; - if(state == BUTTON_CLICKED) + switch(state) { + case BUTTON_CLICKED: + case BUTTON_WHEELUP: + case BUTTON_WHEELDOWN: rstate = state; state = BUTTON_NONE; return rstate; - } - else - { + default: return state; } } Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- tile.cpp 5 May 2004 22:04:48 -0000 1.19 +++ tile.cpp 6 May 2004 19:55:39 -0000 1.20 @@ -23,7 +23,7 @@ #include "assert.h" TileManager* TileManager::instance_ = 0; -std::vector<TileGroup>* TileManager::tilegroups_ = 0; +std::set<TileGroup>* TileManager::tilegroups_ = 0; Tile::Tile() { @@ -152,13 +152,12 @@ else if (strcmp(lisp_symbol(lisp_car(element)), "tilegroup") == 0) { TileGroup new_; - if(!tilegroups_) - tilegroups_ = new std::vector<TileGroup>; - tilegroups_->push_back(new_); LispReader reader(lisp_cdr(element)); - tilegroups_->back().name; - reader.read_string("name", &tilegroups_->back().name); - reader.read_int_vector("tiles", &tilegroups_->back().tiles); + reader.read_string("name", &new_.name); + reader.read_int_vector("tiles", &new_.tiles); + if(!tilegroups_) + tilegroups_ = new std::set<TileGroup>; + tilegroups_->insert(new_).first; } else if (strcmp(lisp_symbol(lisp_car(element)), "properties") == 0) { Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- leveleditor.cpp 6 May 2004 16:50:30 -0000 1.89 +++ leveleditor.cpp 6 May 2004 19:55:39 -0000 1.90 @@ -190,7 +190,7 @@ int last_time, now_time, i; le_level = 1; - + if(le_init() != 0) return 1; @@ -330,7 +330,7 @@ if(i >= 1) { if(le_load_level(level_subsets.item[i-1])) - return 1; + return 1; } break; } @@ -408,24 +408,24 @@ int le_load_level(char *filename) { -le_level_subset->load(filename); -leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; -le_level = 1; -le_world.arrays_free(); -delete le_current_level; -le_current_level = new Level; -if(le_current_level->load(le_level_subset->name, le_level) != 0) + le_level_subset->load(filename); + leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; + le_level = 1; + le_world.arrays_free(); + delete le_current_level; + le_current_level = new Level; + if(le_current_level->load(le_level_subset->name, le_level) != 0) { le_quit(); return 1; } -le_set_defaults(); -le_current_level->load_gfx(); -le_world.activate_bad_guys(); + le_set_defaults(); + le_current_level->load_gfx(); + le_world.activate_bad_guys(); -Menu::set_current(NULL); + Menu::set_current(NULL); -return 0; + return 0; } void le_init_menus() @@ -501,17 +501,17 @@ select_tilegroup_menu->arrange_left = true; select_tilegroup_menu->additem(MN_LABEL,"Tilegroup",0,0); select_tilegroup_menu->additem(MN_HL,"",0,0); - std::vector<TileGroup>* tilegroups = TileManager::tilegroups(); + std::set<TileGroup>* tilegroups = TileManager::tilegroups(); int tileid = 1; - for(std::vector<TileGroup>::iterator it = tilegroups->begin(); + for(std::set<TileGroup>::iterator it = tilegroups->begin(); it != tilegroups->end(); ++it ) { select_tilegroup_menu->additem(MN_ACTION, it->name, 0, 0, tileid); tileid++; tilegroups_map[(*it).name] = new ButtonPanel(screen->w - 64,96, 64, 318); i = 0; - - for(std::vector<int>::iterator sit = (*it).tiles.begin(); + + for(std::vector<int>::const_iterator sit = (*it).tiles.begin(); sit != (*it).tiles.end(); ++sit, ++i) { std::string imagefile = "/images/tilesets/" ; @@ -561,7 +561,7 @@ int le_init() { - + level_subsets = dsubdirs("/levels", "info"); le_level_subset = new LevelSubset; @@ -785,17 +785,17 @@ void le_drawminimap() { -if(le_current_level == NULL) -return; + if(le_current_level == NULL) + return; -int mini_tile_width; -if(screen->w - 64 > le_current_level->width * 4) -mini_tile_width = 4; -else if(screen->w - 64 > le_current_level->width * 2) -mini_tile_width = 2; -else -mini_tile_width = 1; -int left_offset = (screen->w - 64 - le_current_level->width*mini_tile_width) / 2; + int mini_tile_width; + if(screen->w - 64 > le_current_level->width * 4) + mini_tile_width = 4; + else if(screen->w - 64 > le_current_level->width * 2) + mini_tile_width = 2; + else + mini_tile_width = 1; + int left_offset = (screen->w - 64 - le_current_level->width*mini_tile_width) / 2; for (int y = 0; y < 15; ++y) for (int x = 0; x < le_current_level->width; ++x) @@ -808,13 +808,13 @@ Tile::draw_stretched(left_offset + mini_tile_width*x, y * 4, mini_tile_width , 4, le_current_level->fg_tiles[y][x]); } - -fillrect(left_offset, 0, le_current_level->width*mini_tile_width, 15*4, 200, 200, 200, 128); -fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 19*mini_tile_width, 2, 200, 200, 200, 200); -fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 2, 15*4, 200, 200, 200, 200); -fillrect(left_offset + (pos_x/32)*mini_tile_width + 19*mini_tile_width - 2, 0, 2, 15*4, 200, 200, 200, 200); -fillrect(left_offset + (pos_x/32)*mini_tile_width, 15*4-2, 19*mini_tile_width, 2, 200, 200, 200, 200); + fillrect(left_offset, 0, le_current_level->width*mini_tile_width, 15*4, 200, 200, 200, 128); + + fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 19*mini_tile_width, 2, 200, 200, 200, 200); + fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 2, 15*4, 200, 200, 200, 200); + fillrect(left_offset + (pos_x/32)*mini_tile_width + 19*mini_tile_width - 2, 0, 2, 15*4, 200, 200, 200, 200); + fillrect(left_offset + (pos_x/32)*mini_tile_width, 15*4-2, 19*mini_tile_width, 2, 200, 200, 200, 200); } @@ -834,15 +834,15 @@ fillrect(0, y*32, screen->w - 32, 1, 225, 225, 225,255); } } - + if(show_minimap && use_gl) // use_gl because the minimap isn't shown correctly in software mode. Any idea? FIXME Possible reasons: SDL_SoftStretch is a hack itsself || an alpha blitting issue SDL can't handle in software mode - le_drawminimap(); + le_drawminimap(); if(le_selection_mode == CURSOR) if(le_current.IsTile()) - le_selection->draw( cursor_x - pos_x, cursor_y); + le_selection->draw( cursor_x - pos_x, cursor_y); else - le_selection->draw( cursor_x, cursor_y); + le_selection->draw( cursor_x, cursor_y); else if(le_selection_mode == SQUARE) { int w, h; @@ -1228,41 +1228,46 @@ } ButtonPanelMap::iterator it; le_tilegroup_bt->event(event); - switch (le_tilegroup_bt->get_state()) + switch (le_tilegroup_bt->get_state()) { case BUTTON_CLICKED: Menu::set_current(select_tilegroup_menu); select_tilegroup_menu_effect.start(200); select_tilegroup_menu->set_pos(screen->w - 64,100,-0.5,0.5); - break; + break; case BUTTON_WHEELUP: - it = tilegroups_map.find(cur_tilegroup); - if(it == tilegroups_map.end()) - { - cur_tilegroup = tilegroups_map.begin()->first; - cur_objects.clear(); - break; - } - if(++it != tilegroups_map.end()) - cur_tilegroup = (*it).first; - else - cur_tilegroup = tilegroups_map.begin()->first; - + if(cur_tilegroup.empty()) + { + cur_tilegroup = tilegroups_map.begin()->first; + } + else + { + it = tilegroups_map.find(cur_tilegroup); + if((++it) == tilegroups_map.end()) + { + cur_tilegroup = tilegroups_map.begin()->first; + } + else + { + cur_tilegroup = (*it).first; + } + } + cur_objects.clear(); break; case BUTTON_WHEELDOWN: - it = tilegroups_map.find(cur_tilegroup); - if(it == tilegroups_map.begin()) - { - cur_tilegroup = tilegroups_map.rbegin()->first; - cur_objects.clear(); - break; - } - if(--it != --tilegroups_map.begin()) - cur_tilegroup = (*it).first; - else - cur_tilegroup = tilegroups_map.rbegin()->first; - + it = tilegroups_map.find(cur_tilegroup); + if(it == tilegroups_map.begin()) + { + cur_tilegroup = tilegroups_map.rbegin()->first; + cur_objects.clear(); + break; + } + if(--it != --tilegroups_map.begin()) + cur_tilegroup = (*it).first; + else + cur_tilegroup = tilegroups_map.rbegin()->first; + cur_objects.clear(); break; default: @@ -1278,35 +1283,35 @@ select_objects_menu->set_pos(screen->w - 64,100,-0.5,0.5); break; case BUTTON_WHEELUP: - it = objects_map.find(cur_objects); - if(it == objects_map.end()) - { - cur_objects = objects_map.begin()->first; - cur_tilegroup.clear(); - break; - } - if(++it != objects_map.end()) - cur_objects = (*it).first; - else - cur_objects = objects_map.begin()->first; - + it = objects_map.find(cur_objects); + if(it == objects_map.end()) + { + cur_objects = objects_map.begin()->first; + cur_tilegroup.clear(); + break; + } + if(++it != objects_map.end()) + cur_objects = (*it).first; + else + cur_objects = objects_map.begin()->first; + cur_tilegroup.clear(); break; case BUTTON_WHEELDOWN: - it = objects_map.find(cur_objects); - if(it == objects_map.begin()) - { - cur_objects = objects_map.rbegin()->first; - cur_tilegroup.clear(); - break; - } - if(--it != --objects_map.begin()) - cur_objects = (*it).first; - else - cur_objects = objects_map.rbegin()->first; - + it = objects_map.find(cur_objects); + if(it == objects_map.begin()) + { + cur_objects = objects_map.rbegin()->first; + cur_tilegroup.clear(); + break; + } + if(--it != --objects_map.begin()) + cur_objects = (*it).first; + else + cur_objects = objects_map.rbegin()->first; + cur_tilegroup.clear(); - break; + break; break; default: break; @@ -1390,7 +1395,7 @@ if(!Menu::current()) { show_minimap = false; - + le_move_left_bt->event(event); le_move_right_bt->event(event); switch(le_move_left_bt->get_state()) @@ -1404,7 +1409,7 @@ show_minimap = true; break; case BUTTON_CLICKED: - show_minimap = true; + show_minimap = true; break; default: break; @@ -1421,12 +1426,12 @@ show_minimap = true; break; case BUTTON_CLICKED: - show_minimap = true; + show_minimap = true; break; default: break; } - + } } |
From: Ryan F. <sik...@us...> - 2004-05-06 18:50:03
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29359 Modified Files: world.cpp Log Message: - undid Ricardo's changes Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- world.cpp 6 May 2004 15:03:24 -0000 1.66 +++ world.cpp 6 May 2004 18:49:52 -0000 1.67 @@ -320,9 +320,9 @@ { int tux_pos_x = (int)(tux.base.x + (tux.base.width/2)); - if (/*level->back_scrolling || */debug_mode) + if (level->back_scrolling || debug_mode) { - if(tux.old_dir != tux.dir) + if(tux.old_dir != tux.dir && level->back_scrolling) scrolling_timer.start(CHANGE_DIR_SCROLL_SPEED); if(scrolling_timer.check()) @@ -340,13 +340,9 @@ final_scroll_x = tux_pos_x - X_SPACE; } -/* scroll_x += (final_scroll_x - scroll_x) + scroll_x += (final_scroll_x - scroll_x) / (frame_ratio * (CHANGE_DIR_SCROLL_SPEED / 100)) + (tux.physic.get_velocity_x() * frame_ratio + tux.physic.get_acceleration_x() * frame_ratio * frame_ratio); -*/ - -scroll_x += ((final_scroll_x - scroll_x) / CHANGE_DIR_SCROLL_SPEED) * frame_ratio; - // std::cerr << tux_pos_x << " " << final_scroll_x << " " << scroll_x << std::endl; } @@ -354,13 +350,13 @@ { if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && debug_mode) + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) scroll_x = tux_pos_x - X_SPACE; else { if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); - else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && debug_mode) + else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) scroll_x = tux_pos_x - X_SPACE; } } @@ -368,10 +364,20 @@ else /*no debug*/ { - if (scroll_x < tux_pos_x - (screen->w - X_SPACE)) + if (tux.physic.get_velocity_x() > 0 && scroll_x < tux_pos_x - (screen->w - X_SPACE)) scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.physic.get_velocity_x() < 0 && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + scroll_x = tux_pos_x - X_SPACE; + else + { + if (tux.dir == RIGHT && scroll_x < tux_pos_x - (screen->w - X_SPACE)) + scroll_x = tux_pos_x - (screen->w - X_SPACE); + else if (tux.dir == LEFT && scroll_x > tux_pos_x - X_SPACE && level->back_scrolling) + scroll_x = tux_pos_x - X_SPACE; } + } + // this code prevent the screen to scroll before the start or after the level's end if(scroll_x < 0) scroll_x = 0; |
From: Tobias Gl??er <to...@us...> - 2004-05-06 16:50:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5704/src Modified Files: leveleditor.cpp Log Message: Fixed bug where tiles/objects could be drawn while scrolling. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- leveleditor.cpp 5 May 2004 22:04:47 -0000 1.88 +++ leveleditor.cpp 6 May 2004 16:50:30 -0000 1.89 @@ -1362,11 +1362,8 @@ } } - if(!Menu::current()) + if(!Menu::current() && !show_minimap) { - le_move_left_bt->event(event); - le_move_right_bt->event(event); - if(le_mouse_pressed[LEFT]) { if(le_current.IsTile()) @@ -1393,28 +1390,43 @@ if(!Menu::current()) { show_minimap = false; - - if(le_move_left_bt->get_state() == BUTTON_PRESSED) + + le_move_left_bt->event(event); + le_move_right_bt->event(event); + switch(le_move_left_bt->get_state()) { + case BUTTON_PRESSED: pos_x -= 192; show_minimap = true; - } - else if(le_move_left_bt->get_state() == BUTTON_HOVER) - { + break; + case BUTTON_HOVER: pos_x -= 32; - show_minimap = true; + show_minimap = true; + break; + case BUTTON_CLICKED: + show_minimap = true; + break; + default: + break; } - if(le_move_right_bt->get_state() == BUTTON_PRESSED) + switch(le_move_right_bt->get_state()) { + case BUTTON_PRESSED: pos_x += 192; - show_minimap = true; - } - else if(le_move_right_bt->get_state() == BUTTON_HOVER) - { + show_minimap = true; + break; + case BUTTON_HOVER: pos_x += 32; - show_minimap = true; + show_minimap = true; + break; + case BUTTON_CLICKED: + show_minimap = true; + break; + default: + break; } + } } |