public EGMFile(FileStream stream) { BinaryReader reader = new BinaryReader(stream); reader.ReadBytes(5); byte[] bytes = new byte[2]; bytes[0] = reader.ReadByte(); StringBuilder bld = new StringBuilder(); bld.Append(BitConverter.ToChar(bytes, 0)); bytes[0] = reader.ReadByte(); bld.Append(BitConverter.ToChar(bytes, 0)); bytes[0] = reader.ReadByte(); bld.Append(BitConverter.ToChar(bytes, 0)); this.version = bld.ToString(); this.verticeCount = reader.ReadInt32(); this.symSize = reader.ReadInt32(); this.asymSize = reader.ReadInt32(); this.dateStamp = reader.ReadUInt32(); this.unknown = new int[10]; for (int i = 0; i < 10; i++) { this.unknown[i] = reader.ReadInt32(); } this.symMorphs = new List <EGMMorphset>(); for (int i = 0; i < this.symSize; i++) { EGMMorphset morph = new EGMMorphset(); morph.Unknown = reader.ReadBytes(4); for (int j = 0; j < this.verticeCount; j++) { VertexDisplacement data = new VertexDisplacement(reader); morph.Add(data); } this.symMorphs.Add(morph); } this.asymMorphs = new List <EGMMorphset>(); for (int i = 0; i < this.asymSize; i++) { EGMMorphset morph = new EGMMorphset(); morph.Unknown = reader.ReadBytes(4); for (int j = 0; j < this.verticeCount; j++) { VertexDisplacement data = new VertexDisplacement(reader); morph.Add(data); } this.asymMorphs.Add(morph); } }
public EGMMorphset(EGMMorphset morph) : base() { this.unknown = new byte[4]; for (int i = 0; i < 4; i++) this.unknown[i] = morph.unknown[i]; foreach (VertexDisplacement data in morph) { this.Add(data); } }