Beispiel #1
0
        public bool Draw(CullList currentCullItems, ref double startHeight)
        {
            CullItem cullItem = cullItems.items[currentCalcCullItem++];

            DrawResult drawResult = cullItem.DoDraw();

            if (drawResult != DrawResult.DontDraw)
            {
                SortedFastList <CullItem> cullItems = currentCullItems.cullItems;

                cullItem.Draw(ref startHeight);
                cullItems.Add(cullItem);

                if (drawResult == DrawResult.DrawHeaderAndRemoveLastHeader)
                {
                    double height = cullItems.items[lastAddedIndex].endHeight - cullItems.items[lastAddedIndex].startHeight;;
                    startHeight -= height;
                    cullItems.RemoveAt(lastAddedIndex);

                    for (int i = lastAddedIndex; i < cullItems.Count; i++)
                    {
                        cullItems.items[i].startHeight -= height;
                        cullItems.items[i].endHeight   -= height;
                    }
                }

                if (drawResult == DrawResult.DrawHeader || drawResult == DrawResult.DrawHeaderAndRemoveLastHeader)
                {
                    lastAddedIndex = cullItems.Count - 1;
                }
                currentCullItems.lastDrawResult = drawResult;
            }

            if (currentCalcCullItem >= cullItems.Count)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Beispiel #2
0
 public CullList(int capacity)
 {
     cullItems = new SortedFastList <CullItem>(capacity);
 }