Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-polyakov committed Oct 10, 2016
1 parent ef88d39 commit 638f108
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ArcanumTextureSlicer.exe bmp-file output-folder
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
16 changes: 13 additions & 3 deletions ArcanumTextureSlicer/ArcanumTextureSlicer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ public static void Main(string[] args)
{
try
{
Console.WriteLine($"Save tile #{j},{i}.");
outputBitmap.Save($"{outputFolder.TrimEnd('/', '\\')}\\tile_{j}_{i}.bmp",
ImageFormat.Bmp);
var tilePath =
$"{outputFolder.TrimEnd('/', '\\')}\\tile_{LeadingZero(j)}_{LeadingZero(i)}.bmp";
Console.WriteLine(tilePath);
outputBitmap.Save(tilePath, ImageFormat.Bmp);
}
catch (Exception e)
{
Expand All @@ -57,5 +58,14 @@ public static void Main(string[] args)
Console.WriteLine(e);
}
}

private static string LeadingZero(int i)
{
return i < 100
? i < 10
? $"00{i}"
: $"0{i}"
: $"{i}";
}
}
}

0 comments on commit 638f108

Please sign in to comment.