예제 #1
0
        public static string GetXml(YddFile ydd, string outputFolder = "")
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine(XmlHeader);

            if (ydd?.DrawableDict != null)
            {
                DrawableDictionary.WriteXmlNode(ydd.DrawableDict, sb, 0, outputFolder);
            }

            return(sb.ToString());
        }
예제 #2
0
        public static YddFile GetYdd(XmlDocument doc, string inputFolder = "")
        {
            YddFile r = new YddFile();

            var ddsfolder = inputFolder;

            var node = doc.DocumentElement;

            if (node != null)
            {
                r.DrawableDict = DrawableDictionary.ReadXmlNode(node, ddsfolder);
            }

            r.Name = Path.GetFileName(inputFolder);

            return(r);
        }
예제 #3
0
        /// <summary>
        /// Reads the data-block from a stream.
        /// </summary>
        public override void Read(ResourceDataReader reader, params object[] parameters)
        {
            base.Read(reader, parameters);

            // read structure data
            this.NamePointer = reader.ReadUInt64();
            this.Unknown_18h = reader.ReadUInt32();
            this.Unknown_1Ch = reader.ReadUInt32();
            this.TextureDictionaryPointer = reader.ReadUInt64();
            this.Unknown_28h = reader.ReadUInt32();
            this.Unknown_2Ch = reader.ReadUInt32();
            this.DrawableDictionaryPointer     = reader.ReadUInt64();
            this.ParticleRuleDictionaryPointer = reader.ReadUInt64();
            this.Unknown_40h = reader.ReadUInt32();
            this.Unknown_44h = reader.ReadUInt32();
            this.EmitterRuleDictionaryPointer = reader.ReadUInt64();
            this.EffectRuleDictionaryPointer  = reader.ReadUInt64();
            this.Unknown_58h = reader.ReadUInt32();
            this.Unknown_5Ch = reader.ReadUInt32();

            // read reference data
            this.Name = reader.ReadBlockAt <string_r>(
                this.NamePointer // offset
                );
            this.TextureDictionary = reader.ReadBlockAt <TextureDictionary>(
                this.TextureDictionaryPointer // offset
                );
            this.DrawableDictionary = reader.ReadBlockAt <DrawableDictionary>(
                this.DrawableDictionaryPointer // offset
                );
            this.ParticleRuleDictionary = reader.ReadBlockAt <ParticleRuleDictionary>(
                this.ParticleRuleDictionaryPointer // offset
                );
            this.EffectRuleDictionary = reader.ReadBlockAt <EffectRuleDictionary>(
                this.EmitterRuleDictionaryPointer // offset
                );
            this.EmitterRuleDictionary = reader.ReadBlockAt <EmitterRuleDictionary>(
                this.EffectRuleDictionaryPointer // offset
                );
        }