Fix sound after mod switching.
This commit is contained in:
@@ -248,6 +248,7 @@ namespace OpenRA
|
|||||||
foreach(var mod in Mod.AllMods)
|
foreach(var mod in Mod.AllMods)
|
||||||
Console.WriteLine("\t{0}: {1} ({2})", mod.Key, mod.Value.Title, mod.Value.Version);
|
Console.WriteLine("\t{0}: {1} ({2})", mod.Key, mod.Value.Title, mod.Value.Version);
|
||||||
|
|
||||||
|
Sound.Create();
|
||||||
InitializeWithMods(Settings.Game.Mods);
|
InitializeWithMods(Settings.Game.Mods);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,12 +266,13 @@ namespace OpenRA
|
|||||||
// Discard any invalid mods
|
// Discard any invalid mods
|
||||||
var mm = mods.Where( m => Mod.AllMods.ContainsKey( m ) ).ToArray();
|
var mm = mods.Where( m => Mod.AllMods.ContainsKey( m ) ).ToArray();
|
||||||
Console.WriteLine("Loading mods: {0}",string.Join(",",mm));
|
Console.WriteLine("Loading mods: {0}",string.Join(",",mm));
|
||||||
|
|
||||||
|
Sound.Initialize();
|
||||||
|
|
||||||
modData = new ModData( mm );
|
modData = new ModData( mm );
|
||||||
modData.LoadInitialAssets();
|
modData.LoadInitialAssets();
|
||||||
|
|
||||||
Sound.Initialize();
|
|
||||||
PerfHistory.items["render"].hasNormalTick = false;
|
PerfHistory.items["render"].hasNormalTick = false;
|
||||||
PerfHistory.items["batches"].hasNormalTick = false;
|
PerfHistory.items["batches"].hasNormalTick = false;
|
||||||
|
|
||||||
|
|||||||
@@ -36,9 +36,13 @@ namespace OpenRA
|
|||||||
return soundEngine.AddSoundSourceFromMemory(rawData, 1, 16, 22050);
|
return soundEngine.AddSoundSourceFromMemory(rawData, 1, 16, 22050);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Create()
|
||||||
{
|
{
|
||||||
soundEngine = new OpenAlSoundEngine();
|
soundEngine = new OpenAlSoundEngine();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Initialize()
|
||||||
|
{
|
||||||
sounds = new Cache<string, ISoundSource>(LoadSound);
|
sounds = new Cache<string, ISoundSource>(LoadSound);
|
||||||
music = null;
|
music = null;
|
||||||
currentMusic = null;
|
currentMusic = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user