An advanced sprite packing tool. Currently a work in progress.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
885B

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Windows.Markup;
  4. using System.IO;
  5. namespace SpritePacker
  6. {
  7. class Program
  8. {
  9. public static void Main(string[] args)
  10. {
  11. List<string> values = new List<string>();
  12. for(int i = 0; i < args.Length; i++)
  13. {
  14. switch(args[i])
  15. {
  16. case "--help":
  17. Console.WriteLine("Help text coming soon!");
  18. return;
  19. case "--version":
  20. Console.WriteLine("Version text coming soon!");
  21. return;
  22. default:
  23. values.Add(args[i]);
  24. break;
  25. }
  26. }
  27. Packer spritePacker = new Packer();
  28. foreach(string filename in values)
  29. {
  30. if (File.Exists(filename))
  31. spritePacker.Add(new Sprite(filename));
  32. else
  33. Console.Error.WriteLine("Warning: Ignoring non-existent file '{0}'.", filename);
  34. }
  35. spritePacker.Arrange();
  36. Console.WriteLine(spritePacker.ToString());
  37. }
  38. }
  39. }