예제 #1
0
        static void Main()
        {
            // enable debug mode so we can get some additional hotkeys, etc
            // (i.e. hold down ALT + Number)
            DebugFlags.EnableDebugKeys = true;

            // change the content directory to whatever custom content location we want
            string basePath = ConfigurationManager.AppSettings["ContentPath"];

            // here is where we spin up a copy of the game to play
            //using (var game = new Game1Hook())
            //{
            //    game.Content.RootDirectory = Path.Combine(basePath, "Content");

            //    // note that sometimes the game uses the working path to load things so we will set this just to be sure
            //    Directory.SetCurrentDirectory(basePath);

            //    // yet another content manager we found that might need overrides
            //    Game1.SpriteManager.GeneralContent.RootDirectory = Path.Combine(basePath, "Content");

            //    game.Run();
            //}



            try
            {
                //if (API.RestartAppIfNecessary(233700U))
                //    return;
                API.Initialize();
                using (var game = new Game1Hook())
                {
                    game.Content.RootDirectory = Path.Combine(basePath, "Content");

                    // note that sometimes the game uses the working path to load things so we will set this just to be sure
                    Directory.SetCurrentDirectory(basePath);

                    // yet another content manager we found that might need overrides
                    Game1.SpriteManager.GeneralContent.RootDirectory = Path.Combine(basePath, "Content");

                    game.Run();
                }
            }
            finally
            {
                API.Shutdown();
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: hross/TheHollow
        static void Main()
        {
            // enable debug mode so we can get some additional hotkeys, etc
            // (i.e. hold down ALT + Number)
            DebugFlags.EnableDebugKeys = true;

            // change the content directory to whatever custom content location we want
            string basePath = ConfigurationManager.AppSettings["ContentPath"];

            // here is where we spin up a copy of the game to play
            using (var game = new Game1Hook())
            {
                game.Content.RootDirectory = Path.Combine(basePath, "Content");

                // note that sometimes the game uses the working path to load things so we will set this just to be sure
                Directory.SetCurrentDirectory(basePath);

                // yet another content manager we found that might need overrides
                Game1.SpriteManager.GeneralContent.RootDirectory = Path.Combine(basePath, "Content");

                game.Run();
            }
        }