示例#1
0
        // Sbar_DrawFrags
        private static void DrawFrags()
        {
            SortFrags();

            // draw the text
            int            l = _ScoreBoardLines <= 4 ? _ScoreBoardLines : 4;
            int            xofs, x = 23;
            client_state_t cl = client.cl;

            if (cl.gametype == protocol.GAME_DEATHMATCH)
            {
                xofs = 0;
            }
            else
            {
                xofs = (Scr.vid.width - 320) >> 1;
            }

            int y = Scr.vid.height - SBAR_HEIGHT - 23;

            for (int i = 0; i < l; i++)
            {
                int          k = _FragSort[i];
                scoreboard_t s = cl.scores[k];
                if (String.IsNullOrEmpty(s.name))
                {
                    continue;
                }

                // draw background
                int top    = s.colors & 0xf0;
                int bottom = (s.colors & 15) << 4;
                top    = ColorForMap(top);
                bottom = ColorForMap(bottom);

                Drawer.Fill(xofs + x * 8 + 10, y, 28, 4, top);
                Drawer.Fill(xofs + x * 8 + 10, y + 4, 28, 3, bottom);

                // draw number
                int    f   = s.frags;
                string num = f.ToString().PadLeft(3);
                //sprintf(num, "%3i", f);

                DrawCharacter((x + 1) * 8, -24, num[0]);
                DrawCharacter((x + 2) * 8, -24, num[1]);
                DrawCharacter((x + 3) * 8, -24, num[2]);

                if (k == cl.viewentity - 1)
                {
                    DrawCharacter(x * 8 + 2, -24, 16);
                    DrawCharacter((x + 4) * 8 - 4, -24, 17);
                }
                x += 4;
            }
        }
示例#2
0
        // Sbar_DeathmatchOverlay
        private static void DeathmatchOverlay()
        {
            Scr.CopyEverithing = true;
            Scr.FullUpdate     = 0;

            glpic_t pic = Drawer.CachePic("gfx/ranking.lmp");

            menu.DrawPic((320 - pic.width) / 2, 8, pic);

            // scores
            SortFrags();

            // draw the text
            int l = _ScoreBoardLines;

            int x = 80 + ((Scr.vid.width - 320) >> 1);
            int y = 40;

            for (int i = 0; i < l; i++)
            {
                int          k = _FragSort[i];
                scoreboard_t s = client.cl.scores[k];
                if (String.IsNullOrEmpty(s.name))
                {
                    continue;
                }

                // draw background
                int top    = s.colors & 0xf0;
                int bottom = (s.colors & 15) << 4;
                top    = ColorForMap(top);
                bottom = ColorForMap(bottom);

                Drawer.Fill(x, y, 40, 4, top);
                Drawer.Fill(x, y + 4, 40, 4, bottom);

                // draw number
                string num = s.frags.ToString().PadLeft(3);

                Drawer.DrawCharacter(x + 8, y, num[0]);
                Drawer.DrawCharacter(x + 16, y, num[1]);
                Drawer.DrawCharacter(x + 24, y, num[2]);

                if (k == client.cl.viewentity - 1)
                {
                    Drawer.DrawCharacter(x - 8, y, 12);
                }

                // draw name
                Drawer.DrawString(x + 64, y, s.name);

                y += 10;
            }
        }
示例#3
0
        // Sbar_DeathmatchOverlay
        private static void MiniDeathmatchOverlay()
        {
            if (Scr.vid.width < 512 || sbar.Lines == 0)
            {
                return;
            }

            Scr.CopyEverithing = true;
            Scr.FullUpdate     = 0;

            // scores
            SortFrags();

            // draw the text
            int l        = _ScoreBoardLines;
            int y        = Scr.vid.height - sbar.Lines;
            int numlines = sbar.Lines / 8;

            if (numlines < 3)
            {
                return;
            }

            //find us
            int i;

            for (i = 0; i < _ScoreBoardLines; i++)
            {
                if (_FragSort[i] == client.cl.viewentity - 1)
                {
                    break;
                }
            }

            if (i == _ScoreBoardLines)  // we're not there
            {
                i = 0;
            }
            else // figure out start
            {
                i = i - numlines / 2;
            }

            if (i > _ScoreBoardLines - numlines)
            {
                i = _ScoreBoardLines - numlines;
            }
            if (i < 0)
            {
                i = 0;
            }

            int x = 324;

            for ( ; i < _ScoreBoardLines && y < Scr.vid.height - 8; i++)
            {
                int          k = _FragSort[i];
                scoreboard_t s = client.cl.scores[k];
                if (String.IsNullOrEmpty(s.name))
                {
                    continue;
                }

                // draw background
                int top    = s.colors & 0xf0;
                int bottom = (s.colors & 15) << 4;
                top    = ColorForMap(top);
                bottom = ColorForMap(bottom);

                Drawer.Fill(x, y + 1, 40, 3, top);
                Drawer.Fill(x, y + 4, 40, 4, bottom);

                // draw number
                string num = s.frags.ToString().PadLeft(3);
                Drawer.DrawCharacter(x + 8, y, num[0]);
                Drawer.DrawCharacter(x + 16, y, num[1]);
                Drawer.DrawCharacter(x + 24, y, num[2]);

                if (k == client.cl.viewentity - 1)
                {
                    Drawer.DrawCharacter(x, y, 16);
                    Drawer.DrawCharacter(x + 32, y, 17);
                }

                // draw name
                Drawer.DrawString(x + 48, y, s.name);

                y += 8;
            }
        }
示例#4
0
        // Sbar_DrawFace
        private static void DrawFace()
        {
            client_state_t cl = client.cl;

            // PGM 01/19/97 - team color drawing
            // PGM 03/02/97 - fixed so color swatch only appears in CTF modes
            if (common.GameKind == GameKind.Rogue &&
                (client.cl.maxclients != 1) &&
                (host.TeamPlay > 3) &&
                (host.TeamPlay < 7))
            {
                scoreboard_t s = cl.scores[cl.viewentity - 1];

                // draw background
                int top    = s.colors & 0xf0;
                int bottom = (s.colors & 15) << 4;
                top    = ColorForMap(top);
                bottom = ColorForMap(bottom);

                int xofs;
                if (cl.gametype == protocol.GAME_DEATHMATCH)
                {
                    xofs = 113;
                }
                else
                {
                    xofs = ((Scr.vid.width - 320) >> 1) + 113;
                }

                DrawPic(112, 0, _RTeamBord);
                Drawer.Fill(xofs, Scr.vid.height - SBAR_HEIGHT + 3, 22, 9, top);
                Drawer.Fill(xofs, Scr.vid.height - SBAR_HEIGHT + 12, 22, 9, bottom);

                // draw number
                string num = s.frags.ToString().PadLeft(3);
                if (top == 8)
                {
                    if (num[0] != ' ')
                    {
                        DrawCharacter(109, 3, 18 + num[0] - '0');
                    }
                    if (num[1] != ' ')
                    {
                        DrawCharacter(116, 3, 18 + num[1] - '0');
                    }
                    if (num[2] != ' ')
                    {
                        DrawCharacter(123, 3, 18 + num[2] - '0');
                    }
                }
                else
                {
                    DrawCharacter(109, 3, num[0]);
                    DrawCharacter(116, 3, num[1]);
                    DrawCharacter(123, 3, num[2]);
                }

                return;
            }
            // PGM 01/19/97 - team color drawing

            int f, anim;

            if (cl.HasItems(QItems.IT_INVISIBILITY | QItems.IT_INVULNERABILITY))
            {
                DrawPic(112, 0, _FaceInvisInvuln);
                return;
            }
            if (cl.HasItems(QItems.IT_QUAD))
            {
                DrawPic(112, 0, _FaceQuad);
                return;
            }
            if (cl.HasItems(QItems.IT_INVISIBILITY))
            {
                DrawPic(112, 0, _FaceInvis);
                return;
            }
            if (cl.HasItems(QItems.IT_INVULNERABILITY))
            {
                DrawPic(112, 0, _FaceInvuln);
                return;
            }

            if (cl.stats[QStats.STAT_HEALTH] >= 100)
            {
                f = 4;
            }
            else
            {
                f = cl.stats[QStats.STAT_HEALTH] / 20;
            }

            if (cl.time <= cl.faceanimtime)
            {
                anim     = 1;
                _Updates = 0; // make sure the anim gets drawn over
            }
            else
            {
                anim = 0;
            }

            DrawPic(112, 0, _Faces[f, anim]);
        }