super-tux-commit Mailing List for Super Tux (Page 43)
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-31 10:07:04
|
Update of /cvsroot/super-tux/supertux/data/levels/bonus1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28377/data/levels/bonus1 Added Files: Tag: supertux_0_1_1_branch wayhome.stl Log Message: -changed bonus island worldmap, added a path leading back -added template for a new level PLEASE NOTE: -the game says tilemap data is buggy, i don't know why, maybe someone can check this out. -I put in a little gag with some map-messages being thrown on that new path leading back to the start; I'm not sure if it's funny :-) please try it and tell me if you like it. Thanks --- NEW FILE: wayhome.stl --- ;; Generated by Flexlay Editor (supertux-level (version 1) (author "Marek Moeckel") (name "The Way Home") (width 20) (height 15) (start_pos_x 100) (start_pos_y 100) (background "") (music "Mortimers_chipdisko.mod") (bkgd_red_top 150) (bkgd_green_top 200) (bkgd_blue_top 255) (bkgd_red_bottom 150) (bkgd_green_bottom 200) (bkgd_blue_bottom 255) (time 500) (gravity 10) (particle_system "") (theme "antarctica") (interactive-tm 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 9 0 0 0 0 0 0 0 0 0 14 14 14 14 14 14 14 14 14 14 15 0 0 0 0 0 0 0 0 0 11 11 11 11 11 11 11 11 11 11 12 0 0 0 0 0 0 0 0 0 11 11 30 17 17 17 17 17 17 17 18 0 0 0 0 0 0 0 0 0 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 11 11 12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) (background-tm 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) (foreground-tm 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) (reset-points ) (objects ) ) ;; EOF ;; |
From: Marek M. <wa...@us...> - 2004-07-31 10:07:02
|
Update of /cvsroot/super-tux/supertux/data/images/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28377/data/images/worldmap Modified Files: Tag: supertux_0_1_1_branch antarctica.stwt Log Message: -changed bonus island worldmap, added a path leading back -added template for a new level PLEASE NOTE: -the game says tilemap data is buggy, i don't know why, maybe someone can check this out. -I put in a little gag with some map-messages being thrown on that new path leading back to the start; I'm not sure if it's funny :-) please try it and tell me if you like it. Thanks Index: antarctica.stwt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/worldmap/antarctica.stwt,v retrieving revision 1.7.2.3 retrieving revision 1.7.2.4 diff -u -d -r1.7.2.3 -r1.7.2.4 --- antarctica.stwt 30 Jul 2004 22:35:13 -0000 1.7.2.3 +++ antarctica.stwt 31 Jul 2004 10:06:51 -0000 1.7.2.4 @@ -324,7 +324,17 @@ (east #f) (stop #f) (one-way "north-south")) - + + ;;one-way horizontal road + (tile (id 66) + (image "road_we.png") + (north #f) + (south #f) + (west #t) + (east #t) + (stop #f) + (one-way "west-east")) + ) ;; EOF ;; |
From: Ricardo C. <rm...@us...> - 2004-07-30 22:35:38
|
Update of /cvsroot/super-tux/supertux/data/images/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9959/data/images/worldmap Modified Files: Tag: supertux_0_1_1_branch antarctica.stwt Log Message: Made the new Marek tile to only having a north-south way. Index: antarctica.stwt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/worldmap/antarctica.stwt,v retrieving revision 1.7.2.2 retrieving revision 1.7.2.3 diff -u -d -r1.7.2.2 -r1.7.2.3 --- antarctica.stwt 30 Jul 2004 16:30:33 -0000 1.7.2.2 +++ antarctica.stwt 30 Jul 2004 22:35:13 -0000 1.7.2.3 @@ -322,7 +322,8 @@ (south #t) (west #f) (east #f) - (stop #f)) + (stop #f) + (one-way "north-south")) ) |
From: Ricardo C. <rm...@us...> - 2004-07-30 22:34:41
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9844/src Modified Files: Tag: supertux_0_1_1_branch worldmap.cpp worldmap.h Log Message: Added support for one way roads, as requested by Marek. Possible of usage: (one-way "north-south"), (one-way "south-north"), (one-way "east-west") or (one-way "west-east"). Use only one. And none for both ways. Worldmap stuff is getting too many expections, which is not bad, but is getting bloated. After the release of 0.1.2, I will port all these new aditions, but in a way to avoid both worldmap dta and source code getting bloated. The use of strings in worldmap data (like in this case), and arrays of booleans or peraphs bitfields in the code sound like a good choice. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.68.2.10 retrieving revision 1.68.2.11 diff -u -d -r1.68.2.10 -r1.68.2.11 --- worldmap.cpp 30 Jul 2004 10:54:53 -0000 1.68.2.10 +++ worldmap.cpp 30 Jul 2004 22:34:30 -0000 1.68.2.11 @@ -125,6 +125,21 @@ reader.read_bool("auto-walk", &tile->auto_walk); reader.read_string("image", &filename); + std::string temp; + reader.read_string("one-way", &temp); + tile->one_way = BOTH_WAYS; + if(!temp.empty()) + { + if(temp == "north-south") + tile->one_way = NORTH_SOUTH_WAY; + else if(temp == "south-north") + tile->one_way = SOUTH_NORTH_WAY; + else if(temp == "east-west") + tile->one_way = EAST_WEST_WAY; + else if(temp == "west-east") + tile->one_way = WEST_EAST_WAY; + } + tile->sprite = new Surface( datadir + "/images/worldmap/" + filename, USE_ALPHA); @@ -265,7 +280,6 @@ } else if (input_direction == back_direction) { - std::cout << "Back triggered" << std::endl; moving = true; direction = input_direction; tile_pos = worldmap->get_next_tile(tile_pos, direction); @@ -296,7 +310,12 @@ } } - if (worldmap->at(tile_pos)->stop || (level && !level->name.empty())) + Tile* cur_tile = worldmap->at(tile_pos); + if (cur_tile->stop || (level && !level->name.empty()) || + (cur_tile->one_way == NORTH_SOUTH_WAY && direction != D_SOUTH) || + (cur_tile->one_way == SOUTH_NORTH_WAY && direction != D_NORTH) || + (cur_tile->one_way == EAST_WEST_WAY && direction != D_WEST) || + (cur_tile->one_way == WEST_EAST_WAY && direction != D_EAST)) { stop(); } @@ -642,6 +661,15 @@ { // New position is outsite the tilemap return false; } + else if(at(*new_pos)->one_way != BOTH_WAYS) + { + if((at(*new_pos)->one_way == NORTH_SOUTH_WAY && direction != D_SOUTH) || + (at(*new_pos)->one_way == SOUTH_NORTH_WAY && direction != D_NORTH) || + (at(*new_pos)->one_way == EAST_WEST_WAY && direction != D_WEST) || + (at(*new_pos)->one_way == WEST_EAST_WAY && direction != D_EAST)) + return false; + return true; + } else { // Check if we the tile allows us to go to new_pos switch(direction) Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.28.2.8 retrieving revision 1.28.2.9 diff -u -d -r1.28.2.8 -r1.28.2.9 --- worldmap.h 30 Jul 2004 10:54:53 -0000 1.28.2.8 +++ worldmap.h 30 Jul 2004 22:34:31 -0000 1.28.2.9 @@ -46,6 +46,15 @@ int y; }; +// For one way tiles +enum { + BOTH_WAYS, + NORTH_SOUTH_WAY, + SOUTH_NORTH_WAY, + EAST_WEST_WAY, + WEST_EAST_WAY + }; + class Tile { public: @@ -60,6 +69,9 @@ bool south; bool west; + /** One way tile */ + int one_way; + /** Stop on this tile or walk over it? */ bool stop; |
From: Marek M. <wa...@us...> - 2004-07-30 16:30:44
|
Update of /cvsroot/super-tux/supertux/data/levels/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9852/data/levels/default Modified Files: Tag: supertux_0_1_1_branch bonusisland.stwm Log Message: added one-way road tile for world map (coding needed - see mailing list!) Index: bonusisland.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/default/Attic/bonusisland.stwm,v retrieving revision 1.1.2.8 retrieving revision 1.1.2.9 diff -u -d -r1.1.2.8 -r1.1.2.9 --- bonusisland.stwm 30 Jul 2004 15:09:07 -0000 1.1.2.8 +++ bonusisland.stwm 30 Jul 2004 16:30:34 -0000 1.1.2.9 @@ -35,7 +35,7 @@ 9 9 9 9 14 21 19 19 19 19 19 19 19 47 23 12 9 9 9 9 14 18 21 47 20 13 9 9 9 9 9 9 9 9 9 9 9 9 15 47 20 18 18 13 9 9 14 21 19 47 17 9 9 14 21 19 19 19 20 18 18 21 47 20 13 9 9 9 9 9 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 65 23 16 16 16 16 16 16 16 22 65 23 16 16 16 16 16 16 16 16 16 16 16 16 16 22 65 23 16 16 16 16 16 16 16 22 65 23 16 16 16 16 16 16 16 16 16 16 22 65 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 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 @@ -124,6 +124,23 @@ (level (map-message "You found a secret place!") (x 49) (y 29) (apply-action-down #f)) + + (level (map-message "No entry from this side!") + (x 13) + (y 27) (apply-action-up #f)) + (level (map-message "No entry from this side!") + (x 23) + (y 27) (apply-action-up #f)) + (level (map-message "No entry from this side!") + (x 39) + (y 27) (apply-action-up #f)) + (level (map-message "No entry from this side!") + (x 49) + (y 27) (apply-action-up #f)) + (level (map-message "No entry from this side!") + (x 62) + (y 27) (apply-action-up #f)) + ) ) |
From: Marek M. <wa...@us...> - 2004-07-30 16:30:43
|
Update of /cvsroot/super-tux/supertux/data/images/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9852/data/images/worldmap Modified Files: Tag: supertux_0_1_1_branch antarctica.stwt Log Message: added one-way road tile for world map (coding needed - see mailing list!) Index: antarctica.stwt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/worldmap/antarctica.stwt,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -u -d -r1.7.2.1 -r1.7.2.2 --- antarctica.stwt 27 Jul 2004 16:48:18 -0000 1.7.2.1 +++ antarctica.stwt 30 Jul 2004 16:30:33 -0000 1.7.2.2 @@ -315,5 +315,15 @@ (west #f) (east #f)) + ;;one-way vertical road + (tile (id 65) + (image "road_ns.png") + (north #t) + (south #t) + (west #f) + (east #f) + (stop #f)) + + ) ;; EOF ;; |
From: Marek M. <wa...@us...> - 2004-07-30 15:09:16
|
Update of /cvsroot/super-tux/supertux/data/levels/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27151/data/levels/default Modified Files: Tag: supertux_0_1_1_branch bonusisland.stwm Log Message: added one new level to the worldmap, fixed "secret area" message added template for that level some more work on secret.stl Index: bonusisland.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/default/Attic/bonusisland.stwm,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -u -d -r1.1.2.7 -r1.1.2.8 --- bonusisland.stwm 30 Jul 2004 11:00:35 -0000 1.1.2.7 +++ bonusisland.stwm 30 Jul 2004 15:09:07 -0000 1.1.2.8 @@ -96,11 +96,13 @@ (level (name "bonus1/wansti-level3.stl") (x 57) (y 23)) + (level (name "bonus1/gate.stl") + (x 35) + (y 28)) (level (name "bonus1/castle.stl") (x 35) (y 36)) - (level (name "bonus1/secret.stl") - (map-message "You found a secret place!") + (level (name "bonus1/secret.stl") (x 49) (y 37)) @@ -118,7 +120,10 @@ (y 8) (apply-action-down #f)) (level (map-message "Torfi's Territory just ahead") (x 36) - (y 7) (apply-action-right #f)) + (y 7) (apply-action-right #f)) + (level (map-message "You found a secret place!") + (x 49) + (y 29) (apply-action-down #f)) ) ) |
From: Ricardo C. <rm...@us...> - 2004-07-30 11:00:43
|
Update of /cvsroot/super-tux/supertux/data/levels/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15007/data/levels/default Modified Files: Tag: supertux_0_1_1_branch bonusisland.stwm Log Message: Fixed the showing of messages when coming from the levels and not from the forks. Dunno if the secret level one needs fixing, since I don't know where it is. Index: bonusisland.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/default/Attic/bonusisland.stwm,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -d -r1.1.2.6 -r1.1.2.7 --- bonusisland.stwm 28 Jul 2004 09:13:57 -0000 1.1.2.6 +++ bonusisland.stwm 30 Jul 2004 11:00:35 -0000 1.1.2.7 @@ -106,19 +106,19 @@ (level (map-message "This way to Abednego's Area") (x 34) - (y 5)) + (y 5) (apply-action-left #f)) (level (map-message "To the SuperTux Team Island") (x 36) - (y 5)) + (y 5) (apply-action-right #f)) (level (map-message "Matr1x' Sector this way") (x 34) - (y 7)) + (y 7) (apply-action-left #f)) (level (map-message "About to enter Thompson's Domain") (x 35) - (y 8)) + (y 8) (apply-action-down #f)) (level (map-message "Torfi's Territory just ahead") (x 36) - (y 7)) + (y 7) (apply-action-right #f)) ) ) |
From: Ricardo C. <rm...@us...> - 2004-07-30 10:55:07
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14207/src Modified Files: Tag: supertux_0_1_1_branch worldmap.cpp worldmap.h Log Message: Let map messages being disabled when the player is coming from a specific direction. For instance, to not show a message when the player comes from left, do: (apply-action-left #f) . It is also possible to have more than one for different directions. Also, you can have to different (level, so that in one it shows a message and from another direction another. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.68.2.9 retrieving revision 1.68.2.10 diff -u -d -r1.68.2.9 -r1.68.2.10 --- worldmap.cpp 28 Jul 2004 20:40:27 -0000 1.68.2.9 +++ worldmap.cpp 30 Jul 2004 10:54:53 -0000 1.68.2.10 @@ -284,9 +284,16 @@ WorldMap::Level* level = worldmap->at_level(); if(level && level->name.empty() && !level->display_map_message.empty()) - { - worldmap->passive_message = level->display_map_message; - worldmap->passive_message_timer.start(DISPLAY_MAP_MESSAGE_TIME); + { // direction and the apply_action_ are opposites, since they "see" + // directions in a different way + if((direction == D_NORTH && level->apply_action_south) || + (direction == D_SOUTH && level->apply_action_north) || + (direction == D_WEST && level->apply_action_east) || + (direction == D_EAST && level->apply_action_west)) + { + worldmap->passive_message = level->display_map_message; + worldmap->passive_message_timer.start(DISPLAY_MAP_MESSAGE_TIME); + } } if (worldmap->at(tile_pos)->stop || (level && !level->name.empty())) @@ -448,6 +455,13 @@ level.auto_path = true; reader.read_bool("auto-path", &level.auto_path); + level.apply_action_north = level.apply_action_south = + level.apply_action_east = level.apply_action_west = true; + reader.read_bool("apply-action-up", &level.apply_action_north); + reader.read_bool("apply-action-down", &level.apply_action_south); + reader.read_bool("apply-action-left", &level.apply_action_west); + reader.read_bool("apply-action-right", &level.apply_action_east); + if(!level.name.empty()) get_level_title(&level); // get level's title Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.28.2.7 retrieving revision 1.28.2.8 diff -u -d -r1.28.2.7 -r1.28.2.8 --- worldmap.h 28 Jul 2004 20:40:27 -0000 1.28.2.7 +++ worldmap.h 30 Jul 2004 10:54:53 -0000 1.28.2.8 @@ -166,6 +166,12 @@ /** If false, disables the auto walking after finishing a level */ bool auto_path; + /** Only applies actions (ie. map messages) when going to that direction */ + bool apply_action_north; + bool apply_action_east; + bool apply_action_south; + bool apply_action_west; + // Directions which are walkable from this level bool north; bool east; |
From: Tobias G. <to...@us...> - 2004-07-29 23:11:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19017/src Modified Files: Makefile.am Log Message: the last change didn't work portable Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- Makefile.am 29 Jul 2004 12:54:25 -0000 1.40 +++ Makefile.am 29 Jul 2004 23:11:03 -0000 1.41 @@ -2,8 +2,8 @@ bin_PROGRAMS = supertux supertux_CXXFLAGS = -DLOCALEDIR=\"$(localedir)\" -supertux_LDADD = $(top_builddir)/lib/.libs/libsupertux @LIBINTL@ -#supertux_LDADD = $(top_builddir)/lib/libsupertux.la @LIBINTL@ Use this for releases +#supertux_LDADD = $(top_builddir)/lib/.libs/libsupertux @LIBINTL@ +supertux_LDADD = $(top_builddir)/lib/libsupertux.la @LIBINTL@ supertux_SOURCES = badguy.cpp badguy.h bitmask.cpp bitmask.h camera.cpp \ |
From: Tobias G. <to...@us...> - 2004-07-29 12:54:34
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30646/src Modified Files: Makefile.am Log Message: Debugging and testing SuperTux from within the source directory should be easier now. Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- Makefile.am 26 Jul 2004 18:09:13 -0000 1.39 +++ Makefile.am 29 Jul 2004 12:54:25 -0000 1.40 @@ -2,7 +2,9 @@ bin_PROGRAMS = supertux supertux_CXXFLAGS = -DLOCALEDIR=\"$(localedir)\" -supertux_LDADD = $(top_builddir)/lib/libsupertux.la @LIBINTL@ +supertux_LDADD = $(top_builddir)/lib/.libs/libsupertux @LIBINTL@ +#supertux_LDADD = $(top_builddir)/lib/libsupertux.la @LIBINTL@ Use this for releases + 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 \ |
From: Ricardo C. <rm...@us...> - 2004-07-29 11:24:49
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16591/lib/video Modified Files: font.cpp font.h Log Message: Added support for break lines for get_text_width() - returns the size of the largest paragraph. Also added a get_text_height() that also supports break lines - returns the size of all the paragraphs. Index: font.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- font.cpp 28 Jul 2004 14:57:24 -0000 1.5 +++ font.cpp 29 Jul 2004 11:24:41 -0000 1.6 @@ -71,15 +71,46 @@ } float -Font::get_height() const +Font::get_text_width(const std::string& text) const { - return h; + /** Let's calculate the size of the biggest paragraph */ + int l, hl; + hl = 0; l = -1; + while(true) + { + l = text.find("\n", l+1); + if(l == (int)std::string::npos) + break; + if(hl < l) + hl = l; + } + if(hl == 0) + hl = text.size(); + + return hl * w; } float -Font::get_text_width(const std::string& text) const +Font::get_text_height(const std::string& text) const { - return text.size() * w; + /** Let's calculate height of the text */ + int l, hh; + hh = h; l = -1; + while(true) + { + l = text.find("\n", l+1); + if(l == (int)std::string::npos) + break; + hh += h + 2; + } + + return hh; +} + +float +Font::get_height() const +{ + return h; } void Index: font.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- font.h 28 Jul 2004 14:57:24 -0000 1.6 +++ font.h 29 Jul 2004 11:24:41 -0000 1.7 @@ -42,14 +42,24 @@ Font(const std::string& file, FontType type, int w, int h, int shadowsize=2); ~Font(); - /// returns the height of the font. - float get_height() const; /** returns the width of a given text. (Note that I won't add a normal * get_width function here, as we might switch to variable width fonts in the - * future. + * future.) + * Supports breaklines. */ float get_text_width(const std::string& text) const; + /** returns the height of a given text. (Note that I won't add a normal + * get_width function here, as we might switch to variable width fonts in the + * future.) + * Supports breaklines. + * In case, you are positive that your text doesn't use break lines, you can + * just use get_height(). + */ + float get_text_height(const std::string& text) const; + /// returns the height of the font. + float get_height() const; + private: friend class DrawingContext; |
From: Ricardo C. <rm...@us...> - 2004-07-29 11:23:30
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16463/lib/video Modified Files: surface.cpp Log Message: Removed unnecessary (?) FIXME comment. Index: surface.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- surface.cpp 28 Jul 2004 22:23:23 -0000 1.5 +++ surface.cpp 29 Jul 2004 11:23:21 -0000 1.6 @@ -175,9 +175,6 @@ Surface::Surface(Color top_background, Color bottom_background, int w_, int h_) : data(top_background, bottom_background, w_, h_), w(0), h(0) { - // FIXME: Gradient surfaces currently don't accept width/height - // If nonzero values are passed to data.create(), supertux - // crashes. impl = data.create(); if (impl) { |
From: Tobias G. <to...@us...> - 2004-07-29 11:05:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13751/src Modified Files: title.cpp worldmap.cpp Log Message: - FrameRate class is more flexible - All "game-loops" use the FrameRate class now Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- title.cpp 27 Jul 2004 19:31:39 -0000 1.114 +++ title.cpp 29 Jul 2004 11:05:28 -0000 1.115 @@ -42,6 +42,7 @@ #include "high_scores.h" #include "gui/menu.h" #include "special/timer.h" +#include "special/frame_rate.h" #include "app/setup.h" #include "level.h" #include "level_subset.h" @@ -66,8 +67,6 @@ static Timer random_timer; static int frame; -static unsigned int last_update_time; -static unsigned int update_time; static GameSession* titlesession; @@ -288,7 +287,9 @@ /* --- Main title loop: --- */ frame = 0; - update_time = Ticks::get(); + FrameRate frame_rate(100); + frame_rate.set_frame_limit(false); + random_timer.start(rand() % 2000 + 2000); Menu::set_current(main_menu); @@ -296,11 +297,11 @@ while (Menu::current()) { // if we spent to much time on a menu entry - if( (update_time - last_update_time) > 1000) - update_time = last_update_time = Ticks::get(); - + frame_rate.smooth_hanger(); + // Calculate the movement-factor - double frame_ratio = ((double)(update_time-last_update_time))/((double)FRAME_RATE); + double frame_ratio = frame_rate.get(); + if(frame_ratio > 1.5) /* Quick hack to correct the unprecise CPU clocks a little bit. */ frame_ratio = 1.5 + (frame_ratio - 1.5) * 0.85; /* Lower the frame_ratio that Tux doesn't jump to hectically throught the demo. */ @@ -358,7 +359,7 @@ leveleditor->run(); delete leveleditor; Menu::set_current(main_menu); - update_time = Ticks::get(); + frame_rate.update(); break; case MNID_CREDITS: display_text_file("CREDITS", SCROLL_SPEED_CREDITS, white_big_text , white_text, white_small_text, blue_text ); @@ -390,7 +391,7 @@ update_load_save_game_menu(load_game_menu); Menu::set_current(main_menu); - update_time = Ticks::get(); + frame_rate.update(); } else if (process_load_game_menu()) { @@ -398,7 +399,7 @@ titlesession->get_current_sector()->activate(); titlesession->set_current(); //titletux.level_begin(); - update_time = Ticks::get(); + frame_rate.update(); } } else if(menu == contrib_menu) @@ -415,9 +416,7 @@ context.do_drawing(); - /* Set the time of the last update and the time of the current update */ - last_update_time = update_time; - update_time = Ticks::get(); + frame_rate.update(); /* Pause: */ frame++; Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -r1.112 -r1.113 --- worldmap.cpp 28 Jul 2004 20:41:59 -0000 1.112 +++ worldmap.cpp 29 Jul 2004 11:05:28 -0000 1.113 @@ -28,6 +28,7 @@ #include "video/screen.h" #include "video/drawing_context.h" #include "utils/lispreader.h" +#include "special/frame_rate.h" #include "gameloop.h" #include "app/setup.h" #include "sector.h" @@ -1013,24 +1014,23 @@ song = SoundManager::get()->load_music(datadir + "/music/" + music); SoundManager::get()->play_music(song); - - unsigned int last_update_time; - unsigned int update_time; - last_update_time = update_time = Ticks::get(); + FrameRate frame_rate(10); + frame_rate.set_frame_limit(false); + + frame_rate.start(); DrawingContext context; while(!quit) { - float delta = ((float)(update_time-last_update_time))/100.0; + float delta = frame_rate.get(); delta *= 1.3f; if (delta > 10.0f) delta = .3f; - - last_update_time = update_time; - update_time = Ticks::get(); + + frame_rate.update(); Vector tux_pos = tux->get_pos(); if (1) @@ -1048,7 +1048,7 @@ draw(context, offset); get_input(); update(delta); - + if(Menu::current()) { Menu::current()->draw(context); |
From: Tobias G. <to...@us...> - 2004-07-29 11:05:36
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13751/lib/special Modified Files: frame_rate.cpp frame_rate.h Log Message: - FrameRate class is more flexible - All "game-loops" use the FrameRate class now Index: frame_rate.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/frame_rate.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frame_rate.h 28 Jul 2004 23:06:11 -0000 1.1 +++ frame_rate.h 29 Jul 2004 11:05:28 -0000 1.2 @@ -29,12 +29,15 @@ FrameRate(double fps); void start(); void set_fps(double fps); + void set_frame_limit(bool); double get(); void update(); + void smooth_hanger(); private: unsigned int last_update_time; unsigned int update_time; unsigned int frame_ms; + bool frame_limit; }; } //namespace SuperTux Index: frame_rate.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/frame_rate.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- frame_rate.cpp 28 Jul 2004 23:06:11 -0000 1.1 +++ frame_rate.cpp 29 Jul 2004 11:05:28 -0000 1.2 @@ -26,6 +26,7 @@ FrameRate::FrameRate(double fps) { set_fps(fps); + set_frame_limit(true); } void FrameRate::start() @@ -38,6 +39,11 @@ frame_ms = static_cast<unsigned int>(1000.f/fps); } +void FrameRate::set_frame_limit(bool set_limit) +{ + frame_limit = set_limit; +} + double FrameRate::get() { return ((double)(update_time-last_update_time))/(double)frame_ms; @@ -52,10 +58,15 @@ /* 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 the results in SDL mode aren't perfect (thought the 100 FPS are reached), even on an AMD2500+. */ - if(last_update_time >= update_time - (frame_ms+2)) + if(frame_limit && last_update_time >= update_time - (frame_ms+2)) { SDL_Delay(frame_ms); update_time = Ticks::get(); } } +void FrameRate::smooth_hanger() +{ + if( (update_time - last_update_time) > frame_ms*100) + update_time = last_update_time = Ticks::get(); +} |
From: Tobias G. <to...@us...> - 2004-07-28 23:48:19
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25464/src Modified Files: level_subset.cpp Log Message: fixed compilation problem Index: level_subset.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level_subset.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- level_subset.cpp 27 Jul 2004 19:31:39 -0000 1.8 +++ level_subset.cpp 28 Jul 2004 23:47:54 -0000 1.9 @@ -19,6 +19,7 @@ // 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-28 23:33:33
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23516/lib/gui Modified Files: menu.cpp Log Message: fix for the compilation problem of many pre gcc3.4.x users. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- menu.cpp 28 Jul 2004 23:06:11 -0000 1.8 +++ menu.cpp 28 Jul 2004 23:33:23 -0000 1.9 @@ -509,7 +509,8 @@ int text_width = int(text_font->get_text_width(pitem.text)); int input_width = int(text_font->get_text_width(pitem.input) + 10); int list_width = 0; - if(pitem.list.second != 0) + std::set<std::string>::iterator tmp = 0; + if(pitem.list.second != tmp) list_width = int(text_font->get_text_width((*pitem.list.second))); if (arrange_left) |
From: Tobias G. <to...@us...> - 2004-07-28 23:06:21
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18640/src Modified Files: gameloop.cpp gameloop.h high_scores.cpp leveleditor.cpp Log Message: - Various fixes and cleanups. - Added FrameRate class to SuperTux library - More menu code C++ing. Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- gameloop.h 25 Jul 2004 19:03:36 -0000 1.56 +++ gameloop.h 28 Jul 2004 23:06:12 -0000 1.57 @@ -24,6 +24,7 @@ #include "special/timer.h" #include "special/base.h" +#include "special/frame_rate.h" using namespace SuperTux; @@ -64,8 +65,7 @@ int st_gl_mode; int levelnb; float fps_fps; - unsigned int last_update_time; - unsigned int update_time; + FrameRate frame_rate; int pause_menu_frame; int debug_fps; Index: high_scores.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/high_scores.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- high_scores.cpp 25 Jul 2004 19:03:36 -0000 1.25 +++ high_scores.cpp 28 Jul 2004 23:06:12 -0000 1.26 @@ -95,10 +95,7 @@ Menu::set_current(highscore_menu); - if(!highscore_menu->item[0].input) - highscore_menu->item[0].input = (char*) malloc(strlen(hs_name.c_str()) + 1); - - strcpy(highscore_menu->item[0].input,hs_name.c_str()); + highscore_menu->item[0].input = hs_name; /* ask for player's name */ while(Menu::current()) @@ -124,8 +121,7 @@ switch (highscore_menu->check()) { case 0: - if(highscore_menu->item[0].input != NULL) - hs_name = highscore_menu->item[0].input; + hs_name = highscore_menu->item[0].input; break; } Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.163 retrieving revision 1.164 diff -u -d -r1.163 -r1.164 --- gameloop.cpp 28 Jul 2004 21:47:43 -0000 1.163 +++ gameloop.cpp 28 Jul 2004 23:06:12 -0000 1.164 @@ -74,6 +74,7 @@ fps_timer.init(true); frame_timer.init(true); + frame_rate.set_fps(100); context = new DrawingContext(); @@ -190,7 +191,7 @@ { time_left.start(level->time_left*1000); Ticks::pause_init(); - update_time = Ticks::get(); + frame_rate.start(); } void @@ -600,7 +601,7 @@ int fps_cnt = 0; - update_time = last_update_time = Ticks::get(); + frame_rate.start(); // Eat unneeded events SDL_Event event; @@ -611,7 +612,7 @@ while (exit_status == ES_NONE) { /* Calculate the movement-factor */ - double frame_ratio = ((double)(update_time-last_update_time))/((double)FRAME_RATE); + double frame_ratio = frame_rate.get(); if(!frame_timer.check()) { @@ -652,18 +653,7 @@ continue; } - /* Set the time of the last update and the time of the current update */ - last_update_time = update_time; - 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 - the results in SDL mode aren't perfect (thought the 100 FPS are reached), even on an AMD2500+. */ - if(last_update_time >= update_time - 12) - { - SDL_Delay(10); - update_time = Ticks::get(); - } + frame_rate.update(); /* Handle time: */ if (!time_left.check() && currentsector->player->dying == DYING_NOT Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.145 retrieving revision 1.146 diff -u -d -r1.145 -r1.146 --- leveleditor.cpp 27 Jul 2004 19:31:39 -0000 1.145 +++ leveleditor.cpp 28 Jul 2004 23:06:12 -0000 1.146 @@ -330,7 +330,7 @@ default: if(i >= 1) { - if(load_level_subset(subset_load_menu->item[i+1].text)) + if(load_level_subset(subset_load_menu->item[i+1].text.c_str())) return 1; } break; @@ -348,7 +348,7 @@ { case MNID_CREATESUBSET: LevelSubset::create(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); - le_level_subset->load(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input); + le_level_subset->load(subset_new_menu->get_item_by_id(MNID_SUBSETNAME).input.c_str()); leveleditor_menu->get_item_by_id(MNID_SUBSETSETTINGS).kind = MN_GOTO; goto_level(1); subset_new_menu->get_item_by_id(MNID_SUBSETNAME).change_input(""); @@ -599,7 +599,7 @@ if(le_level->get_sector("main")->background->get_image().compare((*level_settings_menu->get_item_by_id(MNID_BGIMG).list.second)) != 0) { - le_level->get_sector("main")->background->set_image((*level_settings_menu->get_item_by_id(MNID_BGIMG).list.second), atoi(level_settings_menu->get_item_by_id(MNID_BGSPEED).input)); + le_level->get_sector("main")->background->set_image((*level_settings_menu->get_item_by_id(MNID_BGIMG).list.second), atoi(level_settings_menu->get_item_by_id(MNID_BGSPEED).input.c_str())); i = true; } @@ -616,17 +616,17 @@ le_level->get_sector("main")->song_title = (*level_settings_menu->get_item_by_id(MNID_SONG).list.second); le_level->get_sector("main")->solids->resize( - atoi(level_settings_menu->get_item_by_id(MNID_LENGTH).input), - atoi(level_settings_menu->get_item_by_id(MNID_HEIGHT).input)); - le_level->time_left = atoi(level_settings_menu->get_item_by_id(MNID_TIME).input); - le_level->get_sector("main")->gravity = atof(level_settings_menu->get_item_by_id(MNID_GRAVITY).input); + atoi(level_settings_menu->get_item_by_id(MNID_LENGTH).input.c_str()), + atoi(level_settings_menu->get_item_by_id(MNID_HEIGHT).input.c_str())); + le_level->time_left = atoi(level_settings_menu->get_item_by_id(MNID_TIME).input.c_str()); + le_level->get_sector("main")->gravity = atof(level_settings_menu->get_item_by_id(MNID_GRAVITY).input.c_str()); le_level->get_sector("main")->background->set_gradient(Color( - atoi(level_settings_menu->get_item_by_id(MNID_TopRed).input), - atoi(level_settings_menu->get_item_by_id(MNID_TopGreen).input), - atoi(level_settings_menu->get_item_by_id(MNID_TopBlue).input)), Color( - atoi(level_settings_menu->get_item_by_id(MNID_BottomRed).input), - atoi(level_settings_menu->get_item_by_id(MNID_BottomGreen).input), - atoi(level_settings_menu->get_item_by_id(MNID_BottomBlue).input))); + atoi(level_settings_menu->get_item_by_id(MNID_TopRed).input.c_str()), + atoi(level_settings_menu->get_item_by_id(MNID_TopGreen).input.c_str()), + atoi(level_settings_menu->get_item_by_id(MNID_TopBlue).input.c_str())), Color( + atoi(level_settings_menu->get_item_by_id(MNID_BottomRed).input.c_str()), + atoi(level_settings_menu->get_item_by_id(MNID_BottomGreen).input.c_str()), + atoi(level_settings_menu->get_item_by_id(MNID_BottomBlue).input.c_str()))); } void LevelEditor::save_subset_settings_menu() |
From: Tobias G. <to...@us...> - 2004-07-28 23:06:20
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18640/lib/gui Modified Files: menu.cpp menu.h Log Message: - Various fixes and cleanups. - Added FrameRate class to SuperTux library - More menu code C++ing. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- menu.cpp 27 Jul 2004 19:31:37 -0000 1.7 +++ menu.cpp 28 Jul 2004 23:06:11 -0000 1.8 @@ -152,15 +152,23 @@ current_ = menu; } +MenuItem::MenuItem(MenuItemKind _kind, int _id) : kind(_kind) , id(_id) +{ + list.second = 0; +} + +MenuItem::MenuItem(MenuItemKind _kind, int _id, const std::string& _text) : kind(_kind) , id(_id) , text(_text) +{ + list.second = 0; +} + /* Return a pointer to a new menu item */ MenuItem* -MenuItem::create(MenuItemKind kind_, const char *text_, int init_toggle_, Menu* target_menu_, int id, int* int_p_) +MenuItem::create(MenuItemKind kind_, const std::string& text_, int init_toggle_, Menu* target_menu_, int id_, int* int_p_) { - MenuItem *pnew_item = new MenuItem; + MenuItem *pnew_item = new MenuItem(kind_,id_); - pnew_item->kind = kind_; - pnew_item->text = (char*) malloc(sizeof(char) * (strlen(text_) + 1)); - strcpy(pnew_item->text, text_); + pnew_item->text = text_; if(kind_ == MN_TOGGLE) pnew_item->toggled = init_toggle_; @@ -168,10 +176,7 @@ pnew_item->toggled = false; pnew_item->target_menu = target_menu_; - pnew_item->input = (char*) malloc(sizeof(char)); - pnew_item->input[0] = '\0'; - pnew_item->id = id; pnew_item->int_p = int_p_; pnew_item->list.second = 0; @@ -184,25 +189,15 @@ } void -MenuItem::change_text(const char *text_) +MenuItem::change_text(const std::string& text_) { - if (text_) - { - free(text); - text = (char*) malloc(sizeof(char )*(strlen(text_)+1)); - strcpy(text, text_); - } + text = text_; } void -MenuItem::change_input(const char *text_) +MenuItem::change_input(const std::string& text_) { - if(text) - { - free(input); - input = (char*) malloc(sizeof(char )*(strlen(text_)+1)); - strcpy(input, text_); - } + input = text_; } std::string MenuItem::get_input_with_symbol(bool active_item) @@ -223,9 +218,9 @@ char str[1024]; if(input_flickering) - sprintf(str,"%s ",input); + sprintf(str,"%s ",input.c_str()); else - sprintf(str,"%s_",input); + sprintf(str,"%s_",input.c_str()); std::string string = str; @@ -298,8 +293,6 @@ { for(unsigned int i = 0; i < item.size(); ++i) { - free(item[i].text); - free(item[i].input); item[i].list.first.clear(); } } @@ -342,6 +335,13 @@ delete pmenu_item; } +/* Add an item to a menu */ +void +Menu::additem(const MenuItem& pmenu_item) +{ + item.push_back(pmenu_item); +} + void Menu::clear() { @@ -432,13 +432,13 @@ if(item[active_item].kind == MN_TEXTFIELD || item[active_item].kind == MN_NUMFIELD) { - if(item[active_item].input != NULL) + if(!item[active_item].input.empty()) { - int i = strlen(item[active_item].input); + int i = item[active_item].input.size(); while(delete_character > 0) /* remove charactes */ { - item[active_item].input[i-1] = '\0'; + item[active_item].input.resize(i-1); delete_character--; } } @@ -449,19 +449,7 @@ 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'; - } + item[active_item].input.push_back(mn_input_char); } case MENU_ACTION_NONE: @@ -688,7 +676,7 @@ 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); //+ ((item[i].list.second != item[i].list.first.end()) ? (strlen((*(item[i].list.second)).c_str())) : 0); + int w = item[i].text.size() + item[i].input.size() + 1; //+ ((item[i].list.second != item[i].list.first.end()) ? (strlen((*(item[i].list.second)).c_str())) : 0); if( w > menu_width ) { menu_width = w; Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- menu.h 27 Jul 2004 19:31:38 -0000 1.5 +++ menu.h 28 Jul 2004 23:06:11 -0000 1.6 @@ -64,19 +64,22 @@ class MenuItem { public: + MenuItem() {}; + MenuItem(MenuItemKind kind, int id = -1); + MenuItem(MenuItemKind kind, int id, const std::string& text); MenuItemKind kind; + int id; // item id int toggled; - char *text; - char *input; + std::string text; + std::string input; int *int_p; // used for setting keys (can be used for more stuff...) - int id; // item id std::pair<std::set<std::string>, std::set<std::string>::iterator> list; Menu* target_menu; - void change_text (const char *text); - void change_input(const char *text); + void change_text (const std::string& text); + void change_input(const std::string& text); - static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu, int id, int* int_p); + static MenuItem* create(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu, int id, int* int_p); std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol private: @@ -148,6 +151,7 @@ Menu(); ~Menu(); + void additem(const MenuItem& menu_item); void additem(MenuItem* pmenu_item); void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu, int id = -1, int *int_p = NULL); |
From: Tobias G. <to...@us...> - 2004-07-28 23:06:20
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18640/lib/special Modified Files: timer.h Added Files: frame_rate.cpp frame_rate.h Log Message: - Various fixes and cleanups. - Added FrameRate class to SuperTux library - More menu code C++ing. Index: timer.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/timer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- timer.h 27 Jul 2004 13:25:05 -0000 1.4 +++ timer.h 28 Jul 2004 23:06:12 -0000 1.5 @@ -21,6 +21,8 @@ #ifndef SUPERTUX_TIMER_H #define SUPERTUX_TIMER_H +#include <cstdlib> + namespace SuperTux { --- NEW FILE: frame_rate.cpp --- // // SuperTux // 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. #include "SDL.h" #include "../special/frame_rate.h" #include "../special/timer.h" using namespace SuperTux; FrameRate::FrameRate(double fps) { set_fps(fps); } void FrameRate::start() { update_time = last_update_time = Ticks::get(); } void FrameRate::set_fps(double fps) { frame_ms = static_cast<unsigned int>(1000.f/fps); } double FrameRate::get() { return ((double)(update_time-last_update_time))/(double)frame_ms; } void FrameRate::update() { /* Set the time of the last update and the time of the current update */ last_update_time = update_time; 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 the results in SDL mode aren't perfect (thought the 100 FPS are reached), even on an AMD2500+. */ if(last_update_time >= update_time - (frame_ms+2)) { SDL_Delay(frame_ms); update_time = Ticks::get(); } } --- NEW FILE: frame_rate.h --- // // SuperTux // 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_FRAMERATE_H #define SUPERTUX_FRAMERATE_H namespace SuperTux { class FrameRate { public: FrameRate() {}; FrameRate(double fps); void start(); void set_fps(double fps); double get(); void update(); private: unsigned int last_update_time; unsigned int update_time; unsigned int frame_ms; }; } //namespace SuperTux #endif /*SUPERTUX_FRAMERATE_H*/ |
From: Tobias G. <to...@us...> - 2004-07-28 23:06:19
|
Update of /cvsroot/super-tux/supertux/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18640/lib Modified Files: Makefile.am Log Message: - Various fixes and cleanups. - Added FrameRate class to SuperTux library - More menu code C++ing. Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 27 Jul 2004 20:07:35 -0000 1.5 +++ Makefile.am 28 Jul 2004 23:06:11 -0000 1.6 @@ -15,6 +15,7 @@ special/sprite.cpp \ special/sprite_manager.cpp \ special/timer.cpp \ + special/frame_rate.cpp \ utils/configfile.cpp \ utils/lispreader.cpp \ utils/lispwriter.cpp \ @@ -45,7 +46,8 @@ special/moving_object.h \ special/sprite.h \ special/sprite_manager.h \ - special/timer.h + special/timer.h \ + special/frame_rate.h libsupertuxutils_HEADERS =utils/configfile.h \ utils/exceptions.h \ utils/lispreader.h \ |
From: Ricardo C. <rm...@us...> - 2004-07-28 22:23:32
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10426/lib/video Modified Files: surface.cpp surface.h Log Message: - Fixed gradient not working when cached (SDL mode); - Fixed and enabled draw_stretched() that allows zooming. Index: surface.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- surface.h 22 Jul 2004 19:07:51 -0000 1.3 +++ surface.h 28 Jul 2004 22:23:23 -0000 1.4 @@ -129,10 +129,8 @@ /** Return 0 on success, -2 if surface needs to be reloaded */ virtual int draw(float x, float y, Uint8 alpha, Uint32 effect = NONE_EFFECT) = 0; virtual int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect = NONE_EFFECT) = 0; -#if 0 + virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, Uint32 effect = NONE_EFFECT) = 0; - virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update) = 0; -#endif int resize(int w_, int h_); @@ -150,10 +148,7 @@ int draw(float x, float y, Uint8 alpha, Uint32 effect = NONE_EFFECT); int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect = NONE_EFFECT); -#if 0 - - int draw_stretched(float x, float y, int w, int h, Uint8 alpha); -#endif + int draw_stretched(float x, float y, int w, int h, Uint8 alpha, Uint32 effect = NONE_EFFECT); }; #ifndef NOOPENGL @@ -172,10 +167,8 @@ int draw(float x, float y, Uint8 alpha, Uint32 effect = NONE_EFFECT); int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect = NONE_EFFECT); -#if 0 + int draw_stretched(float x, float y, int w, int h, Uint8 alpha, Uint32 effect = NONE_EFFECT); - int draw_stretched(float x, float y, int w, int h, Uint8 alpha); -#endif private: void create_gl(SDL_Surface * surf, GLuint * tex); Index: surface.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- surface.cpp 25 Jul 2004 19:03:35 -0000 1.4 +++ surface.cpp 28 Jul 2004 22:23:23 -0000 1.5 @@ -173,7 +173,7 @@ } Surface::Surface(Color top_background, Color bottom_background, int w_, int h_) - : data(top_background, bottom_background, 0, 0), w(0), h(0) + : data(top_background, bottom_background, w_, h_), w(0), h(0) { // FIXME: Gradient surfaces currently don't accept width/height // If nonzero values are passed to data.create(), supertux @@ -373,7 +373,7 @@ sdl_surface = SDL_CreateRGBSurface(screen->flags, w, h, screen->format->BitsPerPixel, screen->format->Rmask, - screen->format->Gmask, screen->format->Bmask, screen->format->Amask); + screen->format->Gmask, screen->format->Bmask, 0); if(sdl_surface == NULL) Termination::abort("Cannot create surface for the gradient", "SURFACE"); @@ -665,32 +665,56 @@ return 0; } -#if 0 int -SurfaceOpenGL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha) +SurfaceOpenGL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, Uint32 effect) { - float pw = power_of_two(int(this->w)); - float ph = power_of_two(int(this->h)); + if(effect & SEMI_TRANSPARENT) + alpha = 128; - glBindTexture(GL_TEXTURE_2D, gl_texture); + float pw = power_of_two(sw); + float ph = power_of_two(sh); + if(effect & SEMI_TRANSPARENT) + alpha = 128; + + glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4ub(alpha, alpha, alpha, alpha); - glEnable(GL_TEXTURE_2D); - + glBindTexture(GL_TEXTURE_2D, gl_texture); glBegin(GL_QUADS); - glTexCoord2f(0, 0); - glVertex2f(x, y); - glTexCoord2f((float)w / pw, 0); - glVertex2f(sw+x, y); - glTexCoord2f((float)w / pw, (float)h / ph); glVertex2f((float)sw+x, (float)sh+y); - glVertex2f(sw +x, sh+y); - glTexCoord2f(0, (float)h / ph); - glVertex2f(x, sh+y); + + if(effect & VERTICAL_FLIP) + { + glTexCoord2f(0, 0); + glVertex2f(x, (float)sh+y); + + glTexCoord2f((float)w / pw, 0); + glVertex2f((float)sw+x, (float)sh+y); + + glTexCoord2f((float)w / pw, (float)h / ph); + glVertex2f((float)sw+x, y); + + glTexCoord2f(0, (float)h / ph); + glVertex2f(x, y); + } + else + { + glTexCoord2f(0, 0); + glVertex2f(x, y); + + glTexCoord2f((float)w / pw, 0); + glVertex2f((float)sw+x, y); + + glTexCoord2f((float)w / pw, (float)h / ph); + glVertex2f((float)sw+x, (float)sh+y); + + glTexCoord2f(0, (float)h / ph); + glVertex2f(x, (float)sh+y); + } glEnd(); glDisable(GL_TEXTURE_2D); @@ -698,7 +722,6 @@ return 0; } -#endif #endif @@ -839,9 +862,8 @@ return ret; } -#if 0 int -SurfaceSDL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, bool update) +SurfaceSDL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, Uint32 effect) { SDL_Rect dest; @@ -850,9 +872,8 @@ dest.w = (int)sw; dest.h = (int)sh; - if(alpha != 255) - SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); - + if(effect & SEMI_TRANSPARENT) + alpha = 128; SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, sw, sh, sdl_surface->format->BitsPerPixel, @@ -863,15 +884,14 @@ SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); SDL_SoftStretch(sdl_surface_copy, NULL, sdl_surface_copy, &dest); + if(alpha != 255) + SDL_SetAlpha(sdl_surface_copy,SDL_SRCALPHA,alpha); + int ret = SDL_BlitSurface(sdl_surface_copy,NULL,screen,&dest); SDL_FreeSurface(sdl_surface_copy); - if (update == UPDATE) - update_rect(screen, dest.x, dest.y, dest.w, dest.h); - return ret; } -#endif SurfaceSDL::~SurfaceSDL() {} |
From: Ricardo C. <rm...@us...> - 2004-07-28 21:47:57
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3626/src Modified Files: gameloop.cpp Log Message: Added a --flip-levels argument, I guess it doesn't need any description of what it does. :) Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.162 retrieving revision 1.163 diff -u -d -r1.162 -r1.163 --- gameloop.cpp 27 Jul 2004 19:31:39 -0000 1.162 +++ gameloop.cpp 28 Jul 2004 21:47:43 -0000 1.163 @@ -77,7 +77,7 @@ context = new DrawingContext(); - if(debug_mode) + if(flip_levels_mode) flip_level = true; restart_level(); |
From: Ricardo C. <rm...@us...> - 2004-07-28 21:47:57
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3626/lib/app Modified Files: globals.cpp globals.h setup.cpp Log Message: Added a --flip-levels argument, I guess it doesn't need any description of what it does. :) Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- setup.cpp 27 Jul 2004 19:31:37 -0000 1.9 +++ setup.cpp 28 Jul 2004 21:47:43 -0000 1.10 @@ -715,6 +715,10 @@ { launch_worldmap_mode = true; } + else if (strcmp(argv[i], "--flip-levels") == 0) + { + flip_levels_mode = true; + } else if (strcmp(argv[i], "--datadir") == 0 || strcmp(argv[i], "-d") == 0 ) { @@ -793,6 +797,7 @@ " Define how joystick buttons and axis should be mapped\n" " --leveleditor Opens the leveleditor in a file.\n" " --worldmap Opens the specified worldmap file.\n" + " --flip-levels Flip levels upside-down.\n" " -d, --datadir DIR Load Game data from DIR (default: automatic)\n" " --debug Enables the debug mode, which is useful for developers.\n" " --help Display a help message summarizing command-line\n" @@ -833,7 +838,7 @@ /* Display the usage message: */ - fprintf(fi, _("Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--debug] | [--usage | --help | --version] [--leveleditor] [--worldmap] FILENAME\n"), + fprintf(fi, _("Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--debug] | [--usage | --help | --version] [--leveleditor] [--worldmap] [--flip-levels] FILENAME\n"), prog); Index: globals.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- globals.cpp 27 Jul 2004 19:31:34 -0000 1.6 +++ globals.cpp 28 Jul 2004 21:47:43 -0000 1.7 @@ -55,6 +55,7 @@ char* level_startup_file = 0; bool launch_leveleditor_mode = false; bool launch_worldmap_mode = false; +bool flip_levels_mode = false; /* SuperTux directory ($HOME/.supertux) and save directory($HOME/.supertux/save) */ char *st_dir, *st_save_dir; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- globals.h 27 Jul 2004 19:31:37 -0000 1.6 +++ globals.h 28 Jul 2004 21:47:43 -0000 1.7 @@ -69,6 +69,7 @@ extern char* level_startup_file; extern bool launch_leveleditor_mode; extern bool launch_worldmap_mode; + extern bool flip_levels_mode; /* SuperTux directory ($HOME/.supertux) and save directory($HOME/.supertux/save) */ extern char* st_dir; |
From: Ricardo C. <rm...@us...> - 2004-07-28 20:42:10
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23520/src Modified Files: worldmap.cpp worldmap.h Log Message: Improved passive messages code. Fixed bug of showing a previous passive message when a new one should be being displayed now. A bug still to fix is that when going from a passive message to a map one, both will be displayed. Anyway, first we need to test if this all code of passive/map messages is working. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- worldmap.cpp 28 Jul 2004 16:07:08 -0000 1.111 +++ worldmap.cpp 28 Jul 2004 20:41:59 -0000 1.112 @@ -37,7 +37,7 @@ #include "app/gettext.h" #include "misc.h" -#define DISPLAY_MAP_MESSAGE_TIME 2600 +#define DISPLAY_MAP_MESSAGE_TIME 2800 Menu* worldmap_menu = 0; @@ -298,7 +298,10 @@ WorldMap::SpecialTile* special_tile = worldmap->at_special_tile(); if(special_tile && special_tile->passive_message) - special_tile->display_map_message_timer.start(DISPLAY_MAP_MESSAGE_TIME); + { + worldmap->passive_message = special_tile->display_map_message; + worldmap->passive_message_timer.start(DISPLAY_MAP_MESSAGE_TIME); + } if (worldmap->at(tile_pos)->stop || (special_tile && !special_tile->passive_message)) @@ -470,7 +473,6 @@ special_tile.passive_message = false; if(!special_tile.display_map_message.empty()) special_tile.passive_message = true; - special_tile.display_map_message_timer.init(true); reader.read_string("map-message", special_tile.display_map_message); reader.read_string("next-world", special_tile.next_worldmap); reader.read_string("level", special_tile.level_name, true); @@ -537,7 +539,7 @@ LispReader* reader = LispReader::load(datadir + "/levels/" + special_tile.level_name, "supertux-level"); if(!reader) { - std::cerr << "Error: Could not open special_tile file. Ignoring...\n"; + std::cerr << "Error: Could not open level file. Ignoring...\n"; return; } @@ -995,18 +997,11 @@ } } } - for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) - { - /* Display a passive message in the map, if any as been selected */ - if(i->display_map_message_timer.check()) - { - if(!i->display_map_message.empty()) - context.draw_text_center(gold_text, i->display_map_message, - Vector(0, screen->h - white_text->get_height() - 60), - LAYER_FOREGROUND1); - break; - } - } + /* Display a passive message in the map, if needed */ + if(passive_message_timer.check()) + context.draw_text_center(gold_text, passive_message, + Vector(0, screen->h - white_text->get_height() - 60), + LAYER_FOREGROUND1); } void Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- worldmap.h 28 Jul 2004 16:04:25 -0000 1.43 +++ worldmap.h 28 Jul 2004 20:41:59 -0000 1.44 @@ -160,7 +160,6 @@ /** Message to show in the Map */ std::string display_map_message; - Timer display_map_message_timer; bool passive_message; /** Go to this world */ @@ -179,6 +178,10 @@ bool west; }; + /** Variables to deal with the passive map messages */ + Timer passive_message_timer; + std::string passive_message; + private: std::string map_filename; |