Beispiel #1
0
            public static FooterHeader Read(BinaryReader aReader)
            {
                var footer = new FooterHeader();

                footer.ReadBase(aReader);


                footer.GoToEnd(aReader);
                return(footer);
            }
Beispiel #2
0
            private void ReadFile(BinaryReader aReader)
            {
                string identifier = new string(aReader.ReadChars(4));

                // The first section should be the Info Section Header.
                Trace.Assert(HeaderTag.Info.Equals(identifier));

                var info = Xno.InfoHeader.Read(aReader);

                // Now we read the rest of the sections
                for (var i = 0; i < info.SectionCount; ++i)
                {
                    identifier = new string(aReader.ReadChars(4));

                    switch (identifier)
                    {
                    case HeaderTag.Texture: TextureHeader.Read(aReader, info); break;

                    case HeaderTag.Effect: EffectHeader.Read(aReader); break;

                    case HeaderTag.Bones: BoneHeader.Read(aReader); break;

                    case HeaderTag.Object: ObjectHeader.Read(aReader, info); break;

                    case HeaderTag.Motion: MotionHeader.Read(aReader); break;
                    }
                }

                identifier = new string(aReader.ReadChars(4));
                Trace.Assert(HeaderTag.Offset.Equals(identifier));
                var offsetHeader = OffsetHeader.Read(aReader);

                identifier = new string(aReader.ReadChars(4));
                Trace.Assert(HeaderTag.Footer.Equals(identifier));
                var footerHeader = FooterHeader.Read(aReader);

                identifier = new string(aReader.ReadChars(4));
                Trace.Assert(HeaderTag.End.Equals(identifier));
                var endHeader = EndHeader.Read(aReader);
            }