Ejemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SpaceShooterGame game = new SpaceShooterGame())
     {
         game.Run();
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (SpaceShooterGame game = new SpaceShooterGame())
     {
         game.Run();
     }
 }
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
#if SDL2
            string baseFolder = GetStorageRoot();
            string oldFolder  = System.IO.Path.Combine(baseFolder, "AllPlayers");
            string newFolder  = System.IO.Path.Combine(baseFolder, "Flotilla", "AllPlayers");
            if (System.IO.Directory.Exists(oldFolder) &&
                !System.IO.Directory.Exists(newFolder))
            {
                try
                {
                    Console.Write("MIGRATING XNA3 SAVES TO XNA4...");
                    System.IO.Directory.CreateDirectory(newFolder);
                    System.IO.File.Copy(
                        System.IO.Path.Combine(oldFolder, "saveinfo.dat"),
                        System.IO.Path.Combine(newFolder, "saveinfo.dat")
                        );
                    System.IO.File.Copy(
                        System.IO.Path.Combine(oldFolder, "scores.dat"),
                        System.IO.Path.Combine(newFolder, "scores.dat")
                        );
                    System.IO.File.Copy(
                        System.IO.Path.Combine(oldFolder, "settings.xml"),
                        System.IO.Path.Combine(newFolder, "settings.xml")
                        );
                    Console.WriteLine(" COMPLETE!");
                }
                catch
                {
                    SDL2.SDL.SDL_ShowSimpleMessageBox(
                        SDL2.SDL.SDL_MessageBoxFlags.SDL_MESSAGEBOX_ERROR,
                        "XNA3->XNA4 Migration Failed!",
                        "We just tried to copy your old XNA3 saves over to the new location,\n" +
                        "but something caused it to fail. We don't know what though.\n\n" +
                        "To migrate by hand, go to this folder...\n\n" + baseFolder + "\n\n" +
                        "... make an extra \"Flotilla\" folder inside, then move the \"AllPlayers\"\n" +
                        "folder inside that extra folder. Your old save data should load after that!",
                        IntPtr.Zero
                        );
                }
            }
#endif

#if WINDOWS
#if !DEBUG
            try
            {
#endif
            using (SpaceShooterGame game = new SpaceShooterGame())
            {
                game.Run();
            }
#if !DEBUG
        }

        catch (Exception e)
        {
            string userVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major.ToString() +
                                 "." + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString();

            string registered = string.Empty;
            if (System.IO.File.Exists(@"WindowsContent/splash.bmp"))
            {
                registered = "Registered";
            }
            else
            {
                registered = "Demo";
            }

            string finalString = registered + " version " + userVersion + "\n\n" + e.ToString();

#if SDL2
            Console.WriteLine(finalString);
            if (YesNoPopup.Show("Flotilla Critical Error", "Flotilla has encountered a catastrophic error:\n\n" + finalString + "\n\n\nSend this crash report to BlendoGames.com?"))
            {
                SendCrashReport(finalString);
            }
#else
            if (MessageBox.Show(
                    "Flotilla has encountered a catastrophic error:\n\n" + finalString + "\n\n\nSend this crash report to BlendoGames.com?",
                    "Flotilla Critical Error", MessageBoxButtons.YesNo, System.Windows.Forms.MessageBoxIcon.Error) == DialogResult.Yes)
            {
                SendCrashReport(finalString);
            }
#endif
        }
#endif
#else
            using (SpaceShooterGame game = new SpaceShooterGame())
            {
                game.Run();
            }
#endif
        }