Пример #1
0
        public override void RecordFrame(int frame, IController source)
        {
            if (frame != 0)
            {
                ChangeLog.AddGeneralUndo(frame - 1, frame - 1, $"Record Frame: {frame}");
            }

            var lg = LogGeneratorInstance(source);

            SetFrameAt(frame, lg.GenerateLogEntry());

            Changes = true;

            LagLog.RemoveFrom(frame);
            LagLog[frame] = _inputPollable.IsLagFrame;

            if (this.IsRecording())
            {
                TasStateManager.Invalidate(frame + 1);
            }

            if (frame != 0)
            {
                ChangeLog.SetGeneralRedo();
            }
        }
        public override void RecordFrame(int frame, IController source)
        {
            // RetroEdit: This check is questionable; recording at frame 0 is valid and should be reversible.
            // Also, frame - 1, why?
            // Is the precondition compensating for frame - 1 reindexing?
            if (frame != 0)
            {
                ChangeLog.AddGeneralUndo(frame - 1, frame - 1, $"Record Frame: {frame}");
            }

            var lg = LogGeneratorInstance(source);

            SetFrameAt(frame, lg.GenerateLogEntry());

            Changes = true;

            LagLog.RemoveFrom(frame);
            LagLog[frame] = _inputPollable.IsLagFrame;

            if (this.IsRecording())
            {
                TasStateManager.InvalidateAfter(frame);
                GreenzoneInvalidated(frame + 1);
            }

            if (frame != 0)
            {
                ChangeLog.SetGeneralRedo();
            }
        }
Пример #3
0
        // Removes lag log and greenzone after this frame
        private void InvalidateAfter(int frame)
        {
            var anyInvalidated = LagLog.RemoveFrom(frame);

            TasStateManager.Invalidate(frame + 1);
            Changes         = anyInvalidated;
            LastEditedFrame = frame;

            if (anyInvalidated && Global.MovieSession.Movie.IsCountingRerecords)
            {
                Rerecords++;
            }
        }
Пример #4
0
        public override void RecordFrame(int frame, IController source)
        {
            if (frame != 0)
            {
                ChangeLog.AddGeneralUndo(frame, frame, "Record Frame: " + frame);
            }

            base.RecordFrame(frame, source);

            LagLog.RemoveFrom(frame);
            LagLog[frame] = Global.Emulator.AsInputPollable().IsLagFrame;

            if (frame != 0)
            {
                ChangeLog.SetGeneralRedo();
            }
        }
Пример #5
0
        public override void RecordFrame(int frame, IController source)
        {
            if (frame != 0)
            {
                ChangeLog.AddGeneralUndo(frame - 1, frame - 1, $"Record Frame: {frame}");
            }

            base.RecordFrame(frame, source);

            LagLog.RemoveFrom(frame);
            LagLog[frame] = Global.Emulator.AsInputPollable().IsLagFrame;

            if (this.IsRecording())
            {
                TasStateManager.Invalidate(frame + 1);
            }

            if (frame != 0)
            {
                ChangeLog.SetGeneralRedo();
            }
        }
Пример #6
0
        public override void Truncate(int frame)
        {
            bool endBatch = ChangeLog.BeginNewBatch("Truncate Movie: " + frame, true);

            ChangeLog.AddGeneralUndo(frame, InputLogLength - 1);

            if (frame < _log.Count - 1)
            {
                Changes = true;
            }

            base.Truncate(frame);

            LagLog.RemoveFrom(frame);
            StateManager.Invalidate(frame);
            Markers.TruncateAt(frame);

            ChangeLog.SetGeneralRedo();
            if (endBatch)
            {
                ChangeLog.EndBatch();
            }
        }