本文整理汇总了C++中CG_Text_Paint_Ext函数的典型用法代码示例。如果您正苦于以下问题:C++ CG_Text_Paint_Ext函数的具体用法?C++ CG_Text_Paint_Ext怎么用?C++ CG_Text_Paint_Ext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CG_Text_Paint_Ext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CG_DemoControlButtonRender
void CG_DemoControlButtonRender(panel_button_t *button)
{
if (button->data[0])
{
CG_FillRect(button->rect.x, button->rect.y, button->rect.w, button->rect.h, color_bg_title);
CG_DrawRect(button->rect.x, button->rect.y, button->rect.w, button->rect.h, 1, color_border);
//BG_PanelButtonsRender_Text(button);
CG_Text_Paint_Ext(button->rect.x + button->rect.w * 0.4f, button->rect.y + button->rect.h * 0.7f, button->font->scalex, button->font->scaley, button->font->colour, button->text, 0.0f, 0, button->font->style, button->font->font);
}
else
{
float demoStatus = ((float)(cg.time - cg.demoinfo->firstTime)) / (cg.demoinfo->lastTime - cg.demoinfo->firstTime);
vec4_t barColor;
Vector4Copy(colorGreen, barColor);
barColor[3] = button->font->colour[3];
//borderColor
CG_FilledBar(button->rect.x, button->rect.y, button->rect.w, button->rect.h, barColor, NULL, color_border1, demoStatus, BAR_BG);
}
}
示例2: CG_DrawFireteamsByTeam
void CG_DrawFireteamsByTeam(panel_button_t *button, team_t t)
{
float y = button->rect.y;
const char *str;
int i;
if (t != TEAM_AXIS && t != TEAM_ALLIES)
{
return;
}
for (i = 0; i < MAX_FIRETEAMS; i++)
{
if (!cg.fireTeams[i].inuse)
{
continue;
}
if (cgs.clientinfo[cg.fireTeams[i].leader].team != t)
{
continue;
}
if (cg_quickMessageAlt.integer)
{
str = va("%i. %s", (cg.fireTeams[i].ident + 1) % 10, bg_fireteamNames[cg.fireTeams[i].ident]);
}
else
{
str = va("%c. %s", 'A' + cg.fireTeams[i].ident, bg_fireteamNames[cg.fireTeams[i].ident]);
}
CG_Text_Paint_Ext(button->rect.x, y, button->font->scalex, button->font->scaley, button->font->colour, str, 0, 0,
button->font->style, button->font->font);
y += button->rect.h;
}
}
示例3: CG_DrawPMItemsBig
void CG_DrawPMItemsBig( void ) {
vec4_t colour = { 0.f, 0.f, 0.f, 1.f };
vec4_t colourText = { 1.f, 1.f, 1.f, 1.f };
float t;
float y = 270;
float w;
if ( !cg_pmWaitingListBig ) {
return;
}
t = cg_pmWaitingListBig->time + CG_TimeForBigPopup( cg_pmWaitingListBig->type ) + PM_WAITTIME_BIG;
if ( cg.time > t ) {
colourText[3] = colour[3] = 1 - ( ( cg.time - t ) / (float)PM_FADETIME_BIG );
}
trap_R_SetColor( colourText );
CG_DrawPic( 640 - 56, y, 48, 48, cg_pmWaitingListBig->shader );
trap_R_SetColor( NULL );
w = CG_Text_Width_Ext( cg_pmWaitingListBig->message, 0.22f, 0, &cgs.media.limboFont2 );
CG_Text_Paint_Ext( 640 - 4 - w, y + 56, 0.22f, 0.24f, colourText, cg_pmWaitingListBig->message, 0, 0, 0, &cgs.media.limboFont2 );
}
示例4: CG_DrawFireTeamOverlay
//.........这里部分代码省略.........
if (cg_fireteamLatchedClass.integer)
{
boxWidth += 28;
}
if ((Ccg_WideX(640) - MIN_BORDER_DISTANCE) < (x + boxWidth))
{
x = x - ((x + boxWidth) - Ccg_WideX(640)) - MIN_BORDER_DISTANCE;
}
else if (x < MIN_BORDER_DISTANCE)
{
x = MIN_BORDER_DISTANCE;
}
CG_FillRect(x, y, boxWidth, h, FT_bg2);
CG_DrawRect(x, y, boxWidth, h, 1, FT_border);
x += 1;
y += 1;
CG_FillRect(x, y, boxWidth - 2, 12, FT_bg);
if (f->priv)
{
Com_sprintf(buffer, 64, CG_TranslateString("Private Fireteam: %s"), bg_fireteamNames[f->ident]);
}
else
{
Com_sprintf(buffer, 64, CG_TranslateString("Fireteam: %s"), bg_fireteamNames[f->ident]);
}
Q_strupr(buffer);
CG_Text_Paint_Ext(x + 4, y + FT_BAR_HEIGHT, .19f, .19f, FT_text, buffer, 0, 0, 0, FONT_HEADER);
lineX = x;
for (i = 0; i < MAX_FIRETEAM_MEMBERS; i++)
{
x = lineX;
y += FT_BAR_HEIGHT + FT_BAR_YSPACING;
// grab a pointer to the current player
ci = CG_SortedFireTeamPlayerForPosition(i);
// make sure it's valid
if (!ci)
{
break;
}
// hilight selected players
if (ci->selected)
{
CG_FillRect(x, y + FT_BAR_YSPACING, boxWidth - 2, FT_BAR_HEIGHT, FT_select);
}
else
{
CG_FillRect(x, y + FT_BAR_YSPACING, boxWidth - 2, FT_BAR_HEIGHT, FT_noselect);
}
x += 4;
// draw class icon in fireteam overlay
CG_DrawPic(x, y + 2, 12, 12, cgs.media.skillPics[SkillNumForClass(ci->cls)]);
x += 14;
if (cg_fireteamLatchedClass.integer && ci->cls != ci->latchedcls)
示例5: CG_DrawPMItems
void CG_DrawPMItems(rectDef_t rect)
{
vec4_t colour = { 0.f, 0.f, 0.f, 1.f };
vec4_t colourText = { 1.f, 1.f, 1.f, 1.f };
float t;
int i, j, size;
pmListItem_t *listItem = cg_pmOldList;
float y = rect.y; //360;
if (cg_drawSmallPopupIcons.integer)
{
size = PM_ICON_SIZE_SMALL;
y += 4;
}
else
{
size = PM_ICON_SIZE_NORMAL;
}
if (cg.snap->ps.persistant[PERS_RESPAWNS_LEFT] >= 0)
{
y -= 20;
}
if (!cg_pmWaitingList)
{
return;
}
t = cg_pmWaitingList->time + cg_popupTime.integer + cg_popupStayTime.integer;
if (cg.time > t)
{
colourText[3] = colour[3] = 1 - ((cg.time - t) / (float)cg_popupFadeTime.integer);
}
if (cg_pmWaitingList->shader > 0)
{
// colorize
for (j = 0; j < 3; j++)
{
colourText[j] = cg_pmWaitingList->color[j];
}
trap_R_SetColor(colourText);
// draw
CG_DrawPic(4, y, size, size, cg_pmWaitingList->shader);
// decolorize
for (j = 0; j < 3; j++)
{
colourText[j] = 1.f;
}
trap_R_SetColor(NULL);
}
else
{
size = 0;
}
CG_Text_Paint_Ext(4 + size + 2, y + 12, 0.2f, 0.2f, colourText, cg_pmWaitingList->message, 0, 0, 0, &cgs.media.limboFont2);
for (i = 0; i < 6 && listItem; i++, listItem = listItem->next)
{
y -= size + 2;
t = listItem->time + cg_popupTime.integer + cg_popupStayTime.integer;
if (cg.time > t)
{
colourText[3] = colour[3] = 1 - ((cg.time - t) / (float)cg_popupFadeTime.integer);
}
else
{
colourText[3] = colour[3] = 1.f;
}
if (listItem->shader > 0)
{
for (j = 0; j < 3; j++) // colorize
{
colourText[j] = listItem->color[j];
}
trap_R_SetColor(colourText);
CG_DrawPic(4, y, size, size, listItem->shader);
for (j = 0; j < 3; j++) // decolorize
{
colourText[j] = 1.f;
}
trap_R_SetColor(NULL);
}
else
{
size = 0;
}
CG_Text_Paint_Ext(rect.x + size + 2, y + 12, 0.2f, 0.2f, colourText, listItem->message, 0, 0, 0, &cgs.media.limboFont2);
}
}
示例6: CG_DrawPlayerNF
void CG_DrawPlayerNF(panel_button_t *button, int *pageofs)
{
float y = button->rect.y;
const char *str;
int i, x;
for (i = 0; i < 8; i++)
{
x = CG_PlayerNFFromPos(i, pageofs);
if (x == -1)
{
break;
}
if (cg_quickMessageAlt.integer)
{
str = va("%i. %s", (i + 1) % 10, cgs.clientinfo[x].name);
}
else
{
str = va("%c. %s", 'A' + i, cgs.clientinfo[x].name);
}
CG_Text_Paint_Ext(button->rect.x, y, button->font->scalex, button->font->scaley, button->font->colour, str, 0, 0,
button->font->style, button->font->font);
y += button->rect.h;
}
if (*pageofs)
{
if (cg_quickMessageAlt.integer)
{
str = va("%i. %s", (8 + 1) % 10, "Previous");
}
else
{
str = va("%c. %s", 'P', "Previous");
}
CG_Text_Paint_Ext(button->rect.x, y, button->font->scalex, button->font->scaley, button->font->colour, str, 0, 0,
button->font->style, button->font->font);
y += button->rect.h;
}
if (CG_CountPlayersNF() > (*pageofs + 1) * 8)
{
if (cg_quickMessageAlt.integer)
{
str = va("%i. %s", (9 + 1) % 10, "Next");
}
else
{
str = va("%c. %s", 'N', "Next");
}
CG_Text_Paint_Ext(button->rect.x, y, button->font->scalex, button->font->scaley, button->font->colour, str, 0, 0,
button->font->style, button->font->font);
y += button->rect.h;
}
}
示例7: CG_LoadPanel_LoadingBarText
/**
* @brief draws infoScreenText in loading bar
*/
void CG_LoadPanel_LoadingBarText(panel_button_t *button)
{
CG_Text_Paint_Ext(button->rect.x, button->rect.y, button->font->scalex, button->font->scaley, button->font->colour, cg.infoScreenText, 0, 0, 0, button->font->font);
}
示例8: WM_TeamScoreboard
static int WM_TeamScoreboard( int x, int y, team_t team, float fade, int maxrows ) {
vec4_t hcolor;
float tempx, tempy;
int height, width;
int i;
int count = 0;
vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f };
height = SMALLCHAR_HEIGHT * maxrows;
width = INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH;
CG_FillRect( x-5, y-2, width+5, 21, clrUiBack );
CG_FillRect( x-5, y-2, width+5, 21, clrUiBar );
Vector4Set( hcolor, 0, 0, 0, fade );
CG_DrawRect_FixedBorder( x-5, y-2, width+5, 21, 1, colorBlack );
// draw header
if( cg_gameType.integer == GT_WOLF_LMS ) {
char *s;
if ( team == TEAM_AXIS ) {
s = va( "%s [%d] (%d %s)", CG_TranslateString( "AXIS" ), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS") );
s = va( "%s ^3%s", s, cg.teamFirstBlood == TEAM_AXIS ? CG_TranslateString("FIRST BLOOD") : "" );
CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 );
} else if ( team == TEAM_ALLIES ) {
s = va( "%s [%d] (%d %s)", CG_TranslateString( "ALLIES" ), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS") );
s = va( "%s ^3%s", s, cg.teamFirstBlood == TEAM_ALLIES ? CG_TranslateString("FIRST BLOOD") : "" );
CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 );
}
} else {
if ( team == TEAM_AXIS ) {
CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, va( "%s [%d] (%d %s)", CG_TranslateString( "AXIS" ), cg.teamScores[0], cg.teamPlayers[team], CG_TranslateString("PLAYERS") ), 0, 0, 0, &cgs.media.limboFont1 );
} else if ( team == TEAM_ALLIES ) {
CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, va( "%s [%d] (%d %s)", CG_TranslateString( "ALLIES" ), cg.teamScores[1], cg.teamPlayers[team], CG_TranslateString("PLAYERS") ), 0, 0, 0, &cgs.media.limboFont1 );
}
}
y += SMALLCHAR_HEIGHT + 3;
// save off y val
tempy = y;
// draw color bands
for ( i = 0; i <= maxrows; i++ ) {
if ( i % 2 == 0 )
VectorSet( hcolor, (80.f/255.f), (80.f/255.f), (80.f/255.f) ); // LIGHT BLUE
else
VectorSet( hcolor, (0.f/255.f), (0.f/255.f), (0.f/255.f) ); // DARK BLUE
hcolor[3] = fade * 0.3;
CG_FillRect( x-5, y, width+5, SMALLCHAR_HEIGHT+1, hcolor );
trap_R_SetColor( colorBlack );
CG_DrawTopBottom( x-5, y, width+5, SMALLCHAR_HEIGHT+1, 1 );
trap_R_SetColor( NULL );
y += SMALLCHAR_HEIGHT;
}
hcolor[3] = 1;
y = tempy;
tempx = x;
CG_FillRect( x-5, y-1, width+5, 18, clrUiBack );
//CG_FillRect( x-5, y-1, width+5, 18, clrUiBar );
trap_R_SetColor( colorBlack );
CG_DrawTopBottom( x-5, y-1, width+5, 18, 1 );
trap_R_SetColor( NULL );
// draw player info headings
CG_DrawSmallString( tempx, y, CG_TranslateString( "Name" ), fade );
tempx += INFO_PLAYER_WIDTH;
CG_DrawSmallString( tempx, y, CG_TranslateString( "Class" ), fade );
tempx += INFO_CLASS_WIDTH;
if( cgs.gametype == GT_WOLF_LMS ) {
CG_DrawSmallString( tempx, y, CG_TranslateString( "Score" ), fade );
tempx += INFO_SCORE_WIDTH;
} else {
CG_DrawSmallString( tempx + 1 * SMALLCHAR_WIDTH, y, CG_TranslateString( "XP" ), fade );
tempx += INFO_XP_WIDTH;
}
CG_DrawSmallString( tempx, y, CG_TranslateString( "Ping" ), fade );
tempx += INFO_LATENCY_WIDTH;
if( cgs.gametype != GT_WOLF_LMS ) {
CG_DrawPicST( tempx + 2, y, INFO_LIVES_WIDTH - 4, 16, 0.f, 0.f, 0.5f, 1.f, team == TEAM_ALLIES ? cgs.media.hudAlliedHelmet : cgs.media.hudAxisHelmet );
tempx += INFO_LIVES_WIDTH;
}
y += SMALLCHAR_HEIGHT;
// draw player info
VectorSet( hcolor, 1, 1, 1 );
hcolor[3] = fade;
//.........这里部分代码省略.........
示例9: CG_DrawSpawnPointInfo
//.........这里部分代码省略.........
if (scissor)
{
icon_extends[0] *= (scissor->zoomFactor / 5.159);
icon_extends[1] *= (scissor->zoomFactor / 5.159);
}
else
{
icon_extends[0] *= cgs.ccZoomFactor;
icon_extends[1] *= cgs.ccZoomFactor;
}
point[0] -= (icon_extends[0] * (39 / 128.f));
point[1] += (icon_extends[1] * (31 / 128.f));
if (changetime)
{
if (draw)
{
float size;
if (cg.spawnTeams[i] == team)
{
size = 20 * (changetime / SPAWN_SIZEUPTIME);
}
else
{
size = 20 * (1 - (changetime / SPAWN_SIZEUPTIME));
}
if (scissor)
{
size *= (scissor->zoomFactor / 5.159);
}
else
{
size *= cgs.ccZoomFactor;
}
CG_DrawPic(point[0] - FLAG_LEFTFRAC * size, point[1] - FLAG_TOPFRAC * size, size, size, cgs.media.commandCentreSpawnShader[cg.spawnTeams[i] == TEAM_AXIS ? 0 : 1]);
}
}
else if ((draw && i == expand) || (!expanded && BG_RectContainsPoint(point[0] - FLAGSIZE_NORMAL * 0.5f, point[1] - FLAGSIZE_NORMAL * 0.5f, FLAGSIZE_NORMAL, FLAGSIZE_NORMAL, cgDC.cursorx, cgDC.cursory)))
{
if (draw)
{
float size = FLAGSIZE_EXPANDED;
if (scissor)
{
size *= (scissor->zoomFactor / 5.159);
}
else
{
size *= cgs.ccZoomFactor;
}
CG_DrawPic(point[0] - FLAG_LEFTFRAC * size, point[1] - FLAG_TOPFRAC * size, size, size, cgs.media.commandCentreSpawnShader[cg.spawnTeams[i] == TEAM_AXIS ? 0 : 1]);
}
else
{
if (!scissor)
{
float w;
Com_sprintf(buffer, sizeof(buffer), "%s (Troops: %i)", cg.spawnPoints[i], cg.spawnPlayerCounts[i]);
w = CG_Text_Width_Ext(buffer, 0.2f, 0, &cgs.media.limboFont2);
CG_CommandMap_SetHighlightText(buffer, point[0] - (w * 0.5f), point[1] - 8);
}
e = i;
}
}
else
{
if (draw)
{
float size = FLAGSIZE_NORMAL;
if (scissor)
{
size *= (scissor->zoomFactor / 5.159);
}
else
{
size *= cgs.ccZoomFactor;
}
CG_DrawPic(point[0] - FLAG_LEFTFRAC * size, point[1] - FLAG_TOPFRAC * size, size, size, cgs.media.commandCentreSpawnShader[cg.spawnTeams[i] == TEAM_AXIS ? 0 : 1]);
if (!scissor)
{
Com_sprintf(buffer, sizeof(buffer), "(Troops: %i)", cg.spawnPlayerCounts[i]);
CG_Text_Paint_Ext(point[0] + FLAGSIZE_NORMAL * 0.25f, point[1], 0.2f, 0.2f, colorWhite, buffer, 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2);
}
}
}
}
return e;
}
示例10: CG_DrawFireTeamOverlay
// FIXME: add more options to shorten this box
void CG_DrawFireTeamOverlay(rectDef_t *rect)
{
int x = rect->x;
int y = rect->y + 1; // +1, jitter it into place in 1024 :)
int i;
int boxWidth = 106;
int bestWidth = -1;
char buffer[64];
float h = 16; // 12 + 2 + 2
clientInfo_t *ci = NULL;
fireteamData_t *f = NULL;
char *locStr[MAX_FIRETEAM_MEMBERS];
int locwidth;
int namewidth;
vec3_t origin;
int curWeap;
// assign fireteam data, and early out if not on one
if (!(f = CG_IsOnFireteam(cg.clientNum)))
{
return;
}
memset(locStr, 0, sizeof(locStr));
// First get name and location width, also store location names
for (i = 0; i < MAX_FIRETEAM_MEMBERS; i++)
{
ci = CG_SortedFireTeamPlayerForPosition(i);
// Make sure it's valid
if (!ci)
{
break;
}
origin[0] = ci->location[0];
origin[1] = ci->location[1];
locStr[i] = CG_BuildLocationString(ci->clientNum, origin, LOC_FTEAM);
if (!locStr[i][1] || !*locStr[i])
{
locStr[i] = "";
}
locwidth = CG_Text_Width_Ext(locStr[i], 0.2f, 0, &cgs.media.limboFont2);
//if ( cg_fixedFTeamSize.integer ) {
// namewidth = 102;
//}
//else {
namewidth = CG_Text_Width_Ext(ci->name, 0.2f, 17, &cgs.media.limboFont2);
if (ci->health == 0)
{
namewidth += 7;
}
//}
if ((locwidth + namewidth) > bestWidth)
{
bestWidth = locwidth + namewidth;
}
h += 12.f;
}
boxWidth += bestWidth;
CG_DrawRect(x, y, boxWidth, h, 1, borderColor);
CG_FillRect(x + 1, y + 1, boxWidth - 2, h - 2, bgColor);
x += 2;
y += 2;
CG_FillRect(x, y, boxWidth - 4, 12, clr1);
Com_sprintf(buffer, 64, "Fireteam: %s", bg_fireteamNames[f->ident]);
Q_strupr(buffer);
CG_Text_Paint_Ext(x + 3, y + FT_BAR_HEIGHT, .19f, .19f, tclr, buffer, 0, 0, 0, &cgs.media.limboFont1);
x += 2;
for (i = 0; i < MAX_FIRETEAM_MEMBERS; i++)
{
y += FT_BAR_HEIGHT + FT_BAR_YSPACING;
x = rect->x + 2;
// Grab a pointer to the current player
ci = CG_SortedFireTeamPlayerForPosition(i);
// Make sure it's valid
if (!ci)
{
break;
}
//.........这里部分代码省略.........
示例11: CG_DrawPMItems
void CG_DrawPMItems( void ) {
vec4_t colour = { 0.f, 0.f, 0.f, 1.f };
vec4_t colourText = { 1.f, 1.f, 1.f, 1.f };
float t;
int i, size;
pmListItem_t* listItem = cg_pmOldList;
int x = cg.hud.cpmtext[0];
int y = cg.hud.cpmtext[1];
float scaleVal;
if( cg_drawSmallPopupIcons.integer ) {
size = PM_ICON_SIZE_SMALL;
y += 4;
} else {
size = PM_ICON_SIZE_NORMAL;
}
if(
(
cg.hudEditor.showHudEditor ||
cg.snap->ps.persistant[PERS_RESPAWNS_LEFT] >= 0
) &&
cg.hud.livesleft[0] == 4 && cg.hud.livesleft[1] == 360 &&
cg.hud.cpmtext[0] == 4 && cg.hud.cpmtext[1] == 360
) {
y -= 20;
}
if( !cg_pmWaitingList || cg.hud.cpmtext[0] < 0 ) {
return;
}
t = cg_pmWaitingList->time + CG_TimeForPopup( cg_pmWaitingList->type ) + PM_WAITTIME;
if( cg.time > t ) {
colourText[3] = colour[3] = 1 - ((cg.time - t) / (float)PM_FADETIME);
}
scaleVal = cg.hud.cpmtext[2]/100.f;
trap_R_SetColor( colourText );
CG_DrawPic( x, y, size, size, cg_pmWaitingList->shader );
trap_R_SetColor( NULL );
CG_Text_Paint_Ext( x + size + 2, y + 12, scaleVal, scaleVal,
colourText, cg_pmWaitingList->message,
0, 0, 0, &cgs.media.font3 );
for( i = 0; i < 4 && listItem; i++, listItem = listItem->next ) {
y -= size + 2;
t = listItem->time + CG_TimeForPopup( listItem->type ) + PM_WAITTIME;
if( cg.time > t ) {
colourText[3] = colour[3] = 1 - ((cg.time - t) / (float)PM_FADETIME);
} else {
colourText[3] = colour[3] = 1.f;
}
trap_R_SetColor( colourText );
CG_DrawPic( x, y, size, size, listItem->shader );
trap_R_SetColor( NULL );
CG_Text_Paint_Ext( x + size + 2, y + 12, scaleVal, scaleVal,
colourText, listItem->message,
0, 0, 0, &cgs.media.font3 );
}
}
示例12: WM_TeamScoreboard
// CHRUKER: b035 - Added absolute maximum rows
static int WM_TeamScoreboard(int x, int y, team_t team, float fade, int maxrows, int absmaxrows)
{
vec4_t hcolor;
float tempx, tempy;
int height, width;
int i;
int count = 0;
qboolean use_mini_chars = qfalse; // CHRUKER: b035 - Needed to check if using mini chars
vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f };
height = SMALLCHAR_HEIGHT * maxrows;
width = INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH;
CG_FillRect(x - 5, y - 2, width + 5, 21, clrUiBack);
CG_FillRect(x - 5, y - 2, width + 5, 21, clrUiBar);
Vector4Set(hcolor, 0, 0, 0, fade);
CG_DrawRect_FixedBorder(x - 5, y - 2, width + 5, 21, 1, colorBlack);
// draw header
if(cg_gameType.integer == GT_WOLF_LMS)
{
char *s;
if(team == TEAM_AXIS)
{
s = va("%s [%d] (%d %s)", CG_TranslateString("AXIS"), cg.teamScores[0], cg.teamPlayers[team],
CG_TranslateString("PLAYERS"));
s = va("%s ^3%s", s, cg.teamFirstBlood == TEAM_AXIS ? CG_TranslateString("FIRST BLOOD") : "");
CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1);
}
else if(team == TEAM_ALLIES)
{
s = va("%s [%d] (%d %s)", CG_TranslateString("ALLIES"), cg.teamScores[1], cg.teamPlayers[team],
CG_TranslateString("PLAYERS"));
s = va("%s ^3%s", s, cg.teamFirstBlood == TEAM_ALLIES ? CG_TranslateString("FIRST BLOOD") : "");
CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1);
}
}
else
{
if(team == TEAM_AXIS)
{
CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr,
va("%s [%d] (%d %s)", CG_TranslateString("AXIS"), cg.teamScores[0], cg.teamPlayers[team],
CG_TranslateString("PLAYERS")), 0, 0, 0, &cgs.media.limboFont1);
}
else if(team == TEAM_ALLIES)
{
CG_Text_Paint_Ext(x, y + 13, 0.25f, 0.25f, tclr,
va("%s [%d] (%d %s)", CG_TranslateString("ALLIES"), cg.teamScores[1], cg.teamPlayers[team],
CG_TranslateString("PLAYERS")), 0, 0, 0, &cgs.media.limboFont1);
}
}
y += SMALLCHAR_HEIGHT + 3;
tempx = x;
// CHRUKER: b076 - Adjusted y coordinate, and changed to use DrawBottom instead of DrawTopBottom
CG_FillRect(x - 5, y, width + 5, 18, clrUiBack);
trap_R_SetColor(colorBlack);
CG_DrawBottom_NoScale(x - 5, y, width + 5, 18, 1);
trap_R_SetColor(NULL);
// draw player info headings
CG_DrawSmallString(tempx, y, CG_TranslateString("Name"), fade);
tempx += INFO_PLAYER_WIDTH;
CG_DrawSmallString(tempx, y, CG_TranslateString("Class"), fade);
tempx += INFO_CLASS_WIDTH;
if(cgs.gametype == GT_WOLF_LMS)
{
CG_DrawSmallString(tempx, y, CG_TranslateString("Score"), fade);
tempx += INFO_SCORE_WIDTH;
}
else
{
CG_DrawSmallString(tempx + 1 * SMALLCHAR_WIDTH, y, CG_TranslateString("XP"), fade);
tempx += INFO_XP_WIDTH;
}
CG_DrawSmallString(tempx, y, CG_TranslateString("Ping"), fade);
tempx += INFO_LATENCY_WIDTH;
if(cgs.gametype != GT_WOLF_LMS)
{
CG_DrawPicST(tempx + 2, y, INFO_LIVES_WIDTH - 4, 16, 0.f, 0.f, 0.5f, 1.f,
team == TEAM_ALLIES ? cgs.media.hudAlliedHelmet : cgs.media.hudAxisHelmet);
tempx += INFO_LIVES_WIDTH;
}
// CHRUKER: b076 - The math says char height + 2 * border width (1 pixel)
y += SMALLCHAR_HEIGHT + 2;
cg.teamPlayers[team] = 0; // JPW NERVE
//.........这里部分代码省略.........
示例13: WM_DrawInfoLine
static int WM_DrawInfoLine(int x, int y, float fade)
{
int w, defender, winner;
const char *s;
vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f };
if(cg.snap->ps.pm_type != PM_INTERMISSION)
{
return y;
}
w = 360;
// CG_DrawPic( 320 - w/2, y, w, INFO_LINE_HEIGHT, trap_R_RegisterShaderNoMip( "ui/assets/mp_line_strip.tga" ) );
s = CG_ConfigString(CS_MULTI_INFO);
defender = atoi(Info_ValueForKey(s, "defender"));
s = CG_ConfigString(CS_MULTI_MAPWINNER);
winner = atoi(Info_ValueForKey(s, "winner"));
if(cgs.currentRound)
{
// first round
s = va(CG_TranslateString("CLOCK IS NOW SET TO %s!"), WM_TimeToString(cgs.nextTimeLimit * 60.f * 1000.f));
}
else
{
// second round
if(!defender)
{
if(winner != defender)
{
s = "ALLIES SUCCESSFULLY BEAT THE CLOCK!";
}
else
{
s = "ALLIES COULDN'T BEAT THE CLOCK!";
}
}
else
{
if(winner != defender)
{
s = "AXIS SUCCESSFULLY BEAT THE CLOCK!";
}
else
{
s = "AXIS COULDN'T BEAT THE CLOCK!";
}
}
s = CG_TranslateString(s);
}
CG_FillRect(320 - w / 2, y, w, 20, clrUiBar);
CG_DrawRect_FixedBorder(320 - w / 2, y, w, 20, 1, colorBlack);
w = CG_Text_Width_Ext(s, 0.25f, 0, &cgs.media.limboFont1);
CG_Text_Paint_Ext(320 - w * 0.5f, y + 15, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1);
// CG_DrawSmallString( 320 - w/2, ( y + INFO_LINE_HEIGHT / 2 ) - SMALLCHAR_HEIGHT / 2, s, fade );
return y + INFO_LINE_HEIGHT + 6;
}
示例14: CG_ObjectivesDraw
//.........这里部分代码省略.........
scale = 1.0f - scale;
}
bgColor[3] *= scale;
bgColorTitle[3] *= scale;
borderColor[3] *= scale;
borderColorTitle[3] *= scale;
hdrColor[3] *= scale;
tColor[3] *= scale;
y += (TS_Y - h) * scale;
}
else if (cgs.objectives.show == SHOW_SHUTDOWN)
{
cgs.objectives.show = SHOW_OFF;
return;
}
else
{
y += TS_Y - h;
}
CG_FillRect(x, y, OBJ_W, h, bgColor);
CG_DrawRect(x, y, OBJ_W, h, 1, borderColor);
y += 1;
// Header
CG_FillRect(x + 1, y, OBJ_W - 2, tSpacing + 4, bgColorTitle);
CG_DrawRect(x + 1, y, OBJ_W - 2, tSpacing + 4, 1, borderColorTitle);
y += tSpacing;
CG_Text_Paint_Ext(x + 4, y, hScale, hScaleY, hdrColor, CG_TranslateString("OBJECTIVES"), 0.0f, 0, hStyle, hFont);
y += 4;
if (!count)
{
y += tSpacing;
CG_Text_Paint_Ext(x + 4, y, tScale, tScale, tColor, "Unable to load objectives", 0.0f, 0, tStyle, tFont);
return;
}
cs = CG_ConfigString(CS_MULTI_OBJECTIVE);
if (cgs.clientinfo[cg.snap->ps.clientNum].team == TEAM_SPECTATOR)
{
Q_strncpyz(temp, cg.objMapDescription_Neutral, sizeof(temp));
while ((s = strchr(temp, '*')))
{
*s = '\n';
}
CG_FitTextToWidth_Ext(temp, tScale, OBJ_W - 8, sizeof(temp), FONT_TEXT);
s = p = temp;
while (*p)
{
if (*p == '\n')
{
*p++ = '\0';
y += tSpacing;
CG_Text_Paint_Ext(x + 4, y, tScale, tScale, tColor, s, 0.0f, 0, tStyle, tFont);
s = p;
}
else
{
示例15: CG_DrawFireTeamOverlay
void CG_DrawFireTeamOverlay(rectDef_t *rect)
{
int x = rect->x;
int y = rect->y + 1; // +1, jitter it into place in 1024 :)
float h;
clientInfo_t *ci = NULL;
char buffer[64];
fireteamData_t *f = NULL;
int i;
vec4_t clr1 = { .16f, .2f, .17f, .8f };
vec4_t clr2 = { 0.f, 0.f, 0.f, .2f };
vec4_t clr3 = { 0.25f, 0.f, 0.f, 153 / 255.f };
vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f };
vec4_t bgColor = { 0.0f, 0.0f, 0.0f, 0.6f }; // window
vec4_t borderColor = { 0.5f, 0.5f, 0.5f, 0.5f }; // window
if (!(f = CG_IsOnFireteam(cg.clientNum)))
{
return;
}
h = 12 + 2 + 2;
for (i = 0; i < 6; i++)
{
ci = CG_SortedFireTeamPlayerForPosition(i, 6);
if (!ci)
{
break;;
}
h += FT_BAR_HEIGHT + FT_BAR_YSPACING;
}
CG_DrawRect(x, y, 204, h, 1, borderColor);
CG_FillRect(x + 1, y + 1, 204 - 2, h - 2, bgColor);
x += 2;
y += 2;
CG_FillRect(x, y, 204 - 4, 12, clr1);
sprintf(buffer, "Fireteam: %s", bg_fireteamNames[f->ident]);
Q_strupr(buffer);
CG_Text_Paint_Ext(x + 3, y + FT_BAR_HEIGHT, .19f, .19f, tclr, buffer, 0, 0, 0, &cgs.media.limboFont1);
x += 2;
//y += 2;
for (i = 0; i < 6; i++)
{
y += FT_BAR_HEIGHT + FT_BAR_YSPACING;
x = rect->x + 2;
ci = CG_SortedFireTeamPlayerForPosition(i, 6);
if (!ci)
{
break;;
}
if (ci->selected)
{
CG_FillRect(x, y + FT_BAR_YSPACING, 204 - 4, FT_BAR_HEIGHT, clr3);
}
else
{
CG_FillRect(x, y + FT_BAR_YSPACING, 204 - 4, FT_BAR_HEIGHT, clr2);
}
x += 4;
CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, BG_ClassLetterForNumber(ci->cls), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2);
x += 10;
CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, ci->team == TEAM_AXIS ? miniRankNames_Axis[ci->rank] : miniRankNames_Allies[ci->rank], 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2);
x += 22;
CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, ci->name, 0, 17, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2);
x += 90;
/* CG_DrawPic(x + 2, y + 2, FT_BAR_HEIGHT - 4, FT_BAR_HEIGHT - 4, cgs.media.movementAutonomyIcons[0]);
x += FT_BAR_HEIGHT;
CG_DrawPic(x + 2, y + 2, FT_BAR_HEIGHT - 4, FT_BAR_HEIGHT - 4, cgs.media.weaponAutonomyIcons[0]);
x += FT_BAR_HEIGHT;
x += 4;*/
/* if( isLeader ) {
CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, va("%i", i+4), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2 );
}*/
x += 20;
if (ci->health > 80)
{
CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, va("%i", ci->health < 0 ? 0 : ci->health), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2);
}
else if (ci->health > 0)
{
CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, colorYellow, va("%i", ci->health < 0 ? 0 : ci->health), 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2);
}
else
//.........这里部分代码省略.........