Ejemplo n.º 1
0
        public MDXAnimationSequence(byte[] data)
        {
            using (MemoryStream ms = new MemoryStream(data))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    if (data.Length != 68)
                    {
                        throw new ArgumentException("Animation block data was too long or too short.");
                    }

                    this.AnimationID            = br.ReadUInt32();
                    this.StartTimestamp         = br.ReadUInt32();
                    this.EndTimestamp           = br.ReadUInt32();
                    this.MovementSpeed          = br.ReadSingle();
                    this.Flags                  = (MDXAnimationSequenceFlags)br.ReadUInt32();
                    this.Probability            = br.ReadInt16();
                    this.Padding                = br.ReadUInt16();
                    this.MinimumRepetitions     = br.ReadUInt32();
                    this.MaximumRepetitions     = br.ReadUInt32();
                    this.BlendTime              = br.ReadUInt32();
                    this.BoundingBox            = br.ReadBox();
                    this.BoundingSphereRadius   = br.ReadSingle();
                    this.NextAnimationID        = br.ReadInt16();
                    this.NextAliasedAnimationID = br.ReadUInt16();
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Deserializes an <see cref="MDXAnimationSequence"/> from a given data stream.
        /// </summary>
        /// <param name="br"></param>
        /// <param name="version"></param>
        public MDXAnimationSequence(BinaryReader br, WarcraftVersion version)
        {
            AnimationID = br.ReadUInt32();

            if (version <= WarcraftVersion.BurningCrusade)
            {
                StartTimestamp = br.ReadUInt32();
                EndTimestamp   = br.ReadUInt32();
            }
            else
            {
                Duration = br.ReadUInt32();
            }

            MovementSpeed = br.ReadSingle();
            Flags         = (MDXAnimationSequenceFlags)br.ReadUInt32();
            Probability   = br.ReadInt16();
            Padding       = br.ReadUInt16();
            ReplayRange   = br.ReadIntegerRange();

            BlendTime              = br.ReadUInt32();
            BoundingBox            = br.ReadBox();
            BoundingSphereRadius   = br.ReadSingle();
            NextVariation          = br.ReadInt16();
            NextAliasedAnimationID = br.ReadUInt16();
        }
Ejemplo n.º 3
0
        public MDXAnimationSequence(byte[] data)
        {
            using (MemoryStream ms = new MemoryStream(data))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    if (data.Length != 68)
                    {
                        throw new ArgumentException("Animation block data was too long or too short.");
                    }

                    this.AnimationID = br.ReadUInt32();
                    this.StartTimestamp = br.ReadUInt32();
                    this.EndTimestamp = br.ReadUInt32();
                    this.MovementSpeed = br.ReadSingle();
                    this.Flags = (MDXAnimationSequenceFlags)br.ReadUInt32();
                    this.Probability = br.ReadInt16();
                    this.Padding = br.ReadUInt16();
                    this.MinimumRepetitions = br.ReadUInt32();
                    this.MaximumRepetitions = br.ReadUInt32();
                    this.BlendTime = br.ReadUInt32();
                    this.BoundingBox = br.ReadBox();
                    this.BoundingSphereRadius = br.ReadSingle();
                    this.NextAnimationID = br.ReadInt16();
                    this.NextAliasedAnimationID = br.ReadUInt16();
                }
            }
        }