示例#1
0
文件: sbar.c 项目: CatalystG/tyrquake
/*
===============
Sbar_Draw
===============
*/
void
Sbar_Draw(void)
{
    qboolean headsup;
    char st[512];

    headsup = !(cl_sbar.value || scr_viewsize.value < 100);
    if ((sb_updates >= vid.numpages) && !headsup)
	return;

    if (scr_con_current == vid.height)
	return;			// console is full screen

    scr_copyeverything = 1;
//      scr_fullupdate = 0;

    sb_updates++;

// top line
    if (sb_lines > 24) {
	if (!cl.spectator || autocam == CAM_TRACK)
	    Sbar_DrawInventory();
	if (!headsup || vid.width < 512)
	    Sbar_DrawFrags();
    }
// main area
    if (sb_lines > 0) {
	if (cl.spectator) {
	    if (autocam != CAM_TRACK) {
		Sbar_DrawPic(0, 0, sb_scorebar);
		Sbar_DrawString(160 - 7 * 8, 4, "SPECTATOR MODE");
		Sbar_DrawString(160 - 14 * 8 + 4, 12,
				"Press [ATTACK] for AutoCamera");
	    } else {
		if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
		    Sbar_SoloScoreboard();
		else
		    Sbar_DrawNormal();

//                                      Sbar_DrawString (160-14*8+4,4, "SPECTATOR MODE - TRACK CAMERA");
		sprintf(st, "Tracking %-.13s, [JUMP] for next",
			cl.players[spec_track].name);
		Sbar_DrawString(0, -8, st);
	    }
	} else if (sb_showscores || cl.stats[STAT_HEALTH] <= 0)
	    Sbar_SoloScoreboard();
	else
	    Sbar_DrawNormal();
    }
// main screen deathmatch rankings
    // if we're dead show team scores in team games
    if (cl.stats[STAT_HEALTH] <= 0 && !cl.spectator)
	if (atoi(Info_ValueForKey(cl.serverinfo, "teamplay")) > 0 &&
	    !sb_showscores)
	    Sbar_TeamOverlay();
	else
	    Sbar_DeathmatchOverlay(0);
    else if (sb_showscores)
	Sbar_DeathmatchOverlay(0);
    else if (sb_showteamscores)
	Sbar_TeamOverlay();

#ifdef GLQUAKE
    if (sb_showscores || sb_showteamscores || cl.stats[STAT_HEALTH] <= 0)
	sb_updates = 0;
    // clear unused areas in gl
#if 0
    {
	int x = (vid.width - 320) >> 1;

	// left
	if (x > 0) {
	    Draw_TileClear(0, vid.height - sb_lines, x, sb_lines);
	    Draw_TileClear(x + 320, vid.height - sb_lines,
			   vid.width - x + 320, sb_lines);
	}
    }
#endif
    if (vid.width > 320 && !headsup)
	Draw_TileClear(320, vid.height - sb_lines, vid.width - 320, sb_lines);
#endif

    if (sb_lines > 0)
	Sbar_MiniDeathmatchOverlay();
}
示例#2
0
文件: sbar.c 项目: dommul/super8
/*
===============
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
}