private void parseTexture(BAR_Editor.BAR.BARFile file, int barPos) { using (BinaryReader br = new BinaryReader(new MemoryStream(file.data, false))) { var v0 = br.ReadInt32(); if (v0 == 0) { this.ParseTIM(br, 0, barPos); } else if (v0 == -1) { v0 = br.ReadInt32(); for (int j = 0; j < v0; j++) { long lPos = br.BaseStream.Position + 4; this.ParseTIM(br, br.ReadInt32(), barPos); br.BaseStream.Position = lPos; } } else { throw new NotSupportedException("Unknown v0: " + v0); } } }
public override void parse() { if (this.bmps.Count != 0) { foreach (Bitmap bmp in this.bmps) { bmp.Dispose(); } this.bmps.Clear(); } for (int i = 0; i < this.BAR.fileList.Count; ++i) { BAR_Editor.BAR.BARFile f = this.BAR.fileList[i]; if (f.type == 7) { Debug.WriteLine("BAR file \"" + f.id + "\" is textures"); this.parseTexture(f, i); } } }