Reverted sound loading changes in 2cb0ee73. I don't think sharing the same Sound objects is necessary, because Sounds using the same audio clip already share the same OggSound object which holds the actual audio data. Also I think these changes would cause removing a sound to break other sounds sharing the same audio clip.
This commit is contained in:
@@ -88,10 +88,6 @@ namespace Barotrauma
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Sound dupe = Sound.loadedSounds.Find(s => s.filePath == file);
|
|
||||||
if (dupe != null)
|
|
||||||
return dupe;
|
|
||||||
|
|
||||||
return new Sound(file, destroyOnGameEnd);
|
return new Sound(file, destroyOnGameEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,9 +100,6 @@ namespace Barotrauma
|
|||||||
{
|
{
|
||||||
newSound.baseVolume = element.GetAttributeFloat("volume", 1.0f);
|
newSound.baseVolume = element.GetAttributeFloat("volume", 1.0f);
|
||||||
newSound.range = element.GetAttributeFloat("range", 1000.0f);
|
newSound.range = element.GetAttributeFloat("range", 1000.0f);
|
||||||
Sound dupe = Sound.loadedSounds.Find(s => s.filePath == filePath && s.baseVolume == newSound.baseVolume && s.range == newSound.range);
|
|
||||||
if (dupe != null)
|
|
||||||
return dupe;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return newSound;
|
return newSound;
|
||||||
|
|||||||
Reference in New Issue
Block a user