From: Marek Moeckel Date: Sun, 13 Mar 2005 23:45:02 +0000 (+0000) Subject: credits music plays on credits screen now X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ccab1476a8c4dba578db46dfb33f1a897c310d11;p=supertux.git credits music plays on credits screen now SVN-Revision: 2290 --- diff --git a/lib/audio/sound_manager.h b/lib/audio/sound_manager.h index 9eece9c83..5dc7cce08 100644 --- a/lib/audio/sound_manager.h +++ b/lib/audio/sound_manager.h @@ -38,7 +38,8 @@ namespace SuperTux NO_MUSIC, LEVEL_MUSIC, HURRYUP_MUSIC, - HERRING_MUSIC + HERRING_MUSIC, + CREDITS_MUSIC }; /// Sound manager diff --git a/src/resources.cpp b/src/resources.cpp index 3cacedebb..d35e1a5cc 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -43,6 +43,7 @@ Menu* contrib_subset_menu = 0; MusicRef herring_song; MusicRef level_end_song; +MusicRef credits_song; SpriteManager* sprite_manager = 0; TileManager* tile_manager = 0; @@ -163,6 +164,8 @@ void loadshared() ()->load_music(datadir + "/music/salcon.mod"); level_end_song = SoundManager::get ()->load_music(datadir + "/music/leveldone.mod"); + credits_song = SoundManager::get + ()->load_music(datadir + "/music/credits.ogg"); } /* Free shared data: */ diff --git a/src/resources.h b/src/resources.h index dee4ee003..cb5689634 100644 --- a/src/resources.h +++ b/src/resources.h @@ -66,6 +66,7 @@ extern Surface* img_super_bkgd; extern MusicRef herring_song; extern MusicRef level_end_song; +extern MusicRef credits_song; extern SpriteManager* sprite_manager; extern TileManager* tile_manager; diff --git a/src/sector.cpp b/src/sector.cpp index 96f7f3491..01c4ea674 100644 --- a/src/sector.cpp +++ b/src/sector.cpp @@ -804,6 +804,9 @@ Sector::play_music(int type) case HERRING_MUSIC: SoundManager::get()->play_music(herring_song); break; + case CREDITS_MUSIC: + SoundManager::get()->play_music(credits_song); + break; default: SoundManager::get()->halt_music(); break; diff --git a/src/title.cpp b/src/title.cpp index 12f1c255b..291431e5d 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -385,8 +385,10 @@ void title(void) break; case MNID_CREDITS: fadeout(500); + titlesession->get_current_sector()->play_music(CREDITS_MUSIC); display_text_file("credits.txt", SCROLL_SPEED_CREDITS, white_big_text , white_text, white_small_text, blue_text ); fadeout(500); + //titlesession->get_current_sector()->play_music(LEVEL_MUSIC); //not needed Menu::set_current(main_menu); break; case MNID_QUITMAINMENU: diff --git a/src/title.h b/src/title.h index 96713a2a3..eb1b32f0e 100644 --- a/src/title.h +++ b/src/title.h @@ -33,7 +33,7 @@ enum MainMenuIDs { /* Scrolling text speed */ -#define SCROLL_SPEED_CREDITS 2.0 +#define SCROLL_SPEED_CREDITS 1.5 #define SCROLL_SPEED_MESSAGE 1.0 void title(void);