super-tux-commit Mailing List for Super Tux (Page 86)
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: Ingo R. <gr...@us...> - 2004-04-26 16:39:06
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20433 Modified Files: TODO.txt Log Message: added milestone1 todo Index: TODO.txt =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TODO.txt 15 Mar 2004 17:45:29 -0000 1.5 +++ TODO.txt 26 Apr 2004 16:38:50 -0000 1.6 @@ -1,26 +1,19 @@ -TODO.txt for Super Tux - -by Bill Kendrick & Tobias Glaesser -b...@ne... -http://www.newbreedsoftware.com/supertux/ - -Version 0.0.6 - -March 15, 2004 +ToDo for Milestone1 +=================== +- you can pick up more than 1 mr iceblock +- not all levels have a correctly placed igloo yet +- supertux crashs from time to time +- some enemies can't be bumped anymore +- there's no effect if you bump specials +- leveleditor is incomplete (maybe we shoudl deactivate it?) +- sometimes you die after being and pause modus and unpausing +- enemies start running backwards, when they collide with a flame +- fast music restart again and again +- time is displayed negatively when tux dies because of timeout +- supertux lifting its feet for kicking is not drawn +- egg gets removed when leaving the screen, while badguys don't or at + least much later, thus its not possible to wait for an egg that + would bounce back -TO DO ------ - Different, better and more music - More enemies - Redo laptop enemy graphics - More levels - Play as Gown, rescuing Tux - - Note: Use our mailing-list to find out what is really to do. - -DONE ------ - One-ups, End game on game over (by Tobias Glaesser <tob...@gm...>) - High score (by Adam Czachorowski <gi...@o2...>) - \ No newline at end of file +# EOF # |
From: Ingo R. <gr...@us...> - 2004-04-26 15:04:32
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31864/src Modified Files: text.cpp Log Message: - fixed miss align in scrolling text Index: text.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/text.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- text.cpp 26 Apr 2004 14:15:48 -0000 1.12 +++ text.cpp 26 Apr 2004 15:04:22 -0000 1.13 @@ -328,11 +328,11 @@ switch(names.item[i][0]) { case ' ': - white_small_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); + white_small_text->drawf(names.item[i]+1, 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); y += white_small_text->h+ITEMS_SPACE; break; case ' ': - white_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); + white_text->drawf(names.item[i]+1, 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); y += white_text->h+ITEMS_SPACE; break; case '-': |
From: Ingo R. <gr...@us...> - 2004-04-26 15:03:33
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31545/src Modified Files: gameloop.cpp lispreader.cpp sprite_manager.cpp title.cpp worldmap.cpp Log Message: - removed st_abort() from lisp reader, client code should check the return value instead Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- title.cpp 26 Apr 2004 14:15:49 -0000 1.63 +++ title.cpp 26 Apr 2004 15:03:24 -0000 1.64 @@ -364,3 +364,5 @@ delete logo; } +// EOF // + Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- worldmap.cpp 26 Apr 2004 13:38:48 -0000 1.55 +++ worldmap.cpp 26 Apr 2004 15:03:24 -0000 1.56 @@ -921,6 +921,12 @@ return; lisp_object_t* savegame = lisp_read_from_file(filename); + if (savegame) + { + std::cout << "WorldMap:loadgame: File not found: " << filename << std::endl; + return; + } + lisp_object_t* cur = savegame; if (strcmp(lisp_symbol(lisp_car(cur)), "supertux-savegame") != 0) Index: sprite_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite_manager.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sprite_manager.cpp 26 Apr 2004 12:21:22 -0000 1.4 +++ sprite_manager.cpp 26 Apr 2004 15:03:24 -0000 1.5 @@ -38,6 +38,12 @@ SpriteManager::load_resfile(const std::string& filename) { lisp_object_t* root_obj = lisp_read_from_file(filename); + if (!root_obj) + { + std::cout << "SpriteManager: Couldn't load: " << filename << std::endl; + return; + } + lisp_object_t* cur = root_obj; if (strcmp(lisp_symbol(lisp_car(cur)), "supertux-resources") != 0) Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- gameloop.cpp 26 Apr 2004 14:24:06 -0000 1.108 +++ gameloop.cpp 26 Apr 2004 15:03:23 -0000 1.109 @@ -750,9 +750,12 @@ sprintf(slotfile,"%s/slot%d.stsg",st_save_dir,slot); lisp_object_t* savegame = lisp_read_from_file(slotfile); - LispReader reader(lisp_cdr(savegame)); - reader.read_string("title", &title); - lisp_free(savegame); + if (savegame) + { + LispReader reader(lisp_cdr(savegame)); + reader.read_string("title", &title); + lisp_free(savegame); + } if (access(slotfile, F_OK) == 0) { Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- lispreader.cpp 26 Apr 2004 12:21:22 -0000 1.16 +++ lispreader.cpp 26 Apr 2004 15:03:24 -0000 1.17 @@ -1317,18 +1317,6 @@ if (has_suffix(filename.c_str(), ".gz")) { return lisp_read_from_gzfile(filename.c_str()); -#if 0 - lisp_object_t* obj = 0; - gzFile in = gzopen(filename, "r"); - - if (in) - { - lisp_stream_init_gzfile(&stream, in); - obj = lisp_read(&stream); - gzclose(in); - } - return obj; -#endif } else { @@ -1341,12 +1329,6 @@ obj = lisp_read(&stream); fclose(in); } - else { - std::cerr << "LispReader: File not found: " << filename << endl; - st_abort("aborting", ""); - } - - return obj; } |
From: Ingo R. <gr...@us...> - 2004-04-26 15:03:31
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31545/data/images/tilesets Modified Files: supertux.stgt Log Message: - removed st_abort() from lisp reader, client code should check the return value instead Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- supertux.stgt 25 Apr 2004 22:46:01 -0000 1.19 +++ supertux.stgt 26 Apr 2004 15:03:23 -0000 1.20 @@ -456,6 +456,7 @@ "goal2-1.png" "goal2-1.png")) - + (tile (id 131) + (images "black.png")) ) |
From: Ricardo C. <rm...@us...> - 2004-04-26 14:40:27
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26352/src Modified Files: badguy.cpp defines.h player.cpp player.h Log Message: Implemented kicking (as asked by Ingo). The kick timing can be changed in defines.h I've not tested it very well, but it doesn't seem to be working. Can anyone have a look? Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -u -d -r1.67 -r1.68 --- player.cpp 26 Apr 2004 13:13:51 -0000 1.67 +++ player.cpp 26 Apr 2004 14:40:17 -0000 1.68 @@ -92,6 +92,7 @@ skidding_timer.init(true); safe_timer.init(true); frame_timer.init(true); + kick_timer.init(true); physic.reset(); } @@ -264,6 +265,7 @@ skidding_timer.check(); invincible_timer.check(); safe_timer.check(); + kick_timer.check(); } bool @@ -522,6 +524,13 @@ else sprite->skid_left->draw(base.x - scroll_x, base.y); } + else if (kick_timer.started()) + { + if (dir == RIGHT) + sprite->kick_right->draw(base.x - scroll_x, base.y); + else + sprite->kick_left->draw(base.x - scroll_x, base.y); + } else if (physic.get_velocity_y() != 0) { if (dir == RIGHT) Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- player.h 25 Apr 2004 16:46:55 -0000 1.42 +++ player.h 26 Apr 2004 14:40:17 -0000 1.43 @@ -127,6 +127,7 @@ Timer skidding_timer; Timer safe_timer; Timer frame_timer; + Timer kick_timer; Physic physic; public: Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- defines.h 25 Apr 2004 21:55:39 -0000 1.24 +++ defines.h 26 Apr 2004 14:40:17 -0000 1.25 @@ -85,6 +85,10 @@ #define LEVEL_WIDTH 375 +/* Timing constants (in ms): */ + +#define KICKING_TIME 3000 + /* Debugging */ Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- badguy.cpp 26 Apr 2004 12:21:22 -0000 1.50 +++ badguy.cpp 26 Apr 2004 14:40:17 -0000 1.51 @@ -291,6 +291,7 @@ old_base = base; mode=KICK; + tux.kick_timer.start(KICKING_TIME); set_sprite(img_laptop_flat_left, img_laptop_flat_right); physic.set_velocity_x((dir == LEFT) ? -3.5 : 3.5); play_sound(sounds[SND_KICK],SOUND_CENTER_SPEAKER); |
From: Ricardo C. <rm...@us...> - 2004-04-26 14:24:16
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23306/src Modified Files: gameloop.cpp Log Message: Removed (just commented) the clear screen code before the level starts. It looks bad when the intro info is gradient and then it displays a black screen and then the level. Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- gameloop.cpp 26 Apr 2004 13:18:40 -0000 1.107 +++ gameloop.cpp 26 Apr 2004 14:24:06 -0000 1.108 @@ -157,7 +157,7 @@ white_text->drawf(str, 0, 224, A_HMIDDLE, A_TOP, 1); sprintf(str, "by %s", world->get_level()->author.c_str()); - white_small_text->drawf(str, 0, 400, A_HMIDDLE, A_TOP, 1); + white_small_text->drawf(str, 0, 360, A_HMIDDLE, A_TOP, 1); flipscreen(); @@ -527,8 +527,8 @@ update_time = last_update_time = st_get_ticks(); /* Clear screen: */ - clearscreen(0, 0, 0); - updatescreen(); +// clearscreen(0, 0, 0); +// updatescreen(); // Eat unneeded events SDL_Event event; |
From: Ricardo C. <rm...@us...> - 2004-04-26 14:20:31
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22445/src Modified Files: intro.cpp setup.cpp Log Message: Intro file should be the one to handle the intro sequence, even if it is only one line of code. I think we shouldn't get rid of it, because in the future it should be improved and maybe support some sort of scripting. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -u -d -r1.60 -r1.61 --- setup.cpp 26 Apr 2004 14:15:48 -0000 1.60 +++ setup.cpp 26 Apr 2004 14:20:22 -0000 1.61 @@ -496,7 +496,7 @@ if (access(slotfile, F_OK) != 0) { - display_text_file("intro.txt", "images/background/arctis2.jpg"); + draw_intro(); } WorldMapNS::WorldMap worldmap; Index: intro.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/intro.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- intro.cpp 25 Apr 2004 14:27:49 -0000 1.16 +++ intro.cpp 26 Apr 2004 14:20:22 -0000 1.17 @@ -26,66 +26,13 @@ #include <SDL.h> #include <SDL_image.h> -#include <sys/types.h> -#include <ctype.h> - #include "defines.h" #include "globals.h" #include "intro.h" -#include "screen.h" #include "text.h" -#include "texture.h" -#include "timer.h" - -char * intro_text[] = { - "Tux and Gown were having a nice picnic..", - "when suddenly...", - "Gown is beamed away!!!", - "This looks like a job for ---" - }; - void draw_intro() { - bool done = false; - - while (!done) - { - SDL_Event event; - drawgradient(Color(155, 200, 255), Color(255, 255, 255)); - - gold_text->draw_align("Gwen gets captured!", screen->w/2, 15, A_HMIDDLE, A_TOP); - - white_text->draw - ("\n" // - "Tux and Gwen were out having a nice\n" - "picnic on the ice fields of Antarctica.\n" - "Suddenly, a creature jumped from\n" - "behind an ice bush, there was a flash,\n" - "and Tux fell asleep!\n" - "\n" // - "When Tux wakes up, he finds that Gwen\n" - "is missing. Where she lay before now\n" - "lies a letter. \"Tux, my arch enemy!\"\n" - "says the letter. \"I have captured\n" - "your beautiful Gwen and have taken her\n" - "to my fortress. The path to my fortress\n" - "is littered with my minions. Give up on the\n" - "thought of trying to reclaim her, you\n" - "haven't a chance! -Nolok\"\n" - "\n" - "Tux looks and see Nolok's fortress in\n" - "the distance. Determined to save his\n" - "beloved Gwen, he begins his journey.", - -5, 30); - - white_small_text->draw_align("Press any button to continue!", - screen->w/2, screen->h - 20, A_HMIDDLE, A_TOP); - - flipscreen(); - SDL_Delay(100); - - done = wait_for_event(event,0); - } +display_text_file("intro.txt", "images/background/arctis2.jpg"); } |
From: Ingo R. <gr...@us...> - 2004-04-26 14:16:33
|
Update of /cvsroot/super-tux/supertux/data/images/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21686/data/images/worldmap Modified Files: antarctica.stwt Added Files: snowman.png Log Message: - added little snowman --- NEW FILE: snowman.png --- (This appears to be a binary file; contents omitted.) Index: antarctica.stwt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/worldmap/antarctica.stwt,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- antarctica.stwt 26 Apr 2004 12:42:05 -0000 1.6 +++ antarctica.stwt 26 Apr 2004 14:16:22 -0000 1.7 @@ -275,6 +275,13 @@ (south #t) (west #f) (east #f)) + + (tile (id 60) + (image "snowman.png") + (north #f) + (south #t) + (west #f) + (east #f)) ) ;; EOF ;; |
From: Ingo R. <gr...@us...> - 2004-04-26 14:16:33
|
Update of /cvsroot/super-tux/supertux/data/levels/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21686/data/levels/default Modified Files: worldmap.stwm Log Message: - added little snowman Index: worldmap.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/default/worldmap.stwm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- worldmap.stwm 26 Apr 2004 12:41:24 -0000 1.13 +++ worldmap.stwm 26 Apr 2004 14:16:23 -0000 1.14 @@ -9,12 +9,12 @@ 9 9 9 9 9 9 9 11 16 12 11 16 16 16 16 12 9 9 9 9 11 16 16 12 9 9 14 13 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 16 16 16 22 19 17 15 24 25 25 26 23 16 12 9 9 14 18 18 13 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 22 58 19 19 20 18 13 15 31 32 32 34 26 19 23 16 12 9 9 9 9 9 9 11 16 16 16 16 12 9 9 9 9 9 9 9 9 - 9 9 15 19 59 19 20 13 9 9 15 31 35 29 29 28 19 19 19 23 16 12 9 9 9 11 22 19 24 25 26 23 12 11 16 16 12 9 9 9 + 9 9 15 19 59 19 20 13 9 9 15 31 35 29 29 28 19 19 60 23 16 12 9 9 9 11 22 19 24 25 26 23 12 11 16 16 12 9 9 9 9 9 15 19 47 19 17 11 16 16 22 30 28 19 48 40 40 39 19 20 18 13 9 9 11 22 19 19 30 36 34 26 23 22 19 19 23 12 9 9 9 9 15 19 47 19 23 22 19 19 19 19 24 26 47 24 26 47 19 23 16 16 16 16 22 48 40 40 39 31 32 34 25 25 25 25 26 17 9 9 9 9 15 19 37 39 19 48 40 40 40 39 30 28 47 30 28 37 40 40 40 40 40 40 40 42 19 19 47 30 29 29 29 29 29 36 27 17 9 9 9 9 15 19 19 47 19 47 24 25 26 37 40 40 42 24 25 25 26 20 18 18 18 21 24 25 25 26 37 40 40 40 40 40 39 31 27 23 12 9 - 9 9 14 18 21 47 19 47 30 29 28 19 24 25 25 33 35 29 28 17 9 9 9 15 30 29 36 27 19 19 19 19 19 19 47 31 34 26 17 9 + 9 9 14 18 21 47 19 47 30 29 28 19 24 25 25 33 35 29 28 17 9 9 9 15 30 29 36 27 19 19 19 19 19 60 47 31 34 26 17 9 9 9 9 9 15 37 40 42 19 19 24 25 33 35 29 29 28 20 18 13 9 9 9 14 18 21 31 27 48 40 40 40 40 40 42 30 36 27 17 9 9 9 9 9 15 19 19 24 25 25 33 32 35 28 20 18 18 13 9 9 9 9 9 9 9 15 31 27 47 24 25 25 25 26 19 19 30 28 17 9 9 9 9 9 14 21 19 31 32 32 32 35 28 20 13 9 9 11 16 12 9 9 9 9 9 15 30 28 47 30 36 32 35 28 20 21 19 20 13 9 @@ -27,10 +27,10 @@ 9 9 9 15 31 27 55 56 57 39 19 48 40 40 39 19 48 40 40 39 30 29 29 28 30 28 47 20 18 18 13 9 9 9 9 9 9 9 9 9 9 9 9 15 31 34 25 26 19 47 19 47 24 26 47 19 47 24 26 47 19 24 26 48 40 40 42 23 12 9 9 9 9 11 12 9 9 9 9 9 9 9 9 15 30 29 29 28 19 37 40 42 31 27 47 19 47 30 28 47 19 30 28 47 19 19 24 26 17 9 9 9 9 14 13 9 9 9 9 9 - 9 9 9 14 18 18 18 18 21 24 26 19 30 28 47 19 47 19 48 42 24 26 48 42 24 25 33 27 17 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 14 18 18 18 18 21 24 26 19 30 28 47 60 47 19 48 42 24 26 48 42 24 25 33 27 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 30 28 24 25 26 37 40 42 19 47 19 30 28 47 19 30 29 36 27 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 12 9 9 9 14 18 21 30 36 34 25 26 19 19 37 40 40 40 42 19 20 21 30 28 17 9 9 11 16 16 12 9 9 9 9 9 - 9 9 9 14 13 9 9 9 9 9 14 21 31 32 32 34 25 25 25 25 26 19 19 20 13 14 18 18 13 9 9 14 21 19 23 12 9 9 9 9 + 9 9 9 14 13 9 9 9 9 9 14 21 31 32 32 34 25 25 25 25 26 19 19 20 13 14 18 18 13 9 9 14 21 60 23 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 30 29 29 29 29 29 29 29 28 19 20 13 11 12 9 9 9 9 9 9 14 18 18 13 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 13 9 14 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 |
From: Ricardo C. <rm...@us...> - 2004-04-26 14:15:59
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21547/src Modified Files: setup.cpp text.cpp text.h title.cpp Log Message: Improved the display_text_file(): moved to text.cpp and made it more independent. I wasn't able to test it, since the game crashes because of: « LispReader: File not found: /home/rick2/.supertux/save/slot1.stsg Error: aborting » Index: text.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/text.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- text.cpp 25 Apr 2004 21:55:39 -0000 1.11 +++ text.cpp 26 Apr 2004 14:15:48 -0000 1.12 @@ -219,3 +219,147 @@ { erasetext(text, screen->w / 2 - (strlen(text) * 8), y, ptexture, update, shadowsize); } + + +/* --- SCROLL TEXT FUNCTION --- */ + +#define MAX_VEL 10 +#define SPEED 1 +#define SCROLL 60 +#define ITEMS_SPACE 4 + +void display_text_file(char *file, char* surface) +{ +Surface* sur = new Surface(datadir + surface, IGNORE_ALPHA); +display_text_file(file, sur); +delete sur; +} + +void display_text_file(char *file, Surface* surface) +{ + int done; + int scroll, speed; + int y; + int length; + FILE* fi; + char temp[1024]; + string_list_type names; + char filename[1024]; + string_list_init(&names); + sprintf(filename,"%s/%s", datadir.c_str(), file); + if((fi = fopen(filename,"r")) != NULL) + { + while(fgets(temp, sizeof(temp), fi) != NULL) + { + temp[strlen(temp)-1]='\0'; + string_list_add_item(&names,temp); + } + fclose(fi); + } + else + { + string_list_add_item(&names,"File was not found!"); + string_list_add_item(&names,filename); + string_list_add_item(&names,"Shame on the guy, who"); + string_list_add_item(&names,"forgot to include it"); + string_list_add_item(&names,"in your SuperTux distribution."); + } + + + scroll = 0; + speed = 2; + done = 0; + + length = names.num_items; + + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + + while(done == 0) + { + /* in case of input, exit */ + SDL_Event event; + while(SDL_PollEvent(&event)) + switch(event.type) + { + case SDL_KEYDOWN: + switch(event.key.keysym.sym) + { + case SDLK_UP: + speed -= SPEED; + break; + case SDLK_DOWN: + speed += SPEED; + break; + case SDLK_SPACE: + case SDLK_RETURN: + if(speed >= 0) + scroll += SCROLL; + break; + case SDLK_ESCAPE: + done = 1; + break; + default: + break; + } + break; + case SDL_QUIT: + done = 1; + break; + default: + break; + } + + if(speed > MAX_VEL) + speed = MAX_VEL; + else if(speed < -MAX_VEL) + speed = -MAX_VEL; + + /* draw the credits */ + + surface->draw_bg(); + + if (strcmp(file, "CREDITS") == 0) + white_big_text->drawf("- SuperTux " VERSION " -", + 0, screen->h-scroll, A_HMIDDLE, A_TOP, 2); + + y = 0; + for(int i = 0; i < length; i++) + { + switch(names.item[i][0]) + { + case ' ': + white_small_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); + y += white_small_text->h+ITEMS_SPACE; + break; + case ' ': + white_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); + y += white_text->h+ITEMS_SPACE; + break; + case '-': + white_big_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 3); + y += white_big_text->h+ITEMS_SPACE; + break; + default: + blue_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); + y += blue_text->h+ITEMS_SPACE; + break; + } + } + + flipscreen(); + + if(60+screen->h+y-scroll < 0 && 20+60+screen->h+y-scroll < 0) + done = 1; + + scroll += speed; + if(scroll < 0) + scroll = 0; + + SDL_Delay(35); + } + string_list_free(&names); + + SDL_EnableKeyRepeat(0, 0); // disables key repeating + Menu::set_current(main_menu); +} + Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- title.cpp 26 Apr 2004 13:00:56 -0000 1.62 +++ title.cpp 26 Apr 2004 14:15:49 -0000 1.63 @@ -62,8 +62,6 @@ static unsigned int last_update_time; static unsigned int update_time; -void display_text_file(char *filename); - std::vector<st_subset> contrib_subsets; std::string current_contrib_subset; @@ -315,7 +313,7 @@ Menu::set_current(main_menu); break; case MNID_CREDITS: - display_text_file("CREDITS"); + display_text_file("CREDITS", bkg_title); Menu::set_current(main_menu); break; case MNID_QUITMAINMENU: @@ -366,144 +364,3 @@ delete logo; } -#define MAX_VEL 10 -#define SPEED 1 -#define SCROLL 60 -#define ITEMS_SPACE 4 - -void display_text_file(char *file) -{ - int done; - int scroll, speed; - int y; - Timer timer; - int length; - FILE* fi; - char temp[1024]; - string_list_type names; - char filename[1024]; - string_list_init(&names); - sprintf(filename,"%s/%s", datadir.c_str(), file); - if((fi = fopen(filename,"r")) != NULL) - { - while(fgets(temp, sizeof(temp), fi) != NULL) - { - temp[strlen(temp)-1]='\0'; - string_list_add_item(&names,temp); - } - fclose(fi); - } - else - { - string_list_add_item(&names,"Credits were not found!"); - string_list_add_item(&names,"Shame on the guy, who"); - string_list_add_item(&names,"forgot to include them"); - string_list_add_item(&names,"in your SuperTux distribution."); - } - - - timer.init(SDL_GetTicks()); - timer.start(50); - - scroll = 0; - speed = 2; - done = 0; - - length = names.num_items; - - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); - - while(done == 0) - { - /* in case of input, exit */ - SDL_Event event; - while(SDL_PollEvent(&event)) - switch(event.type) - { - case SDL_KEYDOWN: - switch(event.key.keysym.sym) - { - case SDLK_UP: - speed -= SPEED; - break; - case SDLK_DOWN: - speed += SPEED; - break; - case SDLK_SPACE: - case SDLK_RETURN: - if(speed >= 0) - scroll += SCROLL; - break; - case SDLK_ESCAPE: - done = 1; - break; - default: - break; - } - break; - case SDL_QUIT: - done = 1; - break; - default: - break; - } - - if(speed > MAX_VEL) - speed = MAX_VEL; - else if(speed < -MAX_VEL) - speed = -MAX_VEL; - - /* draw the credits */ - - draw_background(); - - if (strcmp(file, "CREDITS") == 0) - white_big_text->drawf("- SuperTux " VERSION " -", - 0, screen->h-scroll, A_HMIDDLE, A_TOP, 2); - - y = 0; - for(int i = 0; i < length; i++) - { - switch(names.item[i][0]) - { - case ' ': - white_small_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); - y += white_small_text->h+ITEMS_SPACE; - break; - case ' ': - white_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); - y += white_text->h+ITEMS_SPACE; - break; - case '-': - white_big_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 3); - y += white_big_text->h+ITEMS_SPACE; - break; - default: - blue_text->drawf(names.item[i], 0, 60+screen->h+y-scroll, A_HMIDDLE, A_TOP, 1); - y += blue_text->h+ITEMS_SPACE; - break; - } - } - - flipscreen(); - - if(60+screen->h+y-scroll < 0 && 20+60+screen->h+y-scroll < 0) - done = 1; - - scroll += speed; - if(scroll < 0) - scroll = 0; - - SDL_Delay(35); - - if(timer.get_left() < 0) - { - frame++; - timer.start(50); - } - } - string_list_free(&names); - - SDL_EnableKeyRepeat(0, 0); // disables key repeating - Menu::set_current(main_menu); -} Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- setup.cpp 26 Apr 2004 12:21:22 -0000 1.59 +++ setup.cpp 26 Apr 2004 14:15:48 -0000 1.60 @@ -55,8 +55,6 @@ #include "player.h" -void display_text_file(char *filename); - #ifdef WIN32 #define mkdir(dir, mode) mkdir(dir) // on win32 we typically don't want LFS paths @@ -498,7 +496,7 @@ if (access(slotfile, F_OK) != 0) { - display_text_file("intro.txt"); + display_text_file("intro.txt", "images/background/arctis2.jpg"); } WorldMapNS::WorldMap worldmap; Index: text.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/text.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- text.h 20 Apr 2004 11:09:34 -0000 1.12 +++ text.h 26 Apr 2004 14:15:48 -0000 1.13 @@ -23,6 +23,8 @@ #include "texture.h" +void display_text_file(char *file, char* surface); +void display_text_file(char *file, Surface* surface); /* Kinds of texts. */ enum { |
From: Ingo R. <gr...@us...> - 2004-04-26 13:43:52
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14973 Modified Files: egg.png Log Message: - rounded the egg a bit Index: egg.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/egg.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsVqpmCX and /tmp/cvs2VkVED differ |
From: Ingo R. <gr...@us...> - 2004-04-26 13:38:57
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13890 Modified Files: worldmap.cpp worldmap.h Log Message: - added small/firetux to worldmap Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- worldmap.cpp 26 Apr 2004 12:41:50 -0000 1.54 +++ worldmap.cpp 26 Apr 2004 13:38:48 -0000 1.55 @@ -165,7 +165,10 @@ Tux::Tux(WorldMap* worldmap_) : worldmap(worldmap_) { - sprite = new Surface(datadir + "/images/worldmap/tux.png", USE_ALPHA); + largetux_sprite = new Surface(datadir + "/images/worldmap/tux.png", USE_ALPHA); + firetux_sprite = new Surface(datadir + "/images/worldmap/firetux.png", USE_ALPHA); + smalltux_sprite = new Surface(datadir + "/images/worldmap/smalltux.png", USE_ALPHA); + offset = 0; moving = false; tile_pos.x = 4; @@ -176,15 +179,30 @@ Tux::~Tux() { - delete sprite; + delete smalltux_sprite; + delete firetux_sprite; + delete largetux_sprite; } void Tux::draw(const Point& offset) { Point pos = get_pos(); - sprite->draw(pos.x + offset.x, - pos.y + offset.y - 10); + switch (player_status.bonus) + { + case PlayerStatus::GROWUP_BONUS: + largetux_sprite->draw(pos.x + offset.x, + pos.y + offset.y - 10); + break; + case PlayerStatus::FLOWER_BONUS: + firetux_sprite->draw(pos.x + offset.x, + pos.y + offset.y - 10); + break; + case PlayerStatus::NO_BONUS: + smalltux_sprite->draw(pos.x + offset.x, + pos.y + offset.y - 10); + break; + } } Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- worldmap.h 26 Apr 2004 12:41:50 -0000 1.25 +++ worldmap.h 26 Apr 2004 13:38:48 -0000 1.26 @@ -95,7 +95,9 @@ Direction back_direction; private: WorldMap* worldmap; - Surface* sprite; + Surface* largetux_sprite; + Surface* firetux_sprite; + Surface* smalltux_sprite; Direction input_direction; Direction direction; |
From: Ingo R. <gr...@us...> - 2004-04-26 13:38:50
|
Update of /cvsroot/super-tux/supertux/data/images/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13864 Added Files: firetux.png smalltux.png Log Message: - added small/firetux to worldmap --- NEW FILE: firetux.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: smalltux.png --- (This appears to be a binary file; contents omitted.) |
From: Ingo R. <gr...@us...> - 2004-04-26 13:19:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9523 Modified Files: gameloop.cpp Log Message: - added more meaningfull savegame titles Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- gameloop.cpp 26 Apr 2004 12:48:33 -0000 1.106 +++ gameloop.cpp 26 Apr 2004 13:18:40 -0000 1.107 @@ -746,10 +746,21 @@ { char tmp[1024]; char slotfile[1024]; + std::string title; sprintf(slotfile,"%s/slot%d.stsg",st_save_dir,slot); + lisp_object_t* savegame = lisp_read_from_file(slotfile); + LispReader reader(lisp_cdr(savegame)); + reader.read_string("title", &title); + lisp_free(savegame); + if (access(slotfile, F_OK) == 0) - sprintf(tmp,"Slot %d - Savegame",slot); + { + if (!title.empty()) + snprintf(tmp,1024,"Slot %d - %s",slot, title.c_str()); + else + snprintf(tmp, 1024,"Slot %d - Savegame",slot); + } else sprintf(tmp,"Slot %d - Free",slot); |
From: Ingo R. <gr...@us...> - 2004-04-26 13:14:01
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8688 Modified Files: player.cpp Log Message: - changed priority of skid and duck to avoid glitches when ducking and skiding at the same time Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- player.cpp 26 Apr 2004 10:03:34 -0000 1.66 +++ player.cpp 26 Apr 2004 13:13:51 -0000 1.67 @@ -508,48 +508,45 @@ else sprite = &largetux; - if (skidding_timer.started()) + if (duck) + { + if (dir == RIGHT) + sprite->duck_right->draw(base.x - scroll_x, base.y); + else + sprite->duck_left->draw(base.x - scroll_x, base.y); + } + else if (skidding_timer.started()) { if (dir == RIGHT) sprite->skid_right->draw(base.x - scroll_x, base.y); else sprite->skid_left->draw(base.x - scroll_x, base.y); } + else if (physic.get_velocity_y() != 0) + { + if (dir == RIGHT) + sprite->jump_right->draw(base.x - scroll_x, base.y); + else + sprite->jump_left->draw(base.x - scroll_x, base.y); + } else { - if (duck) - { - if (dir == RIGHT) - sprite->duck_right->draw(base.x - scroll_x, base.y); - else - sprite->duck_left->draw(base.x - scroll_x, base.y); - } - else if (physic.get_velocity_y() != 0) + if (fabsf(physic.get_velocity_x()) < 1.0f) // standing { if (dir == RIGHT) - sprite->jump_right->draw(base.x - scroll_x, base.y); + sprite->stand_right->draw( base.x - scroll_x, base.y); else - sprite->jump_left->draw(base.x - scroll_x, base.y); + sprite->stand_left->draw( base.x - scroll_x, base.y); } - else + else // moving { - if (fabsf(physic.get_velocity_x()) < 1.0f) // standing - { - if (dir == RIGHT) - sprite->stand_right->draw( base.x - scroll_x, base.y); - else - sprite->stand_left->draw( base.x - scroll_x, base.y); - } - else // moving - { - if (dir == RIGHT) - sprite->walk_right->draw(base.x - scroll_x, base.y); - else - sprite->walk_left->draw(base.x - scroll_x, base.y); - } + if (dir == RIGHT) + sprite->walk_right->draw(base.x - scroll_x, base.y); + else + sprite->walk_left->draw(base.x - scroll_x, base.y); } } - + // Draw arm overlay graphics when Tux is holding something if (holding_something && physic.get_velocity_y() == 0) { |
From: Ingo R. <gr...@us...> - 2004-04-26 13:01:06
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6065 Modified Files: title.cpp Log Message: - fix for title-demo going weird Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- title.cpp 25 Apr 2004 21:55:39 -0000 1.61 +++ title.cpp 26 Apr 2004 13:00:56 -0000 1.62 @@ -253,6 +253,10 @@ Menu::set_current(main_menu); 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 = st_get_ticks(); + // Calculate the movement-factor double frame_ratio = ((double)(update_time-last_update_time))/((double)FRAME_RATE); if(frame_ratio > 1.5) /* Quick hack to correct the unprecise CPU clocks a little bit. */ |
From: Ingo R. <gr...@us...> - 2004-04-26 12:48:45
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3061 Modified Files: gameloop.cpp Log Message: - fixed lives status to handle more than 5 lives Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- gameloop.cpp 26 Apr 2004 12:19:22 -0000 1.105 +++ gameloop.cpp 26 Apr 2004 12:48:33 -0000 1.106 @@ -121,7 +121,6 @@ world->get_tux()->base.y = best_reset_point.y; } } - if (st_gl_mode != ST_GL_DEMO_GAME) { @@ -674,7 +673,18 @@ white_text->draw("COINS", screen->h, 0, 1); gold_text->draw(str, 608, 0, 1); - white_text->draw("LIVES", screen->h, 20, 1); + white_text->draw("LIVES", 480, 20); + if (player_status.lives >= 5) + { + sprintf(str, "%dx", player_status.lives); + gold_text->draw(str, 585, 20); + tux_life->draw(565+(18*3), 20); + } + else + { + for(int i= 0; i < player_status.lives; ++i) + tux_life->draw(565+(18*i),20); + } if(show_fps) { @@ -682,11 +692,6 @@ white_text->draw("FPS", screen->h, 40, 1); gold_text->draw(str, screen->h + 60, 40, 1); } - - for(int i= 0; i < player_status.lives; ++i) - { - tux_life->draw(565+(18*i),20); - } } void |
From: Ingo R. <gr...@us...> - 2004-04-26 12:42:15
|
Update of /cvsroot/super-tux/supertux/data/images/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1967 Modified Files: antarctica.stwt Log Message: - added auto-walk markings Index: antarctica.stwt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/worldmap/antarctica.stwt,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- antarctica.stwt 24 Apr 2004 19:39:44 -0000 1.5 +++ antarctica.stwt 26 Apr 2004 12:42:05 -0000 1.6 @@ -1,3 +1,4 @@ +;; -*- mode: scheme -*- ;; (tile (id INT) ;; (directions TOP RIGHT DOWN LEFT) ;; @@ -118,6 +119,8 @@ (tile (id 37) (image "road_ne.png") + (stop #f) + (auto-walk #t) (north #t) (south #f) (west #f) @@ -131,6 +134,8 @@ (east #f)) (tile (id 39) (image "road_sw.png") + (stop #f) + (auto-walk #t) (north #f) (south #t) (west #t) @@ -150,6 +155,8 @@ (east #t)) (tile (id 42) (image "road_nw.png") + (stop #f) + (auto-walk #t) (north #t) (south #f) (west #t) @@ -187,6 +194,8 @@ (stop #f)) (tile (id 48) (image "road_se.png") + (stop #f) + (auto-walk #t) (north #f) (south #t) (west #f) |
From: Ingo R. <gr...@us...> - 2004-04-26 12:42:00
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1889 Modified Files: worldmap.cpp worldmap.h Log Message: - added automatic walking on worldmap Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- worldmap.cpp 26 Apr 2004 12:21:23 -0000 1.53 +++ worldmap.cpp 26 Apr 2004 12:41:50 -0000 1.54 @@ -110,6 +110,7 @@ tile->south = true; tile->west = true; tile->stop = true; + tile->auto_walk = false; LispReader reader(lisp_cdr(element)); reader.read_int("id", &id); @@ -118,6 +119,7 @@ reader.read_bool("west", &tile->west); reader.read_bool("east", &tile->east); reader.read_bool("stop", &tile->stop); + reader.read_bool("auto-walk", &tile->auto_walk); reader.read_string("image", &filename); tile->sprite = new Surface( @@ -265,6 +267,33 @@ } else { + if (worldmap->at(tile_pos)->auto_walk) + { // Turn to a new direction + Tile* tile = worldmap->at(tile_pos); + Direction dir = NONE; + + if (tile->north && back_direction != NORTH) + dir = NORTH; + else if (tile->south && back_direction != SOUTH) + dir = SOUTH; + else if (tile->east && back_direction != EAST) + dir = EAST; + else if (tile->west && back_direction != WEST) + dir = WEST; + + if (dir != NONE) + { + direction = dir; + back_direction = reverse_dir(direction); + } + else + { + // Should never be reached if tiledata is good + stop(); + return; + } + } + // Walk automatically to the next tile Point next_tile; if (worldmap->path_ok(direction, tile_pos, &next_tile)) Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- worldmap.h 26 Apr 2004 12:19:23 -0000 1.24 +++ worldmap.h 26 Apr 2004 12:41:50 -0000 1.25 @@ -63,8 +63,9 @@ /** Stop on this tile or walk over it? */ bool stop; - /** direction in which to automatically turn when walked on such a tile */ - Direction auto_walk; + /** When set automatically turn directions when walked over such a + tile (ie. walk smoothly a curve) */ + bool auto_walk; }; class TileManager |
From: Ingo R. <gr...@us...> - 2004-04-26 12:41:33
|
Update of /cvsroot/super-tux/supertux/data/levels/default In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1809 Modified Files: worldmap.stwm Log Message: - added some more trees Index: worldmap.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/default/worldmap.stwm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- worldmap.stwm 25 Apr 2004 18:35:44 -0000 1.12 +++ worldmap.stwm 26 Apr 2004 12:41:24 -0000 1.13 @@ -23,12 +23,12 @@ 9 9 9 9 14 13 9 9 9 9 11 16 16 16 12 9 9 11 16 12 9 9 9 9 9 9 9 14 21 47 19 31 27 17 9 9 9 9 9 9 9 9 9 9 9 11 16 16 16 16 22 24 25 26 23 16 16 22 19 23 16 16 12 9 9 9 9 9 15 47 19 30 28 17 9 9 9 9 9 9 9 9 9 11 16 22 49 50 51 24 26 30 36 34 25 26 19 24 25 25 25 26 23 16 16 16 16 16 22 47 20 18 18 13 9 9 9 9 9 9 - 9 9 9 15 24 26 52 53 54 30 28 19 30 29 29 28 19 30 29 29 36 34 25 26 19 19 48 40 40 42 17 9 9 9 9 9 9 9 9 9 - 9 9 9 15 31 27 55 56 57 39 19 48 40 40 39 19 48 40 40 39 30 29 29 28 19 19 47 20 18 18 13 9 9 9 9 9 9 9 9 9 - 9 9 9 15 31 34 25 26 19 47 19 47 19 19 47 19 47 19 19 47 19 19 19 48 40 40 42 23 12 9 9 9 9 11 12 9 9 9 9 9 - 9 9 9 15 30 29 29 28 19 37 40 42 19 19 47 19 47 19 19 47 19 19 19 47 19 19 24 26 17 9 9 9 9 14 13 9 9 9 9 9 - 9 9 9 14 18 18 18 18 21 24 26 19 19 19 47 19 47 19 48 42 19 19 48 42 24 25 33 27 17 9 9 9 9 9 9 9 9 9 9 9 - 9 9 9 9 9 9 9 9 15 30 28 24 25 26 37 40 42 19 47 19 19 19 47 19 30 29 36 27 17 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 15 24 26 52 53 54 30 28 19 30 29 29 28 19 30 29 29 36 34 25 26 24 26 48 40 40 42 17 9 9 9 9 9 9 9 9 9 + 9 9 9 15 31 27 55 56 57 39 19 48 40 40 39 19 48 40 40 39 30 29 29 28 30 28 47 20 18 18 13 9 9 9 9 9 9 9 9 9 + 9 9 9 15 31 34 25 26 19 47 19 47 24 26 47 19 47 24 26 47 19 24 26 48 40 40 42 23 12 9 9 9 9 11 12 9 9 9 9 9 + 9 9 9 15 30 29 29 28 19 37 40 42 31 27 47 19 47 30 28 47 19 30 28 47 19 19 24 26 17 9 9 9 9 14 13 9 9 9 9 9 + 9 9 9 14 18 18 18 18 21 24 26 19 30 28 47 19 47 19 48 42 24 26 48 42 24 25 33 27 17 9 9 9 9 9 9 9 9 9 9 9 + 9 9 9 9 9 9 9 9 15 30 28 24 25 26 37 40 42 19 47 19 30 28 47 19 30 29 36 27 17 9 9 9 9 9 9 9 9 9 9 9 9 9 9 11 12 9 9 9 14 18 21 30 36 34 25 26 19 19 37 40 40 40 42 19 20 21 30 28 17 9 9 11 16 16 12 9 9 9 9 9 9 9 9 14 13 9 9 9 9 9 14 21 31 32 32 34 25 25 25 25 26 19 19 20 13 14 18 18 13 9 9 14 21 19 23 12 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 15 30 29 29 29 29 29 29 29 28 19 20 13 11 12 9 9 9 9 9 9 14 18 18 13 9 9 9 9 @@ -118,5 +118,6 @@ (y 20)) ) + ) |
From: Ingo R. <gr...@us...> - 2004-04-26 12:21:50
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30410 Modified Files: badguy.cpp level.cpp lispreader.cpp resources.cpp setup.cpp sound.cpp sound.h special.cpp sprite.cpp sprite.h sprite_manager.cpp sprite_manager.h supertux.cpp texture.cpp texture.h tile.cpp tile.h world.cpp worldmap.cpp Log Message: <MatzeB> -cleanup in resource management functions <MatzeB> -fixes 3 potential crashs (deleting Sprite classes, using member function in <MatzeB> BadGuy class after removing it) <MatzeB> -cleans up sound init code and hopes that calling Mix_AllocateChannel will make <MatzeB> SDL_mixer happy... <MatzeB> -fix paths that missed a / after DATADIR <MatzeB> at least valgrind doesn't report any errors anymore when you apply that patch <MatzeB> (memory errors though, not memory leaks) Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- tile.h 25 Apr 2004 21:55:39 -0000 1.13 +++ tile.h 26 Apr 2004 12:21:22 -0000 1.14 @@ -85,13 +85,19 @@ { private: TileManager(); + ~TileManager(); + std::vector<Tile*> tiles; static TileManager* instance_ ; static std::vector<TileGroup>* tilegroups_; void load_tileset(std::string filename); + + std::string current_tileset; public: static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); } + static void destroy_instance() { delete instance_; instance_ = 0; } + static std::vector<TileGroup>* tilegroups() { return tilegroups_ ? tilegroups_ : tilegroups_ = new std::vector<TileGroup>; } Tile* get(unsigned int id) { if(id < tiles.size()) Index: sprite_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite_manager.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- sprite_manager.cpp 25 Apr 2004 21:55:39 -0000 1.3 +++ sprite_manager.cpp 26 Apr 2004 12:21:22 -0000 1.4 @@ -26,6 +26,14 @@ load_resfile(filename); } +SpriteManager::~SpriteManager() +{ + for(std::map<std::string, Sprite*>::iterator i = sprites.begin(); + i != sprites.end(); ++i) { + delete i->second; + } +} + void SpriteManager::load_resfile(const std::string& filename) { Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- special.cpp 26 Apr 2004 10:51:07 -0000 1.30 +++ special.cpp 26 Apr 2004 12:21:22 -0000 1.31 @@ -363,6 +363,5 @@ void free_special_gfx() { - delete img_bullet; } Index: sound.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- sound.h 24 Apr 2004 17:48:49 -0000 1.27 +++ sound.h 26 Apr 2004 12:21:22 -0000 1.28 @@ -23,9 +23,6 @@ #include "defines.h" /* get YES/NO defines */ -/* used to reserve some channels for panning effects */ -#define SOUND_RESERVED_CHANNELS 2 - /*global variable*/ extern bool use_sound; /* handle sound on/off menu and command-line option */ extern bool use_music; /* handle music on/off menu and command-line */ @@ -39,11 +36,11 @@ HERRING_MUSIC }; - /* panning effects: terrible :-) ! */ enum Sound_Speaker { SOUND_LEFT_SPEAKER = 0, SOUND_RIGHT_SPEAKER = 1, + SOUND_RESERVED_CHANNELS = 2, // 2 channels reserved for left/right speaker SOUND_CENTER_SPEAKER = -1 }; Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- worldmap.cpp 26 Apr 2004 12:19:23 -0000 1.52 +++ worldmap.cpp 26 Apr 2004 12:21:23 -0000 1.53 @@ -85,7 +85,7 @@ TileManager::TileManager() { - std::string stwt_filename = datadir + "images/worldmap/antarctica.stwt"; + std::string stwt_filename = datadir + "/images/worldmap/antarctica.stwt"; lisp_object_t* root_obj = lisp_read_from_file(stwt_filename); if (!root_obj) @@ -327,7 +327,7 @@ void WorldMap::load_map() { - std::string filename = datadir + "levels/default/worldmap.stwm"; + std::string filename = datadir + "/levels/default/worldmap.stwm"; lisp_object_t* root_obj = lisp_read_from_file(filename); if (!root_obj) @@ -404,10 +404,10 @@ FILE * fi; lisp_object_t* root_obj = 0; - fi = fopen((datadir + "levels/" + level->name).c_str(), "r"); + fi = fopen((datadir + "/levels/" + level->name).c_str(), "r"); if (fi == NULL) { - perror((datadir + "levels/" + level->name).c_str()); + perror((datadir + "/levels/" + level->name).c_str()); return; } @@ -590,7 +590,7 @@ level->y == tux->get_tile_pos().y) { std::cout << "Enter the current level: " << level->name << std::endl;; - GameSession session(datadir + "levels/" + level->name, + GameSession session(datadir + "/levels/" + level->name, 1, ST_GL_LOAD_LEVEL_FILE); switch (session.run()) Index: sprite.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sprite.cpp 21 Apr 2004 12:45:07 -0000 1.5 +++ sprite.cpp 26 Apr 2004 12:21:22 -0000 1.6 @@ -21,6 +21,7 @@ #include <math.h> #include "globals.h" #include "sprite.h" +#include "setup.h" Sprite::Sprite(lisp_object_t* cur) { @@ -28,22 +29,32 @@ LispReader reader(cur); - reader.read_string("name", &name); + if(!reader.read_string("name", &name)) + st_abort("Sprite wihtout name", ""); reader.read_int("x-hotspot", &x_hotspot); reader.read_int("y-hotspot", &y_hotspot); reader.read_float("fps", &fps); + std::vector<std::string> images; - reader.read_string_vector("images", &images); - surfaces.resize(images.size()); + if(!reader.read_string_vector("images", &images)) + st_abort("Sprite contains no images: ", name.c_str()); for(std::vector<std::string>::size_type i = 0; i < images.size(); ++i) { - surfaces[i] = new Surface(datadir + "/images/" + images[i], USE_ALPHA); + surfaces.push_back( + new Surface(datadir + "/images/" + images[i], USE_ALPHA)); } frame_delay = 1000.0f/fps; } +Sprite::~Sprite() +{ + for(std::vector<Surface*>::iterator i = surfaces.begin(); i != surfaces.end(); + ++i) + delete *i; +} + void Sprite::init_defaults() { Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- supertux.cpp 20 Apr 2004 11:09:34 -0000 1.13 +++ supertux.cpp 26 Apr 2004 12:21:22 -0000 1.14 @@ -31,6 +31,8 @@ #include "screen.h" #include "worldmap.h" #include "resources.h" +#include "texture.h" +#include "tile.h" int main(int argc, char * argv[]) { @@ -63,6 +65,10 @@ updatescreen(); unloadshared(); + TileManager::destroy_instance(); +#ifdef DEBUG + Surface::debug_check(); +#endif st_shutdown(); return 0; Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- tile.cpp 25 Apr 2004 21:55:39 -0000 1.14 +++ tile.cpp 26 Apr 2004 12:21:22 -0000 1.15 @@ -45,12 +45,22 @@ TileManager::TileManager() { - std::string filename = datadir + "images/tilesets/supertux.stgt"; + std::string filename = datadir + "/images/tilesets/supertux.stgt"; load_tileset(filename); } +TileManager::~TileManager() +{ + for(std::vector<Tile*>::iterator i = tiles.begin(); i != tiles.end(); ++i) { + delete *i; + } +} + void TileManager::load_tileset(std::string filename) { + if(filename == current_tileset) + return; + // free old tiles for(std::vector<Tile*>::iterator i = tiles.begin(); i != tiles.end(); ++i) { delete *i; @@ -109,7 +119,7 @@ Surface* cur_image; tile->images.push_back(cur_image); tile->images[tile->images.size()-1] = new Surface( - datadir + "images/tilesets/" + (*it), + datadir + "/images/tilesets/" + (*it), USE_ALPHA); } for(std::vector<std::string>::iterator it = editor_filenames.begin(); @@ -119,7 +129,7 @@ Surface* cur_image; tile->editor_images.push_back(cur_image); tile->editor_images[tile->editor_images.size()-1] = new Surface( - datadir + "images/tilesets/" + (*it), + datadir + "/images/tilesets/" + (*it), USE_ALPHA); } @@ -134,7 +144,7 @@ LispReader reader(lisp_cdr(element)); std::string filename; reader.read_string("file", &filename); - filename = datadir + "images/tilesets/" + filename; + filename = datadir + "/images/tilesets/" + filename; load_tileset(filename); } else if (strcmp(lisp_symbol(lisp_car(element)), "tilegroup") == 0) @@ -168,6 +178,7 @@ } lisp_free(root_obj); + current_tileset = filename; } void Index: sound.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- sound.cpp 24 Apr 2004 17:48:49 -0000 1.14 +++ sound.cpp 26 Apr 2004 12:21:22 -0000 1.15 @@ -59,24 +59,21 @@ int open_audio (int frequency, Uint16 format, int channels, int chunksize) { - /* if success we reserved some channels and register panning effects */ - if (Mix_OpenAudio( frequency, format, channels, chunksize ) == 0) - { - if (Mix_ReserveChannels( SOUND_RESERVED_CHANNELS ) - != SOUND_RESERVED_CHANNELS ) - { - DEBUG_MSG( "Warning: open_audio could'nt reserve channels" ); - } + if (Mix_OpenAudio( frequency, format, channels, chunksize ) < 0) + return -1; - /* prepare the spanning effects, no error checking */ - Mix_SetPanning( SOUND_LEFT_SPEAKER, 230, 24 ); - Mix_SetPanning( SOUND_RIGHT_SPEAKER, 24, 230 ); - return 0; - } - else - { - return -1; - } + // allocate 16 channels for mixing + if (Mix_AllocateChannels(8) != 8) + return -2; + + /* reserve some channels and register panning effects */ + if (Mix_ReserveChannels(SOUND_RESERVED_CHANNELS) != SOUND_RESERVED_CHANNELS) + return -3; + + /* prepare the spanning effects */ + Mix_SetPanning( SOUND_LEFT_SPEAKER, 230, 24 ); + Mix_SetPanning( SOUND_RIGHT_SPEAKER, 24, 230 ); + return 0; } @@ -94,31 +91,19 @@ /* --- LOAD A SOUND --- */ -Mix_Chunk * load_sound(const std::string& file) +Mix_Chunk* load_sound(const std::string& file) { - Mix_Chunk * snd; - - snd = Mix_LoadWAV(file.c_str()); + if(!audio_device) + return 0; + + Mix_Chunk* snd = Mix_LoadWAV(file.c_str()); - if ((snd == NULL) && audio_device) + if (snd == 0) st_abort("Can't load", file); return(snd); } - -/* --- LOAD A SONG --- */ - -Mix_Music * load_song(const std::string& file) -{ - if(!audio_device) - return (Mix_Music*) ~0; - - Mix_Music* song = Mix_LoadMUS(file.c_str()); - return song; -} - - /* --- PLAY A SOUND ON LEFT OR RIGHT OR CENTER SPEAKER --- */ void play_sound(Mix_Chunk * snd, enum Sound_Speaker whichSpeaker) @@ -126,32 +111,26 @@ /* this won't call the function if the user has disabled sound * either via menu or via command-line option */ - if (use_sound && audio_device) - { - Mix_PlayChannel( whichSpeaker, snd, 0); + if(!audio_device || !use_sound) + return; - /* prepare for panning effects for next call */ - /* warning: currently, I do not check for errors here */ - switch (whichSpeaker) { - case SOUND_LEFT_SPEAKER: - Mix_SetPanning( SOUND_LEFT_SPEAKER, 230, 24 ); - break; - case SOUND_RIGHT_SPEAKER: - Mix_SetPanning( SOUND_RIGHT_SPEAKER, 24, 230 ); - break; - default: // keep the compiler happy - break; - } - } -} + Mix_PlayChannel( whichSpeaker, snd, 0); + /* prepare for panning effects for next call */ + switch (whichSpeaker) { + case SOUND_LEFT_SPEAKER: + Mix_SetPanning( SOUND_LEFT_SPEAKER, 230, 24 ); + break; + case SOUND_RIGHT_SPEAKER: + Mix_SetPanning( SOUND_RIGHT_SPEAKER, 24, 230 ); + break; + default: // keep the compiler happy + break; + } +} void free_chunk(Mix_Chunk *chunk) { - if (chunk != NULL) - { - Mix_FreeChunk( chunk ); - chunk = NULL; - } + Mix_FreeChunk( chunk ); } Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- lispreader.cpp 25 Apr 2004 21:55:39 -0000 1.15 +++ lispreader.cpp 26 Apr 2004 12:21:22 -0000 1.16 @@ -1341,8 +1341,11 @@ obj = lisp_read(&stream); fclose(in); } - else + else { std::cerr << "LispReader: File not found: " << filename << endl; + st_abort("aborting", ""); + } + return obj; Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- setup.cpp 25 Apr 2004 21:55:39 -0000 1.58 +++ setup.cpp 26 Apr 2004 12:21:22 -0000 1.59 @@ -348,10 +348,10 @@ { std::string exedir = std::string(dirname(exe_file)) + "/"; - datadir = exedir + "../data/"; // SuperTux run from source dir + datadir = exedir + "../data"; // SuperTux run from source dir if (access(datadir.c_str(), F_OK) != 0) { - datadir = exedir + "../share/supertux/"; // SuperTux run from PATH + datadir = exedir + "../share/supertux"; // SuperTux run from PATH if (access(datadir.c_str(), F_OK) != 0) { // If all fails, fall back to compiled path datadir = DATA_PREFIX; @@ -880,7 +880,6 @@ abort(); } - /* Set Icon (private) */ void seticon(void) Index: sprite.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sprite.h 17 Apr 2004 22:22:35 -0000 1.5 +++ sprite.h 26 Apr 2004 12:21:22 -0000 1.6 @@ -49,6 +49,7 @@ /** cur has to be a pointer to data in the form of ((x-hotspot 5) (y-hotspot 10) ...) */ Sprite(lisp_object_t* cur); + ~Sprite(); void reset(); Index: texture.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- texture.cpp 25 Apr 2004 21:55:39 -0000 1.15 +++ texture.cpp 26 Apr 2004 12:21:22 -0000 1.16 @@ -177,6 +177,16 @@ } void +Surface::debug_check() +{ + for(Surfaces::iterator i = surfaces.begin(); i != surfaces.end(); ++i) + { + printf("Surface not freed: T:%d F:%s.\n", (*i)->data.type, + (*i)->data.file.c_str()); + } +} + +void Surface::draw(float x, float y, Uint8 alpha, bool update) { if (impl) @@ -513,9 +523,7 @@ glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); - /* Avoid compiler warnings */ - if(update) - {} + (void) update; // avoid warnings return 0; } #endif Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- badguy.cpp 22 Apr 2004 21:51:19 -0000 1.49 +++ badguy.cpp 26 Apr 2004 12:21:22 -0000 1.50 @@ -1115,181 +1115,6 @@ img_snowball_right = sprite_manager->load("snowball-right"); img_snowball_squished_left = sprite_manager->load("snowball-squished-left"); img_snowball_squished_right = sprite_manager->load("snowball-squished-right"); -#if 0 - /* (BSOD) */ - img_bsod_left[0] = new Surface(datadir + "/images/shared/bsod-left-0.png", USE_ALPHA); - - img_bsod_left[1] = new Surface(datadir + - "/images/shared/bsod-left-1.png", - USE_ALPHA); - - img_bsod_left[2] = new Surface(datadir + - "/images/shared/bsod-left-2.png", - USE_ALPHA); - - img_bsod_left[3] = new Surface(datadir + - "/images/shared/bsod-left-3.png", - USE_ALPHA); - - img_bsod_right[0] = new Surface(datadir + - "/images/shared/bsod-right-0.png", - USE_ALPHA); - - img_bsod_right[1] = new Surface(datadir + - "/images/shared/bsod-right-1.png", - USE_ALPHA); - - img_bsod_right[2] = new Surface(datadir + - "/images/shared/bsod-right-2.png", - USE_ALPHA); - - img_bsod_right[3] = new Surface(datadir + - "/images/shared/bsod-right-3.png", - USE_ALPHA); - - img_bsod_squished_left[0] = new Surface(datadir + - "/images/shared/bsod-squished-left.png", - USE_ALPHA); - - img_bsod_squished_right[0] = new Surface(datadir + - "/images/shared/bsod-squished-right.png", - USE_ALPHA); - - img_bsod_falling_left[0] = new Surface(datadir + - "/images/shared/bsod-falling-left.png", - USE_ALPHA); - - img_bsod_falling_right[0] = new Surface(datadir + - "/images/shared/bsod-falling-right.png", - USE_ALPHA); - - - /* (Laptop) */ - - img_laptop_left[0] = new Surface(datadir + "/images/shared/mriceblock-left-0.png", USE_ALPHA); - img_laptop_left[1] = new Surface(datadir + "/images/shared/mriceblock-left-1.png", USE_ALPHA); - img_laptop_left[2] = new Surface(datadir + "/images/shared/mriceblock-left-2.png", USE_ALPHA); - img_laptop_left[3] = new Surface(datadir + "/images/shared/mriceblock-left-1.png", USE_ALPHA); - - img_laptop_right[0] = new Surface(datadir + "/images/shared/mriceblock-right-0.png", USE_ALPHA); - img_laptop_right[1] = new Surface(datadir + "/images/shared/mriceblock-right-1.png", USE_ALPHA); - img_laptop_right[2] = new Surface(datadir + "/images/shared/mriceblock-right-2.png", USE_ALPHA); - img_laptop_right[3] = new Surface(datadir + "/images/shared/mriceblock-right-1.png", USE_ALPHA); - - img_laptop_flat_left[0] = new Surface( - datadir + "/images/shared/laptop-flat-left.png", - USE_ALPHA); - - img_laptop_flat_right[0] = new Surface(datadir + - "/images/shared/laptop-flat-right.png", - USE_ALPHA); - - img_laptop_falling_left[0] = new Surface(datadir + - "/images/shared/laptop-falling-left.png", - USE_ALPHA); - - img_laptop_falling_right[0] = new Surface(datadir + - "/images/shared/laptop-falling-right.png", - USE_ALPHA); - - - /* (Money) */ - img_jumpy_left_up = new Surface(datadir + - "/images/shared/jumpy-left-up-0.png", - USE_ALPHA); - img_jumpy_left_down = new Surface(datadir + - "/images/shared/jumpy-left-down-0.png", - USE_ALPHA); - img_jumpy_left_middle = new Surface(datadir + - "/images/shared/jumpy-left-middle-0.png", - USE_ALPHA); - - /* Mr. Bomb */ - for(int i=0; i<4; ++i) { - char num[4]; - snprintf(num, 4, "%d", i); - img_mrbomb_left[i] = new Surface( - datadir + "/images/shared/mrbomb-left-" + num + ".png", USE_ALPHA); - img_mrbomb_right[i] = new Surface( - datadir + "/images/shared/mrbomb-right-" + num + ".png", USE_ALPHA); - } - img_mrbomb_ticking_left[0] = new Surface( - datadir + "/images/shared/mrbombx-left-0.png", USE_ALPHA); - img_mrbomb_ticking_right[0] = new Surface( - datadir + "/images/shared/mrbombx-right-0.png", USE_ALPHA); - img_mrbomb_explosion[0] = new Surface( - datadir + "/images/shared/mrbomb-explosion.png", USE_ALPHA); - - /* stalactite */ - img_stalactite[0] = new Surface( - datadir + "/images/shared/stalactite.png", USE_ALPHA); - img_stalactite_broken[0] = new Surface( - datadir + "/images/shared/stalactite-broken.png", USE_ALPHA); - - /* flame */ - img_flame[0] = new Surface( - datadir + "/images/shared/flame-0.png", USE_ALPHA); - img_flame[1] = new Surface( - datadir + "/images/shared/flame-1.png", USE_ALPHA); - - /* fish */ - img_fish[0] = new Surface( - datadir + "/images/shared/fish-left-0.png", USE_ALPHA); - img_fish[1] = new Surface( - datadir + "/images/shared/fish-left-1.png", USE_ALPHA); - img_fish_down[0] = new Surface( - datadir + "/images/shared/fish-down-0.png", USE_ALPHA); - - /* bouncing snowball */ - for(int i=0; i<6; ++i) { - char num[4]; - snprintf(num, 4, "%d", i); - img_bouncingsnowball_left[i] = new Surface( - datadir + "/images/shared/bouncingsnowball-left-" + num + ".png", - USE_ALPHA); - img_bouncingsnowball_right[i] = new Surface( - datadir + "/images/shared/bouncingsnowball-right-" + num + ".png", - USE_ALPHA); - } - img_bouncingsnowball_squished[0] = new Surface( - datadir + "/images/shared/bsod-squished-left.png", USE_ALPHA); - - /* flying snowball */ - img_flyingsnowball[0] = new Surface( - datadir + "/images/shared/flyingsnowball-left-0.png", USE_ALPHA); - img_flyingsnowball[1] = new Surface( - datadir + "/images/shared/flyingsnowball-left-1.png", USE_ALPHA); - img_flyingsnowball_squished[0] = new Surface( - datadir + "/images/shared/bsod-squished-left.png", USE_ALPHA); - - /* spiky */ - for(int i = 0; i < 3; ++i) { - char num[4]; - snprintf(num, 4, "%d", i); - img_spiky_left[i] = new Surface( - datadir + "/images/shared/spiky-left-" + num + ".png", - USE_ALPHA); - img_spiky_right[i] = new Surface( - datadir + "/images/shared/spiky-right-" + num + ".png", - USE_ALPHA); - } - - /** snowball */ - img_snowball_left[0] = new Surface(datadir + "/images/shared/snowball-left-0.png", USE_ALPHA); - img_snowball_left[1] = new Surface(datadir + "/images/shared/snowball-left-1.png", USE_ALPHA); - img_snowball_left[2] = new Surface(datadir + "/images/shared/snowball-left-2.png", USE_ALPHA); - img_snowball_left[3] = new Surface(datadir + "/images/shared/snowball-left-1.png", USE_ALPHA); - - img_snowball_right[0] = new Surface(datadir + "/images/shared/snowball-right-0.png", USE_ALPHA); - img_snowball_right[1] = new Surface(datadir + "/images/shared/snowball-right-1.png", USE_ALPHA); - img_snowball_right[2] = new Surface(datadir + "/images/shared/snowball-right-2.png", USE_ALPHA); - img_snowball_right[3] = new Surface(datadir + "/images/shared/snowball-right-1.png", USE_ALPHA); - - img_snowball_squished_left[0] = new Surface( - datadir + "/images/shared/bsod-squished-left.png", USE_ALPHA); - img_snowball_squished_right[0] = new Surface( - datadir + "/images/shared/bsod-squished-right.png", USE_ALPHA); -#endif } void free_badguy_gfx() Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- level.cpp 25 Apr 2004 23:46:30 -0000 1.52 +++ level.cpp 26 Apr 2004 12:21:22 -0000 1.53 @@ -210,13 +210,15 @@ Level::Level(const std::string& subset, int level) : img_bkgd(0) { - load(subset, level); + if(load(subset, level) < 0) + st_abort("Couldn't load level from subset", subset.c_str()); } Level::Level(const std::string& filename) : img_bkgd(0) { - load(filename); + if(load(filename) < 0) + st_abort("Couldn't load level " , filename.c_str()); } Level::~Level() @@ -308,28 +310,44 @@ if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-level") == 0) { LispReader reader(lisp_cdr(root_obj)); + version = 0; reader.read_int("version", &version); + use_endsequence = false; reader.read_bool("use-endsequence", &use_endsequence); - reader.read_int("width", &width); + if(!reader.read_int("width", &width)) + st_abort("No width specified for level.", ""); if (!reader.read_int("start_pos_x", &start_pos_x)) start_pos_x = 100; if (!reader.read_int("start_pos_y", &start_pos_y)) start_pos_y = 170; - reader.read_int("time", &time_left); + time_left = 500; + if(!reader.read_int("time", &time_left)) { + printf("Warning no time specified for level.\n"); + } + bkgd_top.red = bkgd_top.green = bkgd_top.blue = 0; reader.read_int("bkgd_red_top", &bkgd_top.red); reader.read_int("bkgd_green_top", &bkgd_top.green); reader.read_int("bkgd_blue_top", &bkgd_top.blue); + bkgd_bottom.red = bkgd_bottom.green = bkgd_bottom.blue = 0; reader.read_int("bkgd_red_bottom", &bkgd_bottom.red); reader.read_int("bkgd_green_bottom", &bkgd_bottom.green); reader.read_int("bkgd_blue_bottom", &bkgd_bottom.blue); + gravity = 10; reader.read_float("gravity", &gravity); + name = "Noname"; reader.read_string("name", &name); + author = "unknown author"; reader.read_string("author", &author); - reader.read_string("theme", &theme); + if(!reader.read_string("theme", &theme)) + st_abort("No theme specified in level file", ""); + song_title = ""; reader.read_string("music", &song_title); + bkgd_image = ""; reader.read_string("background", &bkgd_image); + particle_system = ""; reader.read_string("particle_system", &particle_system); + reader.read_int_vector("background-tm", &bg_tm); if (!reader.read_int_vector("interactive-tm", &ia_tm)) Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- world.cpp 26 Apr 2004 10:46:42 -0000 1.41 +++ world.cpp 26 Apr 2004 12:21:23 -0000 1.42 @@ -283,11 +283,15 @@ /* Handle all possible collisions. */ collision_handler(); - { // Cleanup marked badguys - for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) - if ((*i)->is_removable()) - delete *i; - bad_guys.remove_if(std::mem_fun(&BadGuy::is_removable)); + // Cleanup marked badguys + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); + /* ++i handled at end of the loop */) { + if ((*i)->is_removable()) { + delete *i; + i = bad_guys.erase(i); + } else { + ++i; + } } } Index: sprite_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite_manager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sprite_manager.h 17 Apr 2004 10:48:04 -0000 1.1 +++ sprite_manager.h 26 Apr 2004 12:21:22 -0000 1.2 @@ -30,8 +30,12 @@ Sprites sprites; public: SpriteManager(const std::string& filename); + ~SpriteManager(); void load_resfile(const std::string& filename); + /** loads a sprite. + * WARNING: You must not delete the returned object. + */ Sprite* load(const std::string& name); }; Index: texture.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- texture.h 25 Apr 2004 21:55:39 -0000 1.18 +++ texture.h 26 Apr 2004 12:21:22 -0000 1.19 @@ -72,6 +72,7 @@ static Surfaces surfaces; public: static void reload_all(); + static void debug_check(); Surface(SDL_Surface* surf, int use_alpha); Surface(const std::string& file, int use_alpha); Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- resources.cpp 25 Apr 2004 16:46:55 -0000 1.26 +++ resources.cpp 26 Apr 2004 12:21:22 -0000 1.27 @@ -208,8 +208,6 @@ free_special_gfx(); free_badguy_gfx(); - delete smalltux_gameover; - delete img_water; for (i = 0; i < 3; i++) delete img_waves[i]; |
From: Ingo R. <gr...@us...> - 2004-04-26 12:19:34
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30023 Modified Files: gameloop.cpp worldmap.cpp worldmap.h Log Message: - added way to interupt exit sequence - added primitive autowalk to worldmap Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- worldmap.cpp 26 Apr 2004 10:46:45 -0000 1.51 +++ worldmap.cpp 26 Apr 2004 12:19:23 -0000 1.52 @@ -596,13 +596,43 @@ switch (session.run()) { case GameSession::LEVEL_FINISHED: - level->solved = true; - if (session.get_world()->get_tux()->got_coffee) - player_status.bonus = PlayerStatus::FLOWER_BONUS; - else if (session.get_world()->get_tux()->size == BIG) - player_status.bonus = PlayerStatus::GROWUP_BONUS; - else - player_status.bonus = PlayerStatus::NO_BONUS; + { + bool old_level_state = level->solved; + level->solved = true; + + if (session.get_world()->get_tux()->got_coffee) + player_status.bonus = PlayerStatus::FLOWER_BONUS; + else if (session.get_world()->get_tux()->size == BIG) + player_status.bonus = PlayerStatus::GROWUP_BONUS; + else + player_status.bonus = PlayerStatus::NO_BONUS; + + if (old_level_state != level->solved) + { // Try to detect the next direction to which we should walk + // FIXME: Mostly a hack + Direction dir = NONE; + + Tile* tile = at(tux->get_tile_pos()); + + if (tile->north && tux->back_direction != NORTH) + dir = NORTH; + else if (tile->south && tux->back_direction != SOUTH) + dir = SOUTH; + else if (tile->east && tux->back_direction != EAST) + dir = EAST; + else if (tile->west && tux->back_direction != WEST) + dir = WEST; + + if (dir != NONE) + { + tux->set_direction(dir); + tux->update(0.33f); + } + + std::cout << "Walk to dir: " << dir << std::endl; + } + } + break; case GameSession::LEVEL_ABORT: // Reseting the player_status might be a worthy Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- gameloop.cpp 26 Apr 2004 10:03:33 -0000 1.104 +++ gameloop.cpp 26 Apr 2004 12:19:22 -0000 1.105 @@ -209,6 +209,43 @@ tux.input.up = UP; last_x_pos = tux.base.x; + + SDL_Event event; + while (SDL_PollEvent(&event)) + { + /* Check for menu-events, if the menu is shown */ + if (Menu::current()) + { + Menu::current()->event(event); + st_pause_ticks_start(); + } + + switch(event.type) + { + case SDL_QUIT: /* Quit event - quit: */ + st_abort("Received window close", ""); + break; + + case SDL_KEYDOWN: /* A keypress! */ + { + SDLKey key = event.key.keysym.sym; + + switch(key) + { + case SDLK_ESCAPE: /* Escape: Open/Close the menu: */ + on_escape_press(); + break; + default: + break; + } + } + + case SDL_JOYBUTTONDOWN: + if (event.jbutton.button == joystick_keymap.start_button) + on_escape_press(); + break; + } + } } else { Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- worldmap.h 25 Apr 2004 21:55:39 -0000 1.23 +++ worldmap.h 26 Apr 2004 12:19:23 -0000 1.24 @@ -62,6 +62,9 @@ /** Stop on this tile or walk over it? */ bool stop; + + /** direction in which to automatically turn when walked on such a tile */ + Direction auto_walk; }; class TileManager |
From: Ingo R. <gr...@us...> - 2004-04-26 11:45:42
|
Update of /cvsroot/super-tux/supertux/data/levels/world1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23090 Modified Files: level14.stl Log Message: - fixed reset point, well, maybe not sure if this was the cause for being reseted in a completly wrong spot Index: level14.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/world1/level14.stl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- level14.stl 25 Apr 2004 20:18:20 -0000 1.6 +++ level14.stl 26 Apr 2004 11:45:30 -0000 1.7 @@ -74,7 +74,7 @@ ) (reset-points - (point (x 7240) (y 180)) + (point (x 7233) (y 139)) ) (objects (mriceblock (x 4548) (y 317)) |
From: Ingo R. <gr...@us...> - 2004-04-26 11:14:22
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17018 Modified Files: gameobjs.cpp Log Message: - little bouncing block fix Index: gameobjs.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- gameobjs.cpp 20 Apr 2004 11:09:33 -0000 1.11 +++ gameobjs.cpp 26 Apr 2004 11:14:11 -0000 1.12 @@ -120,7 +120,6 @@ void BouncyBrick::draw() { - int s; SDL_Rect dest; if (base.x >= scroll_x - 32 && @@ -144,7 +143,7 @@ } else { - s = (int)scroll_x / 30; + int s = ((int)scroll_x / 2)%640; plevel->img_bkgd->draw_part(dest.x + s, dest.y, dest.x, dest.y,dest.w,dest.h); } |
From: Ingo R. <gr...@us...> - 2004-04-26 10:51:15
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11781 Modified Files: special.cpp Log Message: - fixed 'jump' on flower collection Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- special.cpp 25 Apr 2004 23:46:30 -0000 1.29 +++ special.cpp 26 Apr 2004 10:51:07 -0000 1.30 @@ -319,9 +319,12 @@ { play_sound(sounds[SND_COFFEE], SOUND_CENTER_SPEAKER); pplayer->got_coffee = true; - pplayer->size = BIG; - pplayer->base.height = 64; - pplayer->base.y -= 32; + if (pplayer->size == SMALL) + { + pplayer->size = BIG; + pplayer->base.height = 64; + pplayer->base.y -= 32; + } if(collision_object_map(pplayer->base)) { pplayer->base.height = 32; |