SortRenderables() 개인적인 메소드

This is a stable sort on Z. It's incredibly fast on already-sorted lists so we'll do this over something like the built-in binary sorts that .NET offers.
private SortRenderables ( ) : void
리턴 void
예제 #1
0
파일: Renderer.cs 프로젝트: jiailiuyan/Gum
        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();
            }
        }
예제 #2
0
        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();
        }
예제 #3
0
파일: Renderer.cs 프로젝트: jiailiuyan/Gum
        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();
            }
        }
예제 #4
0
        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();
        }