예제 #1
0
        public Renderer(Config config, GameContent content)
        {
            this.config = config;

            palette = content.Palette;

            if (config.video_highresolution)
            {
                screen = new DrawScreen(content.Wad, 640, 400);
            }
            else
            {
                screen = new DrawScreen(content.Wad, 320, 200);
            }

            menu            = new MenuRenderer(content.Wad, screen);
            threeD          = new ThreeDRenderer(content, screen, config.video_gamescreensize);
            statusBar       = new StatusBarRenderer(content.Wad, screen);
            intermission    = new IntermissionRenderer(content.Wad, screen);
            openingSequence = new OpeningSequenceRenderer(content.Wad, screen, this);
            autoMap         = new AutoMapRenderer(content.Wad, screen);
            finale          = new FinaleRenderer(content, screen);

            pause = Patch.FromWad(content.Wad, "M_PAUSE");

            var scale = screen.Width / 320;

            wipeBandWidth = 2 * scale;
            wipeBandCount = screen.Width / wipeBandWidth + 1;
            wipeHeight    = screen.Height / scale;
            wipeBuffer    = new byte[screen.Data.Length];

            palette.ResetColors(gammaCorrectionParameters[config.video_gammacorrection]);
        }
        public OpeningSequenceRenderer(Wad wad, DrawScreen screen, Renderer parent)
        {
            this.screen = screen;
            this.parent = parent;

            cache = new PatchCache(wad);
        }
예제 #3
0
        public MenuRenderer(Wad wad, DrawScreen screen)
        {
            this.wad    = wad;
            this.screen = screen;

            cache = new PatchCache(wad);
        }
예제 #4
0
        public FinaleRenderer(GameContent content, DrawScreen screen)
        {
            wad     = content.Wad;
            flats   = content.Flats;
            sprites = content.Sprites;

            this.screen = screen;
            scale       = screen.Width / 320;

            cache = new PatchCache(wad);
        }
예제 #5
0
        public AutoMapRenderer(Wad wad, DrawScreen screen)
        {
            this.screen = screen;

            scale    = screen.Width / 320;
            amWidth  = screen.Width;
            amHeight = screen.Height - scale * StatusBarRenderer.Height;
            ppu      = (float)scale / 16;

            markNumbers = new Patch[10];
            for (var i = 0; i < markNumbers.Length; i++)
            {
                markNumbers[i] = Patch.FromWad(wad, "AMMNUM" + i);
            }
        }
예제 #6
0
        public IntermissionRenderer(Wad wad, DrawScreen screen)
        {
            this.wad    = wad;
            this.screen = screen;

            cache = new PatchCache(wad);

            minus   = Patch.FromWad(wad, "WIMINUS");
            numbers = new Patch[10];
            for (var i = 0; i < 10; i++)
            {
                numbers[i] = Patch.FromWad(wad, "WINUM" + i);
            }
            percent = Patch.FromWad(wad, "WIPCNT");
            colon   = Patch.FromWad(wad, "WICOLON");

            scale = screen.Width / 320;
        }
예제 #7
0
        public StatusBarRenderer(Wad wad, DrawScreen screen)
        {
            this.screen = screen;

            patches = new Patches(wad);

            scale = screen.Width / 320;

            ready         = new NumberWidget();
            ready.Patches = patches.TallNumbers;
            ready.Width   = ammoWidth;
            ready.X       = ammoX;
            ready.Y       = ammoY;

            health = new PercentWidget();
            health.NumberWidget.Patches = patches.TallNumbers;
            health.NumberWidget.Width   = 3;
            health.NumberWidget.X       = healthX;
            health.NumberWidget.Y       = healthY;
            health.Patch = patches.TallPercent;

            armor = new PercentWidget();
            armor.NumberWidget.Patches = patches.TallNumbers;
            armor.NumberWidget.Width   = 3;
            armor.NumberWidget.X       = armorX;
            armor.NumberWidget.Y       = armorY;
            armor.Patch = patches.TallPercent;

            ammo            = new NumberWidget[(int)AmmoType.Count];
            ammo[0]         = new NumberWidget();
            ammo[0].Patches = patches.ShortNumbers;
            ammo[0].Width   = ammo0Width;
            ammo[0].X       = ammo0X;
            ammo[0].Y       = ammo0Y;
            ammo[1]         = new NumberWidget();
            ammo[1].Patches = patches.ShortNumbers;
            ammo[1].Width   = ammo1Width;
            ammo[1].X       = ammo1X;
            ammo[1].Y       = ammo1Y;
            ammo[2]         = new NumberWidget();
            ammo[2].Patches = patches.ShortNumbers;
            ammo[2].Width   = ammo2Width;
            ammo[2].X       = ammo2X;
            ammo[2].Y       = ammo2Y;
            ammo[3]         = new NumberWidget();
            ammo[3].Patches = patches.ShortNumbers;
            ammo[3].Width   = ammo3Wdth;
            ammo[3].X       = ammo3X;
            ammo[3].Y       = ammo3Y;

            maxAmmo            = new NumberWidget[(int)AmmoType.Count];
            maxAmmo[0]         = new NumberWidget();
            maxAmmo[0].Patches = patches.ShortNumbers;
            maxAmmo[0].Width   = maxAmmo0Width;
            maxAmmo[0].X       = maxAmmo0X;
            maxAmmo[0].Y       = maxAmmo0Y;
            maxAmmo[1]         = new NumberWidget();
            maxAmmo[1].Patches = patches.ShortNumbers;
            maxAmmo[1].Width   = maxAmmo1Width;
            maxAmmo[1].X       = maxAmmo1X;
            maxAmmo[1].Y       = maxAmmo1Y;
            maxAmmo[2]         = new NumberWidget();
            maxAmmo[2].Patches = patches.ShortNumbers;
            maxAmmo[2].Width   = maxAmmo2Width;
            maxAmmo[2].X       = maxAmmo2X;
            maxAmmo[2].Y       = maxAmmo2Y;
            maxAmmo[3]         = new NumberWidget();
            maxAmmo[3].Patches = patches.ShortNumbers;
            maxAmmo[3].Width   = maxAmmo3Width;
            maxAmmo[3].X       = maxAmmo3X;
            maxAmmo[3].Y       = maxAmmo3Y;

            weapons = new MultIconWidget[6];
            for (var i = 0; i < weapons.Length; i++)
            {
                weapons[i]         = new MultIconWidget();
                weapons[i].X       = armsX + (i % 3) * armsSpaceX;
                weapons[i].Y       = armsY + (i / 3) * armsSpaceY;
                weapons[i].Patches = patches.Arms[i];
            }

            frags         = new NumberWidget();
            frags.Patches = patches.TallNumbers;
            frags.Width   = fragsWidth;
            frags.X       = fragsX;
            frags.Y       = fragsY;

            keys            = new MultIconWidget[3];
            keys[0]         = new MultIconWidget();
            keys[0].X       = key0X;
            keys[0].Y       = key0Y;
            keys[0].Patches = patches.Keys;
            keys[1]         = new MultIconWidget();
            keys[1].X       = key1X;
            keys[1].Y       = key1Y;
            keys[1].Patches = patches.Keys;
            keys[2]         = new MultIconWidget();
            keys[2].X       = key2X;
            keys[2].Y       = key2Y;
            keys[2].Patches = patches.Keys;
        }