Beispiel #1
0
        static void Main(string[] args)
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Splash Screen init
            SplashScreen.ShowSplashScreen();
            Application.DoEvents();

            SplashScreen.SetStatus("Setting Up Application Path ...");
            EV.SetFindPath(Path.GetDirectoryName(Application.ExecutablePath));

            SplashScreen.SetStatus("Registering COM dll ...");
            bool bSucReg = EV.RegComDll("AtlKG3DEngineProxy.dll");

            if (!bSucReg)
            {
                MessageBox.Show("COM注册失败!", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            SplashScreen.SetStatus("Checking Application Instancing ...");
            if (Helper.ProgramAlreadyRunning())
            {
                MessageBox.Show("此工具不能双开。", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            SplashScreen.SetStatus("Initing Editor Config ...");
            EditorLayer.Init();
            SplashScreen.SetStatus("Starting KG3DEngine ...");
            EngineLayer.Init();
            SplashScreen.SetStatus("Loading JX3 Logics ...");
            LogicsLayer.Init();

            // close Splash Screen
            SplashScreen.CheckForIllegalCrossThreadCalls = false;
            if (SplashScreen.SplashForm != null)
            {
                SplashScreen.SplashForm.Owner = EditorLayer.MainFrm;
            }
            SplashScreen.CloseForm();


            EditorLayer.Run();


            LogicsLayer.Uninit();
            EngineLayer.Uninit();
            EditorLayer.Uninit();
        }