public byte[] Save() { BinaryTexFile.Textures.Clear(); BinaryTexFile.TextureDict.Clear(); foreach (TextureData tex in Textures.Values) { tex.Texture.Name = tex.Text; BinaryTexFile.Textures.Add(tex.Texture); BinaryTexFile.TextureDict.Add(tex.Text); } MemoryStream mem = new MemoryStream(); BinaryTexFile.Save(mem); return(mem.ToArray()); }
private byte[] CreateNewBNTX(string Name) { MemoryStream mem = new MemoryStream(); BntxFile bntx = new BntxFile(); bntx.Target = new char[] { 'N', 'X', ' ', ' ' }; bntx.Name = Name; bntx.Alignment = 0xC; bntx.TargetAddressSize = 0x40; bntx.VersionMajor = 0; bntx.VersionMajor2 = 4; bntx.VersionMinor = 0; bntx.VersionMinor2 = 0; bntx.Textures = new List <Texture>(); bntx.TextureDict = new ResDict(); bntx.RelocationTable = new RelocationTable(); bntx.Flag = 0; bntx.Save(mem); return(mem.ToArray()); }
private void CreateBNTX(string path, List <Texture> textures) { BntxFile bntx = new BntxFile(); bntx.Target = new char[] { 'N', 'X', ' ', ' ' }; bntx.Name = "textures"; bntx.Alignment = 0xC; bntx.TargetAddressSize = 0x40; bntx.VersionMajor = 0; bntx.VersionMajor2 = 4; bntx.VersionMinor = 0; bntx.VersionMinor2 = 0; bntx.Textures = new List <Texture>(); bntx.TextureDict = new ResDict(); bntx.RelocationTable = new RelocationTable(); bntx.Flag = 0; foreach (var file in textures) { bntx.Textures.Add(file); } bntx.Save(path); }
public void Save(Stream stream) { BntxFile.Save(stream); }