Exemple #1
0
        public override void Render(DwarfTime gameTime)
        {
            GuiRoot.Draw();

            if (SpeakerVisible && SpeakerAnimationPlayer != null && !_Output.Hidden)
            {
                var sheet = SpeakerAnimationPlayer.GetCurrentAnimation().SpriteSheet;
                var frame = SpeakerAnimationPlayer.GetCurrentAnimation().Frames[SpeakerAnimationPlayer.CurrentFrame];
                SpeakerRectangle.ResetQuadTexture();
                SpeakerRectangle.Texture(sheet.TileMatrix(frame.X, frame.Y));
                GuiRoot.DrawMesh(SpeakerRectangle, sheet.GetTexture());
            }

            base.Render(gameTime);
        }
Exemple #2
0
        protected override void Draw(GameTime time)
        {
            if (GraphicsDevice.IsDisposed)
            {
                return;
            }

            HasRendered = true;

#if !DEBUG
            try
            {
#endif
            PerformanceMonitor.PushFrame("Render");

            GraphicsDevice.Clear(Color.Black);

            if (GameStateManager.DrawScreensaver)
            {
                ScreenSaver.Render(GraphicsDevice, DwarfTime.LastTime);
            }

            GameStateManager.Render(DwarfTime.LastTime);

            GraphicsDevice.SetRenderTarget(null);
            base.Draw(time);
            PerformanceMonitor.PopFrame();
            PerformanceMonitor.Render();

            if (ConsoleVisible)
            {
                ConsoleGui.Draw();
            }

#if !DEBUG
        }

        catch (Exception exception)
        {
            Program.CaptureException(exception);
            if (Program.ShowErrorDialog(exception.Message))
            {
                throw new HandledException(exception);
            }
        }
#endif
        }
Exemple #3
0
        protected override void Draw(GameTime time)
        {
            if (GraphicsDevice.IsDisposed)
            {
                return;
            }

            HasRendered = true;
#if SHARP_RAVEN && !DEBUG
            try
            {
#endif
            PerformanceMonitor.PushFrame("Render");

            GraphicsDevice.Clear(Color.Black);

            if (GameStateManager.DrawScreensaver)
            {
                ScreenSaver.Render(GraphicsDevice, DwarfTime.LastTime);
            }

            GameStateManager.Render(DwarfTime.LastTime);

            GraphicsDevice.SetRenderTarget(null);
            base.Draw(time);
            PerformanceMonitor.PopFrame();
            PerformanceMonitor.Render();

            if (ConsoleVisible)
            {
                ConsoleGui.Draw();
            }

#if SHARP_RAVEN && !DEBUG
        }

        catch (Exception exception)
        {
            if (ravenClient != null)
            {
                ravenClient.Capture(new SentryEvent(exception));
            }
            throw;
        }
#endif
        }