Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SoundInstanceGarbageCollector.cs
Go to the documentation of this file.
2using Microsoft.Xna.Framework.Audio;
3
4namespace Terraria.Audio;
5
7{
9
10 public static void Track(SoundEffectInstance sound)
11 {
12 if (Program.IsFna)
13 {
15 }
16 }
17
18 public static void Update()
19 {
20 for (int i = 0; i < _activeSounds.Count; i++)
21 {
22 if (_activeSounds[i] == null)
23 {
24 _activeSounds.RemoveAt(i);
25 i--;
26 }
27 else if (_activeSounds[i].State == SoundState.Stopped)
28 {
29 _activeSounds[i].Dispose();
30 _activeSounds.RemoveAt(i);
31 i--;
32 }
33 }
34 }
35}
static readonly List< SoundEffectInstance > _activeSounds
static bool IsFna
Definition Program.cs:23