コード例 #1
0
        private void InnerUpdate()
        {
            EffectStateRatioSet set = Sets.Values[BinaryFinder.FindNearest(Sets.Keys, ref currentFrame)];

            CurrentState = set.StartState.GetMixedState(set.GetRatios(CurrentFrame), set.EndState);
            Parallel.ForEach(Effects, new ParallelOptions {
                MaxDegreeOfParallelism = Environment.ProcessorCount
            }, effect =>
            {
                if (effect.Effects.Count == 0)
                {
                    effect.Update(currentFrame, CurrentState);
                }
                else
                {
                    effect.Update(currentFrame * effect.FPS / FPS, CurrentState);
                }
            });
        }
コード例 #2
0
        private bool InnerUpdate(float parentframe, EffectStateStructure parentState)
        {
            currentframe = parentframe - StartFrame;
            if (currentframe > FrameLength || currentframe < 0)
            {
                return(false);
            }
            EffectStateRatioSet set = Sets.Values[BinaryFinder.FindNearest(Sets.Keys, ref parentframe)];

            CurrentState = set.StartState.GetMixedState(set.GetRatios(parentframe), set.EndState);
            if (set.IsBezierPosition)
            {
                var bratio = set.GetRatio(RatioType.BezierPosition, parentframe);
                set.BAnalyzer.GetPoint(BezierCaliculator.BezierAnalyzer.MaxRatio * (1 - bratio), out PointF outp, out PointF outdir);
                CurrentState.X = outp.X;
                CurrentState.Y = outp.Y;
            }
            CurrentState.Compose(parentState);
            return(true);
        }