/// <summary> /// Reads Quaternion16 from given MPQFileStream. /// </summary> /// <param name="stream">The MPQFileStream to read from.</param> public Quaternion16(MpqFileStream stream) { this.Short0 = stream.ReadValueS16(); this.Short1 = stream.ReadValueS16(); this.Short2 = stream.ReadValueS16(); this.Short3 = stream.ReadValueS16(); }
public void Read(MpqFileStream stream) { this.Min = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); this.Max = new Vector3D(stream.ReadValueF32(), stream.ReadValueF32(), stream.ReadValueF32()); this.Flags = (NavCellFlags)stream.ReadValueS16(); this.NeighbourCount = stream.ReadValueS16(); this.NeighborsIndex = stream.ReadValueS32(); }
public void Read(MpqFileStream stream) { I0 = stream.ReadValueS32(); I1 = stream.ReadValueS16(); I2 = stream.ReadValueS16(); B1 = stream.ReadValueS8(); B2 = stream.ReadValueS8(); stream.Position += 2; }
/// <summary> /// Reads all available serialized shorts. /// </summary> /// <param name="stream">The MPQFileStream to read from.</param> /// <returns>The list of read shorts.</returns> public static List <short> ReadSerializedShorts(this MpqFileStream stream) { int offset = stream.ReadValueS32(); // ofset for serialized data. int size = stream.ReadValueS32(); // size of serialized data. var items = new List <short>(); // read-items if any. if (size <= 0) { return(items); } var oldPos = stream.Position; stream.Position = offset + 16; // offset is relative to actual sno data start, so add that 16 bytes file header to get actual position. /raist while (stream.Position < offset + size + 16) { items.Add(stream.ReadValueS16()); } stream.Position = oldPos; return(items); }
public void Read(MpqFileStream stream) { W0 = stream.ReadValueS16(); W1 = stream.ReadValueS16(); }
public void Read(MpqFileStream stream) { Flags = stream.ReadValueS16(); W1 = stream.ReadValueS16(); W2 = stream.ReadValueS16(); }
public void Read(MpqFileStream stream) { this.Flags = stream.ReadValueS16(); this.WCell = stream.ReadValueS16(); }