Exemplo n.º 1
0
        /// <summary>
        /// Process the current game renderer.
        /// </summary>
        /// <param name="graphic_manager" >Reference to the current game graphic manager</param>
        public void Process(ref GraphicManager graphic_manager)
        {
            this.sprite_batch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, SamplerState.PointClamp);

            this.CurrrentID = 0;
            while (this.CurrrentID < this.BatchCount)
            {
                this.Current = this.Batchs[this.CurrrentID];

                graphic_manager.GetShader(this.Current.Shader);
                var sprite_sheet = graphic_manager.GetSpriteSheet(this.Current.SpriteSheet);

                this.TempIndex = 0;
                while (this.TempIndex < this.Current.Pointer)
                {
                    var temp = this.Current.Data[this.TempIndex++];

                    this.sprite_batch.Draw(
                        sprite_sheet.Texture,
                        temp.Position,
                        sprite_sheet.Sprites[temp.Frame],
                        temp.Filter,
                        temp.Rotation,
                        Vector2.Zero,
                        temp.Scale,
                        SpriteEffects.None,
                        temp.Depth
                        );
                }

                this.CurrrentID++;
            }

            this.sprite_batch.End( );

            this.Batchs.Clear( );
        }