Ejemplo n.º 1
0
        private void newMapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (NewMapDlg newMapDlg = new NewMapDlg())
            {
                if (newMapDlg.ShowDialog(this) == DialogResult.OK)
                {
                    int w = newMapDlg.GetHMapWidth();
                    int h = newMapDlg.GetHMapHeight();
                    float xScale = newMapDlg.GetHMapXScale();
                    float yScale = newMapDlg.GetHMapYScale();
                    float zScale = newMapDlg.GetHMapZScale();
                    int bits = newMapDlg.GetHMapBits();
                    int initVal = newMapDlg.GetInitValue();

                    CoreAPI.mgCreateMap(newMapDlg.GetMapName(),
                        w, h,
                        bits, initVal,
                        xScale, yScale, zScale);

                    if (newMapDlg.GetInitType() == NewMapDlg.EInitType.Noise)
                    {
                        CoreAPI.mgHeightmapNoise(0, 0, -1, -1,
                            newMapDlg.GetNoiseOctaves(),
                            newMapDlg.GetNoiseAmplitude(),
                            newMapDlg.GetNoiseFrequency());
                    }
                }//endof if(OK)
            }
        }
Ejemplo n.º 2
0
        private void newMapToolStripMenuItem_Click(object sender, EventArgs e)
        {
            using (NewMapDlg newMapDlg = new NewMapDlg())
            {
                if (newMapDlg.ShowDialog(this) == DialogResult.OK)
                {
                    int   w       = newMapDlg.GetHMapWidth();
                    int   h       = newMapDlg.GetHMapHeight();
                    float xScale  = newMapDlg.GetHMapXScale();
                    float yScale  = newMapDlg.GetHMapYScale();
                    float zScale  = newMapDlg.GetHMapZScale();
                    int   bits    = newMapDlg.GetHMapBits();
                    int   initVal = newMapDlg.GetInitValue();

                    CoreAPI.mgCreateMap(newMapDlg.GetMapName(),
                                        w, h,
                                        bits, initVal,
                                        xScale, yScale, zScale);

                    if (newMapDlg.GetInitType() == NewMapDlg.EInitType.Noise)
                    {
                        CoreAPI.mgHeightmapNoise(0, 0, -1, -1,
                                                 newMapDlg.GetNoiseOctaves(),
                                                 newMapDlg.GetNoiseAmplitude(),
                                                 newMapDlg.GetNoiseFrequency());
                    }
                }//endof if(OK)
            }
        }