TileClear() public static method

public static TileClear ( int x, int y, int w, int h ) : void
x int
y int
w int
h int
return void
示例#1
0
        // SCR_TileClear
        private static void TileClear()
        {
            refdef_t rdef = Render.RefDef;

            if (rdef.vrect.x > 0)
            {
                // left
                Drawer.TileClear(0, 0, rdef.vrect.x, _VidDef.height - Sbar.Lines);
                // right
                Drawer.TileClear(rdef.vrect.x + rdef.vrect.width, 0,
                                 _VidDef.width - rdef.vrect.x + rdef.vrect.width,
                                 _VidDef.height - Sbar.Lines);
            }
            if (rdef.vrect.y > 0)
            {
                // top
                Drawer.TileClear(rdef.vrect.x, 0, rdef.vrect.x + rdef.vrect.width, rdef.vrect.y);
                // bottom
                Drawer.TileClear(rdef.vrect.x, rdef.vrect.y + rdef.vrect.height,
                                 rdef.vrect.width, _VidDef.height - Sbar.Lines - (rdef.vrect.height + rdef.vrect.y));
            }
        }
示例#2
0
        // Sbar_Draw
        // called every frame by screen
        public static void Draw()
        {
            viddef_t vid = Scr.vid;

            if (Scr.ConCurrent == vid.height)
            {
                return;     // console is full screen
            }

            if (_Updates >= vid.numpages)
            {
                return;
            }

            Scr.CopyEverithing = true;

            _Updates++;

            if (Sbar.Lines > 0 && vid.width > 320)
            {
                Drawer.TileClear(0, vid.height - Sbar.Lines, vid.width, Sbar.Lines);
            }

            if (Sbar.Lines > 24)
            {
                DrawInventory();
                if (Client.Cl.maxclients != 1)
                {
                    DrawFrags();
                }
            }

            ClientState cl = Client.Cl;

            if (_ShowScores || cl.stats[QStats.STAT_HEALTH] <= 0)
            {
                DrawPic(0, 0, _ScoreBar);
                DrawScoreboard();
                _Updates = 0;
            }
            else if (Sbar.Lines > 0)
            {
                DrawPic(0, 0, _SBar);

                // keys (hipnotic only)
                //MED 01/04/97 moved keys here so they would not be overwritten
                if (Common.GameKind == GameKind.Hipnotic)
                {
                    if (cl.HasItems(QItems.IT_KEY1))
                    {
                        DrawPic(209, 3, _Items[0]);
                    }

                    if (cl.HasItems(QItems.IT_KEY2))
                    {
                        DrawPic(209, 12, _Items[1]);
                    }
                }
                // armor
                if (cl.HasItems(QItems.IT_INVULNERABILITY))
                {
                    DrawNum(24, 0, 666, 3, 1);
                    DrawPic(0, 0, Drawer.Disc);
                }
                else
                {
                    if (Common.GameKind == GameKind.Rogue)
                    {
                        DrawNum(24, 0, cl.stats[QStats.STAT_ARMOR], 3, cl.stats[QStats.STAT_ARMOR] <= 25 ? 1 : 0); // uze: corrected color param
                        if (cl.HasItems(QItems.RIT_ARMOR3))
                        {
                            DrawPic(0, 0, _Armor[2]);
                        }
                        else if (cl.HasItems(QItems.RIT_ARMOR2))
                        {
                            DrawPic(0, 0, _Armor[1]);
                        }
                        else if (cl.HasItems(QItems.RIT_ARMOR1))
                        {
                            DrawPic(0, 0, _Armor[0]);
                        }
                    }
                    else
                    {
                        DrawNum(24, 0, cl.stats[QStats.STAT_ARMOR], 3, cl.stats[QStats.STAT_ARMOR] <= 25 ? 1 : 0);
                        if (cl.HasItems(QItems.IT_ARMOR3))
                        {
                            DrawPic(0, 0, _Armor[2]);
                        }
                        else if (cl.HasItems(QItems.IT_ARMOR2))
                        {
                            DrawPic(0, 0, _Armor[1]);
                        }
                        else if (cl.HasItems(QItems.IT_ARMOR1))
                        {
                            DrawPic(0, 0, _Armor[0]);
                        }
                    }
                }

                // face
                DrawFace();

                // health
                DrawNum(136, 0, cl.stats[QStats.STAT_HEALTH], 3, cl.stats[QStats.STAT_HEALTH] <= 25 ? 1 : 0);

                // ammo icon
                if (Common.GameKind == GameKind.Rogue)
                {
                    if (cl.HasItems(QItems.RIT_SHELLS))
                    {
                        DrawPic(224, 0, _Ammo[0]);
                    }
                    else if (cl.HasItems(QItems.RIT_NAILS))
                    {
                        DrawPic(224, 0, _Ammo[1]);
                    }
                    else if (cl.HasItems(QItems.RIT_ROCKETS))
                    {
                        DrawPic(224, 0, _Ammo[2]);
                    }
                    else if (cl.HasItems(QItems.RIT_CELLS))
                    {
                        DrawPic(224, 0, _Ammo[3]);
                    }
                    else if (cl.HasItems(QItems.RIT_LAVA_NAILS))
                    {
                        DrawPic(224, 0, _RAmmo[0]);
                    }
                    else if (cl.HasItems(QItems.RIT_PLASMA_AMMO))
                    {
                        DrawPic(224, 0, _RAmmo[1]);
                    }
                    else if (cl.HasItems(QItems.RIT_MULTI_ROCKETS))
                    {
                        DrawPic(224, 0, _RAmmo[2]);
                    }
                }
                else
                {
                    if (cl.HasItems(QItems.IT_SHELLS))
                    {
                        DrawPic(224, 0, _Ammo[0]);
                    }
                    else if (cl.HasItems(QItems.IT_NAILS))
                    {
                        DrawPic(224, 0, _Ammo[1]);
                    }
                    else if (cl.HasItems(QItems.IT_ROCKETS))
                    {
                        DrawPic(224, 0, _Ammo[2]);
                    }
                    else if (cl.HasItems(QItems.IT_CELLS))
                    {
                        DrawPic(224, 0, _Ammo[3]);
                    }
                }

                DrawNum(248, 0, cl.stats[QStats.STAT_AMMO], 3, cl.stats[QStats.STAT_AMMO] <= 10 ? 1 : 0);
            }

            if (vid.width > 320)
            {
                if (Client.Cl.gametype == Protocol.GAME_DEATHMATCH)
                {
                    MiniDeathmatchOverlay();
                }
            }
        }