Add IntX stream read support.

This commit is contained in:
Jean-Baptiste Perrier
2021-04-08 19:00:25 +02:00
parent 4e86f1c776
commit 8e7ff6f657

View File

@@ -240,6 +240,36 @@ namespace FlaxEngine
return new Vector4(stream.ReadSingle(), stream.ReadSingle(), stream.ReadSingle(), stream.ReadSingle());
}
/// <summary>
/// Reads the Int2 from the binary stream.
/// </summary>
/// <param name="stream">The stream.</param>
/// <returns>The value.</returns>
public static Int2 ReadInt2(this BinaryReader stream)
{
return new Int2(stream.ReadInt32(), stream.ReadInt32());
}
/// <summary>
/// Reads the Int3 from the binary stream.
/// </summary>
/// <param name="stream">The stream.</param>
/// <returns>The value.</returns>
public static Int3 ReadInt3(this BinaryReader stream)
{
return new Int3(stream.ReadInt32(), stream.ReadInt32(), stream.ReadInt32());
}
/// <summary>
/// Reads the Int4 from the binary stream.
/// </summary>
/// <param name="stream">The stream.</param>
/// <returns>The value.</returns>
public static Int4 ReadInt4(this BinaryReader stream)
{
return new Int4(stream.ReadInt32(), stream.ReadInt32(), stream.ReadInt32(), stream.ReadInt32());
}
/// <summary>
/// Reads the Quaternion from the binary stream.
/// </summary>