diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 13f40e383f..b9a679b65d 100755 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -248,6 +248,7 @@ namespace OpenRA foreach(var mod in Mod.AllMods) Console.WriteLine("\t{0}: {1} ({2})", mod.Key, mod.Value.Title, mod.Value.Version); + Sound.Create(); InitializeWithMods(Settings.Game.Mods); } @@ -265,12 +266,13 @@ namespace OpenRA // Discard any invalid mods var mm = mods.Where( m => Mod.AllMods.ContainsKey( m ) ).ToArray(); Console.WriteLine("Loading mods: {0}",string.Join(",",mm)); - + + Sound.Initialize(); modData = new ModData( mm ); modData.LoadInitialAssets(); - Sound.Initialize(); + PerfHistory.items["render"].hasNormalTick = false; PerfHistory.items["batches"].hasNormalTick = false; diff --git a/OpenRA.Game/Sound.cs b/OpenRA.Game/Sound.cs index d73f2a47be..ae0af975bd 100644 --- a/OpenRA.Game/Sound.cs +++ b/OpenRA.Game/Sound.cs @@ -36,9 +36,13 @@ namespace OpenRA return soundEngine.AddSoundSourceFromMemory(rawData, 1, 16, 22050); } - public static void Initialize() + public static void Create() { soundEngine = new OpenAlSoundEngine(); + } + + public static void Initialize() + { sounds = new Cache(LoadSound); music = null; currentMusic = null;