PreDraw() public method

public PreDraw ( Microsoft.Xna.Framework.Graphics.GraphicsDevice gd, FSO.LotView.WorldState state ) : void
gd Microsoft.Xna.Framework.Graphics.GraphicsDevice
state FSO.LotView.WorldState
return void
示例#1
0
        /// <summary>
        /// Pre-Draw
        /// </summary>
        /// <param name="device"></param>
        public override void PreDraw(GraphicsDevice device)
        {
            base.PreDraw(device);
            if (HasInit == false)
            {
                return;
            }

            //For all the tiles in the dirty list, re-render them
            State._2D.Begin(this.State.Camera);
            _2DWorld.PreDraw(device, State);
            State._2D.End();

            State._3D.Begin(device);
            _3DWorld.PreDraw(device, State);
            State._3D.End();
        }
示例#2
0
        /// <summary>
        /// Pre-Draw
        /// </summary>
        /// <param name="device"></param>
        public override void PreDraw(GraphicsDevice device)
        {
            base.PreDraw(device);
            if (HasInit == false)
            {
                return;
            }
            BoundView();
            State._2D.PreciseZoom = State.PreciseZoom;
            State.OutsideColor    = Blueprint.OutsideColor;
            FSO.Common.Rendering.Framework.GameScreen.ClearColor = new Color(new Color(0x72, 0x72, 0x72).ToVector4() * State.OutsideColor.ToVector4());
            foreach (var sub in Blueprint.SubWorlds)
            {
                sub.PreDraw(device, State);
            }
            State.UpdateInterpolation();
            if (Blueprint != null)
            {
                foreach (var ent in Blueprint.Objects)
                {
                    ent.Update(null, State);
                }
            }

            //For all the tiles in the dirty list, re-render them
            //PPXDepthEngine.SetPPXTarget(null, null, true);
            State.PrepareLighting();
            State._2D.Begin(this.State.Camera);
            _2DWorld.PreDraw(device, State);
            device.SetRenderTarget(null);
            State._2D.End();

            State._3D.Begin(device);
            _3DWorld.PreDraw(device, State);
            State._3D.End();

            if (UseBackbuffer)
            {
                PPXDepthEngine.SetPPXTarget(null, null, true);
                InternalDraw(device);
                device.SetRenderTarget(null);
            }

            return;
        }
示例#3
0
        /// <summary>
        /// Pre-Draw
        /// </summary>
        /// <param name="device"></param>
        public override void PreDraw(GraphicsDevice device)
        {
            base.PreDraw(device);
            if (HasInit == false)
            {
                return;
            }

            if (Blueprint != null)
            {
                foreach (var ent in Blueprint.Objects)
                {
                    ent.Update(null, State);
                }
            }

            //For all the tiles in the dirty list, re-render them
            //PPXDepthEngine.SetPPXTarget(null, null, true);
            State._2D.Begin(this.State.Camera);
            _2DWorld.PreDraw(device, State);
            device.SetRenderTarget(null);
            State._2D.End();

            State._3D.Begin(device);
            _3DWorld.PreDraw(device, State);
            State._3D.End();

            if (FSOEnvironment.SoftwareDepth)
            {
                PPXDepthEngine.SetPPXTarget(null, null, true);
                InternalDraw(device);
                device.SetRenderTarget(null);
            }

            return;
        }
示例#4
0
        /// <summary>
        /// Pre-Draw
        /// </summary>
        /// <param name="device"></param>
        public override void PreDraw(GraphicsDevice device)
        {
            //bound the scroll so we can't see gray space.
            float boundfactor = 0.5f;

            switch (State.Zoom)
            {
            case WorldZoom.Near:
                boundfactor = 1.20f; break;

            case WorldZoom.Medium:
                boundfactor = 1.05f; break;
            }
            boundfactor *= Blueprint?.Width ?? 64;
            var off  = 0.5f * (Blueprint?.Width ?? 64);
            var tile = State.CenterTile;

            tile = new Vector2(Math.Min(boundfactor + off, Math.Max(off - boundfactor, tile.X)), Math.Min(boundfactor + off, Math.Max(off - boundfactor, tile.Y)));
            if (tile != State.CenterTile)
            {
                State.CenterTile = tile;
            }

            base.PreDraw(device);
            if (HasInit == false)
            {
                return;
            }
            State._2D.PreciseZoom = State.PreciseZoom;
            State.OutsideColor    = Blueprint.OutsideColor;
            foreach (var sub in Blueprint.SubWorlds)
            {
                sub.PreDraw(device, State);
            }
            if (Blueprint != null)
            {
                foreach (var ent in Blueprint.Objects)
                {
                    ent.Update(null, State);
                }
            }

            //For all the tiles in the dirty list, re-render them
            //PPXDepthEngine.SetPPXTarget(null, null, true);
            State.PrepareLighting();
            State._2D.Begin(this.State.Camera);
            _2DWorld.PreDraw(device, State);
            device.SetRenderTarget(null);
            State._2D.End();

            State._3D.Begin(device);
            _3DWorld.PreDraw(device, State);
            State._3D.End();

            if (UseBackbuffer)
            {
                PPXDepthEngine.SetPPXTarget(null, null, true);
                InternalDraw(device);
                device.SetRenderTarget(null);
            }

            return;
        }