public void ReadSoundEntry(ResourceEntry entry, XmlWriter resourceXML, string name, string soundDir) { // Create and deserialize the data. SoundResource resource = new SoundResource(); using (MemoryStream stream = new MemoryStream(entry.Data)) { resource.Deserialize(entry.Version, stream, _Endian); } entry.Data = resource.Data; // Create directories and then write the XML to finish it off. string fileName = name + ".fsb"; string[] dirs = name.Split(new char[] { Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries); string tempDir = soundDir; for (int z = 0; z < dirs.Length - 1; z++) { tempDir = Path.Combine(tempDir, dirs[z]); Directory.CreateDirectory(tempDir); } resourceXML.WriteElementString("File", fileName); }
public void ReadSoundEntry(ResourceEntry entry, XmlWriter resourceXML, string name, string soundDir) { //Do resource first.. SoundResource resource = new SoundResource(); resource.Deserialize(entry.Version, new MemoryStream(entry.Data), Endian.Little); entry.Data = resource.Data; string fileName = name + ".fsb"; string[] dirs = name.Split('/'); string sounddir = soundDir; for (int z = 0; z != dirs.Length - 1; z++) { sounddir += "/" + dirs[z]; Directory.CreateDirectory(sounddir); } resourceXML.WriteElementString("File", fileName); }