Beispiel #1
0
        protected override void Initialize()
        {
            Logger.Instance.Log("MainGame Initializing...");

            Window.Position = new Point(0, 0);
            VariableTimeStep();

            var context = CallContext <GlobalContextPresentation> .GetData("GlobalContextPresentation");

            context.GraphicsDevice        = GraphicsDevice;
            context.GraphicsDeviceManager = _graphicsDeviceManager;
            context.GameWindow            = Window;

            if (context.DesiredResolution == PointI.Empty)
            {
                SetScreenResolution(_graphicsDeviceManager, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Width, GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Height);
            }
            else
            {
                SetScreenResolution(_graphicsDeviceManager, context.DesiredResolution.X, context.DesiredResolution.Y);
            }

            PhoenixGame.MakeWorld();
            _phoenixGameView = new PhoenixGameView();
            _metricsPanel    = new MetricsPanel();

            Logger.Instance.LogComplete();

            base.Initialize();
        }
Beispiel #2
0
 private static bool BeforeRunGameLevel_Skip(PhoenixGame __instance, LevelSceneBinding levelSceneBinding, ref IEnumerator <NextUpdate> __result)
 {
     try {
         if (levelSceneBinding != __instance.Def.IntroLevelSceneDef.Binding)
         {
             return(true);
         }
         Info("Skipping Logos");
         __result = Enumerable.Empty <NextUpdate>().GetEnumerator();
         Unpatch(ref LogoPatch);
         return(false);
     } catch (Exception ex) { return(Error(ex)); }
 }