Made implementation of credits song less stupid, thanks to Matze's suggestions :-)
authorMarek Moeckel <wansti@gmx.de>
Mon, 14 Mar 2005 00:48:39 +0000 (00:48 +0000)
committerMarek Moeckel <wansti@gmx.de>
Mon, 14 Mar 2005 00:48:39 +0000 (00:48 +0000)
SVN-Revision: 2291

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

index 5dc7cce..9eece9c 100644 (file)
@@ -38,8 +38,7 @@ namespace SuperTux
     NO_MUSIC,
     LEVEL_MUSIC,
     HURRYUP_MUSIC,
-    HERRING_MUSIC,
-    CREDITS_MUSIC
+    HERRING_MUSIC
   };
 
   /// Sound manager
index d35e1a5..fc8c038 100644 (file)
@@ -164,8 +164,6 @@ 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 cb56896..dee4ee0 100644 (file)
@@ -66,7 +66,6 @@ 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 01c4ea6..96f7f34 100644 (file)
@@ -804,9 +804,6 @@ 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 291431e..3f0f3a5 100644 (file)
@@ -286,6 +286,7 @@ void title(void)
 {
   walking = true;
   LevelEditor* leveleditor;
+  MusicRef credits_music;
 
   Ticks::pause_init();
 
@@ -385,10 +386,10 @@ void title(void)
                   break;
                 case MNID_CREDITS:
                   fadeout(500);
-                   titlesession->get_current_sector()->play_music(CREDITS_MUSIC);
+                  credits_music = SoundManager::get()->load_music(datadir + "/music/credits.ogg");
+                  SoundManager::get()->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: