예제 #1
0
        public void Render(OpeningSequence sequence)
        {
            var scale = this.screen.Width / 320;

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

                break;

            case OpeningSequenceState.Credit:
                this.screen.DrawPatch(this.cache["CREDIT"], 0, 0, scale);

                break;
            }
        }
        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;
            }
        }
예제 #3
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}");
        }
예제 #4
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;
            }
        }
예제 #5
0
        public void Render(OpeningSequence sequence)
        {
            var scale = screen.Width / 320;

            screen.DrawPatch(titlePic, 0, 0, scale);
        }
예제 #6
0
        public DoomApplication(IPlatform platform, CommandLineArgs args)
        {
            DoomApplication.Instance = this;

            this.FileSystem = new VirtualFileSystem();

            var wads = this.GetWadPaths(args);

            foreach (var wad in wads)
            {
                this.FileSystem.Add(new WadFileSystem(this.FileSystem.Read(wad)));
            }

            this.config = new Config(platform, "managed-doom.cfg");

            try
            {
                this.config.video_screenwidth  = Math.Clamp(this.config.video_screenwidth, 320, 3200);
                this.config.video_screenheight = Math.Clamp(this.config.video_screenheight, 200, 2000);

                this.window = platform.CreateWindow(ApplicationInfo.Title, this.config);
                this.window.Clear(Color.FromArgb(64, 64, 64));
                this.window.Display();

                this.Resource = new CommonResource();

                this.renderer = platform.CreateRenderer(this.config, this.window, this.Resource);

                if (!args.nosound.Present && !args.nosfx.Present)
                {
                    this.sound = platform.CreateSound(this.config);
                }

                if (!args.nosound.Present && !args.nomusic.Present)
                {
                    this.music = platform.CreateMusic(this.config);
                }

                this.userInput = platform.CreateUserInput(this.config, this.window, args.nomouse.Present);

                this.events = new List <DoomEvent>();

                this.options           = new GameOptions();
                this.options.Renderer  = this.renderer;
                this.options.Sound     = this.sound;
                this.options.Music     = this.music;
                this.options.UserInput = this.userInput;

                this.menu = new DoomMenu(this);

                this.opening = new OpeningSequence(this.options);

                this.cmd = new TicCmd();

                this.game = new DoomGame(this.Resource, this.options);

                this.wipe   = new WipeEffect(this.renderer.WipeBandCount, this.renderer.WipeHeight);
                this.wiping = false;

                this.currentState = ApplicationState.None;
                this.nextState    = ApplicationState.Opening;
                this.needWipe     = false;

                this.sendPause = false;

                this.quit        = false;
                this.quitMessage = null;

                this.CheckGameArgs(args);

                this.window.Closed      += (sender, e) => this.window.Close();
                this.window.KeyPressed  += this.KeyPressed;
                this.window.KeyReleased += this.KeyReleased;

                this.window.SetFramerateLimit(35);
            }
            catch (Exception e)
            {
                this.Dispose();
                ExceptionDispatchInfo.Throw(e);
            }
        }