Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding priority importing to GetArt.NET.
  • Loading branch information
MainMemory committed Apr 23, 2015
1 parent 4cab524 commit ab1885c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions GetArt.NET/Program.cs
Expand Up @@ -85,7 +85,18 @@ static void Main(string[] args)
LevelData.BmpPal.Entries[i] = Color.Transparent;
int w = img.Width;
int h = img.Height;
int pal = 0;
bool[,] priority = new bool[w / 8, h / 8];
bmpfile = null;
foreach (string extension in filetypes)
if (File.Exists("Priority." + extension))
{
bmpfile = "Priority." + extension;
break;
}
if (bmpfile != null)
using (Bitmap pribmp = new Bitmap(bmpfile))
LevelData.GetPriMap(pribmp, priority);
int pal = 0;
bool match = false;
List<BitmapBits> tiles = new List<BitmapBits>();
using (FileStream art = File.Create("Art.bin"))
Expand All @@ -96,7 +107,7 @@ static void Main(string[] args)
for (int y = 0; y < h / 8; y++)
for (int x = 0; x < w / 8; x++)
{
map = new PatternIndex();
map = new PatternIndex() { Priority = priority[x, y] };
tile = LevelData.BmpToTile(img.Clone(new Rectangle(x * 8, y * 8, 8, 8), img.PixelFormat), out pal);
map.Palette = (byte)pal;
BitmapBits bits = BitmapBits.FromTile(tile, 0);
Expand Down

0 comments on commit ab1885c

Please sign in to comment.