Пример #1
0
            public static BoneHeader Read(BinaryReader aReader)
            {
                var bones = new BoneHeader();

                bones.ReadBase(aReader);


                bones.GoToEnd(aReader);
                return(bones);
            }
Пример #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);
            }