Ejemplo n.º 1
0
        private void DrawGroundLayers(SpriteBatch spriteBatch)
        {
            //Draw Ground Layers
            ScreenController.graphicsDevice.Viewport = camera.viewport;
            ScreenController.graphicsDevice.SetRenderTarget(DisplayController.GetRenderTarget(worldObjectsRender));
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, camera.TranslationMatrix(1f, 1f));
            world.DrawGroundLayers(spriteBatch, camera.drawPoints, mapObjectsDraw);
            spriteBatch.End();

            //Draw burnt layer
            if (mapObjectsDraw.IsBurntTiles())
            {
                ScreenController.graphicsDevice.SetRenderTarget(DisplayController.GetRenderTarget(burntLayerRender));
                ScreenController.graphicsDevice.Clear(Color.Transparent);
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, null, camera.TranslationMatrix(1f, 1f));
                mapObjectsDraw.DrawBurntLayer(spriteBatch);
                spriteBatch.End();

                /*  //Soften the burnt
                 * ScreenController.graphicsDevice.SetRenderTarget(DisplayController.GetRenderTarget(burntToSoftenRender));
                 * spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null);
                 * spriteBatch.Draw(DisplayController.GetRenderTarget(burntLayerRender), Vector2.Zero, Color.White * 0.5f);
                 * spriteBatch.End();*/

                //Back to world render
                ScreenController.graphicsDevice.SetRenderTarget(DisplayController.GetRenderTarget(worldObjectsRender));
                spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend, null, null, null, null);
                spriteBatch.Draw(DisplayController.GetRenderTarget(burntLayerRender), Vector2.Zero, Color.White * 0.85f);
                spriteBatch.End();
            }
        }