Ejemplo n.º 1
0
        private TextureStack GetTexture(string name, long data, TextureTranslation translation = null, RotateFlipType rot = RotateFlipType.RotateNoneFlipNone)
        {
            string texturePath = null;

            if (texturesJson.ContainsKey(name))
            {
                var texture = texturesJson[name];

                if (texture.Subtextures.Count <= data || data < 0)
                {
                    //Console.WriteLine("Index out of bounds during GetTexture for {0}", name);
                    texturePath = texture.Subtextures.First().Path;
                }
                else
                {
                    texturePath = texture.Subtextures[(int)data].Path;
                }
            }

            if (texturePath == null)
            {
                return(null);
            }
            return(new TextureStack(texturePath, translation, rot));
        }
Ejemplo n.º 2
0
 public TextureStack(string filename, TextureTranslation translation, RotateFlipType rotation)
 {
     Infos.Add(new TextureInfo(filename, translation, rotation));
 }
Ejemplo n.º 3
0
 public TextureInfo(string filename, TextureTranslation translation, RotateFlipType rotation)
 {
     Filename    = filename;
     Translation = translation;
     Rotation    = rotation;
 }