Exemple #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 { }
        }
Exemple #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());
 }