コード例 #1
0
        internal static CameraAnimation Parse(BinaryReader reader)
        {
            var result = new CameraAnimation();

            result.AnimationType = reader.ReadFourCc(bigEndian: true);
            if (result.AnimationType != "free" && result.AnimationType != "look")
            {
                throw new InvalidDataException();
            }

            result.Name        = reader.ReadUInt16PrefixedAsciiString();
            result.NumFrames   = reader.ReadUInt32();
            result.StartOffset = reader.ReadUInt32();

            switch (result.AnimationType)
            {
            case "free":
                result.FrameData = FreeCameraAnimationFrameData.Parse(reader);
                break;

            case "look":
                result.FrameData = LookAtCameraAnimationFrameData.Parse(reader);
                break;

            default:
                throw new InvalidDataException();
            }

            return(result);
        }
コード例 #2
0
        internal static FreeCameraAnimationFrameData Parse(BinaryReader reader)
        {
            var result = new FreeCameraAnimationFrameData();

            var numCameraFrames = reader.ReadUInt32();

            result.Frames = new FreeCameraAnimationCameraFrame[numCameraFrames];
            for (var i = 0; i < numCameraFrames; i++)
            {
                result.Frames[i] = FreeCameraAnimationCameraFrame.Parse(reader);
            }

            return(result);
        }