Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //ArrayList[] a = { new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList() };
            //ArrayList elem = (ArrayList)a[0];
            //elem.Add("aaa");
            m_strSockets    = new string[9];
            m_strSockets[0] = "s_hat"; m_strSockets[1] = "s_spine2"; m_strSockets[2] = "s_spine";
            m_strSockets[3] = "s_rp";  m_strSockets[4] = "s_lp";     m_strSockets[5] = "s_rc";
            m_strSockets[6] = "s_lc";  m_strSockets[7] = "s_rh";     m_strSockets[8] = "s_lh";

            m_HeadFilePath = new ArrayList();
            m_HandFilePath = new ArrayList();
            m_LegFilePath  = new ArrayList();
            m_BodyFilePath = new ArrayList();
            m_BeltFilePath = new ArrayList();
            m_FaceFilePath = new ArrayList();
            m_AniFilePath  = new ArrayList();
            m_ItemFilePath = new ArrayList();
            m_MdlFile      = new ArrayList();
            m_3DEngie      = new Test3DEngine();
            m_3DEngie.Init((int)this.pictureBox1.Handle);

            string DirName    = Application.StartupPath;
            string PlayerName = DirName + "\\Data\\public\\PlayerCheckTool\\Checker.mdl";
            // DirName + "\\Data\\public\\PlayerCheckTool\\Checker_skin.ani";
            string AniFileName = DirName + "\\data\\source\\player\\F2\\动作\\F2b01aq攻击22.ani";

            m_3DEngie.LoadPlayerModel(PlayerName);
            m_3DEngie.LoadAni(AniFileName);
            m_PartDirPath = PlayerPathText.Text;
            FindModelInDirectory(PlayerPathText.Text);
            for (int i = m_MdlFile.Count - 1; i >= 0; i--)
            {
                this.Player_comboBox.Items.Add(m_MdlFile[i]);
            }
            ItemsRefresh();
            this.Player_comboBox.SelectedIndex = 0;
            if (Ani_listBox.Items.Count > 0)
            {
                this.Ani_listBox.SelectedIndex = 0;
            }
        }
Exemplo n.º 2
0
Arquivo: Form1.cs Projeto: viticm/pap2
        private void Form1_Load(object sender, EventArgs e)
        {
            //ArrayList[] a = { new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList(), new ArrayList() };
            //ArrayList elem = (ArrayList)a[0];
            //elem.Add("aaa");
            m_strSockets = new string[9];
            m_strSockets[0] = "s_hat"; m_strSockets[1] = "s_spine2"; m_strSockets[2] = "s_spine";
            m_strSockets[3] = "s_rp";  m_strSockets[4] = "s_lp";     m_strSockets[5] = "s_rc";
            m_strSockets[6] = "s_lc";  m_strSockets[7] = "s_rh";     m_strSockets[8] = "s_lh";

            m_HeadFilePath = new ArrayList();
            m_HandFilePath = new ArrayList();
            m_LegFilePath = new ArrayList();
            m_BodyFilePath = new ArrayList();
            m_BeltFilePath = new ArrayList();
            m_FaceFilePath = new ArrayList();
            m_AniFilePath = new ArrayList();
            m_ItemFilePath = new ArrayList();
            m_MdlFile = new ArrayList();
            m_3DEngie = new Test3DEngine();
            m_3DEngie.Init((int)this.pictureBox1.Handle);

            string DirName = Application.StartupPath;
            string PlayerName = DirName + "\\Data\\public\\PlayerCheckTool\\Checker.mdl";
            // DirName + "\\Data\\public\\PlayerCheckTool\\Checker_skin.ani";
            string AniFileName = DirName + "\\data\\source\\player\\F2\\动作\\F2b01aq攻击22.ani";
            m_3DEngie.LoadPlayerModel(PlayerName);
            m_3DEngie.LoadAni(AniFileName);
            m_PartDirPath = PlayerPathText.Text;
            FindModelInDirectory(PlayerPathText.Text);
            for (int i = m_MdlFile.Count-1; i >= 0; i--)
                this.Player_comboBox.Items.Add(m_MdlFile[i]);
            ItemsRefresh();
            this.Player_comboBox.SelectedIndex = 0;
            if (Ani_listBox.Items.Count > 0)
                this.Ani_listBox.SelectedIndex = 0;        
                     
        }
Exemplo n.º 3
0
        private void doInitPreview(int iOption)
        {
            int old_wrong_index = this.tabControl1.SelectedTabIndex;
            int new_right_index = init_preview_index;
            // new_right_index 是从1 开始的下标。
            string strTabIndex = "[" + new_right_index.ToString() + "]";

            if (Program.EngineDir.Trim().Length <= 0)
            {
                if (!m_bWarning3dEngine)
                {
                    m_bWarning3dEngine = true;
                    MessageBox.Show("3DEngine 路径为空,不能正常打开预览窗口", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                return;
            }

            string strdir = "";

            if (Program.EngineDir.Substring(Program.EngineDir.Length - 1) != "\\")
            {
                strdir = Program.EngineDir + "\\";
            }
            else
            {
                strdir = Program.EngineDir;
            }

            if (m_3DEngie == null)
            {
                bool bSuc = Helper.RegComDll("atlax.dll");

                m_3DEngie = new Test3DEngine();

                if (m_3DEngie == null)
                {
                    MessageBox.Show("3D Engine 初始化失败!m_3DEngie = null。");
                    return;
                }

                m_3DEngie.Init((int)(preview_panels[new_right_index - 1].Handle), Program.EngineDir, Application.StartupPath);

                // 传给mainform, 让它关闭时uninit 引擎。
                ((MainForm)ParentForm).K3DEngine = m_3DEngie;

                string content = string.Format(@"
RegComDll: {0}
m_3DEngie: {1}
EngineDir: {2}
Engine:    {3}
Enginenull:{4}
", bSuc, m_3DEngie, strdir, m_3DEngie, m_3DEngie == null?"null":"not null");

                FileFolderHelper.StringToFile(content, Application.StartupPath + "/GameDesignerTools.log");
            }

            m_lua["EngineDir"] = strdir;
            m_lua["Engine"]    = m_3DEngie;

            int count;

            m_3DEngie.GetEditorSceneCount(ModelName + strTabIndex, out count);
            if (count > 0)
            {
                return;
            }

            m_3DEngie.AddScene((int)preview_panels[new_right_index - 1].Handle, ModelName + strTabIndex, iOption);

            //string DirName = strdir;
            //string PlayerName = DirName + "\\Data\\public\\PlayerCheckTool\\Male\\Normal\\M2.mdl";
            //string AniFileName = DirName + "\\data\\source\\player\\M2\\动作\\M2b04ty空手普通待机.ani";
            //m_3DEngie.LoadPlayerModel(PlayerName);
            //m_3DEngie.LoadAni(AniFileName, 1);

            this.SetTmrRenderInterval(Program.m_3d_tmrRender);
            tmrRender.Enabled = true;

            PreviewBar.Visible = true;
            PreviewBar.RecalcLayout();
            this.ResumeLayout();
        }
Exemplo n.º 4
0
        private void doInitPreview(int iOption)
        {
            int old_wrong_index = this.tabControl1.SelectedTabIndex;
            int new_right_index = init_preview_index;
            // new_right_index 是从1 开始的下标。
            string strTabIndex = "[" + new_right_index.ToString() + "]";

            if (Program.EngineDir.Trim().Length <= 0)
            {
                if (!m_bWarning3dEngine)
                {
                    m_bWarning3dEngine = true;
                    MessageBox.Show("3DEngine 路径为空,不能正常打开预览窗口", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
                return;
            }

            string strdir = "";
            if (Program.EngineDir.Substring(Program.EngineDir.Length - 1) != "\\")
                strdir = Program.EngineDir + "\\";
            else
                strdir = Program.EngineDir;

            if (m_3DEngie == null)
            {
                bool bSuc = Helper.RegComDll("atlax.dll");
                
                m_3DEngie = new Test3DEngine();

                if (m_3DEngie == null)
                {
                    MessageBox.Show("3D Engine 初始化失败!m_3DEngie = null。");
                    return;
                }

                m_3DEngie.Init((int)(preview_panels[new_right_index - 1].Handle), Program.EngineDir, Application.StartupPath);

                // 传给mainform, 让它关闭时uninit 引擎。
                ((MainForm)ParentForm).K3DEngine = m_3DEngie;

                string content = string.Format(@"
RegComDll: {0}
m_3DEngie: {1}
EngineDir: {2}
Engine:    {3}
Enginenull:{4}
", bSuc, m_3DEngie, strdir, m_3DEngie, m_3DEngie == null?"null":"not null");

                FileFolderHelper.StringToFile(content, Application.StartupPath + "/GameDesignerTools.log");
            }

            m_lua["EngineDir"] = strdir;
            m_lua["Engine"] = m_3DEngie;

            int count;
            m_3DEngie.GetEditorSceneCount(ModelName + strTabIndex, out count);
            if (count > 0)
                return;

            m_3DEngie.AddScene((int)preview_panels[new_right_index - 1].Handle, ModelName + strTabIndex, iOption);

            //string DirName = strdir;
            //string PlayerName = DirName + "\\Data\\public\\PlayerCheckTool\\Male\\Normal\\M2.mdl";
            //string AniFileName = DirName + "\\data\\source\\player\\M2\\动作\\M2b04ty空手普通待机.ani";
            //m_3DEngie.LoadPlayerModel(PlayerName);
            //m_3DEngie.LoadAni(AniFileName, 1);

            this.SetTmrRenderInterval(Program.m_3d_tmrRender);
            tmrRender.Enabled = true;

            PreviewBar.Visible = true;
            PreviewBar.RecalcLayout();
            this.ResumeLayout();
        }