public static void Main(string[] args)
        {
            FreelancerGame flgame = null;

            AppHandler.Run(() =>
            {
                Func <string> filePath = null;
                if (args.Length > 0)
                {
                    filePath = () => args[0];
                }
                var cfg = GameConfig.Create(true, filePath);
                flgame  = new FreelancerGame(cfg);
                flgame.Run();
            }, () => flgame.Crashed());
        }
Exemple #2
0
        public static void Main(string[] args)
        {
            Application.Initialize();
            Config = GameConfig.Create();
            var win = new LaunchWindow();

            win.Show();
            Application.Run();

            if (Start)
            {
                Config.Save();
                //Setup State
                Config.IntroMovies = false;
                Config.CustomState = (g) => new MainState(g);
                Config.VSync       = true;
                //Run
                Config.Launch();
            }
        }
Exemple #3
0
        public static void Main(string[] args)
        {
            if (Platform.RunningOS == OS.Windows)
            {
                string bindir   = Path.GetDirectoryName(typeof(MainClass).Assembly.Location);
                var    fullpath = Path.Combine(bindir, IntPtr.Size == 8 ? "x64" : "x86");
                SetDllDirectory(fullpath);
            }
            if (!Platform.CheckDependencies())
            {
                return;
            }
            FreelancerGame flgame = null;

#if !DEBUG
            var domain = AppDomain.CurrentDomain;
            domain.UnhandledException += (object sender, UnhandledExceptionEventArgs e) => {
                var ex = (Exception)(e.ExceptionObject);
                CrashWindow.Run("Uh-oh!", "Librelancer has crashed. See the log for more information.",
                                ex.Message + "\n" + ex.StackTrace);
            };
            try {
#endif
            Func <string> filePath = null;
            if (args.Length > 0)
            {
                filePath = () => args[0];
            }
            var cfg = GameConfig.Create(true, filePath);
            flgame = new FreelancerGame(cfg);
            flgame.Run();
#if !DEBUG
        }

        catch (Exception ex)
        {
            try { flgame.Crashed(); } catch { }
            CrashWindow.Run("Uh-oh!", "Librelancer has crashed. See the log for more information.", ex.Message + "\n" + ex.StackTrace);
        }
#endif
        }