コード例 #1
0
ファイル: FrmMain.cs プロジェクト: viticm/pap2
        public FrmMain()
        {
            try
            {
                InitializeComponent();
                ImageCutter.OnCutting += new ImageCutter.OnCuttingHandler(ImageCutter_OnCutting);
                string strIniFileFullName = Application.StartupPath + "\\GameDesingerTools.ini";
                strMapPath = IniIO.IniReadValue("General", "RootDir", strIniFileFullName);
                if(strMapPath == null || strMapPath == "")
                {
                    MessageBox.Show("地图目录路径未设置!请把程序放到填表工具同一目录下!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                strMapPath = strMapPath.TrimEnd(new char[] { '\\' });
                rootPath = strMapPath;
                Panel p = new Panel();

                try
                {
                    Helper.RegComDll("atlax.dll");
                    m_3DEngie = new atlaxLib.Test3DEngine();
                    m_3DEngie.Init((int)p.Handle, strMapPath + "\\", Application.StartupPath);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("atlax初始化失败: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                strMapPath += @"\data\source\maps\";
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmMain初始化失败: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }
コード例 #2
0
ファイル: FrmMain.cs プロジェクト: weimingtom/pap2
        public FrmMain()
        {
            try
            {
                InitializeComponent();
                ImageCutter.OnCutting += new ImageCutter.OnCuttingHandler(ImageCutter_OnCutting);
                string strIniFileFullName = Application.StartupPath + "\\GameDesingerTools.ini";
                strMapPath = IniIO.IniReadValue("General", "RootDir", strIniFileFullName);
                if (strMapPath == null || strMapPath == "")
                {
                    MessageBox.Show("地图目录路径未设置!请把程序放到填表工具同一目录下!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                strMapPath = strMapPath.TrimEnd(new char[] { '\\' });
                rootPath   = strMapPath;
                Panel p = new Panel();

                try
                {
                    Helper.RegComDll("atlax.dll");
                    m_3DEngie = new atlaxLib.Test3DEngine();
                    m_3DEngie.Init((int)p.Handle, strMapPath + "\\", Application.StartupPath);
                }
                catch (Exception ex)
                {
                    MessageBox.Show("atlax初始化失败: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                strMapPath += @"\data\source\maps\";
            }
            catch (Exception ex)
            {
                MessageBox.Show("frmMain初始化失败: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
        }