super-tux-commit Mailing List for Super Tux (Page 45)
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: Marek M. <wa...@us...> - 2004-07-27 16:48:31
|
Update of /cvsroot/super-tux/supertux/data/levels/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv848/data/levels/default Modified Files: Tag: supertux_0_1_1_branch bonusisland.stwm Log Message: added secret path to the bonus island map (the actual secret level will follow) Index: bonusisland.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/default/Attic/bonusisland.stwm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- bonusisland.stwm 10 Jul 2004 21:53:08 -0000 1.1.2.1 +++ bonusisland.stwm 27 Jul 2004 16:48:18 -0000 1.1.2.2 @@ -36,18 +36,18 @@ 9 9 9 9 9 14 18 18 18 18 18 18 21 47 20 13 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 14 21 47 17 9 9 9 14 18 18 18 13 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 23 16 16 16 16 16 16 16 22 47 23 16 16 16 16 16 16 16 16 16 16 16 16 16 22 47 23 16 16 16 16 16 16 16 22 47 23 16 16 16 16 16 16 16 16 16 16 22 47 17 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 15 37 40 40 40 40 40 40 40 40 40 44 40 40 40 40 40 40 40 40 40 40 40 43 40 40 40 44 40 40 40 40 40 40 40 40 40 44 40 40 40 40 40 40 40 40 40 40 40 40 42 17 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 14 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 21 47 20 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 13 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 22 47 23 16 16 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 19 37 40 39 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 49 50 51 47 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 60 19 52 53 54 47 60 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 55 56 57 42 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 19 19 19 19 19 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 14 18 18 18 18 18 18 18 13 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 15 37 40 40 40 40 40 40 40 40 40 44 40 40 40 40 40 40 40 40 40 40 40 43 40 40 40 44 40 40 40 40 40 40 40 40 40 61 40 40 40 40 40 40 40 40 40 40 40 40 42 17 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 14 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 21 47 20 18 18 18 18 18 18 18 18 18 18 18 18 62 18 18 18 18 18 18 18 18 18 18 18 18 18 13 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 63 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 47 17 9 9 9 9 9 9 9 9 9 9 9 9 63 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 22 47 23 16 16 12 9 9 9 9 9 9 9 9 9 63 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 19 37 40 39 19 17 9 9 9 9 9 9 9 9 9 63 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 49 50 51 47 19 17 9 9 9 9 9 9 9 9 9 63 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 60 19 52 53 54 47 60 17 9 9 9 9 9 9 9 9 9 63 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 55 56 57 42 19 17 9 9 9 9 9 9 9 11 16 64 16 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 19 19 19 19 19 19 19 17 9 9 9 9 9 9 9 14 21 19 19 23 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 14 18 18 18 18 18 18 18 13 9 9 9 9 9 9 9 9 14 21 19 20 13 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 14 18 13 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 )) (levels @@ -99,6 +99,9 @@ (level (name "bonus1/castle.stl") (x 35) (y 36)) + (level (name "bonus1/secret.stl") + (x 49) + (y 37)) ) ) |
From: Marek M. <wa...@us...> - 2004-07-27 16:48:31
|
Update of /cvsroot/super-tux/supertux/data/images/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv848/data/images/worldmap Modified Files: Tag: supertux_0_1_1_branch antarctica.stwt Log Message: added secret path to the bonus island map (the actual secret level will follow) Index: antarctica.stwt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/worldmap/antarctica.stwt,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -d -r1.7 -r1.7.2.1 --- antarctica.stwt 26 Apr 2004 14:16:22 -0000 1.7 +++ antarctica.stwt 27 Jul 2004 16:48:18 -0000 1.7.2.1 @@ -282,6 +282,38 @@ (south #t) (west #f) (east #f)) - ) + + ;; SECRET PATHS, derived from tiles 44,18,9,16 + (tile (id 61) + (image "road_new.png") + (north #t) + (south #t) + (west #t) + (east #t)) + + (tile (id 62) + (image "snow8.png") + (stop #f) + (north #t) + (south #t) + (west #f) + (east #f)) + + (tile (id 63) + (image "water.png") + (stop #f) + (north #t) + (south #t) + (west #f) + (east #f)) + + (tile (id 64) + (image "snow6.png") + (stop #f) + (north #t) + (south #t) + (west #f) + (east #f)) +) ;; EOF ;; |
From: Ricardo C. <rm...@us...> - 2004-07-27 16:44:47
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv318/src Modified Files: worldmap.cpp worldmap.h Log Message: Added auto-walk field for world maps. (auto-walk #f) makes the player not walk or walk (default to walk) after finishing level. Not sure if it is usefull, but could be used in levels in a hidden place to not reveal the next one. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- worldmap.cpp 27 Jul 2004 13:25:05 -0000 1.102 +++ worldmap.cpp 27 Jul 2004 16:44:34 -0000 1.103 @@ -436,6 +436,7 @@ reader.read_string("level", level.name, true); reader.read_int("x", level.x); reader.read_int("y", level.y); + reader.read_bool("auto-path", &level.auto_path); level.swap_x = level.swap_y = -1; reader.read_int("swap-x", level.swap_x); reader.read_int("swap-y", level.swap_y); @@ -695,7 +696,7 @@ else player_status.bonus = PlayerStatus::NO_BONUS; - if (old_level_state != level->solved) + if (old_level_state != level->solved && level->auto_path) { // Try to detect the next direction to which we should walk // FIXME: Mostly a hack Direction dir = D_NONE; Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- worldmap.h 20 Jul 2004 18:04:49 -0000 1.39 +++ worldmap.h 27 Jul 2004 16:44:36 -0000 1.40 @@ -167,6 +167,9 @@ /** Quit the worldmap */ bool quit_worldmap; + /** If false, disables the auto walking after finishing a level */ + bool auto_path; + // Directions which are walkable from this level bool north; bool east; |
From: Ricardo C. <rm...@us...> - 2004-07-27 16:43:34
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32536/src Modified Files: Tag: supertux_0_1_1_branch level.cpp Log Message: Added the layer that has more than 15 tiles in the warning message, so that they are not equal, and thus looking like if it was a bug. Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.68.2.3 retrieving revision 1.68.2.4 diff -u -d -r1.68.2.3 -r1.68.2.4 --- level.cpp 27 Jul 2004 13:03:07 -0000 1.68.2.3 +++ level.cpp 27 Jul 2004 16:43:23 -0000 1.68.2.4 @@ -482,8 +482,9 @@ { if(j >= 15) { - std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; - std::cerr << "The level might not be finishable anymore!\n"; + std::cerr << "Warning: Level higher than 15 interactive tiles." + "Ignoring by cutting tiles.\n" + "The level might not be finishable anymore!\n"; break; } @@ -500,8 +501,8 @@ { if(j >= 15) { - std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; - std::cerr << "The level might not be finishable anymore!\n"; + std::cerr << "Warning: Level higher than 15 background tiles." + "Ignoring by cutting tiles.\n"; break; } @@ -518,8 +519,8 @@ { if(j >= 15) { - std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; - std::cerr << "The level might not be finishable anymore!\n"; + std::cerr << "Warning: Level higher than 15 foreground tiles." + "Ignoring by cutting tiles.\n"; break; } |
From: Ricardo C. <rm...@us...> - 2004-07-27 16:37:09
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31152/src Modified Files: Tag: supertux_0_1_1_branch worldmap.cpp worldmap.h Log Message: Added map-message and auto-walk fields for world maps. (map-message "message") shows 'message' when player is in the specified position. It can or not have a level specified as well. (auto-walk #f) makes the player not walk or walk (default to walk) after finishing level. Not sure if it is usefull, but could be used in levels in a hidden place. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.68.2.4 retrieving revision 1.68.2.5 diff -u -d -r1.68.2.4 -r1.68.2.5 --- worldmap.cpp 18 Jul 2004 11:58:15 -0000 1.68.2.4 +++ worldmap.cpp 27 Jul 2004 16:36:59 -0000 1.68.2.5 @@ -434,8 +434,12 @@ reader.read_string("name", &level.name); reader.read_int("x", &level.x); reader.read_int("y", &level.y); + reader.read_string("map-message", &level.display_map_message); + level.auto_path = true; + reader.read_bool("auto-path", &level.auto_path); - get_level_title(&level); // get level's title + if(!level.name.empty()) + get_level_title(&level); // get level's title levels.push_back(level); } @@ -666,7 +670,7 @@ else player_status.bonus = PlayerStatus::NO_BONUS; - if (old_level_state != level->solved) + if (old_level_state != level->solved && level->auto_path) { // Try to detect the next direction to which we should walk // FIXME: Mostly a hack Direction dir = D_NONE; @@ -804,6 +808,9 @@ for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) { + if(i->name.empty()) + continue; + if (i->solved) leveldot_green->draw(i->x*32 + offset.x, i->y*32 + offset.y); @@ -848,7 +855,15 @@ if (i->x == tux->get_tile_pos().x && i->y == tux->get_tile_pos().y) { + if(!i->name.empty()) + { white_text->draw_align(i->title.c_str(), screen->w/2, screen->h, A_HMIDDLE, A_BOTTOM); + } + + /* Display a message in the map, if any as been selected */ + if(!i->display_map_message.empty()) + gold_text->draw_align(i->display_map_message.c_str(), + screen->w/2, screen->h - 30,A_HMIDDLE, A_BOTTOM); break; } } Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.28.2.4 retrieving revision 1.28.2.5 diff -u -d -r1.28.2.4 -r1.28.2.5 --- worldmap.h 18 Jul 2004 19:12:28 -0000 1.28.2.4 +++ worldmap.h 27 Jul 2004 16:37:00 -0000 1.28.2.5 @@ -160,6 +160,12 @@ successfully completed */ std::string extro_filename; + /** Message to show in the Map */ + std::string display_map_message; + + /** If false, disables the auto walking after finishing a level */ + bool auto_path; + // Directions which are walkable from this level bool north; bool east; |
From: Ryan F. <sik...@us...> - 2004-07-27 16:35:02
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30718 Modified Files: level_subset.cpp Log Message: - added include Index: level_subset.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level_subset.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- level_subset.cpp 25 Jul 2004 19:03:36 -0000 1.6 +++ level_subset.cpp 27 Jul 2004 16:34:52 -0000 1.7 @@ -19,6 +19,8 @@ // 02111-1307, USA. #include <assert.h> +#include <unistd.h> + #include "app/setup.h" #include "level.h" #include "app/globals.h" |
From: Tobias G. <to...@us...> - 2004-07-27 13:25:15
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25595/src Modified Files: gameloop.cpp title.cpp worldmap.cpp Log Message: C++ifyied SuperTux ticks. Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- title.cpp 26 Jul 2004 18:09:14 -0000 1.112 +++ title.cpp 27 Jul 2004 13:25:05 -0000 1.113 @@ -262,7 +262,7 @@ walking = true; - st_pause_ticks_init(); + Ticks::pause_init(); titlesession = new GameSession(datadir + "/levels/misc/menu.stl", ST_GL_DEMO_GAME); @@ -280,7 +280,7 @@ /* --- Main title loop: --- */ frame = 0; - update_time = st_get_ticks(); + update_time = Ticks::get(); random_timer.start(rand() % 2000 + 2000); Menu::set_current(main_menu); @@ -289,7 +289,7 @@ { // if we spent to much time on a menu entry if( (update_time - last_update_time) > 1000) - update_time = last_update_time = st_get_ticks(); + update_time = last_update_time = Ticks::get(); // Calculate the movement-factor double frame_ratio = ((double)(update_time-last_update_time))/((double)FRAME_RATE); @@ -349,7 +349,7 @@ leveleditor->run(); delete leveleditor; Menu::set_current(main_menu); - update_time = st_get_ticks(); + update_time = Ticks::get(); break; case MNID_CREDITS: display_text_file("CREDITS", SCROLL_SPEED_CREDITS, white_big_text , white_text, white_small_text, blue_text ); @@ -381,7 +381,7 @@ update_load_save_game_menu(load_game_menu); Menu::set_current(main_menu); - update_time = st_get_ticks(); + update_time = Ticks::get(); } else if (process_load_game_menu()) { @@ -389,7 +389,7 @@ titlesession->get_current_sector()->activate(); titlesession->set_current(); //titletux.level_begin(); - update_time = st_get_ticks(); + update_time = Ticks::get(); } } else if(menu == contrib_menu) @@ -408,7 +408,7 @@ /* Set the time of the last update and the time of the current update */ last_update_time = update_time; - update_time = st_get_ticks(); + update_time = Ticks::get(); /* Pause: */ frame++; Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- worldmap.cpp 26 Jul 2004 15:48:38 -0000 1.101 +++ worldmap.cpp 27 Jul 2004 13:25:05 -0000 1.102 @@ -960,7 +960,7 @@ unsigned int last_update_time; unsigned int update_time; - last_update_time = update_time = st_get_ticks(); + last_update_time = update_time = Ticks::get(); DrawingContext context; while(!quit) @@ -973,7 +973,7 @@ delta = .3f; last_update_time = update_time; - update_time = st_get_ticks(); + update_time = Ticks::get(); Vector tux_pos = tux->get_pos(); if (1) Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.159 retrieving revision 1.160 diff -u -d -r1.159 -r1.160 --- gameloop.cpp 26 Jul 2004 18:09:13 -0000 1.159 +++ gameloop.cpp 27 Jul 2004 13:25:05 -0000 1.160 @@ -189,8 +189,8 @@ GameSession::start_timers() { time_left.start(level->time_left*1000); - st_pause_ticks_init(); - update_time = st_get_ticks(); + Ticks::pause_init(); + update_time = Ticks::get(); } void @@ -219,7 +219,7 @@ tux.key_event((SDLKey)keymap.fire, UP); Menu::set_current(game_menu); - st_pause_ticks_start(); + Ticks::pause_start(); } } @@ -250,7 +250,7 @@ { Menu::current()->event(event); if(!Menu::current()) - st_pause_ticks_stop(); + Ticks::pause_stop(); } switch(event.type) @@ -283,7 +283,7 @@ else // normal mode { if(!Menu::current() && !game_pause) - st_pause_ticks_stop(); + Ticks::pause_stop(); SDL_Event event; while (SDL_PollEvent(&event)) @@ -293,7 +293,7 @@ { Menu::current()->event(event); if(!Menu::current()) - st_pause_ticks_stop(); + Ticks::pause_stop(); } else { @@ -350,12 +350,12 @@ if(game_pause) { game_pause = false; - st_pause_ticks_stop(); + Ticks::pause_stop(); } else { game_pause = true; - st_pause_ticks_start(); + Ticks::pause_start(); } } break; @@ -573,10 +573,10 @@ switch (game_menu->check()) { case MNID_CONTINUE: - st_pause_ticks_stop(); + Ticks::pause_stop(); break; case MNID_ABORTLEVEL: - st_pause_ticks_stop(); + Ticks::pause_stop(); exit_status = ES_LEVEL_ABORT; break; } @@ -600,7 +600,7 @@ int fps_cnt = 0; - update_time = last_update_time = st_get_ticks(); + update_time = last_update_time = Ticks::get(); // Eat unneeded events SDL_Event event; @@ -654,7 +654,7 @@ /* Set the time of the last update and the time of the current update */ last_update_time = update_time; - update_time = st_get_ticks(); + update_time = Ticks::get(); /* Pause till next frame, if the machine running the game is too fast: */ /* FIXME: Works great for in OpenGl mode, where the CPU doesn't have to do that much. But @@ -662,7 +662,7 @@ if(last_update_time >= update_time - 12) { SDL_Delay(10); - update_time = st_get_ticks(); + update_time = Ticks::get(); } /* Handle time: */ @@ -866,7 +866,7 @@ Menu::set_current(main_menu); - st_pause_ticks_stop(); + Ticks::pause_stop(); return true; } else |
From: Tobias G. <to...@us...> - 2004-07-27 13:25:14
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25595/lib/special Modified Files: timer.cpp timer.h Log Message: C++ifyied SuperTux ticks. Index: timer.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/timer.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- timer.h 21 Jul 2004 16:51:52 -0000 1.3 +++ timer.h 27 Jul 2004 13:25:05 -0000 1.4 @@ -24,22 +24,29 @@ namespace SuperTux { - extern unsigned int st_pause_ticks, st_pause_count; + class Ticks + { + public: + /// Time a game is running. (Non-pause mode, etc.) + static unsigned int get(void); - /// Time a game is running. (Non-pause mode, etc.) - unsigned int st_get_ticks(void); + static void pause_init(void); + static void pause_start(void); + static void pause_stop(void); + static bool pause_started(void); - void st_pause_ticks_init(void); - void st_pause_ticks_start(void); - void st_pause_ticks_stop(void); - bool st_pause_ticks_started(void); + private: + static unsigned int pause_ticks; + static unsigned int pause_count; + + }; /// Timer /** This class can be used as stop watch for example. It's also possible to calculate frames per seconds and things like that with it. It's a general timing class, but it - can esspecially be used together with st_get_ticks(). */ + can esspecially be used together with Ticks::get(). */ class Timer { public: @@ -51,8 +58,8 @@ Timer(); /// Initialize the timer. - /** @param st_ticks: If true internally st_get_ticks() is used, else SDL_GetTicks() is used. */ - void init(bool st_ticks); + /** @param st_ticks: If true internally Ticks::get() is used, else SDL_GetTicks() is used. */ + void init(bool game_ticks); /// Start the timer with the given period (in ms). void start(unsigned int period); Index: timer.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/timer.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- timer.cpp 22 Jul 2004 19:07:50 -0000 1.3 +++ timer.cpp 27 Jul 2004 13:25:05 -0000 1.4 @@ -23,40 +23,40 @@ using namespace SuperTux; -unsigned int SuperTux::st_pause_ticks, SuperTux::st_pause_count; +unsigned int Ticks::pause_ticks, Ticks::pause_count; -unsigned int SuperTux::st_get_ticks(void) +unsigned int Ticks::get(void) { - if(st_pause_count != 0) - return /*SDL_GetTicks()*/ - st_pause_ticks /*- SDL_GetTicks()*/ + st_pause_count; + if(pause_count != 0) + return /*SDL_GetTicks()*/ - pause_ticks /*- SDL_GetTicks()*/ + pause_count; else - return SDL_GetTicks() - st_pause_ticks; + return SDL_GetTicks() - pause_ticks; } -void SuperTux::st_pause_ticks_init(void) +void Ticks::pause_init(void) { - st_pause_ticks = 0; - st_pause_count = 0; + pause_ticks = 0; + pause_count = 0; } -void SuperTux::st_pause_ticks_start(void) +void Ticks::pause_start(void) { - if(st_pause_count == 0) - st_pause_count = SDL_GetTicks(); + if(pause_count == 0) + pause_count = SDL_GetTicks(); } -void SuperTux::st_pause_ticks_stop(void) +void Ticks::pause_stop(void) { -if(st_pause_count == 0) +if(pause_count == 0) return; - st_pause_ticks += SDL_GetTicks() - st_pause_count; - st_pause_count = 0; + pause_ticks += SDL_GetTicks() - pause_count; + pause_count = 0; } -bool SuperTux::st_pause_ticks_started(void) +bool Ticks::pause_started(void) { -if(st_pause_count == 0) +if(pause_count == 0) return false; else return true; @@ -68,11 +68,11 @@ } void -Timer::init(bool st_ticks) +Timer::init(bool game_ticks) { period = 0; time = 0; - get_ticks = st_ticks ? st_get_ticks : SDL_GetTicks; + get_ticks = game_ticks ? Ticks::get : SDL_GetTicks; } void @@ -85,7 +85,7 @@ void Timer::stop() { - if(get_ticks == st_get_ticks) + if(get_ticks == get_ticks) init(true); else init(false); @@ -136,7 +136,7 @@ ::fwrite(&period,sizeof(unsigned int),1,fi); ::fwrite(&diff_ticks,sizeof(unsigned int),1,fi); - if(get_ticks == st_get_ticks) + if(get_ticks == get_ticks) tick_mode = true; else tick_mode = false; @@ -154,7 +154,7 @@ ::fread(&tick_mode,sizeof(unsigned int),1,fi); if (tick_mode) - get_ticks = st_get_ticks; + get_ticks = get_ticks; else get_ticks = SDL_GetTicks; |
From: Marek M. <wa...@us...> - 2004-07-27 13:03:15
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21290 Modified Files: Tag: supertux_0_1_1_branch NEWS Log Message: extended "level higher than 15 tiles" warning (why is it shown three times, anyway?) Index: NEWS =================================================================== RCS file: /cvsroot/super-tux/supertux/NEWS,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -u -d -r1.9.2.1 -r1.9.2.2 --- NEWS 27 Jul 2004 12:50:08 -0000 1.9.2.1 +++ NEWS 27 Jul 2004 13:03:06 -0000 1.9.2.2 @@ -3,7 +3,7 @@ * one new island containing contributed and "official" new levels * a "new" enemy: The Fish * support for auto-scrolling levels - * extended world map format + * extended world map format, support for contributed world maps * thrown ice blocks destroy wooden crates now * minor bug fixes |
From: Marek M. <wa...@us...> - 2004-07-27 13:03:15
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21290/src Modified Files: Tag: supertux_0_1_1_branch level.cpp Log Message: extended "level higher than 15 tiles" warning (why is it shown three times, anyway?) Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.68.2.2 retrieving revision 1.68.2.3 diff -u -d -r1.68.2.2 -r1.68.2.3 --- level.cpp 27 Jul 2004 12:00:14 -0000 1.68.2.2 +++ level.cpp 27 Jul 2004 13:03:07 -0000 1.68.2.3 @@ -483,6 +483,7 @@ if(j >= 15) { std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + std::cerr << "The level might not be finishable anymore!\n"; break; } @@ -500,6 +501,7 @@ if(j >= 15) { std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + std::cerr << "The level might not be finishable anymore!\n"; break; } @@ -517,6 +519,7 @@ if(j >= 15) { std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + std::cerr << "The level might not be finishable anymore!\n"; break; } |
From: Marek M. <wa...@us...> - 2004-07-27 12:50:16
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19131 Modified Files: Tag: supertux_0_1_1_branch NEWS Log Message: updated NEWS with changes that will appear in 0.1.2 (If I forgot anything, please add) Index: NEWS =================================================================== RCS file: /cvsroot/super-tux/supertux/NEWS,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -d -r1.9 -r1.9.2.1 --- NEWS 10 May 2004 22:23:14 -0000 1.9 +++ NEWS 27 Jul 2004 12:50:08 -0000 1.9.2.1 @@ -1,3 +1,13 @@ +Super Tux 0.1.2 (upcoming release) +===================== + * one new island containing contributed and "official" new levels + * a "new" enemy: The Fish + * support for auto-scrolling levels + * extended world map format + * thrown ice blocks destroy wooden crates now + * minor bug fixes + + Super Tux 0.1.1 (11 May 04) ===================== * new handwritten font |
From: Ricardo C. <rm...@us...> - 2004-07-27 12:00:32
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9898/src Modified Files: Tag: supertux_0_1_1_branch level.cpp Log Message: Fixed bug: in the last commit that avoided the crash in level bigger than 15 vertical tiles, I was cutting the X tiles, not the Y. It was a typo in the name of the variable. Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.68.2.1 retrieving revision 1.68.2.2 diff -u -d -r1.68.2.1 -r1.68.2.2 --- level.cpp 26 Jul 2004 18:04:30 -0000 1.68.2.1 +++ level.cpp 27 Jul 2004 12:00:14 -0000 1.68.2.2 @@ -480,9 +480,9 @@ int j = 0; for(vector<int>::iterator it = ia_tm.begin(); it != ia_tm.end(); ++it, ++i) { - if(i > 15) + if(j >= 15) { - std::cerr << "Error: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; break; } @@ -497,9 +497,9 @@ i = j = 0; for(vector<int>::iterator it = bg_tm.begin(); it != bg_tm.end(); ++it, ++i) { - if(i > 15) + if(j >= 15) { - std::cerr << "Error: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; break; } @@ -514,9 +514,9 @@ i = j = 0; for(vector<int>::iterator it = fg_tm.begin(); it != fg_tm.end(); ++it, ++i) { - if(i > 15) + if(j >= 15) { - std::cerr << "Error: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + std::cerr << "Warning: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; break; } |
From: Tobias G. <to...@us...> - 2004-07-27 09:56:24
|
Update of /cvsroot/super-tux/supertux/lib/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22928/lib/utils Modified Files: configfile.cpp Log Message: commited fix by Leo Savernik <l.s...@ao...>. Index: configfile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/utils/configfile.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- configfile.cpp 25 Jul 2004 19:03:35 -0000 1.4 +++ configfile.cpp 27 Jul 2004 09:56:14 -0000 1.5 @@ -28,7 +28,7 @@ using namespace SuperTux; #ifdef WIN32 -const char * config_filename = "/st_config.dat"; +const char * config_filename = ("/"+ package_symbol_name + "_config.dat").c_str(); #else const char * config_filename = "/config"; #endif @@ -138,6 +138,7 @@ customload(reader); lisp_free(root_obj); + fclose(file); } void Config::save () @@ -173,6 +174,7 @@ customsave(config); fprintf(config, ")\n"); + fclose(config); } } |
From: Tobias G. <to...@us...> - 2004-07-27 09:56:24
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22928/lib/app Modified Files: setup.cpp Log Message: commited fix by Leo Savernik <l.s...@ao...>. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- setup.cpp 26 Jul 2004 18:09:12 -0000 1.7 +++ setup.cpp 27 Jul 2004 09:56:14 -0000 1.8 @@ -604,9 +604,9 @@ void Termination::shutdown(void) { + config->save(); SoundManager::get()->close_audio(); SDL_Quit(); - config->save(); } /* --- ABORT! --- */ |
From: Tobias G. <to...@us...> - 2004-07-26 18:09:35
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28058/src Modified Files: Makefile.am badguy.cpp badguy.h camera.h collision.cpp gameloop.cpp intro.cpp leveleditor.cpp player.cpp player.h scene.cpp special.cpp supertux.cpp title.cpp Added Files: defines.h Log Message: Moved defines.h out of the library and back to src/. Made Menu independend of global MouseCursor variable. Index: scene.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- scene.cpp 20 Jul 2004 18:04:48 -0000 1.32 +++ scene.cpp 26 Jul 2004 18:09:14 -0000 1.33 @@ -20,7 +20,7 @@ #include <cstdlib> #include "scene.h" -#include "app/defines.h" +#include "defines.h" PlayerStatus player_status; Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.77 retrieving revision 1.78 diff -u -d -r1.77 -r1.78 --- player.h 25 Jul 2004 19:03:36 -0000 1.77 +++ player.h 26 Jul 2004 18:09:13 -0000 1.78 @@ -29,7 +29,7 @@ #include "collision.h" #include "special/moving_object.h" #include "math/physic.h" -#include "app/defines.h" +#include "defines.h" using namespace SuperTux; Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- Makefile.am 20 Jul 2004 18:07:30 -0000 1.38 +++ Makefile.am 26 Jul 2004 18:09:13 -0000 1.39 @@ -5,14 +5,14 @@ supertux_LDADD = $(top_builddir)/lib/libsupertux.la @LIBINTL@ supertux_SOURCES = badguy.cpp badguy.h bitmask.cpp bitmask.h camera.cpp \ - camera.h collision.cpp collision.h door.cpp door.h intro.cpp intro.h \ - gameloop.cpp gameloop.h high_scores.cpp high_scores.h interactive_object.cpp \ - interactive_object.h level.cpp level.h level_subset.cpp level_subset.h leveleditor.cpp \ - leveleditor.h particlesystem.cpp particlesystem.h player.cpp player.h scene.cpp \ - scene.h special.cpp special.h supertux.cpp title.cpp title.h worldmap.cpp \ - worldmap.h tile.h tile.cpp tile_manager.h tile_manager.cpp resources.h \ - resources.cpp gameobjs.h gameobjs.cpp background.h background.cpp tilemap.h \ - tilemap.cpp serializable.h sector.cpp sector.h misc.h misc.cpp + camera.h collision.cpp collision.h door.cpp door.h intro.cpp intro.h \ + gameloop.cpp gameloop.h high_scores.cpp high_scores.h interactive_object.cpp \ + interactive_object.h level.cpp level.h level_subset.cpp level_subset.h leveleditor.cpp \ + leveleditor.h particlesystem.cpp particlesystem.h player.cpp player.h scene.cpp \ + scene.h special.cpp special.h supertux.cpp title.cpp title.h worldmap.cpp \ + worldmap.h tile.h tile.cpp tile_manager.h tile_manager.cpp resources.h \ + resources.cpp gameobjs.h gameobjs.cpp background.h background.cpp tilemap.h \ + tilemap.cpp serializable.h sector.cpp sector.h misc.h misc.cpp defines.h # EOF # INCLUDES = -I$(top_srcdir)/lib Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -u -d -r1.64 -r1.65 --- special.cpp 25 Jul 2004 19:03:36 -0000 1.64 +++ special.cpp 26 Jul 2004 18:09:14 -0000 1.65 @@ -22,7 +22,7 @@ #include "SDL.h" -#include "app/defines.h" +#include "defines.h" #include "special.h" #include "camera.h" #include "gameloop.h" Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.158 retrieving revision 1.159 diff -u -d -r1.158 -r1.159 --- gameloop.cpp 26 Jul 2004 15:48:38 -0000 1.158 +++ gameloop.cpp 26 Jul 2004 18:09:13 -0000 1.159 @@ -36,7 +36,7 @@ #include <ctype.h> #endif -#include "app/defines.h" +#include "defines.h" #include "app/globals.h" #include "gameloop.h" #include "video/screen.h" Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- badguy.h 21 Jul 2004 16:51:53 -0000 1.60 +++ badguy.h 26 Jul 2004 18:09:13 -0000 1.61 @@ -29,7 +29,7 @@ #include "video/surface.h" #include "math/physic.h" #include "special/sprite.h" -#include "app/defines.h" +#include "defines.h" #include "special/moving_object.h" #include "collision.h" #include "serializable.h" --- NEW FILE: defines.h --- // $Id: defines.h,v 1.49 2004/07/26 18:09:13 tobgle Exp $ // // SuperTux // Copyright (C) 2000 Bill Kendrick <bi...@ne...> // Copyright (C) 2004 Tobias Glaesser <tob...@gm...> // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // 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 // 02111-1307, USA. #ifndef SUPERTUX_DEFINES_H #define SUPERTUX_DEFINES_H 1 #include <config.h> /* Version: */ #ifndef VERSION #define VERSION "0.1.1" #endif enum Direction { LEFT = 0, RIGHT = 1 }; /* Direction (keyboard/joystick) states: */ #define UP 0 #define DOWN 1 /* Dying types: */ /* ---- NO 0 */ enum DyingType { DYING_NOT = 0, DYING_SQUISHED = 1, DYING_FALLING = 2 }; /* Screen-related stuff */ // +1 is needed because when tiles are wrapping around the screen there // are two partial tiles on the screen #define VISIBLE_TILES_X (25 +1) #define VISIBLE_TILES_Y (19 +1) /* Speed constraints: */ #define MAX_WALK_XM 2.3 #define MAX_RUN_XM 3.2 #define MAX_YM 20.0 #define MAX_JUMP_TIME 375 #define MAX_LIVES 99 #define WALK_SPEED 1.0 #define RUN_SPEED 1.5 #define JUMP_SPEED 1.2 /* gameplay related defines */ #define START_LIVES 4 #define MAX_FIRE_BULLETS 2 #define MAX_ICE_BULLETS 1 #define FROZEN_TIME 3000 #define YM_FOR_JUMP 6.0 #define WALK_ACCELERATION_X 0.03 #define RUN_ACCELERATION_X 0.04 #define KILL_BOUNCE_YM 8.0 #define SKID_XM 2.0 #define SKID_TIME 200 /* Size constraints: */ #define X_OFFSCREEN_DISTANCE (screen->w/2) #define Y_OFFSCREEN_DISTANCE (screen->h/2) /* Debugging */ #ifdef DEBUG #define DEBUG_MSG( msg ) { \ printf( msg ); printf("\n"); \ } #else #define DEBUG_MSG( msg ) {} #endif #define UNUSED_ARG(a) do {/* null */} while (&a == 0) #endif /*SUPERTUX_DEFINES_H*/ Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/collision.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- collision.cpp 20 Jul 2004 18:04:47 -0000 1.30 +++ collision.cpp 26 Jul 2004 18:09:13 -0000 1.31 @@ -19,7 +19,7 @@ // 02111-1307, USA. #include <cmath> -#include "app/defines.h" +#include "defines.h" #include "collision.h" #include "bitmask.h" #include "scene.h" Index: intro.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/intro.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- intro.cpp 26 Jul 2004 15:48:38 -0000 1.30 +++ intro.cpp 26 Jul 2004 18:09:13 -0000 1.31 @@ -19,7 +19,7 @@ #include "intro.h" #include "app/globals.h" -#include "app/defines.h" +#include "defines.h" #include "video/font.h" #include "video/screen.h" #include "resources.h" Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.143 retrieving revision 1.144 diff -u -d -r1.143 -r1.144 --- leveleditor.cpp 25 Jul 2004 19:03:36 -0000 1.143 +++ leveleditor.cpp 26 Jul 2004 18:09:13 -0000 1.144 @@ -34,7 +34,7 @@ #include "leveleditor.h" #include "video/screen.h" -#include "app/defines.h" +#include "defines.h" #include "app/globals.h" #include "app/setup.h" #include "sector.h" Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.147 retrieving revision 1.148 diff -u -d -r1.147 -r1.148 --- player.cpp 25 Jul 2004 19:03:36 -0000 1.147 +++ player.cpp 26 Jul 2004 18:09:13 -0000 1.148 @@ -24,7 +24,7 @@ #include "gameloop.h" #include "app/globals.h" #include "player.h" -#include "app/defines.h" +#include "defines.h" #include "scene.h" #include "tile.h" #include "special/sprite.h" Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- badguy.cpp 25 Jul 2004 19:03:36 -0000 1.111 +++ badguy.cpp 26 Jul 2004 18:09:13 -0000 1.112 @@ -24,7 +24,7 @@ #include <cmath> #include "app/globals.h" -#include "app/defines.h" +#include "defines.h" #include "special/sprite_manager.h" #include "utils/lispwriter.h" #include "badguy.h" Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- title.cpp 26 Jul 2004 15:48:38 -0000 1.111 +++ title.cpp 26 Jul 2004 18:09:14 -0000 1.112 @@ -34,7 +34,7 @@ #include <ctype.h> #endif -#include "app/defines.h" +#include "defines.h" #include "app/globals.h" #include "title.h" #include "video/screen.h" Index: camera.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/camera.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- camera.h 21 Jul 2004 16:51:53 -0000 1.11 +++ camera.h 26 Jul 2004 18:09:13 -0000 1.12 @@ -23,7 +23,7 @@ #include <vector> #include <cassert> -#include "app/defines.h" +#include "defines.h" #include "math/vector.h" #include "special/game_object.h" #include "video/drawing_context.h" Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- supertux.cpp 25 Jul 2004 19:03:36 -0000 1.28 +++ supertux.cpp 26 Jul 2004 18:09:14 -0000 1.29 @@ -24,7 +24,7 @@ #include <exception> #include "utils/exceptions.h" -#include "app/defines.h" +#include "defines.h" #include "app/globals.h" #include "app/setup.h" #include "intro.h" |
From: Tobias G. <to...@us...> - 2004-07-26 18:09:23
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28058/lib/gui Modified Files: menu.cpp Log Message: Moved defines.h out of the library and back to src/. Made Menu independend of global MouseCursor variable. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- menu.cpp 26 Jul 2004 15:48:37 -0000 1.5 +++ menu.cpp 26 Jul 2004 18:09:13 -0000 1.6 @@ -892,11 +892,13 @@ y < pos_y + get_height()/2) { active_item = (y - (pos_y - get_height()/2)) / 24; - mouse_cursor->set_state(MC_LINK); + if(MouseCursor::current()) + MouseCursor::current()->set_state(MC_LINK); } else { - mouse_cursor->set_state(MC_NORMAL); + if(MouseCursor::current()) + MouseCursor::current()->set_state(MC_NORMAL); } } break; |
From: Tobias G. <to...@us...> - 2004-07-26 18:09:22
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28058/lib/app Modified Files: setup.cpp Removed Files: defines.h Log Message: Moved defines.h out of the library and back to src/. Made Menu independend of global MouseCursor variable. --- defines.h DELETED --- Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- setup.cpp 26 Jul 2004 15:48:37 -0000 1.6 +++ setup.cpp 26 Jul 2004 18:09:12 -0000 1.7 @@ -42,7 +42,6 @@ #include <cctype> #include "../app/globals.h" -#include "../app/defines.h" #include "../app/setup.h" #include "../video/screen.h" #include "../video/surface.h" @@ -775,8 +774,8 @@ } else if (strcmp(argv[i], "--help") == 0) { /* Show help: */ - puts(_(" SuperTux " VERSION "\n" - " Please see the file \"README.txt\" for more details.\n")); + puts(_((" SuperTux " + package_version + "\n" + " Please see the file \"README.txt\" for more details.\n").c_str())); printf(_("Usage: %s [OPTIONS] FILENAME\n\n"), argv[0]); puts(_("Display Options:\n" " -f, --fullscreen Run in fullscreen mode.\n" |
From: Tobias G. <to...@us...> - 2004-07-26 18:09:22
|
Update of /cvsroot/super-tux/supertux/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28058/lib Modified Files: Makefile.am Log Message: Moved defines.h out of the library and back to src/. Made Menu independend of global MouseCursor variable. Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Makefile.am 25 Jul 2004 19:03:33 -0000 1.3 +++ Makefile.am 26 Jul 2004 18:09:12 -0000 1.4 @@ -31,8 +31,7 @@ libsupertuxspecialdir = $(libsupertuxdir)/special libsupertuxutilsdir = $(libsupertuxdir)/utils libsupertuxvideodir = $(libsupertuxdir)/video -libsupertuxapp_HEADERS =app/defines.h \ - app/setup.h \ +libsupertuxapp_HEADERS =app/setup.h \ app/gettext.h \ app/globals.h libsupertuxaudio_HEADERS =audio/musicref.h \ |
From: Ricardo C. <rm...@us...> - 2004-07-26 18:04:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27181/src Modified Files: Tag: supertux_0_1_1_branch level.cpp Log Message: Don't crash in levels bigger than 15 vertical tiles. Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.68 retrieving revision 1.68.2.1 diff -u -d -r1.68 -r1.68.2.1 --- level.cpp 10 May 2004 19:06:02 -0000 1.68 +++ level.cpp 26 Jul 2004 18:04:30 -0000 1.68.2.1 @@ -480,6 +480,12 @@ int j = 0; for(vector<int>::iterator it = ia_tm.begin(); it != ia_tm.end(); ++it, ++i) { + if(i > 15) + { + std::cerr << "Error: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + break; + } + ia_tiles[j][i] = (*it); if(i == width - 1) { @@ -491,6 +497,11 @@ i = j = 0; for(vector<int>::iterator it = bg_tm.begin(); it != bg_tm.end(); ++it, ++i) { + if(i > 15) + { + std::cerr << "Error: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + break; + } bg_tiles[j][i] = (*it); if(i == width - 1) @@ -503,6 +514,11 @@ i = j = 0; for(vector<int>::iterator it = fg_tm.begin(); it != fg_tm.end(); ++it, ++i) { + if(i > 15) + { + std::cerr << "Error: Level higher than 15 tiles. Ignoring by cutting tiles.\n"; + break; + } fg_tiles[j][i] = (*it); if(i == width - 1) |
From: Tobias G. <to...@us...> - 2004-07-26 15:48:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv708/src Modified Files: gameloop.cpp intro.cpp resources.cpp resources.h title.cpp worldmap.cpp Log Message: Made the SuperTux library again a bit more selfstanding. Moved global fonts to src/ and they are handled as static variables inside Menu:: and Button:: . Index: resources.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- resources.h 21 Jul 2004 16:51:53 -0000 1.13 +++ resources.h 26 Jul 2004 15:48:38 -0000 1.14 @@ -82,6 +82,14 @@ extern Menu* load_game_menu; extern Menu* save_game_menu; +extern Font* gold_text; +extern Font* white_text; +extern Font* blue_text; +extern Font* gray_text; +extern Font* white_small_text; +extern Font* white_big_text; +extern Font* yellow_nums; + void loadshared(); void unloadshared(); Index: intro.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/intro.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- intro.cpp 21 Jul 2004 16:51:53 -0000 1.29 +++ intro.cpp 26 Jul 2004 15:48:38 -0000 1.30 @@ -22,11 +22,12 @@ #include "app/defines.h" #include "video/font.h" #include "video/screen.h" +#include "resources.h" using namespace SuperTux; void draw_intro() { - display_text_file("intro.txt", 1); + display_text_file("intro.txt", 1, white_big_text , white_text, white_small_text, blue_text ); } Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.110 retrieving revision 1.111 diff -u -d -r1.110 -r1.111 --- title.cpp 25 Jul 2004 19:03:36 -0000 1.110 +++ title.cpp 26 Jul 2004 15:48:38 -0000 1.111 @@ -352,7 +352,7 @@ update_time = st_get_ticks(); break; case MNID_CREDITS: - display_text_file("CREDITS", SCROLL_SPEED_CREDITS); + display_text_file("CREDITS", SCROLL_SPEED_CREDITS, white_big_text , white_text, white_small_text, blue_text ); Menu::set_current(main_menu); break; case MNID_QUITMAINMENU: Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- worldmap.cpp 25 Jul 2004 19:03:36 -0000 1.100 +++ worldmap.cpp 26 Jul 2004 15:48:38 -0000 1.101 @@ -784,7 +784,7 @@ if (!level->extro_filename.empty()) { // Display a text file - display_text_file(level->extro_filename, SCROLL_SPEED_MESSAGE); + display_text_file(level->extro_filename, SCROLL_SPEED_MESSAGE, white_big_text , white_text, white_small_text, blue_text ); } if (level->swap_x != -1 && level->swap_y != -1) { Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.157 retrieving revision 1.158 diff -u -d -r1.157 -r1.158 --- gameloop.cpp 25 Jul 2004 19:03:36 -0000 1.157 +++ gameloop.cpp 26 Jul 2004 15:48:38 -0000 1.158 @@ -851,13 +851,19 @@ // shrink_fade(Point((screen->w/2),(screen->h/2)), 1000); fadeout(256); + + DrawingContext context; + context.draw_text_center(white_text, "Loading...", + Vector(0, screen->h/2), LAYER_FOREGROUND1); + context.do_drawing(); + WorldMapNS::WorldMap worldmap; - + // Load the game or at least set the savegame_file variable worldmap.loadgame(slotfile); worldmap.display(); - + Menu::set_current(main_menu); st_pause_ticks_stop(); Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- resources.cpp 25 Jul 2004 19:03:36 -0000 1.44 +++ resources.cpp 26 Jul 2004 15:48:38 -0000 1.45 @@ -28,6 +28,7 @@ #include "audio/sound_manager.h" #include "app/setup.h" #include "door.h" +#include "gui/button.h" Surface* img_waves[3]; Surface* img_water; @@ -76,9 +77,41 @@ "/sounds/explosion.wav" }; + +Font* gold_text; +Font* blue_text; +Font* gray_text; +Font* yellow_nums; +Font* white_text; +Font* white_small_text; +Font* white_big_text; + /* Load graphics/sounds shared between all levels: */ void loadshared() { + + /* Load global images: */ + gold_text = new Font(datadir + "/images/fonts/gold.png", Font::TEXT, 16,18); + blue_text = new Font(datadir + "/images/fonts/blue.png", Font::TEXT, 16,18,3); + white_text = new Font(datadir + "/images/fonts/white.png", + Font::TEXT, 16,18); + gray_text = new Font(datadir + "/images/fonts/gray.png", + Font::TEXT, 16,18); + white_small_text = new Font(datadir + "/images/fonts/white-small.png", + Font::TEXT, 8,9, 1); + white_big_text = new Font(datadir + "/images/fonts/white-big.png", + Font::TEXT, 20,22, 3); + yellow_nums = new Font(datadir + "/images/fonts/numbers.png", + Font::NUM, 32,32); + + Menu::default_font = white_text; + Menu::active_font = blue_text; + Menu::deactive_font = gray_text; + Menu::label_font = white_big_text; + Menu::field_font = gold_text; + + Button::info_font = white_small_text; + int i; sprite_manager = new SpriteManager(datadir + "/supertux.strf"); @@ -90,13 +123,13 @@ char img_name[1024]; for (int i = 0; i < GROWING_FRAMES; i++) - { - sprintf(img_name, "%s/images/shared/tux-grow-left-%i.png", datadir.c_str(), i+1); - growingtux_left[i] = new Surface(img_name, false); + { + sprintf(img_name, "%s/images/shared/tux-grow-left-%i.png", datadir.c_str(), i+1); + growingtux_left[i] = new Surface(img_name, false); - sprintf(img_name, "%s/images/shared/tux-grow-right-%i.png", datadir.c_str(), i+1); - growingtux_right[i] = new Surface(img_name, false); - } + sprintf(img_name, "%s/images/shared/tux-grow-right-%i.png", datadir.c_str(), i+1); + growingtux_right[i] = new Surface(img_name, false); + } smalltux.stand_left = sprite_manager->load("smalltux-stand-left"); smalltux.stand_right = sprite_manager->load("smalltux-stand-right"); @@ -165,56 +198,56 @@ img_water = new Surface(datadir + "/images/shared/water.png", false); img_waves[0] = new Surface(datadir + "/images/shared/waves-0.png", - true); + true); img_waves[1] = new Surface(datadir + "/images/shared/waves-1.png", - true); + true); img_waves[2] = new Surface(datadir + "/images/shared/waves-2.png", - true); + true); /* Pole: */ img_pole = new Surface(datadir + "/images/shared/pole.png", true); img_poletop = new Surface(datadir + "/images/shared/poletop.png", - true); + true); /* Flag: */ img_flag[0] = new Surface(datadir + "/images/shared/flag-0.png", - true); + true); img_flag[1] = new Surface(datadir + "/images/shared/flag-1.png", - true); + true); /* Cloud: */ img_cloud[0][0] = new Surface(datadir + "/images/shared/cloud-00.png", - true); + true); img_cloud[0][1] = new Surface(datadir + "/images/shared/cloud-01.png", - true); + true); img_cloud[0][2] = new Surface(datadir + "/images/shared/cloud-02.png", - true); + true); img_cloud[0][3] = new Surface(datadir + "/images/shared/cloud-03.png", - true); + true); img_cloud[1][0] = new Surface(datadir + "/images/shared/cloud-10.png", - true); + true); img_cloud[1][1] = new Surface(datadir + "/images/shared/cloud-11.png", - true); + true); img_cloud[1][2] = new Surface(datadir + "/images/shared/cloud-12.png", - true); + true); img_cloud[1][3] = new Surface(datadir + "/images/shared/cloud-13.png", - true); + true); /* Bad guys: */ @@ -230,22 +263,22 @@ door = sprite_manager->load("door"); for (int i = 0; i < DOOR_OPENING_FRAMES; i++) { - sprintf(img_name, "%s/images/shared/door-%i.png", datadir.c_str(), i+1); - door_opening[i] = new Surface(img_name, false); + sprintf(img_name, "%s/images/shared/door-%i.png", datadir.c_str(), i+1); + door_opening[i] = new Surface(img_name, false); } /* Distros: */ img_distro[0] = new Surface(datadir + "/images/tilesets/coin1.png", - true); + true); img_distro[1] = new Surface(datadir + "/images/tilesets/coin2.png", - true); + true); img_distro[2] = new Surface(datadir + "/images/tilesets/coin3.png", - true); + true); img_distro[3] = new Surface(datadir + "/images/tilesets/coin2.png", - true); + true); /* Tux life: */ @@ -263,17 +296,29 @@ Send a mail to me: neo...@us..., if you have another opinion. :) */ for (i = 0; i < NUM_SOUNDS; i++) - SoundManager::get()->add_sound(SoundManager::get()->load_sound(datadir + soundfilenames[i]),i); + SoundManager::get + ()->add_sound(SoundManager::get + ()->load_sound(datadir + soundfilenames[i]),i); /* Herring song */ - herring_song = SoundManager::get()->load_music(datadir + "/music/SALCON.MOD"); - level_end_song = SoundManager::get()->load_music(datadir + "/music/leveldone.mod"); + herring_song = SoundManager::get + ()->load_music(datadir + "/music/SALCON.MOD"); + level_end_song = SoundManager::get + ()->load_music(datadir + "/music/leveldone.mod"); } - /* Free shared data: */ void unloadshared(void) { + /* Free global images: */ + delete gold_text; + delete white_text; + delete blue_text; + delete gray_text; + delete white_small_text; + delete white_big_text; + delete yellow_nums; + int i; free_special_gfx(); |
From: Tobias G. <to...@us...> - 2004-07-26 15:48:47
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv708/lib/gui Modified Files: button.cpp button.h menu.cpp menu.h Log Message: Made the SuperTux library again a bit more selfstanding. Moved global fonts to src/ and they are handled as static variables inside Menu:: and Button:: . Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- menu.cpp 25 Jul 2004 19:03:34 -0000 1.4 +++ menu.cpp 26 Jul 2004 15:48:37 -0000 1.5 @@ -50,12 +50,17 @@ std::vector<Menu*> Menu::last_menus; Menu* Menu::current_ = 0; +Font* Menu::default_font; +Font* Menu::active_font; +Font* Menu::deactive_font; +Font* Menu::label_font; +Font* Menu::field_font; /* just displays a Yes/No text that can be used to confirm stuff */ bool SuperTux::confirm_dialog(Surface *background, std::string text) { //Surface* cap_screen = Surface::CaptureScreen(); - + Menu* dialog = new Menu; dialog->additem(MN_DEACTIVE, text,0,0); dialog->additem(MN_HL,"",0,0); @@ -68,44 +73,44 @@ DrawingContext context; while(true) - { - SDL_Event event; - - while (SDL_PollEvent(&event)) { - dialog->event(event); - } + SDL_Event event; - if(background == NULL) - context.draw_gradient(Color(200,240,220), Color(200,200,220), LAYER_BACKGROUND0); - else - context.draw_surface(background, Vector(0,0), LAYER_BACKGROUND0); + while (SDL_PollEvent(&event)) + { + dialog->event(event); + } - dialog->draw(context); - dialog->action(); + if(background == NULL) + context.draw_gradient(Color(200,240,220), Color(200,200,220), LAYER_BACKGROUND0); + else + context.draw_surface(background, Vector(0,0), LAYER_BACKGROUND0); - switch (dialog->check()) - { - case true: - //delete cap_screen; - Menu::set_current(0); - delete dialog; - return true; - break; - case false: - //delete cap_screen; - Menu::set_current(0); - delete dialog; - return false; - break; - default: - break; - } + dialog->draw(context); + dialog->action(); - mouse_cursor->draw(context); - context.do_drawing(); - SDL_Delay(25); - } + switch (dialog->check()) + { + case true: + //delete cap_screen; + Menu::set_current(0); + delete dialog; + return true; + break; + case false: + //delete cap_screen; + Menu::set_current(0); + delete dialog; + return false; + break; + default: + break; + } + + mouse_cursor->draw(context); + context.do_drawing(); + SDL_Delay(25); + } return false; } @@ -124,16 +129,16 @@ Menu::pop_current() { if (!last_menus.empty()) - { - current_ = last_menus.back(); - current_->effect.start(500); + { + current_ = last_menus.back(); + current_->effect.start(500); - last_menus.pop_back(); - } + last_menus.pop_back(); + } else - { - current_ = 0; - } + { + current_ = 0; + } } void @@ -167,10 +172,10 @@ pnew_item->input[0] = '\0'; if(kind_ == MN_STRINGSELECT) - { - pnew_item->list = (string_list_type*) malloc(sizeof(string_list_type)); - string_list_init(pnew_item->list); - } + { + pnew_item->list = (string_list_type*) malloc(sizeof(string_list_type)); + string_list_init(pnew_item->list); + } else pnew_item->list = NULL; @@ -188,22 +193,22 @@ MenuItem::change_text(const char *text_) { if (text_) - { - free(text); - text = (char*) malloc(sizeof(char )*(strlen(text_)+1)); - strcpy(text, text_); - } + { + free(text); + text = (char*) malloc(sizeof(char )*(strlen(text_)+1)); + strcpy(text, text_); + } } void MenuItem::change_input(const char *text_) { if(text) - { - free(input); - input = (char*) malloc(sizeof(char )*(strlen(text_)+1)); - strcpy(input, text_); - } + { + free(input); + input = (char*) malloc(sizeof(char )*(strlen(text_)+1)); + strcpy(input, text_); + } } std::string MenuItem::get_input_with_symbol(bool active_item) @@ -211,16 +216,16 @@ if(!active_item) input_flickering = true; else - { - if(input_flickering_timer.get_left() < 0) { - if(input_flickering) - input_flickering = false; - else - input_flickering = true; - input_flickering_timer.start(FLICK_CURSOR_TIME); + if(input_flickering_timer.get_left() < 0) + { + if(input_flickering) + input_flickering = false; + else + input_flickering = true; + input_flickering_timer.start(FLICK_CURSOR_TIME); + } } - } char str[1024]; if(input_flickering) @@ -237,51 +242,51 @@ void Menu::get_controlfield_key_into_input(MenuItem *item) { switch(*item->int_p) - { - case SDLK_UP: - item->change_input(_("Up cursor")); - break; - case SDLK_DOWN: - item->change_input(_("Down cursor")); - break; - case SDLK_LEFT: - item->change_input(_("Left cursor")); - break; - case SDLK_RIGHT: - item->change_input(_("Right cursor")); - break; - case SDLK_RETURN: - item->change_input(_("Return")); - break; - case SDLK_SPACE: - item->change_input(_("Space")); - break; - case SDLK_RSHIFT: - item->change_input(_("Right Shift")); - break; - case SDLK_LSHIFT: - item->change_input(_("Left Shift")); - break; - case SDLK_RCTRL: - item->change_input(_("Right Control")); - break; - case SDLK_LCTRL: - item->change_input(_("Left Control")); - break; - case SDLK_RALT: - item->change_input(_("Right Alt")); - break; - case SDLK_LALT: - item->change_input(_("Left Alt")); - break; - default: { - char tmp[64]; - snprintf(tmp, 64, "%d", *item->int_p); - item->change_input(tmp); + case SDLK_UP: + item->change_input(_("Up cursor")); + break; + case SDLK_DOWN: + item->change_input(_("Down cursor")); + break; + case SDLK_LEFT: + item->change_input(_("Left cursor")); + break; + case SDLK_RIGHT: + item->change_input(_("Right cursor")); + break; + case SDLK_RETURN: + item->change_input(_("Return")); + break; + case SDLK_SPACE: + item->change_input(_("Space")); + break; + case SDLK_RSHIFT: + item->change_input(_("Right Shift")); + break; + case SDLK_LSHIFT: + item->change_input(_("Left Shift")); + break; + case SDLK_RCTRL: + item->change_input(_("Right Control")); + break; + case SDLK_LCTRL: + item->change_input(_("Left Control")); + break; + case SDLK_RALT: + item->change_input(_("Right Alt")); + break; + case SDLK_LALT: + item->change_input(_("Left Alt")); + break; + default: + { + char tmp[64]; + snprintf(tmp, 64, "%d", *item->int_p); + item->change_input(tmp); + } + break; } - break; - } } /* Set ControlField for joystick button */ @@ -296,14 +301,14 @@ Menu::~Menu() { if(item.size() != 0) - { - for(unsigned int i = 0; i < item.size(); ++i) { - free(item[i].text); - free(item[i].input); - string_list_free(item[i].list); + for(unsigned int i = 0; i < item.size(); ++i) + { + free(item[i].text); + free(item[i].input); + string_list_free(item[i].list); + } } - } } @@ -355,133 +360,133 @@ { hit_item = -1; if(item.size() != 0) - { - switch(menuaction) { - case MENU_ACTION_UP: - if (active_item > 0) - --active_item; - else - active_item = int(item.size())-1; - break; - - case MENU_ACTION_DOWN: - if(active_item < int(item.size())-1) - ++active_item; - else - active_item = 0; - break; - - case MENU_ACTION_LEFT: - if(item[active_item].kind == MN_STRINGSELECT - && item[active_item].list->num_items != 0) - { - if(item[active_item].list->active_item > 0) - --item[active_item].list->active_item; - else - item[active_item].list->active_item = item[active_item].list->num_items-1; - } - break; - - case MENU_ACTION_RIGHT: - if(item[active_item].kind == MN_STRINGSELECT - && item[active_item].list->num_items != 0) - { - if(item[active_item].list->active_item < item[active_item].list->num_items-1) - ++item[active_item].list->active_item; - else - item[active_item].list->active_item = 0; - } - break; - - case MENU_ACTION_HIT: - { - hit_item = active_item; - switch (item[active_item].kind) + switch(menuaction) { - case MN_GOTO: - if (item[active_item].target_menu != NULL) - Menu::push_current(item[active_item].target_menu); + case MENU_ACTION_UP: + if (active_item > 0) + --active_item; else - puts("NULLL"); + active_item = int(item.size())-1; break; - case MN_TOGGLE: - item[active_item].toggled = !item[active_item].toggled; + case MENU_ACTION_DOWN: + if(active_item < int(item.size())-1) + ++active_item; + else + active_item = 0; break; - case MN_ACTION: - Menu::set_current(0); - item[active_item].toggled = true; - break; - case MN_TEXTFIELD: - case MN_NUMFIELD: - menuaction = MENU_ACTION_DOWN; - action(); + case MENU_ACTION_LEFT: + if(item[active_item].kind == MN_STRINGSELECT + && item[active_item].list->num_items != 0) + { + if(item[active_item].list->active_item > 0) + --item[active_item].list->active_item; + else + item[active_item].list->active_item = item[active_item].list->num_items-1; + } break; - case MN_BACK: - Menu::pop_current(); - break; - default: + case MENU_ACTION_RIGHT: + if(item[active_item].kind == MN_STRINGSELECT + && item[active_item].list->num_items != 0) + { + if(item[active_item].list->active_item < item[active_item].list->num_items-1) + ++item[active_item].list->active_item; + else + item[active_item].list->active_item = 0; + } break; - } - } - break; - case MENU_ACTION_REMOVE: - if(item[active_item].kind == MN_TEXTFIELD - || item[active_item].kind == MN_NUMFIELD) - { - if(item[active_item].input != NULL) - { - int i = strlen(item[active_item].input); - - while(delete_character > 0) /* remove charactes */ + case MENU_ACTION_HIT: { - item[active_item].input[i-1] = '\0'; - delete_character--; + hit_item = active_item; + switch (item[active_item].kind) + { + case MN_GOTO: + if (item[active_item].target_menu != NULL) + Menu::push_current(item[active_item].target_menu); + else + puts("NULLL"); + break; + + case MN_TOGGLE: + item[active_item].toggled = !item[active_item].toggled; + break; + + case MN_ACTION: + Menu::set_current(0); + item[active_item].toggled = true; + break; + case MN_TEXTFIELD: + case MN_NUMFIELD: + menuaction = MENU_ACTION_DOWN; + action(); + break; + + case MN_BACK: + Menu::pop_current(); + break; + default: + break; + } } - } - } - break; + break; - case MENU_ACTION_INPUT: - if(item[active_item].kind == MN_TEXTFIELD - || (item[active_item].kind == MN_NUMFIELD && mn_input_char >= '0' && mn_input_char <= '9')) - { - if(item[active_item].input != NULL) - { - int i = strlen(item[active_item].input); - item[active_item].input = (char*) realloc(item[active_item].input,sizeof(char)*(i + 2)); - item[active_item].input[i] = mn_input_char; - item[active_item].input[i+1] = '\0'; - } - else - { - item[active_item].input = (char*) malloc(2*sizeof(char)); - item[active_item].input[0] = mn_input_char; - item[active_item].input[1] = '\0'; - } - } + case MENU_ACTION_REMOVE: + if(item[active_item].kind == MN_TEXTFIELD + || item[active_item].kind == MN_NUMFIELD) + { + if(item[active_item].input != NULL) + { + int i = strlen(item[active_item].input); - case MENU_ACTION_NONE: - break; + while(delete_character > 0) /* remove charactes */ + { + item[active_item].input[i-1] = '\0'; + delete_character--; + } + } + } + break; + + case MENU_ACTION_INPUT: + if(item[active_item].kind == MN_TEXTFIELD + || (item[active_item].kind == MN_NUMFIELD && mn_input_char >= '0' && mn_input_char <= '9')) + { + if(item[active_item].input != NULL) + { + int i = strlen(item[active_item].input); + item[active_item].input = (char*) realloc(item[active_item].input,sizeof(char)*(i + 2)); + item[active_item].input[i] = mn_input_char; + item[active_item].input[i+1] = '\0'; + } + else + { + item[active_item].input = (char*) malloc(2*sizeof(char)); + item[active_item].input[0] = mn_input_char; + item[active_item].input[1] = '\0'; + } + } + + case MENU_ACTION_NONE: + break; + } } - } MenuItem& new_item = item[active_item]; if(new_item.kind == MN_DEACTIVE || new_item.kind == MN_LABEL || new_item.kind == MN_HL) - { - // Skip the horzontal line item - if (menuaction != MENU_ACTION_UP && menuaction != MENU_ACTION_DOWN) - menuaction = MENU_ACTION_DOWN; + { + // Skip the horzontal line item + if (menuaction != MENU_ACTION_UP && menuaction != MENU_ACTION_DOWN) + menuaction = MENU_ACTION_DOWN; - if (item.size() > 1) - action(); - } + if (item.size() > 1) + action(); + } menuaction = MENU_ACTION_NONE; @@ -500,8 +505,8 @@ void Menu::draw_item(DrawingContext& context, - int index, // Position of the current item in the menu - int menu_width, int menu_height) + int index, // Position of the current item in the menu + int menu_width, int menu_height) { MenuItem& pitem = item[index]; @@ -515,7 +520,7 @@ effect_offset = (index % 2) ? effect_time : -effect_time; } - Font* text_font = white_text; + Font* text_font = default_font; int x_pos = pos_x; int y_pos = pos_y + 24*index - menu_height/2 + 12 + effect_offset; int shadow_size = 2; @@ -528,182 +533,182 @@ x_pos += 24 - menu_width/2 + (text_width + input_width + list_width)/2; if(index == active_item) - { - shadow_size = 3; - text_font = blue_text; - } - - switch (pitem.kind) - { - case MN_DEACTIVE: { - context.draw_text_center(gray_text, pitem.text, - Vector(0, y_pos - int(blue_text->get_height()/2)), - LAYER_GUI); - break; + shadow_size = 3; + text_font = active_font; } - case MN_HL: - { - // TODO - int x = pos_x - menu_width/2; - int y = y_pos - 12 - effect_offset; - /* Draw a horizontal line with a little 3d effect */ - context.draw_filled_rect(Vector(x, y + 6), - Vector(menu_width, 4), Color(150,200,255,225), LAYER_GUI); - context.draw_filled_rect(Vector(x, y + 6), - Vector(menu_width, 2), Color(255,255,255,255), LAYER_GUI); - break; - } - case MN_LABEL: - { - context.draw_text_center(white_big_text, - pitem.text, Vector(0, y_pos - int(white_big_text->get_height()/2)), - LAYER_GUI); - break; - } - case MN_TEXTFIELD: - case MN_NUMFIELD: - case MN_CONTROLFIELD_KB: - case MN_CONTROLFIELD_JS: + switch (pitem.kind) { - int width = text_width + input_width + 5; - int text_pos = screen->w/2 - width/2; - int input_pos = text_pos + text_width + 10; + case MN_DEACTIVE: + { + context.draw_text_center(deactive_font, pitem.text, + Vector(0, y_pos - int(deactive_font->get_height()/2)), + LAYER_GUI); + break; + } - context.draw_filled_rect( + case MN_HL: + { + // TODO + int x = pos_x - menu_width/2; + int y = y_pos - 12 - effect_offset; + /* Draw a horizontal line with a little 3d effect */ + context.draw_filled_rect(Vector(x, y + 6), + Vector(menu_width, 4), Color(150,200,255,225), LAYER_GUI); + context.draw_filled_rect(Vector(x, y + 6), + Vector(menu_width, 2), Color(255,255,255,255), LAYER_GUI); + break; + } + case MN_LABEL: + { + context.draw_text_center(label_font, + pitem.text, Vector(0, y_pos - int(label_font->get_height()/2)), + LAYER_GUI); + break; + } + case MN_TEXTFIELD: + case MN_NUMFIELD: + case MN_CONTROLFIELD_KB: + case MN_CONTROLFIELD_JS: + { + int width = text_width + input_width + 5; + int text_pos = screen->w/2 - width/2; + int input_pos = text_pos + text_width + 10; + + context.draw_filled_rect( Vector(input_pos - 5, y_pos - 10), Vector(input_width + 10, 20), Color(255,255,255,255), LAYER_GUI-5); - context.draw_filled_rect( + context.draw_filled_rect( Vector(input_pos - 4, y_pos - 9), Vector(input_width + 8, 18), Color(0,0,0,128), LAYER_GUI-4); - if(pitem.kind == MN_CONTROLFIELD_KB) - get_controlfield_key_into_input(&pitem); - else if (pitem.kind == MN_CONTROLFIELD_JS) - get_controlfield_js_into_input(&pitem); + if(pitem.kind == MN_CONTROLFIELD_KB) + get_controlfield_key_into_input(&pitem); + else if (pitem.kind == MN_CONTROLFIELD_JS) + get_controlfield_js_into_input(&pitem); - if(pitem.kind == MN_TEXTFIELD || pitem.kind == MN_NUMFIELD) - { - if(active_item == index) - context.draw_text(gold_text, - pitem.get_input_with_symbol(true), - Vector(input_pos, y_pos - int(gold_text->get_height()/2)), - LAYER_GUI); + if(pitem.kind == MN_TEXTFIELD || pitem.kind == MN_NUMFIELD) + { + if(active_item == index) + context.draw_text(field_font, + pitem.get_input_with_symbol(true), + Vector(input_pos, y_pos - int(field_font->get_height()/2)), + LAYER_GUI); + else + context.draw_text(field_font, + pitem.get_input_with_symbol(false), + Vector(input_pos, y_pos - int(field_font->get_height()/2)), + LAYER_GUI); + } else - context.draw_text(gold_text, - pitem.get_input_with_symbol(false), - Vector(input_pos, y_pos - int(gold_text->get_height()/2)), - LAYER_GUI); - } - else - context.draw_text(gold_text, pitem.input, - Vector(input_pos, y_pos - int(gold_text->get_height()/2)), - LAYER_GUI); + context.draw_text(field_font, pitem.input, + Vector(input_pos, y_pos - int(field_font->get_height()/2)), + LAYER_GUI); - context.draw_text(text_font, pitem.text, - Vector(text_pos, y_pos - int(text_font->get_height()/2)), - LAYER_GUI); - break; - } - case MN_STRINGSELECT: - { - int list_pos_2 = list_width + 16; - int list_pos = list_width/2; - int text_pos = (text_width + 16)/2; + context.draw_text(text_font, pitem.text, + Vector(text_pos, y_pos - int(text_font->get_height()/2)), + LAYER_GUI); + break; + } + case MN_STRINGSELECT: + { + int list_pos_2 = list_width + 16; + int list_pos = list_width/2; + int text_pos = (text_width + 16)/2; - /* Draw arrows */ - context.draw_surface(arrow_left, - Vector(x_pos - list_pos + text_pos - 17, y_pos - 8), - LAYER_GUI); - context.draw_surface(arrow_right, - Vector(x_pos - list_pos + text_pos - 1 + list_pos_2, y_pos - 8), - LAYER_GUI); + /* Draw arrows */ + context.draw_surface(arrow_left, + Vector(x_pos - list_pos + text_pos - 17, y_pos - 8), + LAYER_GUI); + context.draw_surface(arrow_right, + Vector(x_pos - list_pos + text_pos - 1 + list_pos_2, y_pos - 8), + LAYER_GUI); - /* Draw input background */ - context.draw_filled_rect( + /* Draw input background */ + context.draw_filled_rect( Vector(x_pos - list_pos + text_pos - 1, y_pos - 10), Vector(list_pos_2 + 2, 20), Color(255,255,255,255), LAYER_GUI - 4); - context.draw_filled_rect( + context.draw_filled_rect( Vector(x_pos - list_pos + text_pos, y_pos - 9), Vector(list_pos_2, 18), Color(0,0,0,128), LAYER_GUI - 5); - context.draw_text_center(text_font, string_list_active(pitem.list), - Vector(text_pos, y_pos - int(text_font->get_height()/2)), - LAYER_GUI); - context.draw_text_center(text_font, pitem.text, - Vector(list_pos_2/2, y_pos - int(text_font->get_height()/2)), - LAYER_GUI); - break; - } - case MN_BACK: - { + context.draw_text_center(text_font, string_list_active(pitem.list), + Vector(text_pos, y_pos - int(text_font->get_height()/2)), + LAYER_GUI); + context.draw_text_center(text_font, pitem.text, + Vector(list_pos_2/2, y_pos - int(text_font->get_height()/2)), + LAYER_GUI); + break; + } + case MN_BACK: + { + context.draw_text_center(text_font, pitem.text, + Vector(0, y_pos - int(text_font->get_height()/2)), + LAYER_GUI); + context.draw_surface(back, + Vector(x_pos + text_width/2 + 16, y_pos - 8), + LAYER_GUI); + break; + } + + case MN_TOGGLE: + { + context.draw_text_center(text_font, pitem.text, + Vector(0, y_pos - (text_font->get_height()/2)), + LAYER_GUI); + + if(pitem.toggled) + context.draw_surface(checkbox_checked, + Vector(x_pos + (text_width+16)/2, y_pos - 8), + LAYER_GUI + 1); + else + context.draw_surface(checkbox, + Vector(x_pos + (text_width+16)/2, y_pos - 8), + LAYER_GUI + 1); + break; + } + case MN_ACTION: context.draw_text_center(text_font, pitem.text, - Vector(0, y_pos - int(text_font->get_height()/2)), - LAYER_GUI); - context.draw_surface(back, - Vector(x_pos + text_width/2 + 16, y_pos - 8), - LAYER_GUI); + Vector(0, y_pos - int(text_font->get_height()/2)), + LAYER_GUI); break; - } - case MN_TOGGLE: - { + case MN_GOTO: context.draw_text_center(text_font, pitem.text, - Vector(0, y_pos - (text_font->get_height()/2)), - LAYER_GUI); - - if(pitem.toggled) - context.draw_surface(checkbox_checked, - Vector(x_pos + (text_width+16)/2, y_pos - 8), - LAYER_GUI + 1); - else - context.draw_surface(checkbox, - Vector(x_pos + (text_width+16)/2, y_pos - 8), - LAYER_GUI + 1); + Vector(0, y_pos - int(text_font->get_height()/2)), + LAYER_GUI); break; } - case MN_ACTION: - context.draw_text_center(text_font, pitem.text, - Vector(0, y_pos - int(text_font->get_height()/2)), - LAYER_GUI); - break; - - case MN_GOTO: - context.draw_text_center(text_font, pitem.text, - Vector(0, y_pos - int(text_font->get_height()/2)), - LAYER_GUI); - break; - } } int Menu::get_width() const -{ - /* The width of the menu has to be more than the width of the text - with the most characters */ - int menu_width = 0; - for(unsigned int i = 0; i < item.size(); ++i) { - int w = strlen(item[i].text) + (item[i].input ? strlen(item[i].input) + 1 : 0) + strlen(string_list_active(item[i].list)); - if( w > menu_width ) - { - menu_width = w; - if( item[i].kind == MN_TOGGLE) - menu_width += 2; - } - } + /* The width of the menu has to be more than the width of the text + with the most characters */ + int menu_width = 0; + for(unsigned int i = 0; i < item.size(); ++i) + { + int w = strlen(item[i].text) + (item[i].input ? strlen(item[i].input) + 1 : 0) + strlen(string_list_active(item[i].list)); + if( w > menu_width ) + { + menu_width = w; + if( item[i].kind == MN_TOGGLE) + menu_width += 2; + } + } - return (menu_width * 16 + 24); -} + return (menu_width * 16 + 24); + } int Menu::get_height() const -{ - return item.size() * 24; -} + { + return item.size() * 24; + } /* Draw the current menu. */ void @@ -714,24 +719,24 @@ /* Draw a transparent background */ context.draw_filled_rect( - Vector(pos_x - menu_width/2, pos_y - 24*item.size()/2 - 10), - Vector(menu_width,menu_height + 20), - Color(150,180,200,125), LAYER_GUI-10); + Vector(pos_x - menu_width/2, pos_y - 24*item.size()/2 - 10), + Vector(menu_width,menu_height + 20), + Color(150,180,200,125), LAYER_GUI-10); for(unsigned int i = 0; i < item.size(); ++i) - { - draw_item(context, i, menu_width, menu_height); - } + { + draw_item(context, i, menu_width, menu_height); + } } MenuItem& Menu::get_item_by_id(int id) { for(std::vector<MenuItem>::iterator i = item.begin(); i != item.end(); ++i) - { - if(i->id == id) - return *i; - } + { + if(i->id == id) + return *i; + } assert(false); static MenuItem dummyitem; @@ -833,7 +838,7 @@ } } break; - + case SDL_JOYAXISMOTION: if(event.jaxis.axis == joystick_keymap.y_axis) { @@ -854,7 +859,7 @@ case SDL_JOYBUTTONDOWN: if (item[active_item].kind == MN_CONTROLFIELD_JS) { - // FIXME: This next line does nothing useable, right? + // FIXME: This next line does nothing useable, right? // *item[active_item].int_p = key; menuaction = MENU_ACTION_DOWN; } @@ -867,9 +872,9 @@ int y = event.motion.y; if(x > pos_x - get_width()/2 && - x < pos_x + get_width()/2 && - y > pos_y - get_height()/2 && - y < pos_y + get_height()/2) + x < pos_x + get_width()/2 && + y > pos_y - get_height()/2 && + y < pos_y + get_height()/2) { menuaction = MENU_ACTION_HIT; } @@ -882,9 +887,9 @@ int y = event.motion.y; if(x > pos_x - get_width()/2 && - x < pos_x + get_width()/2 && - y > pos_y - get_height()/2 && - y < pos_y + get_height()/2) + x < pos_x + get_width()/2 && + y > pos_y - get_height()/2 && + y < pos_y + get_height()/2) { active_item = (y - (pos_y - get_height()/2)) / 24; mouse_cursor->set_state(MC_LINK); Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- menu.h 22 Jul 2004 19:07:50 -0000 1.3 +++ menu.h 26 Jul 2004 15:48:37 -0000 1.4 @@ -25,6 +25,7 @@ #include "SDL.h" #include "../video/surface.h" +#include "../video/font.h" #include "../special/timer.h" #include "../special/base.h" #include "../special/stringlist.h" @@ -130,6 +131,12 @@ Timer joystick_timer; public: + static Font* default_font; + static Font* active_font; + static Font* deactive_font; + static Font* label_font; + static Font* field_font; + Timer effect; int arrange_left; int active_item; Index: button.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/button.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- button.h 22 Jul 2004 19:07:50 -0000 1.4 +++ button.h 26 Jul 2004 15:48:37 -0000 1.5 @@ -24,6 +24,7 @@ #include <vector> #include "../video/surface.h" +#include "../video/font.h" #include "../special/timer.h" namespace SuperTux @@ -81,6 +82,8 @@ // void set_drawable(Drawable* newdrawable) // { drawable = newdrawable; } + static Font* info_font; + private: static Timer popup_timer; // Drawable* drawable; Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/button.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- button.cpp 25 Jul 2004 19:03:34 -0000 1.4 +++ button.cpp 26 Jul 2004 15:48:37 -0000 1.5 @@ -30,6 +30,7 @@ using namespace SuperTux; Timer Button::popup_timer; +Font* Button::info_font = 0; Button::Button(Surface* button_image, const std::string& ninfo, SDLKey nshortcut, int x, int y, int mw, int mh) @@ -121,13 +122,13 @@ char str[80]; int i = -32; - if(0 > rect.x - white_small_text->get_text_width(info)) - i = rect.w + (int)white_small_text->get_text_width(info); + if(0 > rect.x - info_font->get_text_width(info)) + i = rect.w + (int)info_font->get_text_width(info); if(!info.empty()) - context.draw_text(white_small_text, info, Vector(i + rect.x - white_small_text->get_text_width(info), rect.y), LAYER_GUI); + context.draw_text(info_font, info, Vector(i + rect.x - info_font->get_text_width(info), rect.y), LAYER_GUI); sprintf(str,"(%s)", SDL_GetKeyName(shortcut)); - context.draw_text(white_small_text, str, Vector(i + rect.x - white_small_text->get_text_width(str), rect.y + white_small_text->get_height()+2), LAYER_GUI); + context.draw_text(info_font, str, Vector(i + rect.x - info_font->get_text_width(str), rect.y + info_font->get_height()+2), LAYER_GUI); } if(state == BUTTON_PRESSED || state == BUTTON_DEACTIVE) fillrect(rect.x,rect.y,rect.w,rect.h,75,75,75,200); |
From: Tobias G. <to...@us...> - 2004-07-26 15:48:47
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv708/lib/video Modified Files: font.cpp font.h screen.cpp Log Message: Made the SuperTux library again a bit more selfstanding. Moved global fonts to src/ and they are handled as static variables inside Menu:: and Button:: . Index: font.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- font.cpp 22 Jul 2004 19:07:51 -0000 1.3 +++ font.cpp 26 Jul 2004 15:48:37 -0000 1.4 @@ -131,7 +131,7 @@ #define SCROLL 60 #define ITEMS_SPACE 4 -void SuperTux::display_text_file(const std::string& file, float scroll_speed) +void SuperTux::display_text_file(const std::string& file, float scroll_speed, Font* heading_font, Font* normal_font, Font* small_font, Font* reference_font ) { std::string text; std::vector<std::string> names; @@ -229,18 +229,18 @@ float y = 0; for(size_t i = 0; i < names.size(); i++) { if(names[i].size() == 0) { - y += white_text->get_height() + ITEMS_SPACE; + y += normal_font->get_height() + ITEMS_SPACE; continue; } Font* font = 0; switch(names[i][0]) { - case ' ': font = white_small_text; break; - case '\t': font = white_text; break; - case '-': font = white_big_text; break; - case '*': font = blue_text; break; - default: font = blue_text; break; + case ' ': font = small_font; break; + case '\t': font = normal_font; break; + case '-': font = heading_font; break; + case '*': font = reference_font; break; + default: font = reference_font; break; } context.draw_text_center(font, Index: font.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- font.h 25 Jul 2004 19:03:35 -0000 1.4 +++ font.h 26 Jul 2004 15:48:38 -0000 1.5 @@ -29,10 +29,6 @@ namespace SuperTux { - /** Reads a text file (using LispReader, so it as to be in its formatting) - and displays it in a StarTrek fashion */ - void display_text_file(const std::string& file, float scroll_speed); - /// Font class Font { @@ -75,6 +71,11 @@ int last_char; }; + + /** Reads a text file (using LispReader, so it as to be in its formatting) + and displays it in a StarTrek fashion */ + void display_text_file(const std::string& file, float scroll_speed, Font* heading_font, Font* normal_font, Font* small_font, Font* reference_font ); + } //namespace SuperTux #endif /*SUPERTUX_FONT_H*/ Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/screen.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- screen.cpp 22 Jul 2004 19:07:51 -0000 1.3 +++ screen.cpp 26 Jul 2004 15:48:38 -0000 1.4 @@ -264,11 +264,7 @@ } fillrect(0, 0, screen->w, screen->h, 0, 0, 0, 255); - - DrawingContext context; - context.draw_text_center(white_text, "Loading...", - Vector(0, screen->h/2), LAYER_FOREGROUND1); - context.do_drawing(); + } void SuperTux::shrink_fade(const Vector& point, int fade_time) |
From: Tobias G. <to...@us...> - 2004-07-26 15:48:46
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv708/lib/app Modified Files: globals.cpp globals.h setup.cpp setup.h Log Message: Made the SuperTux library again a bit more selfstanding. Moved global fonts to src/ and they are handled as static variables inside Menu:: and Button:: . Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- setup.cpp 25 Jul 2004 19:03:34 -0000 1.5 +++ setup.cpp 26 Jul 2004 15:48:37 -0000 1.6 @@ -346,20 +346,6 @@ SDL_EnableUNICODE(1); - /* Load global images: */ - gold_text = new Font(datadir + "/images/fonts/gold.png", Font::TEXT, 16,18); - blue_text = new Font(datadir + "/images/fonts/blue.png", Font::TEXT, 16,18,3); - white_text = new Font(datadir + "/images/fonts/white.png", - Font::TEXT, 16,18); - gray_text = new Font(datadir + "/images/fonts/gray.png", - Font::TEXT, 16,18); - white_small_text = new Font(datadir + "/images/fonts/white-small.png", - Font::TEXT, 8,9, 1); - white_big_text = new Font(datadir + "/images/fonts/white-big.png", - Font::TEXT, 20,22, 3); - yellow_nums = new Font(datadir + "/images/fonts/numbers.png", - Font::NUM, 32,32); - /* Load GUI/menu images: */ checkbox = new Surface(datadir + "/images/status/checkbox.png", true); checkbox_checked = new Surface(datadir + "/images/status/checkbox-checked.png", true); @@ -376,15 +362,6 @@ void Setup::general_free(void) { - /* Free global images: */ - delete gold_text; - delete white_text; - delete blue_text; - delete gray_text; - delete white_small_text; - delete white_big_text; - delete yellow_nums; - /* Free GUI/menu images: */ delete checkbox; delete checkbox_checked; Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- globals.cpp 24 Jul 2004 11:50:09 -0000 1.4 +++ globals.cpp 26 Jul 2004 15:48:37 -0000 1.5 @@ -43,14 +43,6 @@ JoystickKeymap joystick_keymap; SDL_Surface * screen; -Font* gold_text; -Font* blue_text; -Font* gray_text; -Font* yellow_nums; -Font* white_text; -Font* white_small_text; -Font* white_big_text; - MouseCursor * mouse_cursor; bool use_gl; Index: setup.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- setup.h 25 Jul 2004 19:03:34 -0000 1.5 +++ setup.h 26 Jul 2004 15:48:37 -0000 1.6 @@ -45,12 +45,14 @@ static void directories(void); static void general(void); static void general_free(); - static void video_sdl(unsigned int screen_w, unsigned int screen_h); - static void video_gl(unsigned int screen_w, unsigned int screen_h); static void video(unsigned int screen_w, unsigned int screen_h); static void audio(void); static void joystick(void); static void parseargs(int argc, char * argv[]); + + private: + static void video_sdl(unsigned int screen_w, unsigned int screen_h); + static void video_gl(unsigned int screen_w, unsigned int screen_h); }; /// Termination handling Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- globals.h 24 Jul 2004 11:50:09 -0000 1.4 +++ globals.h 26 Jul 2004 15:48:37 -0000 1.5 @@ -55,13 +55,6 @@ extern JoystickKeymap joystick_keymap; extern SDL_Surface* screen; - extern Font* gold_text; - extern Font* white_text; - extern Font* blue_text; - extern Font* gray_text; - extern Font* white_small_text; - extern Font* white_big_text; - extern Font* yellow_nums; extern MouseCursor * mouse_cursor; |
From: Tobias G. <to...@us...> - 2004-07-26 15:24:14
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28029 Added Files: Doxyfile Log Message: With this file and doxygen you can generate a wonderful SuperTux library API documentation. ;) --- NEW FILE: Doxyfile --- # Doxyfile 1.3.7-KDevelop #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- PROJECT_NAME = SuperTux PROJECT_NUMBER = $VERSION$ OUTPUT_DIRECTORY = CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English USE_WINDOWS_ENCODING = NO BRIEF_MEMBER_DESC = YES REPEAT_BRIEF = YES ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ "The $name file" \ is \ provides \ specifies \ contains \ represents \ a \ an \ the ALWAYS_DETAILED_SEC = YES INLINE_INHERITED_MEMB = NO FULL_PATH_NAMES = NO STRIP_FROM_PATH = ./ STRIP_FROM_INC_PATH = SHORT_NAMES = NO JAVADOC_AUTOBRIEF = NO MULTILINE_CPP_IS_BRIEF = NO DETAILS_AT_TOP = NO INHERIT_DOCS = YES DISTRIBUTE_GROUP_DOC = NO TAB_SIZE = 8 ALIASES = OPTIMIZE_OUTPUT_FOR_C = NO OPTIMIZE_OUTPUT_JAVA = NO SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- EXTRACT_ALL = YES EXTRACT_PRIVATE = YES EXTRACT_STATIC = YES EXTRACT_LOCAL_CLASSES = YES EXTRACT_LOCAL_METHODS = NO HIDE_UNDOC_MEMBERS = NO HIDE_UNDOC_CLASSES = NO HIDE_FRIEND_COMPOUNDS = NO HIDE_IN_BODY_DOCS = NO INTERNAL_DOCS = NO CASE_SENSE_NAMES = YES HIDE_SCOPE_NAMES = NO SHOW_INCLUDE_FILES = YES INLINE_INFO = YES SORT_MEMBER_DOCS = YES SORT_BRIEF_DOCS = NO SORT_BY_SCOPE_NAME = NO GENERATE_TODOLIST = YES GENERATE_TESTLIST = YES GENERATE_BUGLIST = YES GENERATE_DEPRECATEDLIST= YES ENABLED_SECTIONS = MAX_INITIALIZER_LINES = 30 SHOW_USED_FILES = YES #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- QUIET = NO WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES WARN_FORMAT = "$file:$line: $text" WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- INPUT = ./lib FILE_PATTERNS = *.c \ *.cc \ *.cxx \ *.cpp \ *.c++ \ *.java \ *.ii \ *.ixx \ *.ipp \ *.i++ \ *.inl \ *.h \ *.hh \ *.hxx \ *.hpp \ *.h++ \ *.idl \ *.odl \ *.cs \ *.php \ *.php3 \ *.inc \ *.m \ *.mm \ *.C \ *.CC \ *.C++ \ *.II \ *.I++ \ *.H \ *.HH \ *.H++ \ *.CS \ *.PHP \ *.PHP3 \ *.M \ *.MM \ *.C \ *.H \ *.tlh \ *.diff \ *.patch \ *.moc \ *.xpm \ *.dox RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXAMPLE_PATH = EXAMPLE_PATTERNS = * EXAMPLE_RECURSIVE = NO IMAGE_PATH = INPUT_FILTER = FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- SOURCE_BROWSER = NO INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES REFERENCED_BY_RELATION = YES REFERENCES_RELATION = YES VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- ALPHABETICAL_INDEX = YES COLS_IN_ALPHA_INDEX = 5 IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- GENERATE_HTML = YES HTML_OUTPUT = html HTML_FILE_EXTENSION = .html HTML_HEADER = HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES GENERATE_HTMLHELP = NO CHM_FILE = HHC_LOCATION = GENERATE_CHI = NO BINARY_TOC = NO TOC_EXPAND = YES DISABLE_INDEX = NO ENUM_VALUES_PER_LINE = 4 GENERATE_TREEVIEW = YES TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- GENERATE_LATEX = NO LATEX_OUTPUT = latex LATEX_CMD_NAME = latex MAKEINDEX_CMD_NAME = makeindex COMPACT_LATEX = NO PAPER_TYPE = a4wide EXTRA_PACKAGES = LATEX_HEADER = PDF_HYPERLINKS = NO USE_PDFLATEX = NO LATEX_BATCHMODE = NO LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- GENERATE_RTF = NO RTF_OUTPUT = rtf COMPACT_RTF = NO RTF_HYPERLINKS = NO RTF_STYLESHEET_FILE = RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- GENERATE_MAN = NO MAN_OUTPUT = man MAN_EXTENSION = .3 MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- GENERATE_XML = NO XML_OUTPUT = xml XML_SCHEMA = XML_DTD = XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- GENERATE_PERLMOD = NO PERLMOD_LATEX = NO PERLMOD_PRETTY = YES PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- ENABLE_PREPROCESSING = YES MACRO_EXPANSION = NO EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES INCLUDE_PATH = INCLUDE_FILE_PATTERNS = PREDEFINED = EXPAND_AS_DEFINED = SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- TAGFILES = GENERATE_TAGFILE = supertux.tag ALLEXTERNALS = NO EXTERNAL_GROUPS = YES PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- CLASS_DIAGRAMS = YES HIDE_UNDOC_RELATIONS = YES HAVE_DOT = NO CLASS_GRAPH = YES COLLABORATION_GRAPH = YES UML_LOOK = NO TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES INCLUDED_BY_GRAPH = YES CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DOT_IMAGE_FORMAT = png DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 MAX_DOT_GRAPH_HEIGHT = 1024 MAX_DOT_GRAPH_DEPTH = 1000 GENERATE_LEGEND = YES DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- SEARCHENGINE = NO |
From: Ricardo C. <rm...@us...> - 2004-07-26 13:56:17
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9463/src Modified Files: Tag: supertux_0_1_1_branch leveleditor.cpp Log Message: Mini-map related tweaks: - Show mini-map in mouse movement, as well; - Removed the 'to fix' comment, related to the SDL use, since it has been already fixed; - Changed the map selection lines color. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.109.2.1 retrieving revision 1.109.2.2 diff -u -d -r1.109.2.1 -r1.109.2.2 --- leveleditor.cpp 15 May 2004 22:22:54 -0000 1.109.2.1 +++ leveleditor.cpp 26 Jul 2004 13:56:08 -0000 1.109.2.2 @@ -780,10 +780,10 @@ 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); - 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 + (pos_x/32)*mini_tile_width, 0, 19*mini_tile_width, 1, 255, 255, 255, 255); + fillrect(left_offset + (pos_x/32)*mini_tile_width, 0, 1, 15*4, 255, 255, 255, 255); + fillrect(left_offset + (pos_x/32)*mini_tile_width + 19*mini_tile_width, 0, 1, 15*4, 255, 255, 255, 255); + fillrect(left_offset + (pos_x/32)*mini_tile_width, 15*4-2, 19*mini_tile_width, 1, 255, 255, 255, 255); } @@ -804,7 +804,7 @@ } } - if(show_minimap) // 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 + if(show_minimap) le_drawminimap(); if(show_selections && MouseCursor::current() != mouse_select_object) @@ -1574,6 +1574,8 @@ break; } + if(le_mouse_pressed[RIGHT]) + show_minimap = true; } } |