当前位置: 首页>>代码示例>>C++>>正文


C++ CG_DrawStringExt函数代码示例

本文整理汇总了C++中CG_DrawStringExt函数的典型用法代码示例。如果您正苦于以下问题:C++ CG_DrawStringExt函数的具体用法?C++ CG_DrawStringExt怎么用?C++ CG_DrawStringExt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CG_DrawStringExt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: CG_demoTimescaleDraw

void CG_demoTimescaleDraw(void)
{
	if(cg.demoPlayback && cgs.timescaleUpdate > cg.time && demo_drawTimeScale.integer != 0) {
		char *s = va("^3TimeScale: ^7%.1f", cg_timescale.value);
		int w = CG_DrawStrlen(s) * SMALLCHAR_WIDTH;

		CG_FillRect(42 - 2, 400, w + 5, SMALLCHAR_HEIGHT + 3, colorDkGreen);
		CG_DrawRect(42 - 2, 400, w + 5, SMALLCHAR_HEIGHT + 3, 1, colorMdYellow);

		CG_DrawStringExt(42, 400, s, colorWhite, qfalse, qtrue, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, 0);
	}
}
开发者ID:rabb,项目名称:eth32nix-rabbmod,代码行数:12,代码来源:cg_window.c

示例2: CG_demoAviFPSDraw

void CG_demoAviFPSDraw(void)
{
	qboolean        fKeyDown =
	    cgs.fKeyPressed[K_F1] | cgs.fKeyPressed[K_F2] | cgs.fKeyPressed[K_F3] | cgs.fKeyPressed[K_F4] | cgs.fKeyPressed[K_F5];

	if (cg.demoPlayback && fKeyDown && cgs.aviDemoRate >= 0)
	{
		CG_DrawStringExt(42, 425,
		                 ((cgs.aviDemoRate > 0) ? va("^3Record AVI @ ^7%d^2fps", cgs.aviDemoRate) : "^1Stop AVI Recording"),
		                 colorWhite, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT - 2, 0);
	}
}
开发者ID:morsik,项目名称:warpig,代码行数:12,代码来源:cg_window.c

示例3: CG_CenterGiantLine

/*
================
CG_CenterGiantLine
================
*/
static void CG_CenterGiantLine( float y, const char *string ) {
	float		x;
/*
	vec4_t		color;
	color[0] = 1;
	color[1] = 1;
	color[2] = 1;
	color[3] = 1;
*/
	x = ( SCREEN_WIDTH - GIANT_WIDTH * CG_DrawStrlen(string) )/2;

	CG_DrawStringExt( x, y, string, colorWhite, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0, SCR_CENTER );
}
开发者ID:themuffinator,项目名称:fnq3,代码行数:18,代码来源:cg_scoreboard.c

示例4: CG_CenterGiantLine

/*
================
CG_CenterGiantLine
================
*/
static void CG_CenterGiantLine( gfixed y, const char *string ) {
	gfixed		x;
	vec4_t		color;

	color[0] = GFIXED_1;
	color[1] = GFIXED_1;
	color[2] = GFIXED_1;
	color[3] = GFIXED_1;

	x = GFIXED(0,5) * MAKE_GFIXED( 640 - GIANT_WIDTH * CG_DrawStrlen( string ) );

	CG_DrawStringExt( FIXED_TO_INT(x), FIXED_TO_INT(y), string, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
}
开发者ID:Jsoucek,项目名称:q3ce,代码行数:18,代码来源:cg_scoreboard.cpp

示例5: CG_CenterGiantLine

/*
=======================================================================================================================================
CG_CenterGiantLine
=======================================================================================================================================
*/
static void CG_CenterGiantLine(float y, const char *string) {
	float x;
	vec4_t color;

	color[0] = 1;
	color[1] = 1;
	color[2] = 1;
	color[3] = 1;

	x = 0.5 * (640 - GIANT_WIDTH * CG_DrawStrlen(string));

	CG_DrawStringExt(x, y, string, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0);
}
开发者ID:ioid3-games,项目名称:ioid3-q3,代码行数:18,代码来源:cg_scoreboard.c

示例6: CG_Cutscene2d_Draw

void CG_Cutscene2d_Draw(void) {
	int i;

	CG_Cutscene2d_Init(); // make sure that we are inited

	for(i=0;i<MAX_CUTSCENE2D_PICTURES;++i) {
		cutscene2dPicture_t* pic = &cg_cutscene2d.pics[i];

		if(pic->isShown) {

			trap_R_SetColor(pic->color);
				CG_DrawPic(pic->x,pic->y,pic->w,pic->h,pic->shader);
			trap_R_SetColor(NULL);

			if(pic->text[0]) {
				char* start, *end;
				int line=0;

				start = pic->text;
				do {
					end = strstr(start,"\\n");
					if(end) end[0] = '\0';

					CG_DrawStringExt(pic->x+pic->text_x,pic->y+pic->text_y +line*pic->text_ch,
									start,pic->textcolor, qfalse, qfalse, pic->text_cw, pic->text_ch, 0 );

					if(end) {
						end[0] = '\\';
						start = end+2;
					}
					++line;
				} while(end);
			}
		}
	}
}
开发者ID:PadWorld-Entertainment,项目名称:wop-gamesource,代码行数:36,代码来源:cg_cutscene2d.c

示例7: WM_DrawClientScore_Small

static void WM_DrawClientScore_Small( int x, int y, score_t *score, float *color, float fade ) {
	int maxchars, offset;
	float tempx;
	vec4_t hcolor;
	clientInfo_t *ci;

	if ( y + SMALLCHAR_HEIGHT >= 470 )
		return;

	ci = &cgs.clientinfo[score->client];

	if ( score->client == cg.snap->ps.clientNum ) {
		tempx = x;

		hcolor[3] = fade * 0.3;
		VectorSet( hcolor, .5f, .5f, .2f );			// DARK-RED

		CG_FillRect( tempx, y + 1, INFO_PLAYER_WIDTH - INFO_BORDER, MINICHAR_HEIGHT - 1, hcolor );
		tempx += INFO_PLAYER_WIDTH;

		if ( ci->team == TEAM_SPECTATOR ) {
			int width;
			width = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH;

			CG_FillRect( tempx, y + 1, width - INFO_BORDER, MINICHAR_HEIGHT - 1, hcolor );
			tempx += width;
		} else {
			CG_FillRect( tempx, y + 1, INFO_CLASS_WIDTH - INFO_BORDER, MINICHAR_HEIGHT - 1, hcolor );
			tempx += INFO_CLASS_WIDTH;

			if( cg_gameType.integer == GT_WOLF_LMS ) {
				CG_FillRect( tempx, y + 1, INFO_SCORE_WIDTH - INFO_BORDER, MINICHAR_HEIGHT - 1, hcolor );
				tempx += INFO_SCORE_WIDTH;
			} else {
				CG_FillRect( tempx, y + 1, INFO_XP_WIDTH - INFO_BORDER, MINICHAR_HEIGHT - 1, hcolor );
				tempx += INFO_XP_WIDTH;				
			}

			CG_FillRect( tempx, y + 1, INFO_LATENCY_WIDTH - INFO_BORDER, MINICHAR_HEIGHT - 1, hcolor );
			tempx += INFO_LATENCY_WIDTH;

			if( cg_gameType.integer != GT_WOLF_LMS ) {
				CG_FillRect( tempx, y + 1, INFO_LIVES_WIDTH - INFO_BORDER, MINICHAR_HEIGHT - 1, hcolor );
				tempx += INFO_LIVES_WIDTH;
			}
		}
	}

	tempx = x;

	// DHM - Nerve
	VectorSet( hcolor, 1, 1, 1 );
	hcolor[3] = fade;

	maxchars = 17;
	offset = 0;

	if ( ci->team != TEAM_SPECTATOR ) {
		if ( ci->powerups & ( (1 << PW_REDFLAG) | (1 << PW_BLUEFLAG) ) ) {
			CG_DrawPic( tempx-2, y-4, 20, 20, trap_R_RegisterShader( "models/multiplayer/treasure/treasure" ) );
			offset += 14;
			tempx += 14;
			maxchars -= 2;
		}

		// draw the skull icon if out of lives
		if ( score->respawnsLeft == -2 || ( cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health == -1 ) ) {
			CG_DrawPic( tempx, y, 12, 12, cgs.media.scoreEliminatedShader );
			offset += 14;
			tempx += 14;
			maxchars -= 2;
		} else if( cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health == 0 ) {
			CG_DrawPic( tempx + 1, y + 1, 10, 10, cgs.media.medicIcon );
			offset += 14;
			tempx += 14;
			maxchars -= 2;
		}
	}

	// draw name
	CG_DrawStringExt( tempx, y, ci->name, hcolor, qfalse, qfalse, MINICHAR_WIDTH, MINICHAR_HEIGHT, maxchars );
	tempx += INFO_PLAYER_WIDTH - offset;
	// dhm - nerve

	if ( ci->team == TEAM_SPECTATOR ) {
		const char *s;
		int w, totalwidth;

		totalwidth = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH - 8;

		s = CG_TranslateString( "^3SPECTATOR" );
		w = CG_DrawStrlen( s ) * MINICHAR_WIDTH;

		CG_DrawSmallString( tempx + totalwidth - w, y, s, fade );
		return;
	}
	else if ( cg.snap->ps.persistant[PERS_TEAM] == ci->team ) {
		CG_DrawStringExt(	tempx, y, CG_TranslateString( BG_ShortClassnameForNumber( score->playerClass ) ), hcolor, qfalse, qfalse, MINICHAR_WIDTH, MINICHAR_HEIGHT, 0 );
//		CG_DrawSmallString( tempx, y, CG_TranslateString( s ), fade );
	}
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:101,代码来源:cg_scoreboard.c

示例8: WM_DrawClientScore

static void WM_DrawClientScore( int x, int y, score_t *score, float *color, float fade ) {
	int maxchars, offset;
	int i, j;
	float tempx;
	vec4_t hcolor;
	clientInfo_t *ci;
	char buf[64];

	if ( y + SMALLCHAR_HEIGHT >= 470 )
		return;

	ci = &cgs.clientinfo[score->client];

	if ( score->client == cg.snap->ps.clientNum ) {
		tempx = x;

		hcolor[3] = fade * 0.3;
		VectorSet( hcolor, .5f, .5f, .2f );			// DARK-RED

		CG_FillRect( tempx, y + 1, INFO_PLAYER_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
		tempx += INFO_PLAYER_WIDTH;

		if ( ci->team == TEAM_SPECTATOR ) {
			int width;
			width = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH;

			CG_FillRect( tempx, y + 1, width - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
			tempx += width;
		} else {
			CG_FillRect( tempx, y + 1, INFO_CLASS_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
			tempx += INFO_CLASS_WIDTH;

			if( cg_gameType.integer == GT_WOLF_LMS ) {
				CG_FillRect( tempx, y + 1, INFO_SCORE_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
				tempx += INFO_SCORE_WIDTH;
			} else {
				CG_FillRect( tempx, y + 1, INFO_XP_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
				tempx += INFO_XP_WIDTH;				
			}

			CG_FillRect( tempx, y + 1, INFO_LATENCY_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
			tempx += INFO_LATENCY_WIDTH;

			if( cg_gameType.integer != GT_WOLF_LMS ) {
				CG_FillRect( tempx, y + 1, INFO_LIVES_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
				tempx += INFO_LIVES_WIDTH;
			}
		}
	}

	tempx = x;

	// DHM - Nerve
	VectorSet( hcolor, 1, 1, 1 );
	hcolor[3] = fade;

	maxchars = 16;
	offset = 0;

	if ( ci->team != TEAM_SPECTATOR ) {
		if ( ci->powerups & ( (1 << PW_REDFLAG) | (1 << PW_BLUEFLAG) ) ) {
			CG_DrawPic( tempx-4, y, 16, 16, cgs.media.objectiveShader );
			offset += 8;
			tempx += 12;
			maxchars -= 2;
		}

		// draw the skull icon if out of lives
		if( score->respawnsLeft == -2 || (cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health == -1 ) ) {
			CG_DrawPic( tempx, y, 18, 18, cgs.media.scoreEliminatedShader );
			offset += 18;
			tempx += 18;
			maxchars -= 2;
		} else if( cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health == 0 ) {
			CG_DrawPic( tempx + 1, y + 1, 16, 16, cgs.media.medicIcon );
			offset += 18;
			tempx += 18;
			maxchars -= 2;			
		}
	}

	// draw name
	CG_DrawStringExt( tempx, y, ci->name, hcolor, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, maxchars );
	maxchars -= CG_DrawStrlen( ci->name );

	// draw medals
	buf[0] = '\0';
	for( i = 0; i < SK_NUM_SKILLS; i++ ) {
		for( j = 0; j < ci->medals[i]; j++ )
			Q_strcat( buf, sizeof(buf), va( "^%c%c", COLOR_RED + i, skillNames[i][0] ) );
	}
	maxchars--;
	CG_DrawStringExt( tempx + (BG_drawStrlen(ci->name) * SMALLCHAR_WIDTH + SMALLCHAR_WIDTH), y, buf, hcolor, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, maxchars );

	tempx += INFO_PLAYER_WIDTH - offset;

	if ( ci->team == TEAM_SPECTATOR ) {
		const char *s;
		int w, totalwidth;

//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:et-flf-svn,代码行数:101,代码来源:cg_scoreboard.c

示例9: CG_DrawSmallStringColor

void CG_DrawSmallStringColor( int x, int y, const char *s, const vector4 *color ) {
	CG_DrawStringExt(x, y, s, color, qtrue, qfalse, SMALLCHAR_WIDTH * cgs.widthRatioCoef, SMALLCHAR_HEIGHT, 0);
}
开发者ID:Arcadiaprime,项目名称:japp,代码行数:3,代码来源:cg_drawtools.cpp

示例10: CG_DrawBigStringColor

void CG_DrawBigStringColor( int x, int y, const char *s, const vector4 *color ) {
	CG_DrawStringExt(x, y, s, color, qtrue, qtrue, BIGCHAR_WIDTH * cgs.widthRatioCoef, BIGCHAR_HEIGHT, 0);
}
开发者ID:Arcadiaprime,项目名称:japp,代码行数:3,代码来源:cg_drawtools.cpp

示例11: CG_DrawTinyStringColor

void CG_DrawTinyStringColor( int x, int y, const char *s, vec4_t color ) {
	CG_DrawStringExt( x, y, s, color, qtrue, qfalse, TINYCHAR_WIDTH, TINYCHAR_HEIGHT, 0 );
}
开发者ID:chegestar,项目名称:omni-bot,代码行数:3,代码来源:cg_drawtools.c

示例12: WM_DrawClientScore

static void WM_DrawClientScore(int x, int y, score_t * score, float *color, float fade)
{
	int             maxchars, offset;
	int             i, j;
	float           tempx;
	vec4_t          hcolor;
	clientInfo_t   *ci;
	char            buf[64];

	// CHRUKER: b0?? - Was using the wrong char height for this calculation
	if(y + SMALLCHAR_HEIGHT >= 470)
	{
		return;
	}

	ci = &cgs.clientinfo[score->client];

	if(score->client == cg.snap->ps.clientNum)
	{
		hcolor[3] = fade * 0.3;
		VectorSet(hcolor, .5f, .5f, .2f);	// DARK-RED

		// CHRUKER: b077 - Player highlighting was split into columns
		CG_FillRect( x-5, y, (INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH + 5), SMALLCHAR_HEIGHT - 1, hcolor );
	}

	tempx = x;

	// DHM - Nerve
	VectorSet(hcolor, 1, 1, 1);
	hcolor[3] = fade;

	maxchars = 16;
	offset = 0;

	if(ci->team != TEAM_SPECTATOR)
	{
		if(ci->powerups & ((1 << PW_REDFLAG) | (1 << PW_BLUEFLAG)))
		{
			// CHRUKER: b078 - Medic, death and objective icons on the scoreboard are drawn too big
			CG_DrawPic( tempx - 3, y + 1, 14, 14, cgs.media.objectiveShader );
			offset += 14;	// CHRUKER: b072 - Need to match tempx or else the other text gets offset
			tempx += 14;
			maxchars -= 2;
		}

		// draw the skull icon if out of lives
		if(score->respawnsLeft == -2 ||
		   (cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team &&
			cgs.clientinfo[score->client].health == -1))
		{
			// CHRUKER: b078 - Medic, death and objective icons on the scoreboard are drawn too big
			CG_DrawPic( tempx - 3, y + 1, 14, 14, cgs.media.scoreEliminatedShader );
			offset += 14;
			tempx += 14;
			maxchars -= 2;
		}
		else if(cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team &&
				cgs.clientinfo[score->client].health == 0)
		{
			// CHRUKER: b078 - Medic, death and objective icons on the scoreboard are drawn too big
			CG_DrawPic( tempx - 3, y + 1, 14, 14, cgs.media.medicIcon );
			offset += 14;
			tempx += 14;
			maxchars -= 2;
		}
	}

	// draw name
	CG_DrawStringExt(tempx, y, ci->name, hcolor, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, maxchars);
	maxchars -= CG_DrawStrlen(ci->name);

	// draw medals
	buf[0] = '\0';
	for(i = 0; i < SK_NUM_SKILLS; i++)
	{
		for(j = 0; j < ci->medals[i]; j++)
			Q_strcat(buf, sizeof(buf), va("^%c%c", COLOR_RED + i, skillNames[i][0]));
	}
	maxchars--;

	// CHRUKER: b032 - Medals clipped wrong in scoreboard when you're dead, because CG_DrawStringExt will draw
	//                 everything if maxchars <= 0
	if (maxchars > 0)
	{
		CG_DrawStringExt(tempx + (BG_drawStrlen(ci->name) * SMALLCHAR_WIDTH + SMALLCHAR_WIDTH), y, buf, hcolor, qfalse, qfalse,
						 SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, maxchars);
	}

	tempx += INFO_PLAYER_WIDTH - offset;

	if(ci->team == TEAM_SPECTATOR)
	{
		const char     *s;
		int             w, totalwidth;

		totalwidth = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH - 8;

		// CHRUKER: b031 -  Show connecting people as connecting
		if (score->ping == -1)
//.........这里部分代码省略.........
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:101,代码来源:cg_scoreboard.c

示例13: WM_DrawClientScore_Small

static void WM_DrawClientScore_Small(int x, int y, score_t * score, float *color, float fade)
{
	int             maxchars, offset;
	float           tempx;
	vec4_t          hcolor;
	clientInfo_t   *ci;
	// CHRUKER: b033 - Added to draw medals
	int i, j;
	char buf[64];

	if(y + MINICHAR_HEIGHT >= 470)
	{
		return;
	}

	ci = &cgs.clientinfo[score->client];

	if(score->client == cg.snap->ps.clientNum)
	{
		hcolor[3] = fade * 0.3;
		VectorSet(hcolor, .5f, .5f, .2f);	// DARK-RED

		// CHRUKER: b077 - Player highlighting was split into columns
		CG_FillRect( x-5, y, (INFO_PLAYER_WIDTH + INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH + 5), MINICHAR_HEIGHT - 1, hcolor );
	}

	tempx = x;

	// DHM - Nerve
	VectorSet(hcolor, 1, 1, 1);
	hcolor[3] = fade;

	// CHRUKER: b033 - Corrected to draw medals
	maxchars = 16;
	offset = 0;

	if(ci->team != TEAM_SPECTATOR)
	{
		if(ci->powerups & ((1 << PW_REDFLAG) | (1 << PW_BLUEFLAG)))
		{
			// CHRUKER: b071 - Objective carrier icon missing on compact scoreboard
			// CHRUKER: b078 - Medic, death and objective icons on the scoreboard are drawn too big
			CG_DrawPic( tempx - 1, y + 1, 10, 10, cgs.media.objectiveShader );
			offset += 10;
			tempx += 10;
			maxchars -= 2;
		}

		// draw the skull icon if out of lives
		if(score->respawnsLeft == -2 ||
		   (cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team &&
			cgs.clientinfo[score->client].health == -1))
		{
			// CHRUKER: b078 - Medic, death and objective icons on the scoreboard are drawn too big
			CG_DrawPic( tempx - 1, y + 1, 10, 10, cgs.media.scoreEliminatedShader );
			offset += 10;
			tempx += 10;
			maxchars -= 2;
		}
		else if(cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team &&
				cgs.clientinfo[score->client].health == 0)
		{
			// CHRUKER: b078 - Medic, death and objective icons on the scoreboard are drawn too big
			CG_DrawPic( tempx - 1, y + 1, 10, 10, cgs.media.medicIcon );
			offset += 10;
			tempx += 10;
			maxchars -= 2;
		}
	}

	// draw name
	CG_DrawStringExt(tempx, y, ci->name, hcolor, qfalse, qfalse, MINICHAR_WIDTH, MINICHAR_HEIGHT, maxchars);

	// CHRUKER: b033 - Added to draw medals
	maxchars -= CG_DrawStrlen( ci->name );

	buf[0] = '\0';
	for( i = 0; i < SK_NUM_SKILLS; i++ )
	{
		for( j = 0; j < ci->medals[i]; j++ )
		{
			Q_strcat( buf, sizeof(buf), va( "^%c%c", COLOR_RED + i, skillNames[i][0] ) );
		}
	}
	maxchars--;

	if (maxchars > 0) CG_DrawStringExt( tempx + (BG_drawStrlen(ci->name) * MINICHAR_WIDTH + MINICHAR_WIDTH), y, buf, hcolor, qfalse, qfalse, MINICHAR_WIDTH, MINICHAR_HEIGHT, maxchars );
	// b033

	tempx += INFO_PLAYER_WIDTH - offset;
	// dhm - nerve

	if(ci->team == TEAM_SPECTATOR)
	{
		const char     *s;
		int             w, totalwidth;

		totalwidth = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH - 8;

		// CHRUKER: b031 -  Show connecting people as connecting
//.........这里部分代码省略.........
开发者ID:DerSaidin,项目名称:OpenWolf,代码行数:101,代码来源:cg_scoreboard.c

示例14: WM_DrawClientScore

static void WM_DrawClientScore( int x, int y, score_t *score, float *color, float fade ) {
	int maxchars, offset;
	float tempx;
	vec4_t hcolor;
	clientInfo_t *ci;

	if ( y + SMALLCHAR_HEIGHT >= 470 ) {
		return;
	}

	ci = &cgs.clientinfo[score->client];

	if ( score->client == cg.snap->ps.clientNum ) {
		tempx = x;

		hcolor[3] = fade * 0.3;
		VectorSet( hcolor, 0.4452, 0.1172, 0.0782 );            // DARK-RED

		CG_FillRect( tempx, y + 1, INFO_PLAYER_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
		tempx += INFO_PLAYER_WIDTH;

		if ( ci->team == TEAM_SPECTATOR ) {
			int width;
			width = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH;

			CG_FillRect( tempx, y + 1, width - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
			tempx += width;
		} else {
			CG_FillRect( tempx, y + 1, INFO_CLASS_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
			tempx += INFO_CLASS_WIDTH;

			CG_FillRect( tempx, y + 1, INFO_SCORE_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
			tempx += INFO_SCORE_WIDTH;

			CG_FillRect( tempx, y + 1, INFO_LATENCY_WIDTH - INFO_BORDER, SMALLCHAR_HEIGHT - 1, hcolor );
			tempx += INFO_LATENCY_WIDTH;
		}
	}

	tempx = x;

	// DHM - Nerve
	VectorSet( hcolor, 1, 1, 1 );
	hcolor[3] = fade;

	maxchars = 17;
	offset = 0;

	if ( ci->team != TEAM_SPECTATOR ) {
		if ( ci->powerups & ( ( 1 << PW_REDFLAG ) | ( 1 << PW_BLUEFLAG ) ) ) {
			CG_DrawPic( tempx - 4, y - 4, 24, 24, trap_R_RegisterShader( "models/multiplayer/treasure/treasure" ) );
			offset += 16;
			tempx += 16;
			maxchars -= 2;
		}

		// draw the skull icon if out of lives
		if ( score->respawnsLeft == -2 ) {
			CG_DrawPic( tempx, y, 18, 18, cgs.media.scoreEliminatedShader );
			offset += 18;
			tempx += 18;
			maxchars -= 2;
		}
	}

	// draw name
	CG_DrawStringExt( tempx, y, ci->name, hcolor, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, maxchars );
	tempx += INFO_PLAYER_WIDTH - offset;
	// dhm - nerve

	if ( ci->team == TEAM_SPECTATOR ) {
		const char *s;
		int w, totalwidth;

		totalwidth = INFO_CLASS_WIDTH + INFO_SCORE_WIDTH + INFO_LATENCY_WIDTH - 8;

		s = CG_TranslateString( "^3SPECTATOR" );
		w = CG_DrawStrlen( s ) * SMALLCHAR_WIDTH;

		CG_DrawSmallString( tempx + totalwidth - w, y, s, fade );
		return;
	} else if ( cg.snap->ps.persistant[PERS_TEAM] == ci->team ) {
		int val = score->playerClass; // cg_entities[ ci->clientNum ].currentState.teamNum;
		const char *s;

		if ( val == 0 ) {
			s = "Soldr";
		} else if ( val == 1 ) {
			s = "Medic";
		} else if ( val == 2 ) {
			s = "Engr";
		} else if ( val == 3 ) {
			s = "Lieut";
		} else {
			s = "";
		}

		CG_DrawSmallString( tempx, y, CG_TranslateString( s ), fade );
	}
	tempx += INFO_CLASS_WIDTH;
//.........这里部分代码省略.........
开发者ID:chegestar,项目名称:omni-bot,代码行数:101,代码来源:cg_scoreboard.c

示例15: WM_DrawClientScore

static void WM_DrawClientScore(int x, int y, score_t *score, float *color, float fade)
{
	int          maxchars, offset;
	int          i, j;
	float        tempx;
	vec4_t       hcolor;
	clientInfo_t *ci;
	char         buf[64];

	if (y + SMALLCHAR_HEIGHT >= 470)
	{
		return;
	}

	ci = &cgs.clientinfo[score->client];

	if (score->client == cg.snap->ps.clientNum)
	{
		hcolor[3] = fade * 0.3;
		VectorSet(hcolor, .5f, .5f, .2f);           // DARK-RED

		CG_FillRect(x - 5, y, (INFO_TOTAL_WIDTH + 5), SMALLCHAR_HEIGHT - 1, hcolor);
	}

	tempx = x;

	VectorSet(hcolor, 1, 1, 1);
	hcolor[3] = fade;

	maxchars = 16;
	offset   = 0;

	if (ci->team != TEAM_SPECTATOR)
	{
		/* FIXME: adjust x,y coordinates ...
		// draw ready icon if client is ready..
		if (score->scoreflags & 1 && cgs.gamestate != GS_PLAYING)
		{
		    CG_DrawPic(tempx - 3, y + 1, 14, 14, cgs.media.readyIcon);
		    offset += 14;
		    tempx += 14;
		    maxchars -= 2;
		}
		*/

		if (ci->powerups & ((1 << PW_REDFLAG) | (1 << PW_BLUEFLAG)))
		{
			CG_DrawPic(tempx - 1, y + 1, 14, 14, cgs.media.objectiveShader);
			offset   += 14;
			tempx    += 14;
			maxchars -= 2;
		}

		if (cgs.gametype == GT_WOLF_GOLDY && ci->team == cgs.clientinfo[cg.clientNum].team && ci->gold > 0 && ci->health != -1)
		{
			CG_DrawPic(tempx - 1, y + 1, 14, 14, cgs.media.goldIcon);
			offset += 14;
			tempx += 14;
			maxchars -= 2;
		}

		// draw the skull icon if out of lives
		if (score->respawnsLeft == -2 || (cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health == -1))
		{
			CG_DrawPic(tempx - 1, y + 1, 14, 14, cgs.media.scoreEliminatedShader);
			offset   += 14;
			tempx    += 14;
			maxchars -= 2;
		}
		else if (cgs.clientinfo[cg.clientNum].team != TEAM_SPECTATOR && ci->team == cgs.clientinfo[cg.clientNum].team && cgs.clientinfo[score->client].health == 0)
		{
			CG_DrawPic(tempx - 1, y + 1, 14, 14, cgs.media.medicIcon);
			offset   += 14;
			tempx    += 14;
			maxchars -= 2;
		}
	}

	// GeoIP - draw flag before name
	if (score->ping != -1 && score->ping != 999 && cg_countryflags.integer)
	{
		if (cf_draw(tempx - 11, y - 8, fade, ci->clientNum))
		{
			offset   += 14;
			tempx    += 14;
			maxchars -= 2;
		}
	}

	// draw name
	CG_DrawStringExt(tempx, y, ci->name, hcolor, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, maxchars);
	maxchars -= CG_DrawStrlen(ci->name);

	// draw medals
	buf[0] = '\0';
	for (i = 0; i < SK_NUM_SKILLS; i++)
	{
		for (j = 0; j < ci->medals[i]; j++)
		{
			Q_strcat(buf, sizeof(buf), va("^%c%c", COLOR_RED + i, skillNames[i][0]));
//.........这里部分代码省略.........
开发者ID:MartijnB,项目名称:ETGoldy,代码行数:101,代码来源:cg_scoreboard.c


注:本文中的CG_DrawStringExt函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。