super-tux-commit Mailing List for Super Tux (Page 92)
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-22 00:16:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15088/src Modified Files: player.cpp player.h resources.cpp title.cpp Log Message: - added small skid tux Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- player.cpp 21 Apr 2004 23:37:50 -0000 1.51 +++ player.cpp 22 Apr 2004 00:13:33 -0000 1.52 @@ -35,6 +35,9 @@ Surface* smalltux_jump_right; Surface* smalltux_stand_left; Surface* smalltux_stand_right; +Sprite* smalltux_gameover; +Sprite* smalltux_skid_left; +Sprite* smalltux_skid_right; Sprite* bigtux_right; Sprite* bigtux_left; @@ -525,30 +528,40 @@ if (!got_coffee) { - if (physic.get_velocity_y() != 0) - { - if (dir == RIGHT) - smalltux_jump_right->draw( base.x - scroll_x, base.y - 10); - else - smalltux_jump_left->draw( base.x - scroll_x, base.y - 10); - } - else + if (!skidding_timer.started()) { - if (fabsf(physic.get_velocity_x()) < 1.0f) // standing + if (physic.get_velocity_y() != 0) { if (dir == RIGHT) - smalltux_stand_right->draw( base.x - scroll_x, base.y - 9); + smalltux_jump_right->draw( base.x - scroll_x, base.y - 10); else - smalltux_stand_left->draw( base.x - scroll_x, base.y - 9); + smalltux_jump_left->draw( base.x - scroll_x, base.y - 10); } - else // moving + else { - if (dir == RIGHT) - tux_right[(global_frame_counter/2) % tux_right.size()]->draw(base.x - scroll_x, base.y - 9); - else - tux_left[(global_frame_counter/2) % tux_left.size()]->draw(base.x - scroll_x, base.y - 9); + if (fabsf(physic.get_velocity_x()) < 1.0f) // standing + { + if (dir == RIGHT) + smalltux_stand_right->draw( base.x - scroll_x, base.y - 9); + else + smalltux_stand_left->draw( base.x - scroll_x, base.y - 9); + } + else // moving + { + if (dir == RIGHT) + tux_right[(global_frame_counter/2) % tux_right.size()]->draw(base.x - scroll_x, base.y - 9); + else + tux_left[(global_frame_counter/2) % tux_left.size()]->draw(base.x - scroll_x, base.y - 9); + } } } + else + { + if (dir == RIGHT) + smalltux_skid_right->draw(base.x - scroll_x, base.y); + else + smalltux_skid_left->draw(base.x - scroll_x, base.y); + } } else { @@ -564,7 +577,7 @@ } } } - else + else // Large Tux { if (invincible_timer.started()) { Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- player.h 21 Apr 2004 15:15:28 -0000 1.33 +++ player.h 22 Apr 2004 00:13:33 -0000 1.34 @@ -81,6 +81,9 @@ extern Surface* smalltux_jump_right; extern Surface* smalltux_stand_left; extern Surface* smalltux_stand_right; +extern Sprite* smalltux_skid_left; +extern Sprite* smalltux_skid_right; +extern Sprite* smalltux_gameover; extern Sprite* bigtux_right; extern Sprite* bigtux_left; extern Sprite* bigtux_right_jump; Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- title.cpp 22 Apr 2004 00:02:18 -0000 1.54 +++ title.cpp 22 Apr 2004 00:13:33 -0000 1.55 @@ -358,8 +358,7 @@ frame++; SDL_Delay(25); - if(!playing_music) - play_music(music); + play_music(music); } /* Free surfaces: */ Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- resources.cpp 20 Apr 2004 11:09:34 -0000 1.13 +++ resources.cpp 22 Apr 2004 00:13:33 -0000 1.14 @@ -47,6 +47,11 @@ sprite_manager = new SpriteManager(datadir + "/supertux.strf"); /* Tuxes: */ + smalltux_gameover = sprite_manager->load("smalltux-gameover"); + + smalltux_skid_left = sprite_manager->load("smalltux-skid-left"); + smalltux_skid_right = sprite_manager->load("smalltux-skid-right"); + smalltux_stand_left = new Surface(datadir + "/images/shared/smalltux-left-6.png", USE_ALPHA); smalltux_stand_right = new Surface(datadir + "/images/shared/smalltux-right-6.png", USE_ALPHA); @@ -296,6 +301,8 @@ free_special_gfx(); + delete smalltux_gameover; + for (i = 0; i < 3; i++) { delete tux_right[i]; |
From: Ingo R. <gr...@us...> - 2004-04-22 00:15:46
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15088/data Modified Files: supertux.strf Log Message: - added small skid tux Index: supertux.strf =================================================================== RCS file: /cvsroot/super-tux/supertux/data/supertux.strf,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- supertux.strf 19 Apr 2004 14:27:11 -0000 1.6 +++ supertux.strf 22 Apr 2004 00:13:33 -0000 1.7 @@ -218,6 +218,20 @@ "shared/iceflower-3.png" "shared/iceflower-2.png" "shared/iceflower-1.png")) + + (sprite (name "smalltux-gameover") + (images "shared/smalltux-gameover-0.png" + "shared/smalltux-gameover-1.png")) + + (sprite (name "smalltux-skid-left") + (x-hotspot 6) + (y-hotspot 8) + (images "shared/smalltux-skid-left.png")) + + (sprite (name "smalltux-skid-right") + (x-hotspot 6) + (y-hotspot 8) + (images "shared/smalltux-skid-right.png")) ) ;; EOF ;; |
From: Ingo R. <gr...@us...> - 2004-04-22 00:08:14
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13526 Modified Files: title.cpp Log Message: 'nother music fix Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.53 retrieving revision 1.54 diff -u -d -r1.53 -r1.54 --- title.cpp 21 Apr 2004 17:43:26 -0000 1.53 +++ title.cpp 22 Apr 2004 00:02:18 -0000 1.54 @@ -249,7 +249,7 @@ random_timer.start(rand() % 2000 + 2000); Mix_Music* music = load_song(datadir + "/music/theme.mod"); - play_music(music, 1); + play_music(music); Menu::set_current(main_menu); while (Menu::current()) @@ -359,7 +359,7 @@ SDL_Delay(25); if(!playing_music) - play_music(music, 1); + play_music(music); } /* Free surfaces: */ |
From: Ingo R. <gr...@us...> - 2004-04-22 00:05:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13312 Modified Files: gameloop.cpp Log Message: patch from MatzeB for freeze at level start Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- gameloop.cpp 21 Apr 2004 23:36:39 -0000 1.92 +++ gameloop.cpp 22 Apr 2004 00:00:58 -0000 1.93 @@ -57,10 +57,17 @@ GameSession* GameSession::current_ = 0; GameSession::GameSession(const std::string& subset_, int levelnb_, int mode) - : world(0), st_gl_mode(mode), levelnb(levelnb_), subset(subset_) + : world(0), st_gl_mode(mode), levelnb(levelnb_), end_sequenze(false), + subset(subset_) { current_ = this; - end_sequenze = false; + + global_frame_counter = 0; + game_pause = false; + + fps_timer.init(true); + frame_timer.init(true); + restart_level(); } @@ -470,16 +477,9 @@ Player* tux = world->get_tux(); current_ = this; - int fps_cnt; - - global_frame_counter = 0; - game_pause = false; - - fps_timer.init(true); - frame_timer.init(true); + int fps_cnt = 0; - last_update_time = st_get_ticks(); - fps_cnt = 0; + update_time = last_update_time = st_get_ticks(); /* Clear screen: */ clearscreen(0, 0, 0); |
From: Ingo R. <gr...@us...> - 2004-04-21 23:42:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9831 Modified Files: gameloop.cpp level.cpp level.h player.cpp scene.cpp setup.cpp sound.cpp sound.h special.cpp world.cpp world.h worldmap.cpp Log Message: - music patch from MatzeB, should fix crash on level exit too worldmap Index: scene.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- scene.cpp 20 Apr 2004 11:09:34 -0000 1.22 +++ scene.cpp 21 Apr 2004 23:38:03 -0000 1.23 @@ -25,7 +25,8 @@ PlayerStatus::PlayerStatus() : score(0), distros(0), - lives(3) + lives(3), + score_multiplier(1) { } Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- world.h 20 Apr 2004 20:10:53 -0000 1.27 +++ world.h 21 Apr 2004 23:38:13 -0000 1.28 @@ -55,6 +55,8 @@ int distro_counter; bool counting_distros; + int currentmusic; + static World* current_; public: static World* current() { return current_; } @@ -73,6 +75,10 @@ void draw(); void action(double frame_ratio); + void play_music(int musictype); + int get_music_type(); + + /** Checks for all possible collisions. And calls the collision_handlers, which the collision_objects provide for this case (or not). */ Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- special.cpp 20 Apr 2004 19:55:10 -0000 1.23 +++ special.cpp 21 Apr 2004 23:38:07 -0000 1.24 @@ -311,12 +311,7 @@ { play_sound(sounds[SND_HERRING], SOUND_CENTER_SPEAKER); pplayer->invincible_timer.start(TUX_INVINCIBLE_TIME); - /* play the herring song ^^ */ - if (get_current_music() != HURRYUP_MUSIC) - { - set_current_music(HERRING_MUSIC); - play_current_music(); - } + World::current()->play_music(HERRING_MUSIC); } else if (kind == UPGRADE_1UP) { Index: sound.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- sound.cpp 20 Apr 2004 11:09:34 -0000 1.9 +++ sound.cpp 21 Apr 2004 23:38:04 -0000 1.10 @@ -54,7 +54,8 @@ #include <SDL_mixer.h> Mix_Chunk * sounds[NUM_SOUNDS]; -Mix_Music * level_song, * level_song_fast, * herring_song; +Mix_Music * herring_song = 0; +Mix_Music * current_song = 0; /* --- OPEN THE AUDIO DEVICE --- */ @@ -113,13 +114,17 @@ Mix_Music * load_song(const std::string& file) { + if(!audio_device) + return 0; + Mix_Music * sng; sng = Mix_LoadMUS(file.c_str()); /* printf message and abort if there is an initialized audio device */ - if ((sng == NULL) && audio_device) + if (sng == NULL) st_abort("Can't load", file); + return (sng); } @@ -161,88 +166,42 @@ } } - -int playing_music(void) +void halt_music(void) { - if (use_music) - { - return Mix_PlayingMusic(); - } - else - { - /* we are in --disable-music we can't be playing music */ - return 0; - } + if (!use_music || !audio_device) + return; + + Mix_HaltMusic(); + current_song = 0; } -int halt_music(void) +void play_music(Mix_Music *music) { - if (use_music && audio_device) - { - return Mix_HaltMusic(); - } - else - { - return 0; - } -} + if (!audio_device) + return; + if (use_music && Mix_PlayMusic(music, -1) < 0) + st_abort("Couldn't play music: ", Mix_GetError()); -int play_music(Mix_Music *music, int loops) -{ - if (use_music && audio_device) - { - DEBUG_MSG(__PRETTY_FUNCTION__); - return Mix_PlayMusic(music, loops); - } - else - { - /* return error since you're trying to play music in --disable-sound mode */ - return -1; - } + current_song = music; } void free_music(Mix_Music *music) { - if ( music != NULL ) - { - DEBUG_MSG(__PRETTY_FUNCTION__); - Mix_FreeMusic( music ); - music = NULL; - } + Mix_FreeMusic( music ); } - int get_current_music() - { - return current_music; - } - - void set_current_music(int music) - { - current_music = music; - } - - void play_current_music() - { - if(playing_music()) - halt_music(); - - switch(current_music) - { - case LEVEL_MUSIC: - play_music(level_song, -1); // -1 to play forever - break; - case HERRING_MUSIC: - play_music(herring_song, -1); - break; - case HURRYUP_MUSIC: - play_music(level_song_fast, -1); - break; - case NO_MUSIC: // keep the compiler happy for the moment :-) - {} - /*default:*/ - } - /* use halt_music whenever you want to stop it */ + +void enable_music(bool enable) +{ + if(!audio_device) + return; + + use_music = enable; + if(!use_music) + Mix_HaltMusic(); + else + Mix_PlayMusic(current_song, -1); } Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- worldmap.cpp 21 Apr 2004 11:17:31 -0000 1.41 +++ worldmap.cpp 21 Apr 2004 23:38:14 -0000 1.42 @@ -582,7 +582,7 @@ break; } - play_music(song, 1); + play_music(song); Menu::set_current(0); if (!savegame_file.empty()) savegame(savegame_file); @@ -726,7 +726,7 @@ quit = false; song = load_song(datadir + "/music/" + music); - play_music(song, 1); + play_music(song); while(!quit) { Point tux_pos = tux->get_pos(); Index: sound.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- sound.h 20 Apr 2004 11:09:34 -0000 1.23 +++ sound.h 21 Apr 2004 23:38:05 -0000 1.24 @@ -77,8 +77,6 @@ /* variables for stocking the sound and music */ extern Mix_Chunk* sounds[NUM_SOUNDS]; -extern Mix_Music* level_song; -extern Mix_Music* level_song_fast; extern Mix_Music* herring_song; /* functions handling the sound and music */ @@ -86,17 +84,13 @@ void close_audio( void ); Mix_Chunk * load_sound(const std::string& file); -void play_sound(Mix_Chunk * snd, enum Sound_Speaker whichSpeaker); -Mix_Music * load_song(const std::string& file); - -int playing_music(void); -int halt_music(void); -int play_music(Mix_Music*music, int loops); -void free_music(Mix_Music*music); void free_chunk(Mix_Chunk*chunk); +void play_sound(Mix_Chunk * snd, enum Sound_Speaker whichSpeaker); -int get_current_music(); -void set_current_music(int music); -void play_current_music(); +Mix_Music* load_song(const std::string& file); +void free_music(Mix_Music* music); +void halt_music(void); +void enable_music(bool enable); +void play_music(Mix_Music* music); #endif /*SUPERTUX_SOUND_H*/ Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -u -d -r1.91 -r1.92 --- gameloop.cpp 21 Apr 2004 13:40:44 -0000 1.91 +++ gameloop.cpp 21 Apr 2004 23:36:39 -0000 1.92 @@ -122,7 +122,8 @@ } time_left.init(true); - start_timers(); + start_timers(); + world->play_music(LEVEL_MUSIC); } GameSession::~GameSession() @@ -484,9 +485,6 @@ clearscreen(0, 0, 0); updatescreen(); - /* Play music: */ - play_current_music(); - // Eat unneeded events SDL_Event event; while (SDL_PollEvent(&event)) {} @@ -557,19 +555,25 @@ } /* Handle time: */ - if (time_left.check()) + if (!time_left.check() && tux->dying == DYING_NOT) + tux->kill(KILL); + + /* Handle music: */ + if(tux->invincible_timer.check()) { - /* are we low on time ? */ - if (time_left.get_left() < TIME_WARNING - && (get_current_music() != HURRYUP_MUSIC)) /* play the fast music */ - { - set_current_music(HURRYUP_MUSIC); - play_current_music(); - } + if(world->get_music_type() != HERRING_MUSIC) + world->play_music(HERRING_MUSIC); } - else if(tux->dying == DYING_NOT) + /* are we low on time ? */ + else if (time_left.get_left() < TIME_WARNING + && (world->get_music_type() == LEVEL_MUSIC)) { - tux->kill(KILL); + world->play_music(HURRYUP_MUSIC); + } + /* or just normal music? */ + else if(world->get_music_type() != LEVEL_MUSIC) + { + world->play_music(LEVEL_MUSIC); } /* Calculate frames per second */ @@ -586,11 +590,8 @@ } } - halt_music(); - - world->get_level()->free_gfx(); - world->get_level()->cleanup(); - world->get_level()->free_song(); + delete world; + world = 0; return exit_status; } Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- setup.cpp 21 Apr 2004 15:15:28 -0000 1.46 +++ setup.cpp 21 Apr 2004 23:38:03 -0000 1.47 @@ -520,22 +520,7 @@ case 5: if(use_music != options_menu->item[5].toggled) { - if(use_music) - { - if(playing_music()) - { - halt_music(); - } - use_music = false; - } - else - { - use_music = true; - if (!playing_music()) - { - play_current_music(); - } - } + enable_music(options_menu->item[5].toggled); } break; case 6: @@ -1000,6 +985,7 @@ /* Disable the compiled in sound feature */ printf("Sounds disabled \n"); use_sound = false; + audio_device = false; } else if (strcmp(argv[i], "--disable-music") == 0) { Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- level.h 20 Apr 2004 11:09:33 -0000 1.34 +++ level.h 21 Apr 2004 23:37:40 -0000 1.35 @@ -68,6 +68,8 @@ { public: Surface* img_bkgd; + Mix_Music* level_song; + Mix_Music* level_song_fast; std::string name; std::string author; @@ -95,6 +97,7 @@ Level(); Level(const std::string& subset, int level); Level(const std::string& filename); + ~Level(); /** Will the Level structure with default values */ void init_defaults(); @@ -115,6 +118,8 @@ void load_song(); void free_song(); + Mix_Music* get_level_music(); + Mix_Music* get_level_music_fast(); void save(const char* subset, int level); Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- player.cpp 20 Apr 2004 19:55:09 -0000 1.50 +++ player.cpp 21 Apr 2004 23:37:50 -0000 1.51 @@ -276,36 +276,8 @@ } } - /* ---- DONE HANDLING TUX! --- */ - /* Handle invincibility timer: */ - if (get_current_music() == HERRING_MUSIC && !invincible_timer.check()) - { - /* - no, we are no more invincible - or we were not in invincible mode - but are we in hurry ? - */ - - // FIXME: Move this to gamesession - if (GameSession::current()->time_left.get_left() < TIME_WARNING) - { - /* yes, we are in hurry - stop the herring_song, prepare to play the correct - fast level_song ! - */ - set_current_music(HURRYUP_MUSIC); - } - else - { - set_current_music(LEVEL_MUSIC); - } - - /* start playing it */ - play_current_music(); - } - // check some timers skidding_timer.check(); invincible_timer.check(); Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- level.cpp 21 Apr 2004 12:45:06 -0000 1.44 +++ level.cpp 21 Apr 2004 23:37:39 -0000 1.45 @@ -199,19 +199,28 @@ } Level::Level() + : level_song(0), level_song_fast(0) { } Level::Level(const std::string& subset, int level) + : level_song(0), level_song_fast(0) { load(subset, level); } Level::Level(const std::string& filename) + : level_song(0), level_song_fast(0) { load(filename); } +Level::~Level() +{ + free_gfx(); + free_song(); +} + void Level::init_defaults() { @@ -688,12 +697,16 @@ Level::free_song(void) { free_music(level_song); + level_song = 0; free_music(level_song_fast); + level_song_fast = 0; } void Level::load_song() { + free_song(); + char* song_path; char* song_subtitle; @@ -710,6 +723,18 @@ free(song_path); } +Mix_Music* +Level::get_level_music() +{ + return level_song; +} + +Mix_Music* +Level::get_level_music_fast() +{ + return level_song_fast; +} + unsigned int Level::gettileid(float x, float y) { Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- world.cpp 21 Apr 2004 22:48:43 -0000 1.34 +++ world.cpp 21 Apr 2004 23:38:08 -0000 1.35 @@ -68,10 +68,13 @@ activate_bad_guys(); activate_particle_systems(); get_level()->load_song(); + + play_music(LEVEL_MUSIC); } World::~World() { + halt_music(); // just to be sure (because levelmusic is freed now) delete level; } @@ -87,7 +90,7 @@ distro_counter = 0; /* set current song/music */ - set_current_music(LEVEL_MUSIC); + currentmusic = LEVEL_MUSIC; } void @@ -409,6 +412,32 @@ play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER); } +void +World::play_music(int musictype) +{ + currentmusic = musictype; + switch(currentmusic) { + case HURRYUP_MUSIC: + ::play_music(get_level()->get_level_music_fast()); + break; + case LEVEL_MUSIC: + ::play_music(get_level()->get_level_music()); + break; + case HERRING_MUSIC: + ::play_music(herring_song); + break; + default: + ::halt_music(); + break; + } +} + +int +World::get_music_type() +{ + return currentmusic; +} + /* Break a brick: */ void World::trybreakbrick(float x, float y, bool small) |
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5826 Modified Files: mriceblock-flat-left.png mriceblock-flat-right.png spiky-left-0.png spiky-left-1.png spiky-left-2.png spiky-right-0.png spiky-right-1.png spiky-right-2.png Added Files: largetux-skid-left.png largetux-skid-right.png smalltux-skid-left.png smalltux-skid-right.png snowball-squished-left.png snowball-squished-right.png Log Message: - some more gfx Index: mriceblock-flat-left.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mriceblock-flat-left.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsdQ1tBf and /tmp/cvsJk6hYq differ --- NEW FILE: snowball-squished-left.png --- (This appears to be a binary file; contents omitted.) Index: spiky-right-2.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/spiky-right-2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvseGnRU8 and /tmp/cvslZ8YkF differ --- NEW FILE: smalltux-skid-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: snowball-squished-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: smalltux-skid-left.png --- (This appears to be a binary file; contents omitted.) Index: spiky-left-0.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/spiky-left-0.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs4mm2j2 and /tmp/cvs5xcOd4 differ Index: spiky-left-1.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/spiky-left-1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsUKBT48 and /tmp/cvswXMozf differ Index: spiky-left-2.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/spiky-left-2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsQF27Ly and /tmp/cvsQjOVbW differ Index: spiky-right-0.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/spiky-right-0.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsuquSRJ and /tmp/cvsCeLBom differ --- NEW FILE: largetux-skid-left.png --- (This appears to be a binary file; contents omitted.) Index: spiky-right-1.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/spiky-right-1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsExgULU and /tmp/cvsQu4a3E differ Index: mriceblock-flat-right.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/mriceblock-flat-right.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsVCS1Ph and /tmp/cvsCGYDUi differ --- NEW FILE: largetux-skid-right.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-04-21 22:49:46
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1476/src Modified Files: defines.h world.cpp Log Message: Limitated the number of bullets to be shot at the same time. I have made 2 bullets to be the maximum... if you don't agree tell me. anyway, you can easily change them in defines.h Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- defines.h 20 Apr 2004 19:55:02 -0000 1.19 +++ defines.h 21 Apr 2004 22:48:30 -0000 1.20 @@ -70,6 +70,8 @@ #define RUN_SPEED 1.5 #define JUMP_SPEED 1.2 +#define MAX_BULLETS 2 + #define GRAVITY 1.0 #define YM_FOR_JUMP 6.0 #define WALK_ACCELERATION_X 0.03 Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- world.cpp 20 Apr 2004 20:10:52 -0000 1.33 +++ world.cpp 21 Apr 2004 22:48:43 -0000 1.34 @@ -399,6 +399,9 @@ void World::add_bullet(float x, float y, float xm, Direction dir) { + if(bullets.size() > MAX_BULLETS-1) + return; + Bullet new_bullet; new_bullet.init(x,y,xm,dir); bullets.push_back(new_bullet); |
From: Ingo R. <gr...@us...> - 2004-04-21 19:08:51
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23635 Modified Files: smalltux-jump-left.png smalltux-jump-right.png Log Message: - improved smalltux Index: smalltux-jump-left.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-jump-left.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsZ7x6lG and /tmp/cvsZvu8Yb differ Index: smalltux-jump-right.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-jump-right.png,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 Binary files /tmp/cvsxnp4hM and /tmp/cvsPh2PNr differ |
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22432 Modified Files: smalltux-jump-left.png smalltux-jump-right.png smalltux-left-1.png smalltux-left-2.png smalltux-left-3.png smalltux-left-4.png smalltux-left-5.png smalltux-left-6.png smalltux-left-7.png smalltux-left-8.png smalltux-right-1.png smalltux-right-2.png smalltux-right-3.png smalltux-right-4.png smalltux-right-5.png smalltux-right-6.png smalltux-right-7.png smalltux-right-8.png Log Message: - improved smalltux Index: smalltux-right-5.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-5.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvseiGEvg and /tmp/cvs8W4B1u differ Index: smalltux-right-4.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-4.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsHiBNAH and /tmp/cvsrEy1h6 differ Index: smalltux-right-7.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-7.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs0Bmn2H and /tmp/cvsnIX8pd differ Index: smalltux-right-6.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-6.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvszjCRLO and /tmp/cvsAMW3iw differ Index: smalltux-right-1.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsaIGaUe and /tmp/cvs6L56jY differ Index: smalltux-right-3.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-3.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsvvp0X7 and /tmp/cvsDh58e3 differ Index: smalltux-right-2.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvssPgM2s and /tmp/cvs0ngSaq differ Index: smalltux-jump-right.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-jump-right.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs3ieofc and /tmp/cvsI1Rlne differ Index: smalltux-right-8.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-right-8.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsZqpeXw and /tmp/cvs1moQRM differ Index: smalltux-left-8.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-8.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvszesut0 and /tmp/cvsJTmy3i differ Index: smalltux-jump-left.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-jump-left.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvskFVOwu and /tmp/cvsbM2RpQ differ Index: smalltux-left-1.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsq1yPUK and /tmp/cvsF45ULg differ Index: smalltux-left-3.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-3.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsWEaG8j and /tmp/cvsBK2HdR differ Index: smalltux-left-2.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-2.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsPA6huv and /tmp/cvsl3tuI8 differ Index: smalltux-left-5.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-5.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsUoAkNP and /tmp/cvsGpSzxE differ Index: smalltux-left-4.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-4.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsVfxDyw and /tmp/cvsLrO57q differ Index: smalltux-left-7.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-7.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvs02QMrf and /tmp/cvsDP6YNi differ Index: smalltux-left-6.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/smalltux-left-6.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvslrP0UQ and /tmp/cvsJtTVMX differ |
From: Ricardo C. <rm...@us...> - 2004-04-21 17:45:27
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5859/src Modified Files: configfile.cpp menu.cpp Log Message: Made the keys to be displayed when typed and also save them to the file. Still to fix: display keys when menu is shown. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- menu.cpp 21 Apr 2004 15:45:39 -0000 1.44 +++ menu.cpp 21 Apr 2004 17:45:17 -0000 1.45 @@ -443,6 +443,7 @@ } case MN_TEXTFIELD: case MN_NUMFIELD: + case MN_CONTROLFIELD: { int input_pos = input_width/2; int text_pos = (text_width + font_width)/2; @@ -463,10 +464,10 @@ A_HMIDDLE, A_VMIDDLE, shadow_size); break; } - case MN_CONTROLFIELD: - { +// case MN_CONTROLFIELD: +// { /* display key */ // FIXME: the key number is not that obvious to the user :P - char str[12]; +/* char str[12]; sprintf(str, "%i", *pitem.int_p); input_width = strlen(str) * font_width; @@ -488,7 +489,7 @@ x_pos - (input_width + font_width)/2, y_pos, A_HMIDDLE, A_VMIDDLE, shadow_size); break; - } + }*/ case MN_STRINGSELECT: { int list_pos_2 = list_width + font_width; @@ -619,6 +620,52 @@ if(item[active_item].kind == MN_CONTROLFIELD) { *item[active_item].int_p = event.key.keysym.unicode; + if(ch[0] != '\0') + strcpy(item[active_item].input, ch); + else + switch(key) + { + case SDLK_UP: + strcpy(item[active_item].input, "Up cursor"); + break; + case SDLK_DOWN: + strcpy(item[active_item].input, "Down cursor"); + break; + case SDLK_LEFT: + strcpy(item[active_item].input, "Left cursor"); + break; + case SDLK_RIGHT: + strcpy(item[active_item].input, "Right cursor"); + break; + case SDLK_RETURN: + strcpy(item[active_item].input, "Return"); + break; + case SDLK_SPACE: + strcpy(item[active_item].input, "Space"); + break; + case SDLK_RSHIFT: + strcpy(item[active_item].input, "Right Shift"); + break; + case SDLK_LSHIFT: + strcpy(item[active_item].input, "Left Shift"); + break; + case SDLK_RCTRL: + strcpy(item[active_item].input, "Right Control"); + break; + case SDLK_LCTRL: + strcpy(item[active_item].input, "Left Control"); + break; + case SDLK_RALT: + strcpy(item[active_item].input, "Right Alt"); + break; + case SDLK_LALT: + strcpy(item[active_item].input, "Left Alt"); + break; + default: + strcpy(item[active_item].input, "?"); + break; + } + menuaction = MENU_ACTION_DOWN; return; } Index: configfile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/configfile.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- configfile.cpp 20 Apr 2004 16:50:18 -0000 1.2 +++ configfile.cpp 21 Apr 2004 17:45:17 -0000 1.3 @@ -23,6 +23,7 @@ #include "setup.h" #include "globals.h" #include "lispreader.h" +#include "player.h" #ifdef WIN32 const char * config_filename = "/st_config.dat"; @@ -97,6 +98,12 @@ reader.read_int ("joystick-b", &joystick_keymap.b_button); reader.read_int ("joystick-start", &joystick_keymap.start_button); reader.read_int ("joystick-deadzone", &joystick_keymap.dead_zone); + + reader.read_int ("keyboard-jump", &keymap.jump); + reader.read_int ("keyboard-duck", &keymap.duck); + reader.read_int ("keyboard-left", &keymap.left); + reader.read_int ("keyboard-right", &keymap.right); + reader.read_int ("keyboard-fire", &keymap.fire); } void saveconfig (void) @@ -127,6 +134,12 @@ fprintf(config, "\t(joystick-start %d)\n", joystick_keymap.start_button); fprintf(config, "\t(joystick-deadzone %d)\n", joystick_keymap.dead_zone); + fprintf(config, "\t(keyboard-jump %d)\n", keymap.jump); + fprintf(config, "\t(keyboard-duck %d)\n", keymap.duck); + fprintf(config, "\t(keyboard-left %d)\n", keymap.left); + fprintf(config, "\t(keyboard-right %d)\n", keymap.right); + fprintf(config, "\t(keyboard-fire %d)\n", keymap.fire); + fprintf(config, ")\n"); } } |
From: Ricardo C. <rm...@us...> - 2004-04-21 17:43:40
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4923/src Modified Files: title.cpp Log Message: Added Marek music to cvs and play it in the main menu. Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -u -d -r1.52 -r1.53 --- title.cpp 20 Apr 2004 11:43:43 -0000 1.52 +++ title.cpp 21 Apr 2004 17:43:26 -0000 1.53 @@ -248,6 +248,9 @@ update_time = st_get_ticks(); random_timer.start(rand() % 2000 + 2000); + Mix_Music* music = load_song(datadir + "/music/theme.mod"); + play_music(music, 1); + Menu::set_current(main_menu); while (Menu::current()) { @@ -305,6 +308,7 @@ generate_contrib_menu(); break; case 3: + halt_music(); leveleditor(1); Menu::set_current(main_menu); break; @@ -354,11 +358,14 @@ frame++; SDL_Delay(25); + if(!playing_music) + play_music(music, 1); } /* Free surfaces: */ delete bkg_title; delete logo; + free_music(music); } #define MAX_VEL 10 |
From: Ricardo C. <rm...@us...> - 2004-04-21 17:43:39
|
Update of /cvsroot/super-tux/supertux/data/music In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4923/data/music Added Files: theme.mod Log Message: Added Marek music to cvs and play it in the main menu. --- NEW FILE: theme.mod --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-04-21 15:45:54
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19419/src Modified Files: menu.cpp Log Message: Display key number on the key selection: This is not obvious to the user, we have to get a way to translate it into human readable strings... Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- menu.cpp 21 Apr 2004 15:15:23 -0000 1.43 +++ menu.cpp 21 Apr 2004 15:45:39 -0000 1.44 @@ -443,7 +443,6 @@ } case MN_TEXTFIELD: case MN_NUMFIELD: - case MN_CONTROLFIELD: { int input_pos = input_width/2; int text_pos = (text_width + font_width)/2; @@ -464,6 +463,32 @@ A_HMIDDLE, A_VMIDDLE, shadow_size); break; } + case MN_CONTROLFIELD: + { + /* display key */ // FIXME: the key number is not that obvious to the user :P + char str[12]; + sprintf(str, "%i", *pitem.int_p); + input_width = strlen(str) * font_width; + + int input_pos = input_width/2; + int text_pos = (text_width + font_width)/2; + + fillrect(x_pos - input_pos + text_pos - 1, y_pos - 10, + input_width + font_width + 2, 20, + 255,255,255,255); + fillrect(x_pos - input_pos + text_pos, y_pos - 9, + input_width + font_width, 18, + 0,0,0,128); + + gold_text->draw_align(str, + x_pos + text_pos, y_pos, + A_HMIDDLE, A_VMIDDLE, 2); + + text_font->draw_align(pitem.text, + x_pos - (input_width + font_width)/2, y_pos, + A_HMIDDLE, A_VMIDDLE, shadow_size); + break; + } case MN_STRINGSELECT: { int list_pos_2 = list_width + font_width; |
From: Ricardo C. <rm...@us...> - 2004-04-21 15:17:36
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13352/src Modified Files: menu.cpp menu.h player.h setup.cpp Log Message: Finally, made keys configurable via the menu!! ;) Next step is to save them to config file and to make joystick also configurable. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- menu.cpp 20 Apr 2004 16:25:57 -0000 1.42 +++ menu.cpp 21 Apr 2004 15:15:23 -0000 1.43 @@ -97,7 +97,7 @@ /* Return a pointer to a new menu item */ MenuItem* -MenuItem::create(MenuItemKind kind_, const char *text_, int init_toggle_, Menu* target_menu_) +MenuItem::create(MenuItemKind kind_, const char *text_, int init_toggle_, Menu* target_menu_, int* int_p_) { MenuItem *pnew_item = new MenuItem; @@ -121,6 +121,9 @@ } else pnew_item->list = NULL; + + pnew_item->int_p = int_p_; + return pnew_item; } @@ -183,12 +186,12 @@ } void -Menu::additem(MenuItemKind kind_, const std::string& text_, int toggle_, Menu* menu_) +Menu::additem(MenuItemKind kind_, const std::string& text_, int toggle_, Menu* menu_, int* int_p) { if(kind_ == MN_BACK) has_backitem = true; - additem(MenuItem::create(kind_, text_.c_str(), toggle_, menu_)); + additem(MenuItem::create(kind_, text_.c_str(), toggle_, menu_, int_p)); } /* Add an item to a menu */ @@ -272,10 +275,11 @@ case MN_ACTION: case MN_TEXTFIELD: case MN_NUMFIELD: - case MN_CONTROLFIELD: Menu::set_current(0); item[active_item].toggled = true; break; + case MN_CONTROLFIELD: + break; case MN_BACK: Menu::pop_current(); @@ -321,7 +325,6 @@ item[active_item].input[1] = '\0'; } } - break; case MENU_ACTION_NONE: break; @@ -588,6 +591,14 @@ /* An International Character. */ } + if(item[active_item].kind == MN_CONTROLFIELD) + { + *item[active_item].int_p = event.key.keysym.unicode; + menuaction = MENU_ACTION_DOWN; + return; + } + + switch(key) { case SDLK_UP: /* Menu Up */ Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- player.h 20 Apr 2004 19:55:10 -0000 1.32 +++ player.h 21 Apr 2004 15:15:28 -0000 1.33 @@ -58,6 +58,8 @@ PlayerKeymap(); }; +extern PlayerKeymap keymap; + struct player_input_type { int right; Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- setup.cpp 20 Apr 2004 16:50:18 -0000 1.45 +++ setup.cpp 21 Apr 2004 15:15:28 -0000 1.46 @@ -50,6 +50,8 @@ #include "scene.h" #include "worldmap.h" +#include "player.h" + #ifdef WIN32 #define mkdir(dir, mode) mkdir(dir) // on win32 we typically don't want LFS paths @@ -405,7 +407,11 @@ options_controls_menu->additem(MN_LABEL,"Controls",0,0); options_controls_menu->additem(MN_HL,"",0,0); - //FIXME:options_controls_menu->additem(MN_CONTROLFIELD,"Move Right", tux.keymap.right,0); + options_controls_menu->additem(MN_CONTROLFIELD,"Right move", 0,0, &keymap.right); + options_controls_menu->additem(MN_CONTROLFIELD,"Left move", 0,0, &keymap.left); + options_controls_menu->additem(MN_CONTROLFIELD,"Jump", 0,0, &keymap.jump); + options_controls_menu->additem(MN_CONTROLFIELD,"Duck", 0,0, &keymap.duck); + options_controls_menu->additem(MN_CONTROLFIELD,"Power", 0,0, &keymap.fire); options_controls_menu->additem(MN_HL,"",0,0); options_controls_menu->additem(MN_BACK,"Back",0,0); Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- menu.h 20 Apr 2004 10:42:05 -0000 1.40 +++ menu.h 21 Apr 2004 15:15:27 -0000 1.41 @@ -51,13 +51,14 @@ int toggled; char *text; char *input; + int *int_p; // used for setting keys (can be used for more stuff...) string_list_type* list; Menu* target_menu; void change_text (const char *text); void change_input(const char *text); - static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu); + static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu, int* int_p); }; class Menu @@ -115,7 +116,7 @@ ~Menu(); void additem(MenuItem* pmenu_item); - void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu); + void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu, int *int_p = NULL); void action (); |
From: Ingo R. <gr...@us...> - 2004-04-21 13:42:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27248 Modified Files: gameloop.cpp gameloop.h Log Message: - made end seq a bit more robust Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- gameloop.h 21 Apr 2004 12:45:05 -0000 1.44 +++ gameloop.h 21 Apr 2004 13:41:01 -0000 1.45 @@ -59,6 +59,7 @@ /** If true the end_sequence will be played, user input will be ignored while doing that */ bool end_sequenze; + float last_x_pos; bool game_pause; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -u -d -r1.90 -r1.91 --- gameloop.cpp 21 Apr 2004 12:44:52 -0000 1.90 +++ gameloop.cpp 21 Apr 2004 13:40:44 -0000 1.91 @@ -60,6 +60,7 @@ : world(0), st_gl_mode(mode), levelnb(levelnb_), subset(subset_) { current_ = this; + end_sequenze = false; restart_level(); } @@ -177,169 +178,179 @@ void GameSession::process_events() { - SDL_Event event; - while (SDL_PollEvent(&event)) + if (end_sequenze) { - /* Check for menu-events, if the menu is shown */ - if (Menu::current()) - { - Menu::current()->event(event); - st_pause_ticks_start(); - } - else if (end_sequenze) - { - Player& tux = *world->get_tux(); - tux.input.left = UP; - tux.input.right = DOWN; - tux.input.up = UP; - tux.input.down = UP; - } + Player& tux = *world->get_tux(); + + tux.input.left = UP; + tux.input.right = DOWN; + tux.input.down = UP; + + if (int(last_x_pos) == int(tux.base.x)) + tux.input.up = DOWN; else - { - Player& tux = *world->get_tux(); - - st_pause_ticks_stop(); + tux.input.up = UP; - switch(event.type) + last_x_pos = tux.base.x; + } + else + { + SDL_Event event; + while (SDL_PollEvent(&event)) + { + /* Check for menu-events, if the menu is shown */ + if (Menu::current()) { - case SDL_QUIT: /* Quit event - quit: */ - st_abort("Received window close", ""); - break; + Menu::current()->event(event); + st_pause_ticks_start(); + } + else + { + Player& tux = *world->get_tux(); + + st_pause_ticks_stop(); - case SDL_KEYDOWN: /* A keypress! */ - { - SDLKey key = event.key.keysym.sym; - - if(tux.key_event(key,DOWN)) + switch(event.type) + { + case SDL_QUIT: /* Quit event - quit: */ + st_abort("Received window close", ""); break; - switch(key) + case SDL_KEYDOWN: /* A keypress! */ { - case SDLK_ESCAPE: /* Escape: Open/Close the menu: */ - on_escape_press(); - break; - default: - break; - } - } - break; - case SDL_KEYUP: /* A keyrelease! */ - { - SDLKey key = event.key.keysym.sym; + SDLKey key = event.key.keysym.sym; + + if(tux.key_event(key,DOWN)) + break; - if(tux.key_event(key, UP)) + switch(key) + { + case SDLK_ESCAPE: /* Escape: Open/Close the menu: */ + on_escape_press(); + break; + default: + break; + } + } break; - - switch(key) + case SDL_KEYUP: /* A keyrelease! */ { - case SDLK_p: - if(!Menu::current()) + SDLKey key = event.key.keysym.sym; + + if(tux.key_event(key, UP)) + break; + + switch(key) { - if(game_pause) - { - game_pause = false; - st_pause_ticks_stop(); - } - else + case SDLK_p: + if(!Menu::current()) { - game_pause = true; - st_pause_ticks_start(); + if(game_pause) + { + game_pause = false; + st_pause_ticks_stop(); + } + else + { + game_pause = true; + st_pause_ticks_start(); + } } - } - break; - case SDLK_TAB: - if(debug_mode) - { - tux.size = !tux.size; - if(tux.size == BIG) + break; + case SDLK_TAB: + if(debug_mode) { - tux.base.height = 64; + tux.size = !tux.size; + if(tux.size == BIG) + { + tux.base.height = 64; + } + else + tux.base.height = 32; } + break; + case SDLK_END: + if(debug_mode) + player_status.distros += 50; + break; + case SDLK_DELETE: + if(debug_mode) + tux.got_coffee = 1; + break; + case SDLK_INSERT: + if(debug_mode) + tux.invincible_timer.start(TUX_INVINCIBLE_TIME); + break; + case SDLK_l: + if(debug_mode) + --player_status.lives; + break; + case SDLK_s: + if(debug_mode) + player_status.score += 1000; + case SDLK_f: + if(debug_fps) + debug_fps = false; else - tux.base.height = 32; + debug_fps = true; + break; + default: + break; } - break; - case SDLK_END: - if(debug_mode) - player_status.distros += 50; - break; - case SDLK_DELETE: - if(debug_mode) - tux.got_coffee = 1; - break; - case SDLK_INSERT: - if(debug_mode) - tux.invincible_timer.start(TUX_INVINCIBLE_TIME); - break; - case SDLK_l: - if(debug_mode) - --player_status.lives; - break; - case SDLK_s: - if(debug_mode) - player_status.score += 1000; - case SDLK_f: - if(debug_fps) - debug_fps = false; - else - debug_fps = true; - break; - default: - break; } - } - break; + break; - case SDL_JOYAXISMOTION: - if (event.jaxis.axis == joystick_keymap.x_axis) - { - if (event.jaxis.value < -joystick_keymap.dead_zone) - { - tux.input.left = DOWN; - tux.input.right = UP; - } - else if (event.jaxis.value > joystick_keymap.dead_zone) + case SDL_JOYAXISMOTION: + if (event.jaxis.axis == joystick_keymap.x_axis) { - tux.input.left = UP; - tux.input.right = DOWN; + if (event.jaxis.value < -joystick_keymap.dead_zone) + { + tux.input.left = DOWN; + tux.input.right = UP; + } + else if (event.jaxis.value > joystick_keymap.dead_zone) + { + tux.input.left = UP; + tux.input.right = DOWN; + } + else + { + tux.input.left = DOWN; + tux.input.right = DOWN; + } } - else + else if (event.jaxis.axis == joystick_keymap.y_axis) { - tux.input.left = DOWN; - tux.input.right = DOWN; + if (event.jaxis.value > joystick_keymap.dead_zone) + tux.input.down = DOWN; + else if (event.jaxis.value < -joystick_keymap.dead_zone) + tux.input.down = UP; + else + tux.input.down = UP; } - } - else if (event.jaxis.axis == joystick_keymap.y_axis) - { - if (event.jaxis.value > joystick_keymap.dead_zone) - tux.input.down = DOWN; - else if (event.jaxis.value < -joystick_keymap.dead_zone) - tux.input.down = UP; - else - tux.input.down = UP; - } - break; + break; - case SDL_JOYBUTTONDOWN: - if (event.jbutton.button == joystick_keymap.a_button) - tux.input.up = DOWN; - else if (event.jbutton.button == joystick_keymap.b_button) - tux.input.fire = DOWN; - else if (event.jbutton.button == joystick_keymap.start_button) - on_escape_press(); - break; - case SDL_JOYBUTTONUP: - if (event.jbutton.button == joystick_keymap.a_button) - tux.input.up = UP; - else if (event.jbutton.button == joystick_keymap.b_button) - tux.input.fire = UP; - break; + case SDL_JOYBUTTONDOWN: + if (event.jbutton.button == joystick_keymap.a_button) + tux.input.up = DOWN; + else if (event.jbutton.button == joystick_keymap.b_button) + tux.input.fire = DOWN; + else if (event.jbutton.button == joystick_keymap.start_button) + on_escape_press(); + break; + case SDL_JOYBUTTONUP: + if (event.jbutton.button == joystick_keymap.a_button) + tux.input.up = UP; + else if (event.jbutton.button == joystick_keymap.b_button) + tux.input.fire = UP; + break; - default: - break; - } /* switch */ - } - } /* while */ + default: + break; + } /* switch */ + } + } /* while */ + } } @@ -353,9 +364,10 @@ { exit_status = LEVEL_FINISHED; } - else if (tux->base.x >= World::current()->get_level()->endpos) + else if (tux->base.x >= World::current()->get_level()->endpos && !end_sequenze) { end_sequenze = true; + last_x_pos = -1; halt_music(); } else |
From: Ingo R. <gr...@us...> - 2004-04-21 13:41:09
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27218 Added Files: endseq.stl Log Message: - test level for endseq --- NEW FILE: endseq.stl --- ;; Generated by Flexlay Editor (supertux-level (version 1) (author "") (name "Hello World") (width 100) (height 15) (start_pos_x 100) (start_pos_y 100) (background "") (music "Mortimers_chipdisko.mod") (bkgd_red_top 150) (bkgd_green_top 150) (bkgd_blue_top 150) (bkgd_red_bottom 150) (bkgd_green_bottom 150) (bkgd_blue_bottom 150) (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 112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 0 112 112 112 112 0 0 0 0 0 0 112 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 48 0 0 0 0 0 0 0 0 0 0 0 0 112 0 0 0 0 0 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 48 8 8 8 0 0 0 0 8 8 8 8 8 112 8 8 8 8 8 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11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 0 0 0 0 0 0 0 0 0 0 0 0 0 ) (reset-points ) (objects ) ) ;; EOF ;; |
From: Ingo R. <gr...@us...> - 2004-04-21 12:46:07
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16778 Modified Files: badguy.h gameloop.cpp gameloop.h level.cpp sprite.cpp Log Message: - added end-sequence code Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- badguy.h 20 Apr 2004 20:10:47 -0000 1.30 +++ badguy.h 21 Apr 2004 12:44:52 -0000 1.31 @@ -24,6 +24,7 @@ #define SUPERTUX_BADGUY_H #include "SDL.h" +#include "defines.h" #include "bitmask.h" #include "type.h" #include "timer.h" Index: gameloop.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- gameloop.h 20 Apr 2004 11:09:33 -0000 1.43 +++ gameloop.h 21 Apr 2004 12:45:05 -0000 1.44 @@ -55,6 +55,11 @@ unsigned int update_time; int pause_menu_frame; int debug_fps; + + /** If true the end_sequence will be played, user input will be + ignored while doing that */ + bool end_sequenze; + bool game_pause; // FIXME: Hack for restarting the level @@ -97,6 +102,7 @@ private: void on_escape_press(); + void process_menu(); }; std::string slotinfo(int slot); Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- level.cpp 20 Apr 2004 20:10:48 -0000 1.43 +++ level.cpp 21 Apr 2004 12:45:06 -0000 1.44 @@ -484,7 +484,7 @@ // Mark the end position of this level! // FIXME: -10 is a rather random value, we still need some kind of // real levelend gola - endpos = 32*(width-10); + endpos = 32*(width-20); fclose(fi); return 0; Index: sprite.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sprite.cpp 17 Apr 2004 22:22:35 -0000 1.4 +++ sprite.cpp 21 Apr 2004 12:45:07 -0000 1.5 @@ -18,6 +18,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <iostream> +#include <math.h> #include "globals.h" #include "sprite.h" Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -u -d -r1.89 -r1.90 --- gameloop.cpp 20 Apr 2004 18:46:57 -0000 1.89 +++ gameloop.cpp 21 Apr 2004 12:44:52 -0000 1.90 @@ -66,8 +66,9 @@ void GameSession::restart_level() { - game_pause = false; - exit_status = NONE; + game_pause = false; + exit_status = NONE; + end_sequenze = false; fps_timer.init(true); frame_timer.init(true); @@ -176,8 +177,6 @@ void GameSession::process_events() { - Player& tux = *world->get_tux(); - SDL_Event event; while (SDL_PollEvent(&event)) { @@ -187,8 +186,18 @@ Menu::current()->event(event); st_pause_ticks_start(); } + else if (end_sequenze) + { + Player& tux = *world->get_tux(); + tux.input.left = UP; + tux.input.right = DOWN; + tux.input.up = UP; + tux.input.down = UP; + } else { + Player& tux = *world->get_tux(); + st_pause_ticks_stop(); switch(event.type) @@ -340,11 +349,15 @@ Player* tux = world->get_tux(); /* End of level? */ - if (tux->base.x >= World::current()->get_level()->endpos - && World::current()->get_level()->endpos != 0) + if (tux->base.x >= World::current()->get_level()->endpos + 320) { exit_status = LEVEL_FINISHED; } + else if (tux->base.x >= World::current()->get_level()->endpos) + { + end_sequenze = true; + halt_music(); + } else { // Check End conditions @@ -405,6 +418,37 @@ updatescreen(); } +void +GameSession::process_menu() +{ + Menu* menu = Menu::current(); + if(menu) + { + menu->action(); + + if(menu == game_menu) + { + switch (game_menu->check()) + { + case 2: + st_pause_ticks_stop(); + break; + case 5: + st_pause_ticks_stop(); + exit_status = LEVEL_ABORT; + break; + } + } + else if(menu == options_menu) + { + process_options_menu(); + } + else if(menu == load_game_menu ) + { + process_load_game_menu(); + } + } +} GameSession::ExitStatus GameSession::run() @@ -453,43 +497,22 @@ tux->input.old_fire = tux->input.fire; process_events(); - - Menu* menu = Menu::current(); - if(menu) - { - menu->action(); + process_menu(); - if(menu == game_menu) - { - switch (game_menu->check()) - { - case 2: - st_pause_ticks_stop(); - break; - case 5: - st_pause_ticks_stop(); - exit_status = LEVEL_ABORT; - break; - } - } - else if(menu == options_menu) - { - process_options_menu(); - } - else if(menu == load_game_menu ) - { - process_load_game_menu(); - } - } - - // Handle actions: + // Update the world state and all objects in the world + // Do that with a constante time-delta so that the game will run + // determistic and not different on different machines if(!game_pause && !Menu::current()) { frame_ratio *= game_speed; frame_ratio += overlap; while (frame_ratio > 0) { - action(1.0f); + // Update the world + if (end_sequenze) + action(.5f); + else + action(1.0f); frame_ratio -= 1.0f; } overlap = frame_ratio; @@ -500,17 +523,6 @@ SDL_Delay(50); } - if(debug_mode && debug_fps) - SDL_Delay(60); - - /*Draw the current scene to the screen */ - /*If the machine running the game is too slow - skip the drawing of the frame (so the calculations are more precise and - the FPS aren't affected).*/ - /*if( ! fps_fps < 50.0 ) - game_draw(); - else - jump = true;*/ /*FIXME: Implement this tweak right.*/ draw(); /* Time stops in pause mode */ @@ -521,17 +533,16 @@ /* Set the time of the last update and the time of the current update */ last_update_time = update_time; - update_time = st_get_ticks(); + update_time = st_get_ticks(); /* 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 = st_get_ticks(); - } - /*if((update_time - last_update_time) < 10) - SDL_Delay((11 - (update_time - last_update_time))/2);*/ + if(last_update_time >= update_time - 12) + { + SDL_Delay(10); + update_time = st_get_ticks(); + } /* Handle time: */ if (time_left.check()) @@ -545,7 +556,9 @@ } } else if(tux->dying == DYING_NOT) - tux->kill(KILL); + { + tux->kill(KILL); + } /* Calculate frames per second */ if(show_fps) |
From: Ingo R. <gr...@us...> - 2004-04-21 11:57:21
|
Update of /cvsroot/super-tux/supertux/data/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8570 Modified Files: icon.png Log Message: - added new icon Index: icon.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/icon.png,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 Binary files /tmp/cvs7W2Go5 and /tmp/cvsPzSBCL differ |
From: Ingo R. <gr...@us...> - 2004-04-21 11:38:38
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5290 Modified Files: tux-life.png Log Message: - added new tux-life pic by Benjamin P. Jung Index: tux-life.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/shared/tux-life.png,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 Binary files /tmp/cvsD2VcCP and /tmp/cvsYbajsH differ |
From: Ricardo C. <rm...@us...> - 2004-04-21 11:18:13
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2177/src Modified Files: worldmap.cpp worldmap.h Log Message: Now, the worldmap displays the Level's name, instead of the path. Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- worldmap.cpp 20 Apr 2004 16:26:08 -0000 1.40 +++ worldmap.cpp 21 Apr 2004 11:17:31 -0000 1.41 @@ -281,7 +281,7 @@ input_direction = NONE; enter_level = false; - name = "<no name>"; + name = "<no file>"; music = "SALCON.MOD"; song = 0; @@ -345,6 +345,9 @@ reader.read_string("name", &level.name); reader.read_int("x", &level.x); reader.read_int("y", &level.y); + + get_level_title(&level); // get level's title + levels.push_back(level); } @@ -361,6 +364,38 @@ } } +void WorldMap::get_level_title(Levels::pointer level) +{ +/** get level's title */ +level->title = "<no title>"; + +FILE * fi; +lisp_object_t* root_obj = 0; +fi = fopen((datadir + "levels/" + level->name).c_str(), "r"); +if (fi == NULL) + { + perror((datadir + "levels/" + level->name).c_str()); + return; + } + +lisp_stream_t stream; +lisp_stream_init_file (&stream, fi); +root_obj = lisp_read (&stream); + +if (root_obj->type == LISP_TYPE_EOF || root_obj->type == LISP_TYPE_PARSE_ERROR) + { + printf("World: Parse Error in file %s", level->name.c_str()); + } + +if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-level") == 0) + { + LispReader reader(lisp_cdr(root_obj)); + reader.read_string("name", &level->title); + } + +fclose(fi); +} + void WorldMap::on_escape_press() { @@ -676,7 +711,7 @@ if (i->x == tux->get_tile_pos().x && i->y == tux->get_tile_pos().y) { - white_text->draw_align(i->name.c_str(), screen->w/2, screen->h, A_HMIDDLE, A_BOTTOM); + white_text->draw_align(i->title.c_str(), screen->w/2, screen->h, A_HMIDDLE, A_BOTTOM); break; } } Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- worldmap.h 19 Apr 2004 19:06:45 -0000 1.20 +++ worldmap.h 21 Apr 2004 11:17:31 -0000 1.21 @@ -139,6 +139,7 @@ int x; int y; std::string name; + std::string title; bool solved; // Directions which are walkable from this level @@ -160,6 +161,8 @@ Point offset; std::string savegame_file; + void get_level_title(Levels::pointer level); + void draw_status(); public: WorldMap(); |
From: Ricardo C. <rm...@us...> - 2004-04-20 22:53:48
|
Update of /cvsroot/super-tux/supertux/data/levels/wansti In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13885/data/levels/wansti Removed Files: info level1.stl level2.stl level3.stl level4.stl level5.stl level6.stl Log Message: These levels are all in the world1 dir. --- level1.stl DELETED --- --- info DELETED --- --- level5.stl DELETED --- --- level2.stl DELETED --- --- level4.stl DELETED --- --- level3.stl DELETED --- --- level6.stl DELETED --- |
From: Ricardo C. <rm...@us...> - 2004-04-20 22:53:22
|
Update of /cvsroot/super-tux/supertux/data/levels/snow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13885/data/levels/snow Removed Files: info level1.stl level2.stl level3.stl level4.stl level5.stl level6.stl level7.stl Log Message: These levels are all in the world1 dir. --- level1.stl DELETED --- --- info DELETED --- --- level5.stl DELETED --- --- level2.stl DELETED --- --- level4.stl DELETED --- --- level3.stl DELETED --- --- level6.stl DELETED --- --- level7.stl DELETED --- |
From: Ricardo C. <rm...@us...> - 2004-04-20 22:53:11
|
Update of /cvsroot/super-tux/supertux/data/levels/sky In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13885/data/levels/sky Removed Files: info level1.stl Log Message: These levels are all in the world1 dir. --- level1.stl DELETED --- --- info DELETED --- |
From: Ricardo C. <rm...@us...> - 2004-04-20 22:52:57
|
Update of /cvsroot/super-tux/supertux/data/levels/cave In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13885/data/levels/cave Removed Files: info level1.stl level2.stl level3.stl level4.stl level5.stl level6.stl Log Message: These levels are all in the world1 dir. --- level1.stl DELETED --- --- info DELETED --- --- level5.stl DELETED --- --- level2.stl DELETED --- --- level4.stl DELETED --- --- level3.stl DELETED --- --- level6.stl DELETED --- |
From: Ricardo C. <rm...@us...> - 2004-04-20 22:52:55
|
Update of /cvsroot/super-tux/supertux/data/levels/castle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13885/data/levels/castle Removed Files: info level1.stl Log Message: These levels are all in the world1 dir. --- level1.stl DELETED --- --- info DELETED --- |