public static SR1ObjectModel Load(BinaryReader xReader, UInt32 uDataStart, UInt32 uModelData, String strModelName, Platform ePlatform, UInt16 usIndex, UInt32 uVersion) { xReader.BaseStream.Position = uModelData + (0x00000004 * usIndex); uModelData = uDataStart + xReader.ReadUInt32(); xReader.BaseStream.Position = uModelData; SR1ObjectModel xModel = new SR1ObjectModel(xReader, uDataStart, uModelData, strModelName, ePlatform, uVersion); xModel.ReadData(xReader); return(xModel); }
public static SR1ObjectModel Load(BinaryReader xReader, UInt32 uDataStart, UInt32 uModelData, String strModelName, Platform ePlatform, UInt16 usIndex, UInt32 uVersion, CDC.Objects.ExportOptions options) { long newPosition = uModelData + (0x00000004 * usIndex); if ((newPosition < 0) || (newPosition > xReader.BaseStream.Length)) { Console.WriteLine(string.Format("Error: attempt to read a model with usIndex {0} from a stream with length {1}", usIndex, xReader.BaseStream.Length)); return(null); } xReader.BaseStream.Position = newPosition; uModelData = uDataStart + xReader.ReadUInt32(); xReader.BaseStream.Position = uModelData; SR1ObjectModel xModel = new SR1ObjectModel(xReader, uDataStart, uModelData, strModelName, ePlatform, uVersion); xModel.ReadData(xReader, options); return(xModel); }