mail[Wesnoth-commits] r33429 - /trunk/src/sound.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by shadowm2006 on March 08, 2009 - 15:50:
Author: shadowmaster
Date: Sun Mar  8 15:50:25 2009
New Revision: 33429

URL: http://svn.gna.org/viewcvs/wesnoth?rev=33429&view=rev
Log:
Remove music files from the playlist when it is proved that they cannot
be located in the binary paths. This is a extremely important
performance saver, specially for users who don't install the
wesnoth-music package.

TODO: make the music_track fields private and make a setter for the
'name' property that can handle this stuff and cache a resolved path
or invalidate the track so the thinker can ignore it and save some time.

Modified:
    trunk/src/sound.cpp

Modified: trunk/src/sound.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/sound.cpp?rev=33429&r1=33428&r2=33429&view=diff
==============================================================================
--- trunk/src/sound.cpp (original)
+++ trunk/src/sound.cpp Sun Mar  8 15:50:25 2009
@@ -14,6 +14,7 @@
 
 #include "global.hpp"
 #include "filesystem.hpp"
+#include "foreach.hpp"
 #include "game_preferences.hpp"
 #include "log.hpp"
 #include "sound.hpp"
@@ -512,7 +513,15 @@
                const std::string& filename = 
get_binary_file_location("music", current_track.name);
 
                if(filename.empty()) {
-                       ERR_AUDIO << "Could not open track '" << 
current_track.name << "'\n";
+                       const std::string bad_track = current_track.name;
+                       ERR_AUDIO << "Could not open track '" << 
current_track.name << "', disabling for this playlist\n";
+
+                       current_track.name = "";
+                       foreach(music_track& trk, current_track_list) {
+                               if(trk.name == bad_track) {
+                                       trk.name = "";
+                               }
+                       }
                        return;
                }
 




Related Messages


Powered by MHonArc, Updated Sun Mar 08 16:20:29 2009