Beispiel #1
0
/*
===============
Sbar_DrawHipKeys
===============
*/
void Sbar_DrawHipKeys (int x, int y) // default 209, 3
{
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_keys.value)
            return;
    if (hipnotic) // keys (hipnotic only)
    {
        if (cl.items & IT_KEY1)
            Sbar_DrawTransPic (x, y, sb_items[0]);
        if (cl.items & IT_KEY2)
            Sbar_DrawTransPic (x, y + 9, sb_items[1]);
    }
}
Beispiel #2
0
/*
=============
Sbar_DrawNum
=============
*/
void
Sbar_DrawNum(int x, int y, int num, int digits, int color)
{
    char str[12];
    char *ptr;
    int l, frame;

    l = Sbar_itoa(num, str);
    ptr = str;
    if (l > digits)
	ptr += (l - digits);
    if (l < digits)
	x += (digits - l) * 24;

    while (*ptr) {
	if (*ptr == '-')
	    frame = STAT_MINUS;
	else
	    frame = *ptr - '0';

	Sbar_DrawTransPic(x, y, sb_nums[color][frame]);
	x += 24;
	ptr++;
    }
}
Beispiel #3
0
/*
===============
Sbar_DrawPowerUps
===============
*/
void Sbar_DrawPowerUps (int x, int y) // default 224, -16
{
    int		i;
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_powerups.value)
            return;
    for (i=0 ; i<4 ; i++)
        if (cl.items & (1<<(19+i)))
            Sbar_DrawTransPic (x + i*16, y, sb_items[i+2]);
}
Beispiel #4
0
/*
===============
Sbar_DrawRunes
===============
*/
void Sbar_DrawRunes (int x, int y) // default 288, -16
{
    int		i;
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_runes.value)
            return;
    if (!rogue && !hipnotic)
        for (i=0 ; i<4 ; i++)
            if (cl.items & (1<<(28+i)))
                Sbar_DrawTransPic (x + i*8, y, sb_sigil[i]);
}
Beispiel #5
0
/*
===============
Sbar_DrawPowerups_Hipnotic
===============
*/
void Sbar_DrawPowerups_Hipnotic (int x, int y) // default 288, -16
{
    int		i;
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_powerups.value)
            return;
    if (hipnotic)
        for (i=0 ; i<2 ; i++)
            if (cl.items & (1<<(24+i)))
                Sbar_DrawTransPic (x + i*16, y, hsb_items[i]);
}
Beispiel #6
0
/*
===============
Sbar_DrawKeys
===============
*/
void Sbar_DrawKeys (int x, int y) // default 192, -16
{
    int		i;
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_keys.value)
            return;
    if (!hipnotic)
        for (i=0 ; i<2 ; i++)
            if (cl.items & (1<<(17+i)))
                Sbar_DrawTransPic (x + i*16, y, sb_items[i]);
}
Beispiel #7
0
/*
===============
Sbar_DrawArmor
===============
*/
void Sbar_DrawArmor (int x, int x2, int y) // default 0, 24, 0
{
    int i = 0;
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_armor.value)
            return;
    if (cl.items & IT_INVULNERABILITY)
    {
        Sbar_DrawTransPic (x, y, draw_disc);
        Sbar_DrawNum (x2, y, 666, 3, 1);
    }
    else
    {
        if (rogue)
        {
            if (cl.items & RIT_ARMOR3)
                Sbar_DrawTransPic (x, y, sb_armor[2]);
            else if (cl.items & RIT_ARMOR2)
                Sbar_DrawTransPic (x, y, sb_armor[1]);
            else if (cl.items & RIT_ARMOR1)
                Sbar_DrawTransPic (x, y, sb_armor[0]);
            else
                i = 1;
        }
        else
        {
            if (cl.items & IT_ARMOR3)
                Sbar_DrawTransPic (x, y, sb_armor[2]);
            else if (cl.items & IT_ARMOR2)
                Sbar_DrawTransPic (x, y, sb_armor[1]);
            else if (cl.items & IT_ARMOR1)
                Sbar_DrawTransPic (x, y, sb_armor[0]);
            else
                i = 1;
        }
        if (!i || sbar.value < 4 || cl.stats[STAT_ARMOR])
            Sbar_DrawNum (x2, y, cl.stats[STAT_ARMOR], 3, cl.stats[STAT_ARMOR] <= 25);
    }
}
Beispiel #8
0
/*
===============
Sbar_DrawFace
===============
*/
void Sbar_DrawFace (int x, int y) // default 112, 0
{
    int		f, anim;

// PGM 01/19/97 - team color drawing
// PGM 03/02/97 - fixed so color swatch only appears in CTF modes
    if (rogue && (cl.maxclients != 1) && (teamplay.value>3) && (teamplay.value<7))
    {
        int				top, bottom;
        int				xofs;
        char			num[12];
        scoreboard_t	*s;

        s = &cl.scores[cl.viewentity - 1];
        // draw background
        top = s->colors & 0xf0;
        bottom = (s->colors & 15)<<4;
        top = Sbar_ColorForMap (top);
        bottom = Sbar_ColorForMap (bottom);

        xofs = x + 2; // 113 mankrip - edited

        Sbar_DrawTransPic (x, 0, rsb_teambord); // 112 mankrip - edited
        M_Draw_Fill (xofs, 200 - SBAR_HEIGHT +  3, 20, 9, top   ); // mankrip - edited
        M_Draw_Fill (xofs, 200 - SBAR_HEIGHT + 12, 20, 9, bottom); // mankrip - edited

        // draw number
        f = s->frags;
        sprintf (num, "%3i",f);

        if (top==8)
        {
            if (num[0] != ' ')
                Sbar_DrawCharacter(x - 3, 3, 18 + num[0] - '0'); // 109 mankrip - edited
            if (num[1] != ' ')
                Sbar_DrawCharacter(x + 4, 3, 18 + num[1] - '0'); // 116 mankrip - edited
            if (num[2] != ' ')
                Sbar_DrawCharacter(x + 11, 3, 18 + num[2] - '0'); // 123 mankrip - edited
        }
        else
        {
            Sbar_DrawCharacter ( x - 3, 3, num[0]); // 109 mankrip - edited
            Sbar_DrawCharacter ( x + 4, 3, num[1]); // 116 mankrip - edited
            Sbar_DrawCharacter ( x + 11, 3, num[2]); // 123 mankrip - edited
        }
        return;
    }
// PGM 01/19/97 - team color drawing

    // mankrip - begin
    if (cl.stats[STAT_HEALTH] <= 0)
    {
        Sbar_DrawTransPic (x, y, sb_faces[0][0]);
        return;
    }
    // mankrip - end

    if ( (cl.items & (IT_INVISIBILITY | IT_INVULNERABILITY)) ==
            (IT_INVISIBILITY | IT_INVULNERABILITY) )
    {
        Sbar_DrawTransPic (x, y, sb_face_invis_invuln); // mankrip - edited
        return;
    }
    if (cl.items & IT_QUAD)
    {
        Sbar_DrawTransPic (x, y, sb_face_quad ); // mankrip - edited
        return;
    }
    if (cl.items & IT_INVISIBILITY)
    {
        Sbar_DrawTransPic (x, y, sb_face_invis ); // mankrip - edited
        return;
    }
    if (cl.items & IT_INVULNERABILITY)
    {
        Sbar_DrawTransPic (x, y, sb_face_invuln); // mankrip - edited
        return;
    }

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

    if (cl.time <= cl.faceanimtime)
        anim = 1;
    else
        anim = 0;
    Sbar_DrawTransPic (x, y, sb_faces[f][anim]); // mankrip - edited
}
Beispiel #9
0
/*
===============
Sbar_DrawWeaponList
===============
*/
void Sbar_DrawWeaponList (int x, int y, int vertical) // default 0, -16, 0
{
    int		i;
    float	time;
    int		flashon;
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_weaponlist.value)
            return;

// weapons
    for (i=0 ; i<7 ; i++)
        if (cl.items & (IT_SHOTGUN<<i) )
        {
            time = cl.item_gettime[i];
            flashon = (int)((cl.time - time)*10);
            if (flashon >= 10)
            {
                if ( cl.stats[STAT_ACTIVEWEAPON] == (IT_SHOTGUN<<i)  )
                    flashon = 1;
                else
                    flashon = 0;
            }
            else
                flashon = (flashon%5) + 2;
            if (vertical == 0)
                Sbar_DrawTransPic (i*24 + x, y, sb_weapons[flashon][i]);
            else if (i == 6)
            {
                if (hipnotic)
                    Sbar_DrawTransPic (x-8, y - i*16, sb_weapons[flashon][i]);
                else
                    Sbar_DrawTransPic (x-24, y - i*16, sb_weapons[flashon][i]);
            }
            else
                Sbar_DrawTransPic (x, y - i*16, sb_weapons[flashon][i]);
        }

// MED 01/04/97
// hipnotic weapons
    if (hipnotic)
    {
        int grenadeflashing=0;
        for (i=0 ; i<4 ; i++)
            if (cl.items & (1<<hipweapons[i]) )
            {
                time = cl.item_gettime[hipweapons[i]];
                flashon = (int)((cl.time - time)*10);
                if (flashon >= 10)
                {
                    if ( cl.stats[STAT_ACTIVEWEAPON] == (1<<hipweapons[i])  )
                        flashon = 1;
                    else
                        flashon = 0;
                }
                else
                    flashon = (flashon%5) + 2;

                // check grenade launcher
                if (i==2)
                {
                    if (cl.items & HIT_PROXIMITY_GUN)
                        if (flashon)
                        {
                            grenadeflashing = 1;
                            {
                                if (vertical == 0)
                                    Sbar_DrawTransPic (96 + x, y, hsb_weapons[flashon][2]);
                                else
                                    Sbar_DrawTransPic (x, y - 64, hsb_weapons[flashon][2]);
                            }
                        }
                }
                else if (i==3)
                {
                    if (cl.items & (IT_SHOTGUN<<4))
                    {
                        if (flashon && !grenadeflashing)
                        {
                            if (vertical == 0)
                                Sbar_DrawTransPic (96 + x, y, hsb_weapons[flashon][3]);
                            else
                                Sbar_DrawTransPic (x, y - 64, hsb_weapons[flashon][3]);
                        }
                        else if (!grenadeflashing)
                        {
                            if (vertical == 0)
                                Sbar_DrawTransPic (96 + x, y, hsb_weapons[0][3]);
                            else
                                Sbar_DrawTransPic (x, y - 64, hsb_weapons[0][3]);
                        }
                    }
                    else
                    {
                        if (vertical == 0)
                            Sbar_DrawTransPic (96 + x, y, hsb_weapons[flashon][4]);
                        else
                            Sbar_DrawTransPic (x, y - 64, hsb_weapons[flashon][4]);
                    }
                }
                else
                {
                    if (vertical == 0)
                        Sbar_DrawTransPic (176 + (i*24) + x, y, hsb_weapons[flashon][i]);
                    else
                        Sbar_DrawTransPic (x, y - 112 - (i*16), hsb_weapons[flashon][i]);
                }
            }
    }
    else if (rogue) // check for powered up weapon.
        if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN )
            for (i=0; i<5; i++)
                if (cl.stats[STAT_ACTIVEWEAPON] == (RIT_LAVA_NAILGUN << i))
                {
                    if (vertical == 0)
                        Sbar_DrawTransPic ((i+2)*24 + x, y, rsb_weapons[i]);
                    else if (i == 4)
                        Sbar_DrawTransPic (x-24, y - (i+2)*16, rsb_weapons[i]);
                    else
                        Sbar_DrawTransPic (x, y - (i+2)*16, rsb_weapons[i]);
                }
}
Beispiel #10
0
/*
===============
Sbar_Draw
===============
*/
void Sbar_Draw (void)
{
    if (scr_con_current == vid.height)
        return;		// console is full screen

    // mankrip - svc_letterbox - start
    if (cl.letterbox)
    {
        if (cl.letterbox == 1) // hack to ensure the whole screen will be black
            Draw_Fill(0, vid.height/2, vid.width, 1, 0);
        return;
    }
    // mankrip - svc_letterbox - end

    // Manoel Kasimier - crosshair - start
    if (crosshair.value)
    {
        if (crosshair.value < 0 || crosshair.value > 5)
            crosshair.value = 0;
        Crosshair_Start(cl_crossx.value + scr_vrect.x + scr_vrect.width/2 - 6*(vid.width/MIN_VID_WIDTH),
                        cl_crossy.value + scr_vrect.y + scr_vrect.height/2 - 6*(vid.width/MIN_VID_WIDTH)); // Manoel Kasimier - crosshair
    }
    // Manoel Kasimier - crosshair - end

    scr_copyeverything = 1;

// mankrip - begin

    Sbar_SizeScreen ();

    if ( (sb_showscores || sbar.value > 0) && sbar.value < 4)
    {
        if (sbar_show_bg.value)
            Draw_TileClear (scr_vrect.x, vid.height - sb_lines, scr_vrect.width, sb_lines);
#if 0
        else
        {
            Draw_Fill (0, vid.height - sb_lines - screen_bottom, scr_vrect.x, sb_lines, 0); // left
            Draw_Fill (scr_vrect.x+scr_vrect.width, vid.height - sb_lines - screen_bottom, vid.width-(scr_vrect.x+scr_vrect.width), sb_lines, 0); // right
            Draw_Fill (scr_vrect.x, scr_vrect.y+scr_vrect.height, scr_vrect.width, vid.height-(scr_vrect.y+scr_vrect.height)-screen_bottom, 0); // bottom
        }
#endif
        if (sbar.value > 1 || sb_showscores) // inventory bar
        {
            if (sbar.value > 2 || sb_showscores) // score bar
            {
                if (sbar_show_bg.value)
                    Sbar_DrawTransPic (0, -48, sb_scorebar);
                Sbar_SoloScoreboard (0, -48, 0);
            }
            if (sbar_show_bg.value)
            {
                if (rogue)
                {
                    if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN )
                        Sbar_DrawTransPic (0, -24, rsb_invbar[0]);
                    else
                        Sbar_DrawTransPic (0, -24, rsb_invbar[1]);
                }
                else
                    Sbar_DrawTransPic (0, -24, sb_ibar);
            }

            Sbar_DrawAmmoList (0, -24, 0); // 0, -24, 0
            Sbar_DrawWeaponList (0, -16, 0); // 0, -16, 0
            if (rogue)
                Sbar_DrawKeys (192, -16); // 192, -16
            else
                Sbar_DrawKeys (192, -16); // 192, -16
            if (rogue || hipnotic)
                Sbar_DrawPowerUps (224, -16); // 224, -16
            else
                Sbar_DrawPowerUps (224, -16); // 224, -16

            if (rogue)
                Sbar_DrawPowerups_Rogue (288, -16); // 288, -16
            else if (hipnotic)
                Sbar_DrawPowerups_Hipnotic (288, -16); // 288, -16
            else
                Sbar_DrawRunes (288, -16); // sigils 288, -16

            Sbar_DrawFrags ();
        }
        // status bar
        if (sbar_show_bg.value)
            Sbar_DrawTransPic (0, 0, sb_sbar);
        Sbar_DrawArmor (0, 24, 0); // 0, 24, 0
        Sbar_DrawHealth (112, 136, 0); // 112, 136, 0
        Sbar_DrawHipKeys (209, 3); // keys (hipnotic only) 209, 3
        Sbar_DrawAmmo (224, 248, 0); // 224, 248, 0
    }
    else if (sbar.value == 4)
    {
#define SBAR_PADDING 4
        if (rogue || hipnotic)
            Sbar_SoloScoreboard (SBAR_PADDING, -49, 1);
        else
            Sbar_SoloScoreboard (SBAR_PADDING, -33, 1);

        Sbar_DrawAmmoList	(320 - SBAR_PADDING - 28, -9, 1);
        Sbar_DrawWeaponList	(320 - SBAR_PADDING - 24, -48, 1);

        if (rogue)
            Sbar_DrawKeys (320 - SBAR_PADDING - 56, -16);
        else
            Sbar_DrawKeys (320 - SBAR_PADDING - 88, -16);

        if (rogue || hipnotic)
        {
            Sbar_DrawPowerUps (SBAR_PADDING, -40);
            Sbar_DrawPowerups_Rogue		(64 + SBAR_PADDING, -40);
            Sbar_DrawPowerups_Hipnotic	(64 + SBAR_PADDING, -40);
        }
        else
            Sbar_DrawPowerUps (320 - SBAR_PADDING - 88, -32);

        Sbar_DrawRunes (320 - SBAR_PADDING - 56, -16); // sigils

//		Sbar_DrawFrags (); // TO DO

        Sbar_DrawArmor	(SBAR_PADDING, 24 + SBAR_PADDING, -24);
        Sbar_DrawHealth	(SBAR_PADDING, 24 + SBAR_PADDING, 0);
        Sbar_DrawHipKeys (320 - SBAR_PADDING - 40, -18); // keys (hipnotic only)
        Sbar_DrawAmmo (320 - SBAR_PADDING - 24, 320 - SBAR_PADDING - 96, 0);
    }

    if (cl.gametype == GAME_DEATHMATCH)
        if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
            Sbar_DeathmatchOverlay ();
// mankrip - end
}
Beispiel #11
0
/*
===============
Sbar_DrawAmmo
===============
*/
void Sbar_DrawAmmo (int x, int x2, int y) // default 224, 248, 0
{
    int i = 0;
    if (sbar.value > 3)
        if (!sb_showscores && !sbar_show_ammo.value)
            return;
    if (rogue)
    {
        if (cl.items & RIT_SHELLS)
            Sbar_DrawTransPic (x, y, sb_ammo[0]);
        else if (cl.items & RIT_NAILS)
            Sbar_DrawTransPic (x, y, sb_ammo[1]);
        else if (cl.items & RIT_ROCKETS)
            Sbar_DrawTransPic (x, y, sb_ammo[2]);
        else if (cl.items & RIT_CELLS)
            Sbar_DrawTransPic (x, y, sb_ammo[3]);
        else if (cl.items & RIT_LAVA_NAILS)
            Sbar_DrawTransPic (x, y, rsb_ammo[0]);
        else if (cl.items & RIT_PLASMA_AMMO)
            Sbar_DrawTransPic (x, y, rsb_ammo[1]);
        else if (cl.items & RIT_MULTI_ROCKETS)
            Sbar_DrawTransPic (x, y, rsb_ammo[2]);
        else
            i = 1;
    }
    else
    {
        if (cl.items & IT_SHELLS)
            Sbar_DrawTransPic (x, y, sb_ammo[0]);
        else if (cl.items & IT_NAILS)
            Sbar_DrawTransPic (x, y, sb_ammo[1]);
        else if (cl.items & IT_ROCKETS)
            Sbar_DrawTransPic (x, y, sb_ammo[2]);
        else if (cl.items & IT_CELLS)
            Sbar_DrawTransPic (x, y, sb_ammo[3]);
        else
            i = 1;
    }
    if (!i || sbar.value < 4 || cl.stats[STAT_AMMO])
        Sbar_DrawNum (x2, y, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
}