/* ================ UI_DrawRect Coordinates are 640*480 virtual values ================= */ void CG_DrawRect( gfixed x, gfixed y, gfixed width, gfixed height, gfixed size, const gfixed *color ) { _CG_trap_R_SetColor( color ); CG_DrawTopBottom(x, y, width, height, size); CG_DrawSides(x, y, width, height, size); _CG_trap_R_SetColor( NULL ); }
/* ================ UI_DrawRect Coordinates are 640*480 virtual values ================= */ void CG_DrawRect( float x, float y, float width, float height, float size, const float *color ) { trap_R_SetColor( color ); CG_DrawTopBottom( x, y, width, height, size ); CG_DrawSides( x, y, width, height, size ); trap_R_SetColor( NULL ); }
/* ================ CG_DrawRect Coordinates are 640*480 virtual values ================= */ void CG_DrawRect( float x, float y, float width, float height, float size, const Color::Color& color ) { trap_R_SetColor( color ); CG_DrawTopBottom( x, y, width, height, size ); CG_DrawSides( x, y, width, height, size ); trap_R_ClearColor(); }
/* ================ CG_DrawRoundedRect Coordinates are 640*480 virtual values ================= */ void CG_DrawRoundedRect( float x, float y, float width, float height, float size, const float *color ) { trap_R_SetColor( color ); CG_DrawTopBottom( x + size * 4, y, width - size * 8, height, size ); CG_DrawSides( x, y + size * 4, width, height - size * 8, size ); CG_DrawCorners( x, y, width, height, size * 4, cgDC.Assets.cornerOut ); trap_R_SetColor( NULL ); }
/* ================ CG_FillRoundedRect Coordinates are 640*480 virtual values ================= */ void CG_FillRoundedRect( float x, float y, float width, float height, float size, const float *color ) { CG_FillRect( x, y + size * 3, width, height - size * 6, color ); trap_R_SetColor( color ); CG_DrawTopBottom( x + size * 3, y, width - size * 6, height, size * 3 ); CG_DrawCorners( x - size, y - size, width + size * 2, height + size * 2, size * 4, cgDC.Assets.cornerIn ); trap_R_SetColor( NULL ); }
/* ================ UI_DrawRect Coordinates are 640*480 virtual values ================= */ void CG_DrawRect( float x, float y, float width, float height, float size, const float *color ) { vec4_t hudAlphaColor; Vector4Copy( color, hudAlphaColor ); hudAlphaColor[3] *= cg_hudAlpha.value; trap_R_SetColor( hudAlphaColor ); CG_DrawTopBottom( x, y, width, height, size ); CG_DrawSides( x, y, width, height, size ); trap_R_SetColor( NULL ); }
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; cg.teamPlayers[team] = 0; // JPW NERVE for ( i = 0; i < cg.numScores; i++ ) { if ( team != cgs.clientinfo[ cg.scores[i].client ].team ) continue; cg.teamPlayers[team]++; } count = 0; for( i = 0; i < cg.numScores && count < maxrows; i++ ) { if( team != cgs.clientinfo[ cg.scores[i].client ].team ) { continue; } if( cg.teamPlayers[team] > maxrows ) { WM_DrawClientScore_Small( x, y, &cg.scores[i], hcolor, fade ); y += MINICHAR_HEIGHT; } else { WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); y += SMALLCHAR_HEIGHT; } count++; } // draw spectators y += SMALLCHAR_HEIGHT; for ( i = 0; i < cg.numScores; i++ ) { if ( cgs.clientinfo[ cg.scores[i].client ].team != TEAM_SPECTATOR ) continue; if ( team == TEAM_AXIS && ( i % 2 ) ) continue; if ( team == TEAM_ALLIES && ( ( i + 1 ) % 2 ) ) continue; WM_DrawClientScore( x, y, &cg.scores[i], hcolor, fade ); y += SMALLCHAR_HEIGHT; } return y; }
void CG_DrawTopBottomDc (float x, float y, float w, float h, float size, int widescreen, rectDef_t menuRect) { wsset(); CG_DrawTopBottom(x, y, w, h, size); wsoff(); }
void UI_DisplayContextCG::drawTopBottom( float x, float y, float w, float h, float size ) { CG_DrawTopBottom( x, y, w, h, size ); }