예제 #1
0
        public void GameUpdate()
        {
            GameUpdateHandleInput();
            var updates = Track.Scheduler.UnqueueUpdates();

            if (updates > 0)
            {
                Invalidate();
                if (Track.Playing)
                {
                    if (InputUtils.Check(Hotkey.PlaybackZoom))
                    {
                        Track.ZoomBy(0.08f);
                    }
                    else if (InputUtils.Check(Hotkey.PlaybackUnzoom))
                    {
                        Track.ZoomBy(-0.08f);
                    }
                }
            }
            if (_autosavewatch.Elapsed.TotalMinutes >= 5)
            {
                _autosavewatch.Restart();
                new Thread(() => { Track.BackupTrack(false); }).Start();
            }


            if (Track.Playing)
            {
                if (ReversePlayback)
                {
                    for (int i = 0; i < updates; i++)
                    {
                        Track.PreviousFrame();
                        Track.UpdateCamera(true);
                    }
                }
                else
                {
                    Track.Update(updates);
                }
            }
            AudioService.EnsureSync();
            if (Program.NewVersion != null)
            {
                Canvas.ShowOutOfDate();
            }
        }
        public void GameUpdate()
        {
            GameUpdateHandleInput();
            var updates = Scheduler.UnqueueUpdates();

            if (updates > 0)
            {
                Invalidate();
                if (Track.Playing)
                {
                    if (InputUtils.Check(Hotkey.PlaybackZoom))
                    {
                        Zoom(0.08f);
                    }
                    else if (InputUtils.Check(Hotkey.PlaybackUnzoom))
                    {
                        Zoom(-0.08f);
                    }
                }
            }
            var qp = (!Track.PlaybackMode) ? InputUtils.Check(Hotkey.EditorQuickPan) : false;

            if (qp != _handToolOverride)
            {
                _handToolOverride = qp;
                if (_handToolOverride == false)
                {
                    HandTool.Stop();
                }
                Invalidate();
                UpdateCursor();
            }
            if (_autosavewatch.Elapsed.TotalMinutes >= 5)
            {
                _autosavewatch.Restart();
                new Thread(() => { Track.BackupTrack(false); }).Start();
            }
            if (Canvas.GetOpenWindows().Count != 0)
            {
                Invalidate();
            }


            if (Track.Playing)
            {
                if (ReversePlayback)
                {
                    Track.ActiveTriggers.Clear();//we don't want wonky unpredictable behavior
                    for (int i = 0; i < updates; i++)
                    {
                        Track.PreviousFrame();
                        Track.UpdateCamera(true);
                    }
                }
                else
                {
                    Track.Update(updates);
                }
            }
            AudioService.EnsureSync();
            if (Program.NewVersion != null)
            {
                Canvas.ShowOutOfDate();
            }
        }