mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-07-18 03:24:15 -04:00
rename
move files improve Sprite read
This commit is contained in:
@ -65,6 +65,19 @@ namespace AssetStudio
|
||||
return new System.Drawing.RectangleF(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
|
||||
}
|
||||
|
||||
public static Matrix ReadMatrix(this BinaryReader reader)
|
||||
{
|
||||
var m = new Matrix();
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
for (int j = 0; j < 4; j++)
|
||||
{
|
||||
m[i, j] = reader.ReadSingle();
|
||||
}
|
||||
}
|
||||
return m;
|
||||
}
|
||||
|
||||
private static T[] ReadArray<T>(Func<T> del, int length)
|
||||
{
|
||||
var array = new T[length];
|
||||
@ -99,5 +112,15 @@ namespace AssetStudio
|
||||
{
|
||||
return ReadArray(reader.ReadVector4, length);
|
||||
}
|
||||
|
||||
public static ushort[] ReadUInt16Array(this BinaryReader reader, int length)
|
||||
{
|
||||
return ReadArray(reader.ReadUInt16, length);
|
||||
}
|
||||
|
||||
public static Matrix[] ReadMatrixArray(this BinaryReader reader, int length)
|
||||
{
|
||||
return ReadArray(reader.ReadMatrix, length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,14 +6,6 @@ namespace AssetStudio
|
||||
{
|
||||
public static class BinaryWriterExtensions
|
||||
{
|
||||
private static void WriteArray<T>(Action<T> del, T[] array)
|
||||
{
|
||||
foreach (var item in array)
|
||||
{
|
||||
del(item);
|
||||
}
|
||||
}
|
||||
|
||||
public static void AlignStream(this BinaryWriter writer, int alignment)
|
||||
{
|
||||
var pos = writer.BaseStream.Position;
|
||||
|
Reference in New Issue
Block a user