internal void RenderLayer(SystemManagers managers, Layer layer) { // If the Layer's clip region has no width or height, then let's // skip over rendering it, otherwise XNA crashes: var clipRegion = layer.GetScissorRectangleFor(managers.Renderer.Camera); if (clipRegion.Width != 0 && clipRegion.Height != 0) { BeginSpriteBatch(mRenderStateVariables, layer, BeginType.Push); layer.SortRenderables(); foreach (IRenderable renderable in layer.RenderablesWriteable) { AdjustRenderStates(mRenderStateVariables, layer, renderable); renderable.Render(mSpriteBatch.SpriteBatch, managers); } mSpriteBatch.Pop(); } }
internal void RenderLayer(SystemManagers managers, Layer layer, bool prerender = true) { //////////////////Early Out//////////////////////////////// if (layer.Renderables.Count == 0) { return; } ///////////////End Early Out/////////////////////////////// if (prerender) { PreRender(layer.Renderables); } spriteRenderer.BeginSpriteBatch(mRenderStateVariables, layer, BeginType.Push, mCamera); layer.SortRenderables(); Render(layer.Renderables, managers, layer); spriteRenderer.EndSpriteBatch(); }
internal void RenderLayer(SystemManagers managers, Layer layer) { // If the Layer's clip region has no width or height, then let's // skip over rendering it, otherwise XNA crashes: var clipRegion = layer.GetScissorRectangleFor(managers.Renderer.Camera); if(clipRegion.Width != 0 && clipRegion.Height != 0) { BeginSpriteBatch(mRenderStateVariables, layer, BeginType.Push); layer.SortRenderables(); foreach (IRenderable renderable in layer.RenderablesWriteable) { AdjustRenderStates(mRenderStateVariables, layer, renderable); renderable.Render(mSpriteBatch.SpriteBatch, managers); } mSpriteBatch.Pop(); } }
internal void RenderLayer(SystemManagers managers, Layer layer, bool prerender = true) { //////////////////Early Out//////////////////////////////// if (layer.Renderables.Count == 0) { return; } ///////////////End Early Out/////////////////////////////// if (prerender) { PreRender(layer.Renderables); } spriteRenderer.BeginSpriteBatch(mRenderStateVariables, layer, BeginType.Push, mCamera); layer.SortRenderables(); Render(layer.Renderables, managers, layer); spriteRenderer.EndSpriteBatch(); }