Esempio n. 1
0
        private void Build()
        {
            var buffer = File.GetData();

            var offset = 0;
            Header = buffer.ToStructure<HeaderData>(ref offset);
            if (Header.Magic != 0x20706170)
                throw new System.IO.InvalidDataException();

            Animations = new PapAnimation[Header.AnimationCount];
            for (var i = 0; i < Header.AnimationCount; ++i)
                Animations[i] = new PapAnimation(this, buffer, ref offset);

            HavokData = new byte[Header.ParametersOffset - Header.HavokDataOffset];
            Array.Copy(buffer, Header.HavokDataOffset, HavokData, 0, HavokData.Length);

            Parameters = new byte[buffer.Length - Header.ParametersOffset];
            Array.Copy(buffer, Header.ParametersOffset, Parameters, 0, Parameters.Length);
        }
Esempio n. 2
0
        private void Build()
        {
            var buffer = File.GetData();

            var offset = 0;

            Header = buffer.ToStructure <HeaderData>(ref offset);
            if (Header.Magic != 0x20706170)
            {
                throw new System.IO.InvalidDataException();
            }

            Animations = new PapAnimation[Header.AnimationCount];
            for (var i = 0; i < Header.AnimationCount; ++i)
            {
                Animations[i] = new PapAnimation(this, buffer, ref offset);
            }

            HavokData = new byte[Header.ParametersOffset - Header.HavokDataOffset];
            Array.Copy(buffer, Header.HavokDataOffset, HavokData, 0, HavokData.Length);

            Parameters = new byte[buffer.Length - Header.ParametersOffset];
            Array.Copy(buffer, Header.ParametersOffset, Parameters, 0, Parameters.Length);
        }