Example #1
0
        public void AddIsland(D2dFloodfill.Island island)
        {
            for (var i = island.Pixels.Count - 1; i >= 0; i--)
            {
                var pixel = island.Pixels[i];

                AddPixel(pixel.X, pixel.Y);
            }
        }
Example #2
0
        public void AddIsland(D2dFloodfill.Island island)
        {
            for (var i = island.Lines.Count - 1; i >= 0; i--)
            {
                var line = island.Lines[i];

                for (var j = line.MinX; j < line.MaxX; j++)
                {
                    AddPixel(j, line.Y);
                }
            }
        }
Example #3
0
        public void Transform(D2dRect newRect, D2dFloodfill.Island island)
        {
            Clear();
            Prepare(newRect, true);

            for (var i = island.Lines.Count - 1; i >= 0; i--)
            {
                var line = island.Lines[i];

                for (var x = line.MinX; x < line.MaxX; x++)
                {
                    Cells[x - newRect.MinX + (line.Y - newRect.MinY) * newRect.SizeX] = new Cell(0, 0, 0);
                }
            }

            Transform();
        }