Skip to content

Commit

Permalink
Make it better
Browse files Browse the repository at this point in the history
  • Loading branch information
simontime authored Oct 16, 2018
1 parent 5421d1b commit c99cbcf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Program.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Text;

Expand All @@ -13,6 +13,8 @@ internal struct FileInfo
internal int Size;
internal int TexWidth;
internal int TexHeight;
internal bool HasAlpha;
internal byte[] Padding;
}

private static string TrimB(byte[] In)
Expand Down Expand Up @@ -42,16 +44,17 @@ private static void Main(string[] args)
Offset = Rd.ReadInt32(),
Size = Rd.ReadInt32(),
TexWidth = Rd.ReadInt32(),
TexHeight = Rd.ReadInt32()
TexHeight = Rd.ReadInt32(),
HasAlpha = Rd.ReadBoolean(),
Padding = Rd.ReadBytes(7)
};

FO.Position += 8;
var CurPos = FO.Position;

var Name = TrimB(Files[i].Filename);
var Resolution = $"{Files[i].TexWidth}x{Files[i].TexHeight}";

Console.WriteLine($"Extracting {Name}.BIN ({Resolution})...");
Console.WriteLine($"Extracting {Name}.BIN\t(Size: {Resolution}) (Alpha: {(Files[i].HasAlpha ? "Yes" : "No")})");

var Out = File.OpenWrite($"GFX/{Name}_{Resolution}.BIN");
var Wrt = new BinaryWriter(Out);
Expand All @@ -71,4 +74,4 @@ private static void Main(string[] args)
FO.Close();
}
}
}
}

0 comments on commit c99cbcf

Please sign in to comment.