// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(BfshaFileLoader loader) { ushort codeLength = loader.ReadUInt16(); loader.Seek(6); uint[] codeSizes = loader.LoadCustom(() => loader.ReadUInt32s(codeLength)); ulong[] codeOffsets = loader.LoadCustom(() => loader.ReadUInt64s(codeLength)); loader.Seek(8); //reserved SourceData = new List <byte[]>(); for (int i = 0; i < codeLength; i++) { loader.Seek((long)codeOffsets[i], System.IO.SeekOrigin.Begin); SourceData.Add(loader.ReadBytes((int)codeSizes[i])); } }
// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(BfshaFileLoader loader) { Name = loader.LoadString(); ChoiceDict = loader.LoadDict(); long ChoiceValuesOffset = loader.ReadOffset(); byte choiceCount = loader.ReadByte(); DefaultIndex = loader.ReadByte(); //Index to default choice value BlockOffset = loader.ReadUInt16(); // Uniform block offset. flag = loader.ReadByte(); keyOffset = loader.ReadByte(); //Offset for key table flags0 = loader.ReadByte(); //Flags for choices flags1 = loader.ReadByte(); flags2 = loader.ReadUInt32(); uint padding = loader.ReadUInt32(); Choices = loader.LoadCustom(() => loader.ReadUInt32s(choiceCount), ChoiceValuesOffset); }
// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(BfshaFileLoader loader) { loader.Seek(8); //always empty ulong[] codeOffsets = loader.ReadUInt64s(2); uint[] codeSizes = loader.ReadUInt32s(2); loader.Seek(32); //padding BinaryData = new List <byte[]>(); for (int i = 0; i < 2; i++) //Fixed with 2 binaries { loader.Seek((long)codeOffsets[i], System.IO.SeekOrigin.Begin); if (i == 0) { BinaryData.Add(loader.ReadBytes((int)codeSizes[1])); } else { BinaryData.Add(loader.ReadBytes((int)codeSizes[0])); } } }