Beispiel #1
0
        public override void Perform(Vec3S32[] marks, Brush brush, DrawOpOutput output)
        {
            selector = new RgbPaletteMatcher();
            CalcLayerColors();

            using (PixelGetter getter = new PixelGetter(Source)) {
                getter.Init();
                OutputPixels(getter, output);
            }
            selector = null;

            // Put all the blocks in shadow
            if (DualLayer)
            {
                ushort y = (ushort)(Origin.Y + Source.Height);
                for (int i = 0; i < Source.Width; i++)
                {
                    ushort x = (ushort)(Origin.X + dx.X * i);
                    ushort z = (ushort)(Origin.Z + dx.Z * i);
                    output(Place(x, y, z, Block.Stone));

                    x = (ushort)(x + adj.X); z = (ushort)(z + adj.Z);
                    output(Place(x, y, z, Block.Stone));
                }
            }

            Source.Dispose();
            Source = null;
            Player.Message("Finished printing image using {0} palette.", Palette.Name);
        }