Created
August 27, 2014 01:47
-
-
Save lunasorcery/72e8a6d0d6ef3beb5151 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
using System.IO; | |
using System.Reflection; | |
namespace MipCreator | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Assembly assembly = Assembly.GetExecutingAssembly(); | |
Console.WriteLine( | |
"{0} v{1}", | |
assembly.GetName().Name, | |
AssemblyName.GetAssemblyName(assembly.Location).Version.ToString() | |
); | |
foreach (string path in args) | |
{ | |
Console.WriteLine(path); | |
Convert(path); | |
} | |
} | |
static void Convert(string p_filePath) | |
{ | |
FileInfo fi = new FileInfo(p_filePath); | |
LibLR2.Texture.CreateFromBitmap( | |
new Bitmap(p_filePath) | |
).SaveAsMip( | |
string.Format( | |
"{0}.mip", | |
fi.FullName.Substring(0, fi.FullName.Length - fi.Extension.Length) | |
) | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment