コード例 #1
0
ファイル: MainForm.cs プロジェクト: rosedge/MagicGearEditor3D
        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)
            }
        }
コード例 #2
0
 public void onInputMessage(ref Message m)
 {
     unchecked
     {
         CoreAPI.mgCameraDefaultInput(m.Msg, (uint)m.WParam, (uint)m.LParam);
     }
 }
コード例 #3
0
        protected override void OnPaint(PaintEventArgs pe)
        {
            // TODO: Add custom paint code here
            CoreAPI.mgRender();

            // Calling the base class OnPaint
            base.OnPaint(pe);
        }
コード例 #4
0
ファイル: BrushDlg.cs プロジェクト: rosedge/MagicGearEditor3D
        private void UpdateBrush()
        {
            int shape = 0;

            if (rbtnSquare.Checked)
            {
                shape = 1;
            }

            int lerpMode = cmbLerpMode.SelectedIndex;

            int innerRadius = tbInner.Value;
            int outerRadius = tbOuter.Value;
            int strength    = tbStrength.Value;

            CoreAPI.mgSetBrush(shape, lerpMode, innerRadius, outerRadius, strength);
        }
コード例 #5
0
ファイル: Program.cs プロジェクト: rosedge/MagicGearEditor3D
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            int clientW = 800,
                clientH = 600;

            using (MainForm mainFrm = new MainForm(clientW, clientH))
            {
                CoreAPI.mgCreateEngine(mainFrm.getRenderTargetWnd(), clientW, clientH);
                mainFrm.Show();

                while (mainFrm.Created)
                {
                    CoreAPI.mgRender();
                    Application.DoEvents();
                }
            }//endof using

            CoreAPI.mgDestroyEngine();
        } //endo Main()