Exemple #1
0
        public Layer(BinaryReader br, uint version)
        {
            long end = br.BaseStream.Position + (TotalSize = br.ReadUInt32());

            BlendMode          = (MDLTEXOP)br.ReadInt32();
            Flags              = (MDLGEO)br.ReadUInt32();
            TextureId          = br.ReadUInt32();
            TextureAnimationId = br.ReadInt32();
            CoordId            = br.ReadInt32();
            Alpha              = br.ReadSingle();

            // this is new but the client doesn't actually check the version!
            // sub_7FF6830300A0
            if (br.BaseStream.Position < end && version >= 900)
            {
                EmissiveGain = br.ReadSingle();
            }

            while (br.BaseStream.Position < end && !br.AtEnd())
            {
                string tagname = br.ReadCString(4);
                switch (tagname)
                {
                case "KMTA": AlphaKeys = new Track <float>(br); break;

                case "KMTF": FlipKeys = new Track <int>(br); break;

                case "KMTE": EmissiveGainKeys = new Track <float>(br); break;

                default:
                    br.BaseStream.Position -= 4;
                    return;
                }
            }
        }
Exemple #2
0
        public Layer(BinaryReader br, int priorityplane)
        {
            PriorityPlane = priorityplane;

            TotalSize = br.ReadUInt32();
            long end = br.BaseStream.Position + TotalSize;

            BlendMode          = (MDLTEXOP)br.ReadInt32();
            Flags              = (MDLGEO)br.ReadUInt32();
            TextureId          = br.ReadUInt32();
            TextureAnimationId = br.ReadInt32();
            CoordId            = br.ReadUInt32();
            Alpha              = br.ReadSingle();

            while (br.BaseStream.Position < end && !br.AtEnd())
            {
                string tagname = br.ReadString(4);
                switch (tagname)
                {
                case "KMTA": AlphaKeys = new Track <float>(br); break;

                case "KMTF": FlipKeys = new SimpleTrack(br, true); break;

                default:
                    br.BaseStream.Position -= 4;
                    return;
                }
            }
        }