这篇教程C++ CG_Text_Paint_Ext函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CG_Text_Paint_Ext函数的典型用法代码示例。如果您正苦于以下问题:C++ CG_Text_Paint_Ext函数的具体用法?C++ CG_Text_Paint_Ext怎么用?C++ CG_Text_Paint_Ext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CG_Text_Paint_Ext函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CG_DemoControlButtonRendervoid 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); }}
开发者ID:belstgut,项目名称:etlegacy,代码行数:22,
示例2: CG_DrawFireteamsByTeamvoid 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; }}
开发者ID:morsik,项目名称:warpig,代码行数:38,
示例3: CG_DrawPMItemsBigvoid 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 );}
开发者ID:TheDushan,项目名称:OpenWolf,代码行数:24,
示例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)
开发者ID:belstgut,项目名称:etlegacy,代码行数:67,
示例5: CG_DrawPMItemsvoid 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); }}
开发者ID:MartijnB,项目名称:ETGoldy,代码行数:98,
示例6: CG_DrawPlayerNFvoid 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; }}
开发者ID:morsik,项目名称:warpig,代码行数:66,
示例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);}
开发者ID:rafal1137,项目名称:etlegacy,代码行数:7,
示例8: WM_TeamScoreboardstatic 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;//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:101,
示例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;}
开发者ID:harleking,项目名称:etlegacy,代码行数:101,
示例10: CG_DrawFireTeamOverlay// FIXME: add more options to shorten this boxvoid 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; }//.........这里部分代码省略.........
开发者ID:BulldogDrummond,项目名称:etlegacy-mysql,代码行数:101,
示例11: CG_DrawPMItemsvoid 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 ); }}
开发者ID:thewolfteam,项目名称:Reloaded,代码行数:64,
示例12: WM_TeamScoreboard// CHRUKER: b035 - Added absolute maximum rowsstatic 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//.........这里部分代码省略.........
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:101,
示例13: WM_DrawInfoLinestatic 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;}
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:63,
示例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 {
开发者ID:belstgut,项目名称:etlegacy,代码行数:67,
示例15: CG_DrawFireTeamOverlayvoid 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//.........这里部分代码省略.........
开发者ID:morsik,项目名称:war-territory,代码行数:101,
示例16: WM_DrawObjectives//.........这里部分代码省略......... }*/ } y += SMALLCHAR_HEIGHT * ( ( rows - 2 ) / 2 ); if ( flagshader ) { CG_DrawPic( 100, 10, 210, 136, trap_R_RegisterShaderNoMip( flagshader ) ); CG_DrawPic( 325, 10, 210, 136, trap_R_RegisterShaderNoMip( flagshader ) ); } if ( shader ) CG_DrawPic( 229, 10, 182, 136, trap_R_RegisterShaderNoMip( shader ) ); if ( nameshader ) { CG_DrawPic( 140, 50, 127, 64, trap_R_RegisterShaderNoMip( nameshader ) ); CG_DrawPic( 365, 50, 127, 64, trap_R_RegisterShaderNoMip( "ui/assets/portraits/text_win.tga" ) ); } return y; }// JPW NERVE -- mission time & reinforce time else { tempy = y; rows = 1; CG_FillRect( x-5, y-2, width+5, 21, clrUiBack ); CG_FillRect( x-5, y-2, width+5, 21, clrUiBar ); CG_DrawRect_FixedBorder( x-5, y-2, width+5, 21, 1, colorBlack ); y += SMALLCHAR_HEIGHT * ( rows - 1 ); if( cgs.timelimit > 0.0f ) { msec = ( cgs.timelimit * 60.f * 1000.f ) - ( cg.time - cgs.levelStartTime ); seconds = msec / 1000; mins = seconds / 60; seconds -= mins * 60; tens = seconds / 10; seconds -= tens * 10; } else { mins = tens = seconds = 0; } if( cgs.gamestate != GS_PLAYING ) { s = va("%s %s", CG_TranslateString("MISSION TIME:"), CG_TranslateString("WARMUP")); } else if ( msec < 0 && cgs.timelimit > 0.0f ) { if ( cgs.gamestate == GS_WAITING_FOR_PLAYERS ) s = va( "%s %s", CG_TranslateString( "MISSION TIME:" ), CG_TranslateString( "GAME STOPPED" ) ); else s = va( "%s %s", CG_TranslateString( "MISSION TIME:" ), CG_TranslateString( "SUDDEN DEATH" ) ); } else { s = va( "%s %2.0f:%i%i", CG_TranslateString( "MISSION TIME:" ), (float)mins, tens, seconds ); // float cast to line up with reinforce time } CG_Text_Paint_Ext( x, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 ); if( cgs.gametype != GT_WOLF_LMS ) { if(cgs.clientinfo[cg.snap->ps.clientNum].team == TEAM_AXIS || cgs.clientinfo[cg.snap->ps.clientNum].team == TEAM_ALLIES) { msec = CG_CalculateReinfTime( qfalse ) * 1000; } else // no team (spectator mode) msec = 0; if (msec) { seconds = msec / 1000; mins = seconds / 60; seconds -= mins * 60; tens = seconds / 10; seconds -= tens * 10; s = va( "%s %2.0f:%i%i", CG_TranslateString( "REINFORCE TIME:" ), (float)mins, tens, seconds ); CG_Text_Paint_Ext( 640 - 20 - CG_Text_Width_Ext( s, 0.25f, 0, &cgs.media.limboFont1 ), y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 ); } } // NERVE - SMF if ( cgs.gametype == GT_WOLF_STOPWATCH ) { int w; s = va( "%s %i", CG_TranslateString( "STOPWATCH ROUND" ), cgs.currentRound + 1 ); w = CG_Text_Width_Ext( s, 0.25f, 0, &cgs.media.limboFont1 ); CG_Text_Paint_Ext( x + 300 - w*0.5f, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 ); } else if( cgs.gametype == GT_WOLF_LMS ) { int w; s = va( "%s %i %s %i-%i", CG_TranslateString( "ROUND" ), cgs.currentRound + 1, CG_TranslateString( "SCORE" ), cg.teamWonRounds[1], cg.teamWonRounds[0] ); w = CG_Text_Width_Ext( s, 0.25f, 0, &cgs.media.limboFont1 ); CG_Text_Paint_Ext( x + 300 - w*0.5f, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 ); } else if( cgs.gametype == GT_WOLF_CAMPAIGN ) { int w; s = va( "MAP %i of %i", cgs.currentCampaignMap + 1, cgs.campaignData.mapCount ); w = CG_Text_Width_Ext( s, 0.25f, 0, &cgs.media.limboFont1 ); CG_Text_Paint_Ext( x + 300 - w*0.5f, y + 13, 0.25f, 0.25f, tclr, s, 0, 0, 0, &cgs.media.limboFont1 ); } y += SMALLCHAR_HEIGHT * 2; }// jpw return y;}
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:101,
示例17: CG_CommandMap_DrawHighlightTextvoid CG_CommandMap_DrawHighlightText(void){ CG_Text_Paint_Ext(cg_highlightTextRect.x, cg_highlightTextRect.y, 0.25f, 0.25f, colorWhite, cg_highlightText, 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2); *cg_highlightText = '/0';}
开发者ID:harleking,项目名称:etlegacy,代码行数:5,
示例18: CG_LimboPanel_WeaponPanelvoid CG_LimboPanel_WeaponPanel(panel_button_t *button) { weapon_t weap = CG_LimboPanel_GetSelectedWeapon(); int cnt = CG_LimboPanel_WeaponCount(); if (cgs.ccSelectedWeapon2 >= CG_LimboPanel_WeaponCount_ForSlot(0)) { cgs.ccSelectedWeapon2 = CG_LimboPanel_WeaponCount_ForSlot(0) - 1; } if (CG_LimboPanel_GetTeam() == TEAM_SPECTATOR) { vec4_t clr = { 0.f, 0.f, 0.f, 0.4f }; CG_DrawPic(button->rect.x, button->rect.y, button->rect.w, button->rect.h, cgs.media.limboWeaponCard); trap_R_SetColor(clr); CG_DrawPic(button->rect.x, button->rect.y, button->rect.w, button->rect.h, cgs.media.limboWeaponBlendThingy); trap_R_SetColor(NULL); CG_Text_Paint_Ext(button->rect.x + 4, button->rect.y + 12, weaponPanelNameFont.scalex, weaponPanelNameFont.scaley, weaponPanelNameFont.colour, "SPECTATOR", 0, 0, weaponPanelNameFont.style, weaponPanelNameFont.font); return; } if (BG_PanelButtons_GetFocusButton() == button && cnt > 1) { int i, x; rectDef_t rect; memcpy(&rect, &button->rect, sizeof (rect)); CG_LimboPanel_WeaponPanel_DrawWeapon(&rect, weap, qtrue, va("%iof%i", CG_LimboPanel_GetSelectedWeaponNum() + 1, cnt), CG_LimboPanel_RealWeaponIsDisabled(weap)); if (BG_CursorInRect(&rect) && button->data[7] != 0) { SOUND_FOCUS; button->data[7] = 0; } rect.y -= rect.h; // render in expanded mode ^ for (i = 0, x = 1; i < cnt; ++i) { weapon_t cycleWeap = CG_LimboPanel_GetWeaponForNumber(i, cgs.ccSelectedWeaponNumber, qtrue); if (cycleWeap != weap) { CG_LimboPanel_WeaponPanel_DrawWeapon(&rect, cycleWeap, qtrue, va("%iof%i", i + 1, cnt), CG_LimboPanel_RealWeaponIsDisabled(cycleWeap)); if (BG_CursorInRect(&rect) && button->data[7] != x) { SOUND_FOCUS; button->data[7] = x; } rect.y -= rect.h; x++; } } CG_DrawBorder(button->rect.x, button->rect.y - ((cnt - 1) * button->rect.h), button->rect.w, button->rect.h * cnt, qfalse, qfalse); } else { vec4_t clr = { 0.f, 0.f, 0.f, 0.4f }; // render in normal mode CG_LimboPanel_WeaponPanel_DrawWeapon(&button->rect, weap, cnt > 1 ? qtrue : qfalse, va("%iof%i", CG_LimboPanel_GetSelectedWeaponNum() + 1, cnt), CG_LimboPanel_RealWeaponIsDisabled(weap)); if (cnt <= 1 || !BG_CursorInRect(&button->rect)) { vec4_t clr2 = { 1.f, 1.f, 1.f, 0.4f }; trap_R_SetColor(clr2); } CG_DrawPic(button->rect.x + button->rect.w - 20, button->rect.y + 4, 16, 12, cgs.media.limboWeaponCardArrow); trap_R_SetColor(clr); CG_DrawPic(button->rect.x, button->rect.y, button->rect.w, button->rect.h, cgs.media.limboWeaponBlendThingy); trap_R_SetColor(NULL); }}
开发者ID:ETrun,项目名称:ETrun,代码行数:69,
示例19: CG_DrawGrid//.........这里部分代码省略......... { continue; } if (grid_y > h) { break; } if (scissor->circular) { // clip line against circle float xc, yc; line[1] = y + grid_y; yc = line[1] >= y + .5f * h ? line[1] - (y + .5f * h) : (y + .5f * h) - line[1]; xc = SQRTFAST(Square(.5f * h) - Square(yc)); line[0] = x + (.5f * w) - xc; line[2] = 2 * xc; line[3] = 1.f; } else { Vector4Set(line, x + dim_x[0], y + grid_y, w, 1); } line[0] *= cgs.screenXScale; line[1] *= cgs.screenYScale; line[2] *= cgs.screenXScale; trap_R_DrawStretchPic(line[0], line[1], line[2], line[3], 0, 0, 0, 1, cgs.media.whiteShader); } trap_R_SetColor(NULL); } else { char coord_char[3], coord_int; float text_width, text_height; vec2_t textOrigin; dim_x[0] = cg.mapcoordsMins[0]; dim_x[1] = cg.mapcoordsMaxs[0]; dim_y[0] = cg.mapcoordsMaxs[1]; dim_y[1] = cg.mapcoordsMins[1]; // transform xscale = w / dist[0]; yscale = h / -dist[1]; dim_x[0] = (dim_x[0] - cg.mapcoordsMins[0]) * xscale; dim_x[1] = (dim_x[1] - cg.mapcoordsMins[0]) * xscale; dim_y[0] = (dim_y[0] - cg.mapcoordsMaxs[1]) * yscale; dim_y[1] = (dim_y[1] - cg.mapcoordsMaxs[1]) * yscale; grid_x = gridStartCoord[0] * xscale; grid_y = gridStartCoord[1] * yscale; step[0] = gridStep[0] * xscale; step[1] = gridStep[1] * yscale; // draw textOrigin[0] = grid_x; textOrigin[1] = grid_y; Vector4Set(gridColour, clrBrownLine[0], clrBrownLine[1], clrBrownLine[2], 1.f); coord_char[1] = '/0'; for (coord_char[0] = ('A' - 1); grid_x < dim_x[1]; grid_x += step[0], coord_char[0]++) { if (coord_char[0] >= 'A') { text_width = CG_Text_Width_Ext(coord_char, 0.2f, 0, &cgs.media.limboFont2); text_height = CG_Text_Height_Ext(coord_char, 0.2f, 0, &cgs.media.limboFont2); CG_Text_Paint_Ext((x + grid_x) - (.5f * step[0]) - (.5f * text_width), y + dim_y[0] + textOrigin[1] + 1.5f * text_height, 0.2f, 0.2f, colorBlack, coord_char, 0, 0, 0, &cgs.media.limboFont2); } trap_R_SetColor(gridColour); Vector4Set(line, x + grid_x, y + dim_y[0], 1, dim_x[1] - dim_x[0]); CG_AdjustFrom640(&line[0], &line[1], &line[2], &line[3]); trap_R_DrawStretchPic(line[0], line[1], line[2], line[3], 0, 0, 0, 1, cgs.media.whiteShader); } for (coord_int = -1; grid_y < dim_y[1]; grid_y += step[1], coord_int++) { if (coord_int >= 0) { Com_sprintf(coord_char, sizeof(coord_char), "%i", coord_int); text_width = CG_Text_Width_Ext("0", 0.2f, 0, &cgs.media.limboFont2); text_height = CG_Text_Height_Ext(coord_char, 0.2f, 0, &cgs.media.limboFont2); CG_Text_Paint_Ext(x + dim_x[0] + textOrigin[0] + .5f * text_width, (y + grid_y) - (.5f * step[1]) + (.5f * text_height), 0.2f, 0.2f, colorBlack, coord_char, 0, 0, 0, &cgs.media.limboFont2); } trap_R_SetColor(gridColour); Vector4Set(line, x + dim_x[0], y + grid_y, dim_y[1] - dim_y[0], 1); CG_AdjustFrom640(&line[0], &line[1], &line[2], &line[3]); trap_R_DrawStretchPic(line[0], line[1], line[2], line[3], 0, 0, 0, 1, cgs.media.whiteShader); } trap_R_SetColor(NULL); }}
开发者ID:harleking,项目名称:etlegacy,代码行数:101,
示例20: CG_LoadPanel_RenderCampaignTypeTextvoid CG_LoadPanel_RenderCampaignTypeText(panel_button_t *button){ CG_Text_Paint_Ext(button->rect.x, button->rect.y, button->font->scalex, button->font->scaley, button->font->colour, va("%s:", CG_LoadPanel_GameTypeName(cgs.gametype)), 0, 0, button->font->style, button->font->font);}
开发者ID:rafal1137,项目名称:etlegacy,代码行数:4,
示例21: CG_DrawMapEntity//.........这里部分代码省略......... trap_R_SetColor(colorRed); } else { trap_R_SetColor(colorYellow); } CG_DrawPic(icon_pos[0], icon_pos[1], icon_extends[0], icon_extends[1], cgs.media.ccPlayerHighlight); trap_R_SetColor(NULL); if (cg.predictedPlayerEntity.voiceChatSpriteTime > cg.time) { CG_DrawPic(icon_pos[0] + 12, icon_pos[1], icon_extends[0] * 0.5f, icon_extends[1] * 0.5f, cg.predictedPlayerEntity.voiceChatSprite); } } else if (mEnt->type == ME_PLAYER_DISGUISED) { trap_R_SetColor(colorOrange); CG_DrawPic(icon_pos[0], icon_pos[1], icon_extends[0], icon_extends[1], cgs.media.ccPlayerHighlight); trap_R_SetColor(NULL); } else if (/*!(cgs.ccFilter & CC_FILTER_BUDDIES) &&*/ CG_IsOnSameFireteam(cg.clientNum, mEnt->data)) { if (ci->ccSelected) { trap_R_SetColor(colorRed); } CG_DrawPic(icon_pos[0], icon_pos[1], icon_extends[0], icon_extends[1], cgs.media.ccPlayerHighlight); trap_R_SetColor(NULL); if (!scissor) { CG_Text_Paint_Ext(string_pos[0], string_pos[1], 0.2f, 0.2f, colorWhite, ci->name, 0, 0, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2); } if (cent->voiceChatSpriteTime > cg.time) { CG_DrawPic(icon_pos[0] + 12, icon_pos[1], icon_extends[0] * 0.5f, icon_extends[1] * 0.5f, cent->voiceChatSprite); } } else if (ci->team == snap->ps.persistant[PERS_TEAM]) { if (ci->ccSelected) { trap_R_SetColor(colorRed); CG_DrawPic(icon_pos[0], icon_pos[1], icon_extends[0], icon_extends[1], cgs.media.ccPlayerHighlight); trap_R_SetColor(NULL); } if (cent->voiceChatSpriteTime > cg.time) { CG_DrawPic(icon_pos[0] + 12, icon_pos[1], icon_extends[0] * 0.5f, icon_extends[1] * 0.5f, cent->voiceChatSprite); } } c_clr[3] = 1.0f; trap_R_SetColor(c_clr); CG_DrawPic(icon_pos[0], icon_pos[1], icon_extends[0], icon_extends[1], classInfo->icon); CG_DrawRotatedPic(icon_pos[0] - 1, icon_pos[1] - 1, icon_extends[0] + 2, icon_extends[1] + 2, classInfo->arrow, (0.5 - (mEnt->yaw - 180.f) / 360.f)); trap_R_SetColor(NULL); } return; case ME_CONSTRUCT:
开发者ID:harleking,项目名称:etlegacy,代码行数:67,
示例22: CG_SpecHelpDraw//.........这里部分代码省略......... // Text settings int tStyle = ITEM_TEXTSTYLE_SHADOWED; int tSpacing = 9; // Should derive from CG_Text_Height_Ext float tScale = 0.19f; fontInfo_t *tFont = FONT_TEXT; vec4_t tColor = COLOR_TEXT; // text float diff = cg.fadeTime - trap_Milliseconds(); // FIXME: Should compute all this stuff beforehand // Compute required width for (i = 0; i < sizeof(help) / sizeof(helpType_t); i++) { if (help[i].cmd != NULL) { len = strlen(CG_getBindKeyName(help[i].cmd, buf, sizeof(buf))); if (len > maxlen) { maxlen = len; } } } Q_strncpyz(format, va("^2%%%ds ^N%%s", maxlen), sizeof(format)); for (i = 0, maxlen = 0; i < sizeof(help) / sizeof(helpType_t); i++) { if (help[i].cmd != NULL) { lines[i] = va(format, CG_getBindKeyName(help[i].cmd, buf, sizeof(buf)), help[i].info); len = CG_Text_Width_Ext(lines[i], tScale, 0, FONT_TEXT); if (len > maxlen) { maxlen = len; } } else { lines[i] = NULL; } } w = maxlen + 8; x = SH_X; y = SH_Y; h = 2 + tSpacing + 2 + // Header 2 + 1 + tSpacing * (sizeof(help) / sizeof(helpType_t)) + 2; // Fade-in effects if (diff > 0.0f) { float scale = (diff / STATS_FADE_TIME); if (cg.spechelpWindow == SHOW_ON) { scale = 1.0f - scale; } bgColor[3] *= scale; bgColorTitle[3] *= scale; borderColor[3] *= scale; borderColorTitle[3] *= scale; hdrColor2[3] *= scale; tColor[3] *= scale; x -= w * (1.0f - scale); } else if (cg.spechelpWindow == SHOW_SHUTDOWN) { cg.spechelpWindow = SHOW_OFF; return; } CG_DrawRect(x, y, w, h, 1, borderColor); CG_FillRect(x, y, w, h, bgColor); // Header CG_FillRect(x, y, w, tSpacing + 4, bgColorTitle); CG_DrawRect(x, y, w, tSpacing + 4, 1, borderColorTitle); x += 4; y += 1; y += tSpacing; CG_Text_Paint_Ext(x, y, hScale, hScaleY, hdrColor2, "SPECTATOR CONTROLS", 0.0f, 0, hStyle, hFont); y += 3; // Control info for (i = 0; i < sizeof(help) / sizeof(helpType_t); i++) { y += tSpacing; if (lines[i] != NULL) { CG_Text_Paint_Ext(x, y, tScale, tScale, tColor, lines[i], 0.0f, 0, tStyle, tFont); } } }}
开发者ID:BulldogDrummond,项目名称:etlegacy-mysql,代码行数:101,
示例23: CG_GameStatsDrawvoid CG_GameStatsDraw(void){ if (cgs.gamestats.show == SHOW_OFF) { return; } else { int i, x = GS_X + 4, y = GS_Y, h; gameStats_t *gs = &cgs.gamestats; vec4_t bgColor = COLOR_BG; // window vec4_t borderColor = COLOR_BORDER; // window vec4_t bgColorTitle = COLOR_BG_TITLE; // titlebar vec4_t borderColorTitle = COLOR_BORDER_TITLE; // titlebar // Main header int hStyle = ITEM_TEXTSTYLE_SHADOWED; float hScale = 0.16f; float hScaleY = 0.21f; fontInfo_t *hFont = FONT_HEADER; // Sub header int hStyle2 = 0; float hScale2 = 0.16f; float hScaleY2 = 0.20f; fontInfo_t *hFont2 = FONT_SUBHEADER; vec4_t hdrColor = COLOR_HDR; // text //vec4_t hdrColor2 = COLOR_HDR2; // text // Text settings int tStyle = ITEM_TEXTSTYLE_SHADOWED; int tSpacing = 9; // Should derive from CG_Text_Height_Ext float tScale = 0.19f; fontInfo_t *tFont = FONT_TEXT; vec4_t tColor = COLOR_TEXT; // text float diff = cgs.gamestats.fadeTime - cg.time; // FIXME: Should compute this beforehand h = 2 + tSpacing + 2 + // Header 2 + 2 + tSpacing + 2 + // Stats columns 1 + // Stats + extra tSpacing * ((gs->cWeapons > 0) ? gs->cWeapons : 1) + tSpacing * ((gs->fHasStats) ? 3 : 0) + ((cgs.gametype == GT_WOLF_LMS) ? 0 : ( 4 + 2 * tSpacing + // Rank/XP 1 + tSpacing + 4 + 2 * tSpacing + // Skill columns 1 + // Skillz tSpacing * ((gs->cSkills > 0) ? gs->cSkills : 1) ) ) + 2; // Fade-in effects if (diff > 0.0f) { float scale = (diff / STATS_FADE_TIME); if (cgs.gamestats.show == SHOW_ON) { scale = 1.0f - scale; } bgColor[3] *= scale; bgColorTitle[3] *= scale; borderColor[3] *= scale; borderColorTitle[3] *= scale; hdrColor[3] *= scale; tColor[3] *= scale; y -= h * (1.0f - scale); } else if (cgs.gamestats.show == SHOW_SHUTDOWN) { cgs.gamestats.show = SHOW_OFF; return; } CG_DrawRect(GS_X, y, GS_W, h, 1, borderColor); CG_FillRect(GS_X, y, GS_W, h, bgColor); // Header CG_FillRect(GS_X, y, GS_W, tSpacing + 4, bgColorTitle); CG_DrawRect(GS_X, y, GS_W, tSpacing + 4, 1, borderColorTitle); y += 1; y += tSpacing; CG_Text_Paint_Ext(x, y, hScale, hScaleY, hdrColor, "PLAYER STATS", 0.0f, 0, hStyle, hFont); y += 3; y += 2;//.........这里部分代码省略.........
开发者ID:BulldogDrummond,项目名称:etlegacy-mysql,代码行数:101,
示例24: CG_Fireteams_MenuText_Drawvoid CG_Fireteams_MenuText_Draw(panel_button_t *button){ float y = button->rect.y; int i; switch (cgs.ftMenuMode) { case 0: if (cgs.ftMenuPos == -1) { for (i = 0; ftMenuRootStrings[i]; i++) { const char *str; if (i < 5) { if (!CG_FireteamHasClass(i, qtrue)) { continue; } } if (cg_quickMessageAlt.integer) { str = va("%i. %s", (i + 1) % 10, ftMenuRootStrings[i]); } else { str = va("%s. %s", ftMenuRootStringsAlphachars[i], ftMenuRootStrings[i]); } 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; } } else { if (cgs.ftMenuPos < 0 || cgs.ftMenuPos > 4) { return; } else { const char **strings = ftMenuStrings[cgs.ftMenuPos]; for (i = 0; strings[i]; i++) { const char *str; if (cg_quickMessageAlt.integer) { str = va("%i. %s", (i + 1) % 10, strings[i]); } else { str = va("%s. %s", (ftMenuStringsAlphachars[cgs.ftMenuPos])[i], strings[i]); } 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; } } } break; case 1: if (!CG_IsOnFireteam(cg.clientNum)) { for (i = 0; ftOffMenuList[i]; i++) { const char *str; if (i == 0 && !CG_CountFireteamsByTeam(cgs.clientinfo[cg.clientNum].team)) { continue; } if (cg_quickMessageAlt.integer) { str = va("%i. %s", (i + 1) % 10, ftOffMenuList[i]); } else { str = va("%s. %s", ftOffMenuListAlphachars[i], ftOffMenuList[i]); } 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; } } else { if (!CG_IsFireTeamLeader(cg.clientNum))//.........这里部分代码省略.........
开发者ID:morsik,项目名称:warpig,代码行数:101,
示例25: CG_TopShotsDrawvoid CG_TopShotsDraw(void){ if (cgs.topshots.show == SHOW_OFF) { return; } else { int x = 640 + TS_X - TS_W, y = 480, h; topshotStats_t *ts = &cgs.topshots; vec4_t bgColor = COLOR_BG; // window vec4_t borderColor = COLOR_BORDER; // window vec4_t bgColorTitle = COLOR_BG_TITLE; // titlebar vec4_t borderColorTitle = COLOR_BORDER_TITLE; // titlebar // Main header int hStyle = ITEM_TEXTSTYLE_SHADOWED; float hScale = 0.16f; float hScaleY = 0.21f; fontInfo_t *hFont = FONT_HEADER; // Sub header int hStyle2 = 0; float hScale2 = 0.16f; float hScaleY2 = 0.20f; fontInfo_t *hFont2 = FONT_SUBHEADER; vec4_t hdrColor = COLOR_HDR; // text vec4_t hdrColor2 = COLOR_HDR2; // text // Text settings int tStyle = ITEM_TEXTSTYLE_SHADOWED; int tSpacing = 9; // Should derive from CG_Text_Height_Ext float tScale = 0.19f; fontInfo_t *tFont = FONT_TEXT; vec4_t tColor = COLOR_TEXT; // text float diff = cgs.topshots.fadeTime - cg.time; // FIXME: Should compute this beforehand h = 2 + tSpacing + 2 + // Header 2 + 2 + tSpacing + 2 + // Stats columns 1 + // Stats + extra tSpacing * ((ts->cWeapons > 0) ? ts->cWeapons : 1) + 1; // Fade-in effects if (diff > 0.0f) { float scale = (diff / STATS_FADE_TIME); if (cgs.topshots.show == SHOW_ON) { scale = 1.0f - scale; } bgColor[3] *= scale; bgColorTitle[3] *= scale; borderColor[3] *= scale; borderColorTitle[3] *= scale; hdrColor[3] *= scale; hdrColor2[3] *= scale; tColor[3] *= scale; y += (TS_Y - h) * scale; } else if (cgs.topshots.show == SHOW_SHUTDOWN) { cgs.topshots.show = SHOW_OFF; return; } else { y += TS_Y - h; } CG_DrawRect(x, y, TS_W, h, 1, borderColor); CG_FillRect(x, y, TS_W, h, bgColor); // Header CG_FillRect(x, y, TS_W, tSpacing + 4, bgColorTitle); CG_DrawRect(x, y, TS_W, tSpacing + 4, 1, borderColorTitle); y += 1; y += tSpacing; CG_Text_Paint_Ext(x + 4, y, hScale, hScaleY, hdrColor, "/"TOPSHOT/" ACCURACIES", 0.0f, 0, hStyle, hFont); y += 4; // Weapon stats y += 2; CG_FillRect(x, y, TS_W, tSpacing + 3, bgColorTitle); CG_DrawRect(x, y, TS_W, tSpacing + 3, 1, borderColorTitle); x += 4; y += 1 + tSpacing;//.........这里部分代码省略.........
开发者ID:BulldogDrummond,项目名称:etlegacy-mysql,代码行数:101,
示例26: CG_DemoHelpDrawvoid CG_DemoHelpDraw() { const char *help[] = { "^nTAB ^mscores", "^nF1-F5 ^mavidemo record", "^nF11-F12 ^mscreenshot", NULL, "^nKP_DOWN ^mslow down (--)", "^nKP_LEFT ^mslow down (-)", "^nKP_UP ^mspeed up (++)", "^nKP_RIGHT ^mspeed up (+)", "^nSPACE ^mnormal speed", NULL, "^nENTER ^mExternal view", "^nLFT/RGHT ^mChange angle", "^nUP/DOWN ^mMove in/out" }; int i, x, y = 480, w, h; vec4_t bgColor = COLOR_BG; // window vec4_t borderColor = COLOR_BORDER; // window vec4_t bgColorTitle = COLOR_BG_TITLE; // titlebar vec4_t borderColorTitle = COLOR_BORDER_TITLE; // titlebar // Main header int hStyle = ITEM_TEXTSTYLE_SHADOWED; float hScale = 0.16f; float hScaleY = 0.21f; fontInfo_t *hFont = FONT_HEADER; vec4_t hdrColor2 = COLOR_HDR2; // text // Text settings int tStyle = ITEM_TEXTSTYLE_SHADOWED; int tSpacing = 9; // Should derive from CG_Text_Height_Ext float tScale = 0.19f; fontInfo_t *tFont = FONT_TEXT; vec4_t tColor = COLOR_TEXT; // text float diff = cg.fadeTime - trap_Milliseconds(); if (cg.demohelpWindow == SHOW_OFF) { return; } // FIXME: Should compute this beforehand w = DH_W; x = 640 + DH_X - w; h = 2 + tSpacing + 2 + // Header 2 + 1 + tSpacing * (2 + (sizeof (help)) / sizeof (char *)) + 2; // Fade-in effects if (diff > 0.0f) { float scale = diff / STATS_FADE_TIME; if (cg.demohelpWindow == SHOW_ON) { scale = 1.0f - scale; } bgColor[3] *= scale; bgColorTitle[3] *= scale; borderColor[3] *= scale; borderColorTitle[3] *= scale; hdrColor2[3] *= scale; tColor[3] *= scale; y += (DH_Y - h) * scale; } else if (cg.demohelpWindow == SHOW_SHUTDOWN) { cg.demohelpWindow = SHOW_OFF; return; } else { y += DH_Y - h; } CG_DrawRect(x, y, w, h, 1, borderColor); CG_FillRect(x, y, w, h, bgColor); // Header CG_FillRect(x, y, w, tSpacing + 4, bgColorTitle); CG_DrawRect(x, y, w, tSpacing + 4, 1, borderColorTitle); x += 4; y += 1; y += tSpacing; CG_Text_Paint_Ext(x, y, hScale, hScaleY, hdrColor2, "DEMO CONTROLS", 0.0f, 0, hStyle, hFont); y += 3; // Control info for (i = 0; i < (int)(sizeof (help) / sizeof (char *)); ++i) { y += tSpacing; if (help[i] != NULL) { CG_Text_Paint_Ext(x, y, tScale, tScale, tColor, (char *)help[i], 0.0f, 0, tStyle, tFont); } } y += tSpacing * 2; CG_Text_Paint_Ext(x, y, tScale, tScale, tColor, "^nBACKSPACE ^mhelp on/off", 0.0f, 0, tStyle, tFont);//.........这里部分代码省略.........
开发者ID:boutetnico,项目名称:ETrun,代码行数:101,
示例27: CG_DrawFireTeamOverlayvoid 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; int i; vec4_t clr1 = { .16f, .2f, .17f, .8f }; vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f }; vec4_t bgColor = { 0.0f, 0.0f, 0.0f, 0.5f }; // window vec4_t borderColor = { 0.5f, 0.5f, 0.5f, 0.5f }; // window f = CG_IsOnFireteam(cg.clientNum); if (!f) { 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, FT_WIDTH, h, 1, borderColor); CG_FillRect(x + 1, y + 1, FT_WIDTH - 2, h - 2, bgColor); x += 2; y += 2; CG_FillRect(x, y, FT_WIDTH - 4, 12, clr1); // Nico, show if it's a private or public FT if (f->priv) { sprintf(buffer, "FT %s (Priv)", bg_fireteamNames[f->ident]); } else { sprintf(buffer, "FT %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 < 6; i++) { y += FT_BAR_HEIGHT + FT_BAR_YSPACING; x = rect->x + 2; ci = CG_SortedFireTeamPlayerForPosition(i, 6); if (!ci) { break; } x += 4; CG_Text_Paint_Ext(x, y + FT_BAR_HEIGHT, .2f, .2f, tclr, ci->name, 0, 17, ITEM_TEXTSTYLE_SHADOWED, &cgs.media.limboFont2); }}
开发者ID:Exosum,项目名称:ETrun,代码行数:61,
示例28: CG_windowDraw//.........这里部分代码省略......... // Multiview rendering has its own handling if(w->effects & WFX_MULTIVIEW) { if(w != cg.mvCurrentMainview && fAllowMV) CG_mvDraw(w); continue; } if(w->effects & WFX_TEXTSIZING) { CG_windowNormalizeOnText(w); w->effects &= ~WFX_TEXTSIZING; } bg = ((w->effects & WFX_FLASH) && (milli % w->flashPeriod) > w->flashMidpoint) ? &w->colorBackground2 : &w->colorBackground; h = w->h; x = w->x; y = w->y; t_offset = milli - w->time; textColor[3] = 1.0f; memcpy(&borderColor, w->colorBorder, sizeof(vec4_t)); memcpy(&bgColor, bg, sizeof(vec4_t)); // TODO: Add in support for ALL scrolling effects if(w->state == WSTATE_START) { tmp = w->targetTime - t_offset; if(w->effects & WFX_SCROLLUP) { if(tmp > 0) { y += (480 - y) * tmp / w->targetTime;//(100 * tmp / w->targetTime) / 100; } else { w->state = WSTATE_COMPLETE; } w->curY = y; } if(w->effects & WFX_FADEIN) { if(tmp > 0) textColor[3] = (float)((float)t_offset / (float)w->targetTime); else w->state = WSTATE_COMPLETE; } } else if(w->state == WSTATE_SHUTDOWN) { tmp = w->targetTime - t_offset; if(w->effects & WFX_SCROLLUP) { if(tmp > 0) y = w->curY + (480 - w->y) * t_offset / w->targetTime;//(100 * t_offset / w->targetTime) / 100; if(tmp < 0 || y >= 480) { w->state = WSTATE_OFF; fCleanup = qtrue; continue; } } if(w->effects & WFX_FADEIN) { if(tmp > 0) { textColor[3] -= (float)((float)t_offset / (float)w->targetTime); } else { textColor[3] = 0.0f; w->state = WSTATE_OFF; } } } borderColor[3] *= textColor[3]; bgColor[3] *= textColor[3]; CG_FillRect(x, y, w->w, h, bgColor); CG_DrawRect(x, y, w->w, h, 1, borderColor); x += 5; y -= (w->effects & WFX_TRUETYPE) ? 3 : 0; for(j=w->lineCount-1; j>=0; j--) { if(w->effects & WFX_TRUETYPE) {// CG_Text_Paint(x, y + h, w->fontScale, textColor, (char*)w->lineText[j], 0.0f, 0, 0); CG_Text_Paint_Ext(x, y + h, w->fontScaleX, w->fontScaleY, textColor, (char*)w->lineText[j], 0.0f, 0, 0, &cgs.media.limboFont2); } h -= (w->lineHeight[j] + 3); if(!(w->effects & WFX_TRUETYPE)) { CG_DrawStringExt2(x, y + h, (char*)w->lineText[j], textColor, qfalse, qtrue, w->fontWidth, w->fontHeight, 0); } } } // Wedge in MV info overlay if(cg.mvTotalClients > 0 && fAllowMV) CG_mvOverlayDisplay(); // Extra rate info CG_demoAviFPSDraw(); CG_demoTimescaleDraw(); // Mouse cursor lays on top of everything if(cg.mvTotalClients > 0 && cg.time < cgs.cursorUpdate && fAllowMV) { //CG_DrawPic(cgs.cursorX - CURSOR_OFFSETX, cgs.cursorY - CURSOR_OFFSETY, 32, 32, cgs.media.cursor); CG_DrawPic( cgDC.cursorx, cgDC.cursory, 32, 32, cgs.media.cursorIcon ); } if(fCleanup) { CG_windowCleanup(); }}
开发者ID:GenaSG,项目名称:ET,代码行数:101,
示例29: CG_DemoHelpDraw//.........这里部分代码省略......... vec4_t tColor = COLOR_TEXT; // text float diff = cg.fadeTime - trap_Milliseconds(); // FIXME: Should compute this beforehand w = DH_W + (#ifdef FEATURE_MULTIVIEW (cg.mvTotalClients > 1) ? 12 :#endif 0); x = Ccg_WideX(SCREEN_WIDTH) + 3 * DH_X - w; h = tSpacing + 9 + tSpacing * (2 +#ifdef FEATURE_MULTIVIEW ((cg.mvTotalClients > 1) ? ARRAY_LEN(mvhelp) : ARRAY_LEN(help))#else ARRAY_LEN(help)#endif ); // Fade-in effects if (diff > 0.0f) { float scale = (diff / STATS_FADE_TIME); if (cg.demohelpWindow == SHOW_ON) { scale = 1.0f - scale; } bgColor[3] *= scale; bgColorTitle[3] *= scale; borderColor[3] *= scale; borderColorTitle[3] *= scale; hdrColor[3] *= scale; tColor[3] *= scale; y += (DH_Y - h) * scale; } else if (cg.demohelpWindow == SHOW_SHUTDOWN) { cg.demohelpWindow = SHOW_OFF; return; } else { y += DH_Y - h; } if (cg.legacyClient && cg.demoinfo) { CG_DrawDemoControls(x, y - 62, w, borderColor, bgColor, tSpacing, bgColorTitle, borderColorTitle, hScale, hScaleY, hdrColor, hStyle, hFont); y += 10; } CG_FillRect(x, y, w, h, bgColor); CG_DrawRect(x, y, w, h, 1, borderColor); y += 1; // Header CG_FillRect(x + 1, y, w - 2, tSpacing + 4, bgColorTitle); CG_DrawRect(x + 1, y, w - 2, tSpacing + 4, 1, borderColorTitle); x += 4; y += tSpacing; CG_Text_Paint_Ext(x, y, hScale, hScaleY, hdrColor, CG_TranslateString("DEMO CONTROLS"), 0.0f, 0, hStyle, hFont); y += 3; // Control info for (i = 0; i < ARRAY_LEN(help); i++) { y += tSpacing; if (help[i] != NULL) { CG_Text_Paint_Ext(x, y, tScale, tScale, tColor, (char *)help[i], 0.0f, 0, tStyle, tFont); } }#if FEATURE_MULTIVIEW if (cg.mvTotalClients > 1) { for (i = 0; i < ARRAY_LEN(mvhelp); i++) { y += tSpacing; if (mvhelp[i] != NULL) { CG_Text_Paint_Ext(x, y, tScale, tScale, tColor, (char *)mvhelp[i], 0.0f, 0, tStyle, tFont); } } }#endif y += tSpacing * 2; CG_Text_Paint_Ext(x, y, tScale, tScale, tColor, CG_TranslateString("^7BACKSPACE ^3help on/off"), 0.0f, 0, tStyle, tFont); }}
开发者ID:belstgut,项目名称:etlegacy,代码行数:101,
注:本文中的CG_Text_Paint_Ext函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CG_Text_Width_Ext函数代码示例 C++ CG_PointContents函数代码示例 |