public void Draw() { Game1.graphicsDevice.SetRenderTarget(null); Game1.graphicsDevice.Clear(Color.Black); #if !EDITOR //try #endif { if (!Loading && MyScene != null) { #if EDITOR && WINDOWS Render.RenderTime.Reset(); #endif if (!MyScene.CanLoad) { MyScene.Load(); } #if !EDITOR if (MyScene.WindowSize.X != Game1.ResolutionX || MyScene.WindowSize.Y != Game1.ResolutionY) { MyScene.SetWindowSize(new Vector2(Game1.ResolutionX, Game1.ResolutionY)); } #endif #if EDITOR if (MyScene.WindowSize.X != Game1.self.Window.ClientBounds.Width || MyScene.WindowSize.Y != Game1.self.Window.ClientBounds.Height) { MyScene.SetWindowSize(new Vector2(Game1.self.Window.ClientBounds.Width, Game1.self.Window.ClientBounds.Height)); } #endif #if WINDOWS && EDITOR if (!LevelForEditing || Game1.self.IsActive) #endif MyScene.PreDraw(); MyScene.Draw2D(GameObjectTag.SceneDrawScene); Game1.graphicsDevice.SetRenderTarget(null); MasterManager.SetViewportToFullscreen(); } } #if !EDITOR //catch (Exception e) //{ MasterManager.e = e; } #endif loadingScreen.Draw(Math.Min(LoadingProgressBar, LoadingProgressBarMax), LoadingProgressBarMax, LoadingProgressBarAlpha); PlayerProfile.Draw(); }
public override void PreDraw() { if (GameManager.GetEditorLevel() != null && GameManager.GetEditorLevel().MyScene != null && !GameManager.GetEditorLevel().Loading) { SceneObject s = GameManager.GetEditorLevel().MyScene; if (s.WindowSize.X != MyRectangle.Width || s.WindowSize.Y != MyRectangle.Height) { s.SetWindowSize(new Vector2(Math.Max(MyRectangle.Width, 64), Math.Max(MyRectangle.Height, 64))); } if (Game1.self.IsActive) { s.PreDraw(); } s.DrawToThumbnail(); } base.PreDraw(); }