示例#1
0
        public static void SetVector(BinaryDeserializer Deserializer, GfxFloatKeyFrameGroup[] Vector)
        {
            long Position = Deserializer.BaseStream.Position;

            uint Flags = GetFlagsFromElem(Deserializer, Position);

            uint ConstantMask = 1u;
            uint NotExistMask = 1u << Vector.Length;

            for (int Axis = 0; Axis < Vector.Length; Axis++)
            {
                Deserializer.BaseStream.Seek(Position, SeekOrigin.Begin);

                Position += 4;

                bool Constant = (Flags & ConstantMask) != 0;
                bool Exists   = (Flags & NotExistMask) == 0;

                if (Exists)
                {
                    Vector[Axis] = GfxFloatKeyFrameGroup.ReadGroup(Deserializer, Constant);
                }

                ConstantMask <<= 1;
                NotExistMask <<= 1;
            }
        }
示例#2
0
        public static void SetVector(BinaryDeserializer Deserializer, GfxFloatKeyFrameGroup Vector)
        {
            uint Flags = GetFlagsFromElem(Deserializer, Deserializer.BaseStream.Position);

            bool Constant = (Flags & 1) != 0;
            bool Exists   = (Flags & 2) == 0;

            if (Exists)
            {
                Vector = GfxFloatKeyFrameGroup.ReadGroup(Deserializer, Constant);
            }
        }
示例#3
0
        public static GfxFloatKeyFrameGroup SetVector(BinaryDeserializer Deserializer)
        {
            uint Flags = GetFlagsFromElem(Deserializer, Deserializer.BaseStream.Position);

            bool Constant = (Flags & 1) != 0;
            bool Exists   = (Flags & 2) == 0;

            if (Exists)
            {
                return(GfxFloatKeyFrameGroup.ReadGroup(Deserializer, Constant));
            }
            return(null);
        }
示例#4
0
        void ICustomSerialization.Deserialize(BinaryDeserializer Deserializer)
        {
            long Position = Deserializer.BaseStream.Position;

            uint Flags = GfxAnimVector.GetFlagsFromElem(Deserializer, Position);

            uint ConstantMask = (uint)GfxAnimTransformFlags.IsScaleXConstant;
            uint NotExistMask = (uint)GfxAnimTransformFlags.IsScaleXInexistent;

            for (int ElemIndex = 0; ElemIndex < 10; ElemIndex++)
            {
                Deserializer.BaseStream.Seek(Position, SeekOrigin.Begin);

                Position += 4;

                bool Constant = (Flags & ConstantMask) != 0;
                bool Exists   = (Flags & NotExistMask) == 0;

                if (Exists)
                {
                    GfxFloatKeyFrameGroup FrameGrp = GfxFloatKeyFrameGroup.ReadGroup(Deserializer, Constant);

                    switch (ElemIndex)
                    {
                    case 0: _ScaleX = FrameGrp; break;

                    case 1: _ScaleY = FrameGrp; break;

                    case 2: _ScaleZ = FrameGrp; break;

                    case 3: _RotationX = FrameGrp; break;

                    case 4: _RotationY = FrameGrp; break;

                    case 5: _RotationZ = FrameGrp; break;

                    case 7: _TranslationX = FrameGrp; break;

                    case 8: _TranslationY = FrameGrp; break;

                    case 9: _TranslationZ = FrameGrp; break;
                    }
                }

                ConstantMask <<= 1;
                NotExistMask <<= 1;
            }
        }