Exemplo n.º 1
0
        private void settingToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ProjectProperties form = new ProjectProperties();

            float x = 0, y = 0, z = 0;

            m_GameEngine.GetSunInfo("Dir", out x, out y, out z);
            form.SetSunDir(x, y, z);

            m_GameEngine.GetSunInfo("Color", out x, out y, out z);
            form.SetColorBox((int)Math.Ceiling(x * 255.0f), (int)Math.Ceiling(y * 255.0f), (int)Math.Ceiling(z * 255.0f));

            m_GameEngine.GetAmbientLight("Color", out x, out y, out z);
            form.SetAmbientLightColor(x * 255.0f, y * 255.0f, z * 255.0f);

            if (form.ShowDialog() == DialogResult.OK)
            {
                ReturnVector3 temp = form.GetSunDir();
                m_GameEngine.SetSunInfo("Dir", temp.mX, temp.mY, temp.mZ);

                temp = form.GetSunColor();
                m_GameEngine.SetSunInfo("Color", temp.mX / 255, temp.mY / 255, temp.mZ / 255);

                temp = form.GetAmbientLight();
                m_GameEngine.SetAmbientLight("Color", temp.mX / 255, temp.mY / 255, temp.mZ / 255);
            }

            UpdateSaveStatus();
        }