Пример #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="res"></param>
        public void Resize(ResolutionState res)
        {
            ResolutionCurrent = res;

            int width  = 16 * (int)res;
            int height = 9 * (int)res;

            graphics.PreferredBackBufferWidth  = width;
            graphics.PreferredBackBufferHeight = height;
            Window.Position = new Point(GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width / 2 - width / 2,
                                        GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height / 2 - height / 2);
            graphics.ApplyChanges();

            if (!ServiceLocator.Instance.IsInitialized)
            {
                ServiceLocator.Instance.Initialize(this.Content,
                                                   this.GraphicsDevice,
                                                   graphics.PreferredBackBufferWidth,
                                                   graphics.PreferredBackBufferHeight);
            }
            else
            {
                ServiceLocator.Instance.Resize(res, width, height);
            }

            SManager.UpdateResolution(ResolutionCurrent);
        }
Пример #2
0
        /// <summary>
        /// Update the resolution scale for all inworld entities/lvl/layers
        /// </summary>
        public void UpdateResolution(int width, int height, ResolutionState res)
        {
            switch (CResolution = res)
            {
            case ResolutionState.R1280x720: ResScale = 1; break;

            case ResolutionState.R1600x900: ResScale = 1.25f; break;

            case ResolutionState.R1920x1080: ResScale = 1.5f; break;
            }

            foreach (var entity in Entities)
            {
                entity.ResScale = ResScale * entity.Scale;
            }

            FWidth  = width;
            FHeight = height;
            var frameW = width * 0.5f;
            var frameH = height * 0.5f;

            Services.Camera.Origin   = new Vector2(frameW, frameH);
            Services.Camera.viewport = CoreGame.GraphicsDevice.Viewport;

            LVLManager.UpdateScale(ResScale, new Vector2(frameW, frameH), CoreGame.GraphicsDevice.Viewport);
        }
Пример #3
0
 public override void Resize(ResolutionState res, int width, int height)
 {
     base.Resize(res, width, height);
     WCore.UpdateResolution(width, height, res);
     LLimit      = WCore.FWidth / 2;
     RLimit      = WCore.LevelLimits.Width - WCore.FWidth / 2;
     RLightLimit = WCore.LevelLimits.Width - WCore.FWidth;
 }
Пример #4
0
        public override void Resize(ResolutionState res, int width, int height)
        {
            base.Resize(res, width, height);

            this.FCamRightPos = (int)(FWidth / 1.5);
            this.FCamLeftPos  = FWidth / 2;

            LVLManager.UpdateScale(SScale, new Vector2(width, height), CoreGame.GraphicsDevice.Viewport);
        }
Пример #5
0
        public void UpdateResolution(ResolutionState res)
        {
            this.ResolutionCurrent = res;

            foreach (var screen in Screens)
            {
                if (screen.Value.IsInitialized)
                {
                    screen.Value.Resize(res, GraphDev.Viewport.Width, GraphDev.Viewport.Height);
                }
            }
        }
Пример #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="res"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        public virtual void Resize(ResolutionState res, int width, int height)
        {
            switch (ResolutionCurrent = res)
            {
            case ResolutionState.R1280x720: SScale = 1; break;

            case ResolutionState.R1600x900: SScale = 1.25f; break;

            case ResolutionState.R1920x1080: SScale = 1.5f; break;
            }

            this.FWidth  = width;
            this.FHeight = height;
        }
        private void InitializeResolutionState()
        {
            var state = new ResolutionState
            {
                AnalysisRequestTime = new DateTime(1999, 12, 30, 7, 0, 0),
                AlertPredicates     = new Dictionary <string, object>
                {
                    ["Predicate"] = "Predicate value"
                }
            };

            this.stateRepository[$"_autoResolve{this.alertResolutionCheckRequest.AlertCorrelationHash}"] = state;
            this.autoResolveSmartDetector.ShouldResolve = true;
        }
Пример #8
0
        private void SetResolutionState(ResolutionState value)
        {
            if (resolutionState != value)
            {
                if (resolutionState == ResolutionState.ResolutionSuccessful)
                {
                    var currentNode = this.Parent;
                    while (currentNode != null)
                    {
                        currentNode.ResolvedDescendentsCount--;
                        currentNode = currentNode.Parent;
                    }
                }
                else if (resolutionState == ResolutionState.ResolutionFailed)
                {
                    var currentNode = this.Parent;
                    while (currentNode != null)
                    {
                        currentNode.UnresolvedDescendentsCount--;
                        currentNode = currentNode.Parent;
                    }
                }

                if (value == ResolutionState.ResolutionSuccessful)
                {
                    var currentNode = this.Parent;
                    while (currentNode != null)
                    {
                        currentNode.ResolvedDescendentsCount++;
                        currentNode = currentNode.Parent;
                    }
                }
                else if (value == ResolutionState.ResolutionFailed)
                {
                    var currentNode = this.Parent;
                    while (currentNode != null)
                    {
                        currentNode.UnresolvedDescendentsCount++;
                        currentNode = currentNode.Parent;
                    }
                }

                this.resolutionState = value;
                OnPropertyChanged(nameof(ResolutionState));
            }
        }
Пример #9
0
 public void Resize(ResolutionState res, int width, int height)
 {
     Camera.viewport = GraphDev.Viewport;
 }
Пример #10
0
 public void Resize(ResolutionState res)
 {
     Core.Resize(res);
 }