Exemplo n.º 1
0
        public static void Render(SpriteBatch batch, Camera camera, Viewport viewport)
        {
            List <DrawCommand2D> extraDraws = new List <DrawCommand2D>();

            foreach (DrawCommand2D draw in DrawCommands)
            {
                try
                {
                    draw.Render(batch, camera, viewport);
                }
                catch (Exception exception)
                {
                    //
                }
                if (draw.EndTime > 0 && DwarfTime.LastTime.TotalGameTime.TotalSeconds < draw.EndTime)
                {
                    extraDraws.Add(draw);
                }
            }

            while (DrawCommands.Count > 0)
            {
                DrawCommand2D draw = null;
                DrawCommands.TryDequeue(out draw);
            }
            foreach (var draw in extraDraws)
            {
                DrawCommands.Enqueue(draw);
            }
        }
Exemplo n.º 2
0
        public static void Render(SpriteBatch batch, Camera camera, Viewport viewport)
        {
            foreach (DrawCommand2D draw in DrawCommands)
            {
                draw.Render(batch, camera, viewport);
            }

            while (DrawCommands.Count > 0)
            {
                DrawCommand2D draw = null;
                DrawCommands.TryDequeue(out draw);
            }
        }