예제 #1
0
        public void RenderGame(DoomGame game)
        {
            // var watch = System.Diagnostics.Stopwatch.StartNew();
            if (game.State == GameState.Level)
            {
                var consolePlayer = game.World.ConsolePlayer;
                var displayPlayer = game.World.DisplayPlayer;

                if (game.World.AutoMap.Visible)
                {
                    autoMap.Render(consolePlayer);
                    statusBar.Render(consolePlayer, true);
                }
                else
                {
                    // var watch2 = System.Diagnostics.Stopwatch.StartNew();
                    threeD.Render(displayPlayer);
                    // Console.WriteLine("threeD.Render(displayPlayer) {0} ms", watch2.ElapsedMilliseconds);
                    // watch2.Restart();
                    if (threeD.WindowSize < 8)
                    {
                        statusBar.Render(consolePlayer, true);
                    }
                    else if (threeD.WindowSize == ThreeDRenderer.MaxScreenSize)
                    {
                        statusBar.Render(consolePlayer, false);
                    }
                    // Console.WriteLine("statusBar.Render {0} ms", watch2.ElapsedMilliseconds);
                    // watch2.Restart();
                }

                if (config.video_displaymessage || ReferenceEquals(consolePlayer.Message, (string)DoomInfo.Strings.MSGOFF))
                {
                    if (consolePlayer.MessageTime > 0)
                    {
                        var scale = screen.Width / 320;
                        screen.DrawText(consolePlayer.Message, 0, 7 * scale, scale);
                    }
                }
            }
            else if (game.State == GameState.Intermission)
            {
                intermission.Render(game.Intermission);
            }
            else if (game.State == GameState.Finale)
            {
                finale.Render(game.Finale);
            }
            //Console.WriteLine("Render state {0}, {1} ms", game.State, watch.ElapsedMilliseconds);
        }
예제 #2
0
        public void RenderGame(DoomGame game)
        {
            if (game.State == GameState.Level)
            {
                var consolePlayer = game.World.ConsolePlayer;
                var displayPlayer = game.World.DisplayPlayer;

                if (game.World.AutoMap.Visible)
                {
                    autoMap.Render(consolePlayer);
                    statusBar.Render(consolePlayer, true);
                }
                else
                {
                    threeD.Render(displayPlayer);
                    if (threeD.WindowSize < 8)
                    {
                        statusBar.Render(consolePlayer, true);
                    }
                    else if (threeD.WindowSize == ThreeDRenderer.MaxScreenSize)
                    {
                        statusBar.Render(consolePlayer, false);
                    }
                }

                if (config.video_displaymessage || ReferenceEquals(consolePlayer.Message, (string)DoomInfo.Strings.MSGOFF))
                {
                    if (consolePlayer.MessageTime > 0)
                    {
                        var scale = screen.Width / 320;
                        screen.DrawText(consolePlayer.Message, 0, 7 * scale, scale);
                    }
                }
            }
            else if (game.State == GameState.Intermission)
            {
                intermission.Render(game.Intermission);
            }
            else if (game.State == GameState.Finale)
            {
                finale.Render(game.Finale);
            }
        }
예제 #3
0
        /*
         * public void BindWorld(World world)
         * {
         *  this.world = world;
         *
         *  threeD.BindWorld(world);
         * }
         *
         * public void UnbindWorld()
         * {
         *  threeD.UnbindWorld();
         * }
         */

        public void RenderGame(DoomGame game)
        {
            if (game.gameState == GameState.Level)
            {
                var player = game.World.Players[game.Options.ConsolePlayer];
                if (game.World.AutoMap.Visible)
                {
                    autoMap.Render(player);
                    statusBar.Render(game.World.StatusBar, player);
                }
                else
                {
                    threeD.Render(player);
                    statusBar.Render(game.World.StatusBar, player);
                }
            }
            else if (game.gameState == GameState.Intermission)
            {
                intermission.Render(game.Intermission);
            }
        }