コード例 #1
0
        public void RenderApplication(DoomApplication app)
        {
            //var watch = System.Diagnostics.Stopwatch.StartNew();
            if (app.State == ApplicationState.Opening)
            {
                openingSequence.Render(app.Opening);
            }
            else if (app.State == ApplicationState.DemoPlayback)
            {
                RenderGame(app.DemoPlayback.Game);
            }
            else if (app.State == ApplicationState.Game)
            {
                RenderGame(app.Game);
            }
            //Console.WriteLine("RenderApplication 1st part: {0} s", (float)(watch.ElapsedMilliseconds) / 1000);
            //watch.Restart();

            if (!app.Menu.Active)
            {
                if (app.State == ApplicationState.Game &&
                    app.Game.State == GameState.Level &&
                    app.Game.Paused)
                {
                    var scale = screen.Width / 320;
                    screen.DrawPatch(
                        pause,
                        (screen.Width - scale * pause.Width) / 2,
                        4 * scale,
                        scale);
                }
            }
            //Console.WriteLine("RenderApplication 2nd part: {0} s", (float)(watch.ElapsedMilliseconds) / 1000);
            //watch.Restart();
        }
コード例 #2
0
        public void RenderApplication(DoomApplication app)
        {
            if (app.State == ApplicationState.Opening)
            {
                openingSequence.Render(app.Opening);
            }
            else if (app.State == ApplicationState.DemoPlayback)
            {
                RenderGame(app.DemoPlayback.Game);
            }
            else if (app.State == ApplicationState.Game)
            {
                RenderGame(app.Game);
            }

            if (!app.Menu.Active)
            {
                if (app.State == ApplicationState.Game &&
                    app.Game.State == GameState.Level &&
                    app.Game.Paused)
                {
                    var scale = screen.Width / 320;
                    screen.DrawPatch(
                        pause,
                        (screen.Width - scale * pause.Width) / 2,
                        4 * scale,
                        scale);
                }
            }
        }
コード例 #3
0
        public void Render(OpeningSequence sequence)
        {
            var scale = screen.Width / 320;

            switch (sequence.State)
            {
            case OpeningSequenceState.Title:
                screen.DrawPatch(cache["TITLEPIC"], 0, 0, scale);
                break;

            case OpeningSequenceState.Demo:
                parent.RenderGame(sequence.DemoGame);
                break;

            case OpeningSequenceState.Credit:
                screen.DrawPatch(cache["CREDIT"], 0, 0, scale);
                break;
            }
        }
コード例 #4
0
        public void Render(OpeningSequence sequence)
        {
            //var watch = System.Diagnostics.Stopwatch.StartNew();
            var scale = screen.Width / 320;

            switch (sequence.State)
            {
            case OpeningSequenceState.Title:
                screen.DrawPatch(cache["TITLEPIC"], 0, 0, scale);
                break;

            case OpeningSequenceState.Demo:
                parent.RenderGame(sequence.DemoGame);
                break;

            case OpeningSequenceState.Credit:
                screen.DrawPatch(cache["CREDIT"], 0, 0, scale);
                break;
            }
            //Console.WriteLine($"OpeningSequence.Render {sequence.State} ms {watch.ElapsedMilliseconds}");
        }
コード例 #5
0
        private void DrawMenuPatch(string name, int x, int y)
        {
            Patch patch;

            if (!patches.TryGetValue(name, out patch))
            {
                Console.WriteLine("Patch loaded: " + name);
                patch = Patch.FromWad(name, wad);
                patches.Add(name, patch);
            }

            var scale = screen.Width / 320;

            screen.DrawPatch(patch, scale * x, scale * y, scale);
        }
コード例 #6
0
        public void Render(OpeningSequence sequence)
        {
            var scale = screen.Width / 320;

            switch (sequence.State)
            {
            case OpeningSequenceState.Title:
                screen.FillRect(0, 0, screen.Width, screen.Height, 0);
                //* fix render title background
                //screen.DrawRaw(cache["TITLE"].Columns[0][0].Data, scale);
                break;

            case OpeningSequenceState.Demo:
                parent.RenderGame(sequence.DemoGame);
                break;

            case OpeningSequenceState.Credit:
                screen.DrawPatch(cache["CREDIT"], 0, 0, scale);
                break;
            }
        }
コード例 #7
0
        private void DrawPatch(string name, int x, int y)
        {
            var scale = screen.Width / 320;

            screen.DrawPatch(cache[name], scale * x, scale * y, scale);
        }
コード例 #8
0
        public void Render(OpeningSequence sequence)
        {
            var scale = screen.Width / 320;

            screen.DrawPatch(titlePic, 0, 0, scale);
        }
コード例 #9
0
 private void DrawPatch(Patch patch, int x, int y)
 {
     screen.DrawPatch(patch, scale * x, scale * y, scale);
 }