예제 #1
0
        private void Step_Click(object sender, EventArgs e)
        {
            if (((Button)sender).Tag is GenerationStep)
            {
                var step = (GenerationStep)((Button)sender).Tag;
                gen.Generate(step + 1);
            }
            else
            {
                gen.Generate();
                if (ras == null)
                {
                    ras = new Rasterizer(seed, gen.ExportGraph());
                }

                var step = (RasterizationStep)((Button)sender).Tag;
                ras.Rasterize(step + 1);
            }

            Render();
            foreach (var btn in btns)
            {
                if (btn.Tag is GenerationStep)
                {
                    btn.Enabled = (GenerationStep)btn.Tag >= gen.Step;
                }
                else
                {
                    btn.Enabled = ras == null || (RasterizationStep)btn.Tag >= ras.Step;
                }
            }
        }
 public void GenerateAsync()
 {
     gen.Generate();
     if (ras == null)
         ras = new Rasterizer(seed, gen.ExportGraph());
     ras.Rasterize();
 }
예제 #3
0
 public void GenerateAsync()
 {
     gen.Generate();
     if (ras == null)
     {
         ras = new Rasterizer(seed, gen.ExportGraph());
     }
     ras.Rasterize();
 }
예제 #4
0
 public void GenerateAsync()
 {
     _gen.Generate();
     if (_ras == null)
     {
         _ras = new Rasterizer(_seed, _gen.ExportGraph());
     }
     _ras.Rasterize();
 }
예제 #5
0
        private void btnNewStep_Click(object sender, EventArgs e)
        {
            seed = rand.Next();
            gen  = new Generator(seed, active);
            ras  = null;
            Text = ProductName + " [Seed: " + seed + "]";

            stepsPane.Enabled = true;
            foreach (var btn in btns)
            {
                btn.Enabled = true;
            }

            var original = box.Image;

            box.Image = null;
            original?.Dispose();
        }