Ejemplo n.º 1
0
        /*
         * =============
         * Draw_Pic
         * =============
         */
        public static void Draw_Pic(int x, int y, wad.qpic_t pic)
        {
            byte[] dest, source;
            int    v, u;

            if ((x < 0) ||
                (x + pic.width > screen.vid.width) ||
                (y < 0) ||
                (y + pic.height > screen.vid.height))
            {
                sys_linux.Sys_Error("Draw_Pic: bad coordinates");
            }

            source = pic.data;

            dest = screen.vid.buffer;

            int srcofs = 0;
            int dstofs = (int)(y * screen.vid.rowbytes + x);

            for (v = 0; v < pic.height; v++)
            {
                Buffer.BlockCopy(source, srcofs, dest, dstofs, pic.width);
                dstofs += (int)screen.vid.rowbytes;
                srcofs += pic.width;
            }
        }
Ejemplo n.º 2
0
        /*
         * ===============
         * Draw_Init
         * ===============
         */
        public static void Draw_Init()
        {
            draw_chars    = wad.W_GetLumpName("conchars");
            draw_disc     = wad.W_GetLumpName("disc");
            draw_backtile = wad.W_GetLumpName("backtile");

            r_rectdesc.width     = draw_backtile.width;
            r_rectdesc.height    = draw_backtile.height;
            r_rectdesc.ptexbytes = draw_backtile.data;
            r_rectdesc.rowbytes  = draw_backtile.width;
        }
Ejemplo n.º 3
0
        //============================================================================

        /*
         * ==================
         * SCR_Init
         * ==================
         */
        public static void SCR_Init()
        {
            cvar_t.Cvar_RegisterVariable(scr_fov);
            cvar_t.Cvar_RegisterVariable(scr_viewsize);
            cvar_t.Cvar_RegisterVariable(scr_conspeed);
            cvar_t.Cvar_RegisterVariable(scr_showram);
            cvar_t.Cvar_RegisterVariable(scr_showturtle);
            cvar_t.Cvar_RegisterVariable(scr_showpause);
            cvar_t.Cvar_RegisterVariable(scr_centertime);
            cvar_t.Cvar_RegisterVariable(scr_printspeed);

            //
            // register our commands
            //
            cmd.Cmd_AddCommand("screenshot", SCR_ScreenShot_f);
            cmd.Cmd_AddCommand("sizeup", SCR_SizeUp_f);
            cmd.Cmd_AddCommand("sizedown", SCR_SizeDown_f);

            scr_ram    = draw.Draw_PicFromWad("ram");
            scr_net    = draw.Draw_PicFromWad("net");
            scr_turtle = draw.Draw_PicFromWad("turtle");

            scr_initialized = true;
        }
Ejemplo n.º 4
0
        //============================================================================
        /*
        ==================
        SCR_Init
        ==================
        */
        public static void SCR_Init()
        {
            cvar_t.Cvar_RegisterVariable(scr_fov);
            cvar_t.Cvar_RegisterVariable(scr_viewsize);
            cvar_t.Cvar_RegisterVariable(scr_conspeed);
            cvar_t.Cvar_RegisterVariable(scr_showram);
            cvar_t.Cvar_RegisterVariable(scr_showturtle);
            cvar_t.Cvar_RegisterVariable(scr_showpause);
            cvar_t.Cvar_RegisterVariable(scr_centertime);
            cvar_t.Cvar_RegisterVariable(scr_printspeed);

            //
            // register our commands
            //
            cmd.Cmd_AddCommand("screenshot", SCR_ScreenShot_f);
            cmd.Cmd_AddCommand("sizeup", SCR_SizeUp_f);
            cmd.Cmd_AddCommand("sizedown", SCR_SizeDown_f);

            scr_ram = draw.Draw_PicFromWad("ram");
            scr_net = draw.Draw_PicFromWad("net");
            scr_turtle = draw.Draw_PicFromWad("turtle");

            scr_initialized = true;
        }
Ejemplo n.º 5
0
        /*
        ===============
        Sbar_Init
        ===============
        */
        public static void Sbar_Init()
        {
            int		i;

            for (i=0 ; i<10 ; i++)
            {
                sb_nums[0,i] = draw.Draw_PicFromWad ("num_" + i);
                sb_nums[1,i] = draw.Draw_PicFromWad ("anum_" + i);
            }

            sb_nums[0,10] = draw.Draw_PicFromWad ("num_minus");
            sb_nums[1,10] = draw.Draw_PicFromWad ("anum_minus");

            sb_colon = draw.Draw_PicFromWad ("num_colon");
            sb_slash = draw.Draw_PicFromWad ("num_slash");

            sb_weapons[0,0] = draw.Draw_PicFromWad ("inv_shotgun");
            sb_weapons[0,1] = draw.Draw_PicFromWad ("inv_sshotgun");
            sb_weapons[0,2] = draw.Draw_PicFromWad ("inv_nailgun");
            sb_weapons[0,3] = draw.Draw_PicFromWad ("inv_snailgun");
            sb_weapons[0,4] = draw.Draw_PicFromWad ("inv_rlaunch");
            sb_weapons[0,5] = draw.Draw_PicFromWad ("inv_srlaunch");
            sb_weapons[0,6] = draw.Draw_PicFromWad ("inv_lightng");

            sb_weapons[1,0] = draw.Draw_PicFromWad ("inv2_shotgun");
            sb_weapons[1,1] = draw.Draw_PicFromWad ("inv2_sshotgun");
            sb_weapons[1,2] = draw.Draw_PicFromWad ("inv2_nailgun");
            sb_weapons[1,3] = draw.Draw_PicFromWad ("inv2_snailgun");
            sb_weapons[1,4] = draw.Draw_PicFromWad ("inv2_rlaunch");
            sb_weapons[1,5] = draw.Draw_PicFromWad ("inv2_srlaunch");
            sb_weapons[1,6] = draw.Draw_PicFromWad ("inv2_lightng");

            for (i=0 ; i<5 ; i++)
            {
                sb_weapons[2+i,0] = draw.Draw_PicFromWad ("inva" + (i+1) + "_shotgun");
                sb_weapons[2+i,1] = draw.Draw_PicFromWad ("inva" + (i+1) + "_sshotgun");
                sb_weapons[2+i,2] = draw.Draw_PicFromWad ("inva" + (i+1) + "_nailgun");
                sb_weapons[2+i,3] = draw.Draw_PicFromWad ("inva" + (i+1) + "_snailgun");
                sb_weapons[2+i,4] = draw.Draw_PicFromWad ("inva" + (i+1) + "_rlaunch");
                sb_weapons[2+i,5] = draw.Draw_PicFromWad ("inva" + (i+1) + "_srlaunch");
                sb_weapons[2+i,6] = draw.Draw_PicFromWad ("inva" + (i+1) + "_lightng");
            }

            sb_ammo[0] = draw.Draw_PicFromWad ("sb_shells");
            sb_ammo[1] = draw.Draw_PicFromWad ("sb_nails");
            sb_ammo[2] = draw.Draw_PicFromWad ("sb_rocket");
            sb_ammo[3] = draw.Draw_PicFromWad ("sb_cells");

            sb_armor[0] = draw.Draw_PicFromWad ("sb_armor1");
            sb_armor[1] = draw.Draw_PicFromWad ("sb_armor2");
            sb_armor[2] = draw.Draw_PicFromWad ("sb_armor3");

            sb_items[0] = draw.Draw_PicFromWad ("sb_key1");
            sb_items[1] = draw.Draw_PicFromWad ("sb_key2");
            sb_items[2] = draw.Draw_PicFromWad ("sb_invis");
            sb_items[3] = draw.Draw_PicFromWad ("sb_invuln");
            sb_items[4] = draw.Draw_PicFromWad ("sb_suit");
            sb_items[5] = draw.Draw_PicFromWad ("sb_quad");

            sb_sigil[0] = draw.Draw_PicFromWad ("sb_sigil1");
            sb_sigil[1] = draw.Draw_PicFromWad ("sb_sigil2");
            sb_sigil[2] = draw.Draw_PicFromWad ("sb_sigil3");
            sb_sigil[3] = draw.Draw_PicFromWad ("sb_sigil4");

            sb_faces[4,0] = draw.Draw_PicFromWad ("face1");
            sb_faces[4,1] = draw.Draw_PicFromWad ("face_p1");
            sb_faces[3,0] = draw.Draw_PicFromWad ("face2");
            sb_faces[3,1] = draw.Draw_PicFromWad ("face_p2");
            sb_faces[2,0] = draw.Draw_PicFromWad ("face3");
            sb_faces[2,1] = draw.Draw_PicFromWad ("face_p3");
            sb_faces[1,0] = draw.Draw_PicFromWad ("face4");
            sb_faces[1,1] = draw.Draw_PicFromWad ("face_p4");
            sb_faces[0,0] = draw.Draw_PicFromWad ("face5");
            sb_faces[0,1] = draw.Draw_PicFromWad ("face_p5");

            sb_face_invis = draw.Draw_PicFromWad ("face_invis");
            sb_face_invuln = draw.Draw_PicFromWad ("face_invul2");
            sb_face_invis_invuln = draw.Draw_PicFromWad ("face_inv2");
            sb_face_quad = draw.Draw_PicFromWad ("face_quad");

            cmd.Cmd_AddCommand("+showscores", Sbar_ShowScores);
            cmd.Cmd_AddCommand("-showscores", Sbar_DontShowScores);

            sb_sbar = draw.Draw_PicFromWad ("sbar");
            sb_ibar = draw.Draw_PicFromWad ("ibar");
            sb_scorebar = draw.Draw_PicFromWad ("scorebar");

            //MED 01/04/97 added new hipnotic weapons
            if (common.hipnotic)
            {
              hsb_weapons[0,0] = draw.Draw_PicFromWad ("inv_laser");
              hsb_weapons[0,1] = draw.Draw_PicFromWad ("inv_mjolnir");
              hsb_weapons[0,2] = draw.Draw_PicFromWad ("inv_gren_prox");
              hsb_weapons[0,3] = draw.Draw_PicFromWad ("inv_prox_gren");
              hsb_weapons[0,4] = draw.Draw_PicFromWad ("inv_prox");

              hsb_weapons[1,0] = draw.Draw_PicFromWad ("inv2_laser");
              hsb_weapons[1,1] = draw.Draw_PicFromWad ("inv2_mjolnir");
              hsb_weapons[1,2] = draw.Draw_PicFromWad ("inv2_gren_prox");
              hsb_weapons[1,3] = draw.Draw_PicFromWad ("inv2_prox_gren");
              hsb_weapons[1,4] = draw.Draw_PicFromWad ("inv2_prox");

              for (i=0 ; i<5 ; i++)
              {
                 hsb_weapons[2+i,0] = draw.Draw_PicFromWad ("inva" + (i+1) + "_laser");
                 hsb_weapons[2+i,1] = draw.Draw_PicFromWad ("inva" + (i+1) + "_mjolnir");
                 hsb_weapons[2+i,2] = draw.Draw_PicFromWad ("inva" + (i+1) + "_gren_prox");
                 hsb_weapons[2+i,3] = draw.Draw_PicFromWad ("inva" + (i+1) + "_prox_gren");
                 hsb_weapons[2+i,4] = draw.Draw_PicFromWad ("inva" + (i+1) + "_prox");
              }

              hsb_items[0] = draw.Draw_PicFromWad ("sb_wsuit");
              hsb_items[1] = draw.Draw_PicFromWad ("sb_eshld");
            }

            if (common.rogue)
            {
                rsb_invbar[0] = draw.Draw_PicFromWad ("r_invbar1");
                rsb_invbar[1] = draw.Draw_PicFromWad ("r_invbar2");

                rsb_weapons[0] = draw.Draw_PicFromWad ("r_lava");
                rsb_weapons[1] = draw.Draw_PicFromWad ("r_superlava");
                rsb_weapons[2] = draw.Draw_PicFromWad ("r_gren");
                rsb_weapons[3] = draw.Draw_PicFromWad ("r_multirock");
                rsb_weapons[4] = draw.Draw_PicFromWad ("r_plasma");

                rsb_items[0] = draw.Draw_PicFromWad ("r_shield1");
                rsb_items[1] = draw.Draw_PicFromWad ("r_agrav1");

            // PGM 01/19/97 - team color border
                rsb_teambord = draw.Draw_PicFromWad ("r_teambord");
            // PGM 01/19/97 - team color border

                rsb_ammo[0] = draw.Draw_PicFromWad ("r_ammolava");
                rsb_ammo[1] = draw.Draw_PicFromWad ("r_ammomulti");
                rsb_ammo[2] = draw.Draw_PicFromWad ("r_ammoplasma");
            }
        }
Ejemplo n.º 6
0
        /*
         * =============
         * Draw_TransPicTranslate
         * =============
         */
        public static void Draw_TransPicTranslate(int x, int y, wad.qpic_t pic, byte[] translation)
        {
            int  dest, source;
            byte tbyte;
            int  v, u;

            if (x < 0 || (uint)(x + pic.width) > screen.vid.width || y < 0 ||
                (uint)(y + pic.height) > screen.vid.height)
            {
                sys_linux.Sys_Error("Draw_TransPic: bad coordinates");
            }

            source = 0;

            dest = (int)(y * screen.vid.rowbytes + x);

            if ((pic.width & 7) != 0)
            {           // general
                for (v = 0; v < pic.height; v++)
                {
                    for (u = 0; u < pic.width; u++)
                    {
                        if ((tbyte = pic.data[source + u]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u] = translation[tbyte];
                        }
                    }

                    dest   += (int)screen.vid.rowbytes;
                    source += pic.width;
                }
            }
            else
            {           // unwound
                for (v = 0; v < pic.height; v++)
                {
                    for (u = 0; u < pic.width; u += 8)
                    {
                        if ((tbyte = pic.data[source + u]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u] = translation[tbyte];
                        }
                        if ((tbyte = pic.data[source + u + 1]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u + 1] = translation[tbyte];
                        }
                        if ((tbyte = pic.data[source + u + 2]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u + 2] = translation[tbyte];
                        }
                        if ((tbyte = pic.data[source + u + 3]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u + 3] = translation[tbyte];
                        }
                        if ((tbyte = pic.data[source + u + 4]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u + 4] = translation[tbyte];
                        }
                        if ((tbyte = pic.data[source + u + 5]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u + 5] = translation[tbyte];
                        }
                        if ((tbyte = pic.data[source + u + 6]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u + 6] = translation[tbyte];
                        }
                        if ((tbyte = pic.data[source + u + 7]) != TRANSPARENT_COLOR)
                        {
                            screen.vid.buffer[dest + u + 7] = translation[tbyte];
                        }
                    }
                    dest   += (int)screen.vid.rowbytes;
                    source += pic.width;
                }
            }
        }
Ejemplo n.º 7
0
        /*
        ===============
        Draw_Init
        ===============
        */
        public static void Draw_Init()
        {
            draw_chars = wad.W_GetLumpName("conchars");
            draw_disc = wad.W_GetLumpName("disc");
            draw_backtile = wad.W_GetLumpName("backtile");

            r_rectdesc.width = draw_backtile.width;
            r_rectdesc.height = draw_backtile.height;
            r_rectdesc.ptexbytes = draw_backtile.data;
            r_rectdesc.rowbytes = draw_backtile.width;
        }