Exemplo n.º 1
0
        public override void WriteXml(StringBuilder sb, int indent, string ddsfolder)
        {
            base.WriteXml(sb, indent, ddsfolder);
            YtdXml.ValueTag(sb, indent, "Width", Width.ToString());
            YtdXml.ValueTag(sb, indent, "Height", Height.ToString());
            YtdXml.ValueTag(sb, indent, "MipLevels", Levels.ToString());
            YtdXml.StringTag(sb, indent, "Format", Format.ToString());
            YtdXml.StringTag(sb, indent, "Usage", Usage.ToString());
            YtdXml.StringTag(sb, indent, "UsageFlags", UsageFlags.ToString());
            YtdXml.ValueTag(sb, indent, "ExtraFlags", ExtraFlags.ToString());
            YtdXml.StringTag(sb, indent, "FileName", YtdXml.XmlEscape((Name ?? "null") + ".dds"));

            try
            {
                if (!string.IsNullOrEmpty(ddsfolder))
                {
                    if (!Directory.Exists(ddsfolder))
                    {
                        Directory.CreateDirectory(ddsfolder);
                    }
                    var filepath = Path.Combine(ddsfolder, (Name ?? "null") + ".dds");
                    var dds      = DDSIO.GetDDSFile(this);
                    File.WriteAllBytes(filepath, dds);
                }
            }
            catch { }
        }
Exemplo n.º 2
0
 public virtual void WriteXml(StringBuilder sb, int indent, string ddsfolder)
 {
     YtdXml.StringTag(sb, indent, "Name", YtdXml.XmlEscape(Name));
     YtdXml.ValueTag(sb, indent, "Unk32", Unknown_32h.ToString());
     YtdXml.StringTag(sb, indent, "Usage", Usage.ToString());
     YtdXml.StringTag(sb, indent, "UsageFlags", UsageFlags.ToString());
     YtdXml.ValueTag(sb, indent, "ExtraFlags", ExtraFlags.ToString());
 }
Exemplo n.º 3
0
 public void WriteXml(StringBuilder sb, int indent, string ddsfolder)
 {
     if (Textures?.data_items != null)
     {
         foreach (var tex in Textures.data_items)
         {
             YtdXml.OpenTag(sb, indent, "Item");
             tex.WriteXml(sb, indent + 1, ddsfolder);
             YtdXml.CloseTag(sb, indent, "Item");
         }
     }
 }
Exemplo n.º 4
0
 public static void WriteXmlNode(TextureDictionary d, StringBuilder sb, int indent, string ddsfolder, string name = "TextureDictionary")
 {
     if (d == null)
     {
         return;
     }
     if ((d.Textures?.data_items == null) || (d.Textures.data_items.Length == 0))
     {
         YtdXml.SelfClosingTag(sb, indent, name);
     }
     else
     {
         YtdXml.OpenTag(sb, indent, name);
         d.WriteXml(sb, indent + 1, ddsfolder);
         YtdXml.CloseTag(sb, indent, name);
     }
 }