Ejemplo n.º 1
0
        private static void DrawLayer(ILContext il)
        {
            ILCursor cursor = new ILCursor(il);

            if (cursor.TryGotoNext(i => i.MatchCall <Main>("DrawWoF")))
            {
                cursor.EmitDelegate <Action>(() =>
                {
                    Routed.RoutedLayer.FilterVisible();
                    Routed.RoutedLayer.Visible = Routed.RoutedLayer.Visible.OrderBy(pair => pair.Value.Tier).ToDictionary(pair => pair.Key, pair => pair.Value);

                    SpriteBatchState state = Utility.End(Main.spriteBatch);
                    Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, Utility.DefaultSamplerState, DepthStencilState.Default, RasterizerState.CullCounterClockwise, null, Main.GameViewMatrix.ZoomMatrix);

                    if (Mode == ViewMode.PartiallyVisible)
                    {
                        Routed.RoutedLayer.DrawDucts(Main.spriteBatch);
                        Routed.RoutedLayer.DrawItems(Main.spriteBatch);
                    }

                    Main.spriteBatch.End();
                    Main.spriteBatch.Begin(state);
                });
            }
        }
Ejemplo n.º 2
0
 public static void Draw(SpriteBatchState state)
 {
     if (_scenes.Count > 0)
     {
         _scenes[_scenes.Count - 1].Draw(state);
     }
 }
Ejemplo n.º 3
0
        public void Draw(SpriteBatchState state)
        {
            state.TransformMatrix = Camera.GetViewMatrix();

            state.Begin();

            _draw.Update(state);

            state.End();

            state.TransformMatrix = SceneManager.ViewportAdapter.GetScaleMatrix();

            state.Begin();

            _gui.Update(state);

            state.End();
        }