Esempio n. 1
0
        public ScmlReader(string scmlpath)
        {
            scml = new XmlDocument();
            try
            {
                scml.Load(scmlpath);
            }
            catch (ArgumentNullException e)
            {
                Logger.Fatal($"You must specify a path to load the SCML from. Original exception is as follows:");
                ExceptionDispatchInfo.Capture(e).Throw();
            }
            // Due to scml conventions, our input directory is the same as the scml file's
            var inputDir = Path.Join(scmlpath, "../");

            inputSprites = new Dictionary <Filename, Bitmap>();
            foreach (var filepath in Directory.GetFiles(inputDir, "*.png", SearchOption.TopDirectoryOnly))
            {
                inputSprites[Filename.FromPath(filepath)] = new Bitmap(filepath);
            }
        }
Esempio n. 2
0
 public static SpriteName FromFilename(Filename filename)
 {
     return(filename.ToSpriteName());
 }