credits music plays on credits screen now
authorMarek Moeckel <wansti@gmx.de>
Sun, 13 Mar 2005 23:45:02 +0000 (23:45 +0000)
committerMarek Moeckel <wansti@gmx.de>
Sun, 13 Mar 2005 23:45:02 +0000 (23:45 +0000)
SVN-Revision: 2290

lib/audio/sound_manager.h
src/resources.cpp
src/resources.h
src/sector.cpp
src/title.cpp
src/title.h

index 9eece9c..5dc7cce 100644 (file)
@@ -38,7 +38,8 @@ namespace SuperTux
     NO_MUSIC,
     LEVEL_MUSIC,
     HURRYUP_MUSIC,
-    HERRING_MUSIC
+    HERRING_MUSIC,
+    CREDITS_MUSIC
   };
 
   /// Sound manager
index 3cacede..d35e1a5 100644 (file)
@@ -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: */
index dee4ee0..cb56896 100644 (file)
@@ -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;
index 96f7f34..01c4ea6 100644 (file)
@@ -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;
index 12f1c25..291431e 100644 (file)
@@ -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:
index 96713a2..eb1b32f 100644 (file)
@@ -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);