Skip to content

Instantly share code, notes, and snippets.

@lunasorcery
Created August 27, 2014 01:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunasorcery/72e8a6d0d6ef3beb5151 to your computer and use it in GitHub Desktop.
Save lunasorcery/72e8a6d0d6ef3beb5151 to your computer and use it in GitHub Desktop.
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