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


C++ CG_CenterPrint函数代码示例

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


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

示例1: CG_UseItem

/*
===============
CG_UseItem
===============
*/
static void CG_UseItem( centity_t *cent ) {
	playerInfo_t *pi;
	int			itemNum, playerNum;
	gitem_t		*item;
	entityState_t *es;
	int			i;

	es = &cent->currentState;
	
	itemNum = (es->event & ~EV_EVENT_BITS) - EV_USE_ITEM0;
	if ( itemNum < 0 || itemNum > HI_NUM_HOLDABLE ) {
		itemNum = 0;
	}

	// print a message if the local player
	for (i = 0; i < CG_MaxSplitView(); i++) {
		if ( es->number != cg.snap->pss[i].playerNum ) {
			continue;
		}

		if ( !itemNum ) {
			CG_CenterPrint( i, "No item to use", SCREEN_HEIGHT * 0.30, 0.5 );
		} else {
			item = BG_FindItemForHoldable( itemNum );
			CG_CenterPrint( i, va("Use %s", item->pickup_name), SCREEN_HEIGHT * 0.30, 0.5 );
		}
	}

	switch ( itemNum ) {
	default:
	case HI_NONE:
		trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.useNothingSound );
		break;

	case HI_TELEPORTER:
		break;

	case HI_MEDKIT:
		playerNum = cent->currentState.playerNum;
		if ( playerNum >= 0 && playerNum < MAX_CLIENTS ) {
			pi = &cgs.playerinfo[ playerNum ];
			pi->medkitUsageTime = cg.time;
		}
		trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.medkitSound );
		break;

#ifdef MISSIONPACK
	case HI_KAMIKAZE:
		break;

	case HI_PORTAL:
		break;
	case HI_INVULNERABILITY:
		trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.useInvulnerabilitySound );
		break;
#endif
	}

}
开发者ID:mecwerks,项目名称:revamp,代码行数:64,代码来源:cg_event.c

示例2: CG_UseItem

/*
===============
CG_UseItem
===============
*/
static void CG_UseItem( centity_t *cent ) {
	clientInfo_t *ci;
	int			itemNum, clientNum;
	gitem_t		*item;
	entityState_t *es;

	es = &cent->currentState;
	
	itemNum = (es->event & ~EV_EVENT_BITS) - EV_USE_ITEM0;
	if ( itemNum < 0 || itemNum > HI_NUM_HOLDABLE ) {
		itemNum = 0;
	}

	// print a message if the local player
	if ( es->number == cg.snap->ps.clientNum ) {
		if ( !itemNum ) {
			CG_CenterPrint( "No item to use", SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
		} else {
			item = BG_FindItemForHoldable( itemNum );
			CG_CenterPrint( va("Use %s", item->pickup_name), SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
		}
	}

	switch ( itemNum ) {
	default:
	case HI_NONE:
		trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.useNothingSound );
		break;

	case HI_TELEPORTER:
		break;

	case HI_MEDKIT:
		clientNum = cent->currentState.clientNum;
		if ( clientNum >= 0 && clientNum < MAX_CLIENTS ) {
			ci = &cgs.clientinfo[ clientNum ];
			ci->medkitUsageTime = cg.time;
		}
		trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.medkitSound );
		break;

#ifdef MISSIONPACK
	case HI_KAMIKAZE:
		break;

	case HI_PORTAL:
		break;
	case HI_INVULNERABILITY:
		trap_S_StartSound (NULL, es->number, CHAN_BODY, cgs.media.useInvulnerabilitySound );
		break;
#endif
	}

}
开发者ID:Hasimir,项目名称:ioq3,代码行数:59,代码来源:cg_event.c

示例3: CG_MapRestart

// The server has issued a map_restart, so the next snapshot is completely new and should not be interpolated to.
// A tournament restart will clear everything, but doesn't require a reload of all the media
static void CG_MapRestart( void ) {
	if ( cg_showMiss.integer )
		trap->Print( "CG_MapRestart\n" );

	trap->R_ClearDecals();
	//FIXME: trap->FX_Reset?

	CG_InitLocalEntities();
	CG_InitMarkPolys();
	CG_KillCEntityInstances();

	cg.fraglimitWarnings = 0;
	cg.timelimitWarnings = 0;
	cg.intermissionStarted = qfalse;
	cgs.voteTime = 0;
	cg.mapRestart = qtrue;

	CG_StartMusic( qtrue );
	trap->S_ClearLoopingSounds();

	// we really should clear more parts of cg here and stop sounds

	// play the "fight" sound if this is a restart without warmup
	if ( cg.warmup == 0 && cgs.gametype != GT_SIEGE && cgs.gametype != GT_POWERDUEL ) {
		trap->S_StartLocalSound( media.sounds.warning.countFight, CHAN_ANNOUNCER );
		CG_CenterPrint( CG_GetStringEdString( "MP_SVGAME", "BEGIN_DUEL" ), 120, GIANTCHAR_WIDTH * 2 );
	}
}
开发者ID:MatthewCZ,项目名称:Ja,代码行数:30,代码来源:cg_servercmds.cpp

示例4: CG_ModHRInfo

// [ERGO MOD START]
void CG_ModHRInfo(entityState_t *es)
{	
	int		currentHr;
	char	*s;
	vec4_t color;


	currentHr = es->eventParm;

	//if msgIdentifier == HR_

	//CG_Printf("EV_JUMP_PAD w/effect #%i\n", es->eventParm);

	s = va("HR: %d", currentHr);


		
	// blue 
	color[0] = 0;
	color[1] = 0;
	color[2] = 1;
	color[3] = 1;
	
	//640 - (Q_PrintStrlen(s) * BIGCHAR_WIDTH)
	//UI_DrawProportionalString(320, 300, s,
	//	UI_CENTER | UI_SMALLFONT | UI_DROPSHADOW, colorWhite);
	
	//CG_DrawStringExt(320, 25, s, colorWhite, qfalse, qtrue, BIGCHAR_WIDTH, BIGCHAR_HEIGHT, 0);

	//CG_DrawStringExt(300, 300, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0);
	//CG_DrawString(SCREEN_WIDTH * 0.2F, SCREEN_HEIGHT * 0.30F, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, s, 1.0F);
	CG_CenterPrint(s, SCREEN_HEIGHT * 0.30, SMALLCHAR_WIDTH);
}
开发者ID:amplejoe,项目名称:Q3AErgo,代码行数:34,代码来源:cg_event.c

示例5: CG_MapRestart

/*
===============
CG_MapRestart

The server has issued a map_restart, so the next snapshot
is completely new and should not be interpolated to.

A tournement restart will clear everything, but doesn't
require a reload of all the media
===============
*/
static void CG_MapRestart( void )
{
	if ( cg_showmiss.integer )
	{
		CG_Printf( "CG_MapRestart\n" );
	}

	CG_InitMarkPolys();

	// make sure the "3 frags left" warnings play again
	cg.fraglimitWarnings = 0;

	cg.timelimitWarnings = 0;

	cg.intermissionStarted = qfalse;

	cgs.voteTime = 0;

	cg.mapRestart = qtrue;

	CG_StartMusic();

	trap_S_ClearLoopingSounds( qtrue );

	// we really should clear more parts of cg here and stop sounds

	// play the "fight" sound if this is a restart without warmup
	if ( cg.warmup == 0 )
	{
		CG_CenterPrint( "FIGHT!", 120, GIANTCHAR_WIDTH * 2 );
	}

	trap_Cvar_Set( "cg_thirdPerson", "0" );
}
开发者ID:SHOVELL,项目名称:Unvanquished,代码行数:45,代码来源:cg_servercmds.c

示例6: CG_AnnounceHumanStageTransistion

/*
================
CG_AnnounceHumanStageTransistion
================
*/
static void CG_AnnounceHumanStageTransistion( stage_t from, stage_t to )
{
  if( cg.predictedPlayerState.stats[ STAT_TEAM ] != TEAM_HUMANS )
    return;

  trap_S_StartLocalSound( cgs.media.humanStageTransition, CHAN_ANNOUNCER );
  CG_CenterPrint( "Reinforcements have arrived!", 200, GIANTCHAR_WIDTH * 4 );
}
开发者ID:enneract,项目名称:cuboid,代码行数:13,代码来源:cg_servercmds.c

示例7: target_autosave_use

void target_autosave_use(gentity_t *self, gentity_t *other, gentity_t *activator)
{
	G_ActivateBehavior(self,BSET_USE);
	//gi.SendServerCommand( NULL, "cp @SP_INGAME_CHECKPOINT" );
	CG_CenterPrint( "@SP_INGAME_CHECKPOINT", SCREEN_HEIGHT * 0.25 );	//jump the network

	gi.SendConsoleCommand( "wait 2;save auto\n" );
}
开发者ID:AlexCSilva,项目名称:jediacademy,代码行数:8,代码来源:g_target.cpp

示例8: CG_AnnounceAlienStageTransistion

/*
================
CG_AnnounceAlienStageTransistion
================
*/
static void CG_AnnounceAlienStageTransistion( stage_t from, stage_t to )
{
  if( cg.predictedPlayerState.stats[ STAT_TEAM ] != TEAM_ALIENS )
    return;

  trap_S_StartLocalSound( cgs.media.alienStageTransition, CHAN_ANNOUNCER );
  CG_CenterPrint( "We have evolved!", 200, GIANTCHAR_WIDTH * 4 );
}
开发者ID:enneract,项目名称:cuboid,代码行数:13,代码来源:cg_servercmds.c

示例9: CG_CenterEcho_f

/*
===================
CG_CenterEcho_f
===================
*/
void CG_CenterEcho_f( int localPlayerNum ) {
	char text[1024];

	trap_Args( text, sizeof( text ) );

	CG_ReplaceCharacter( text, '\\', '\n' );

	CG_CenterPrint( localPlayerNum, text, SCREEN_HEIGHT * 0.30, 0.5 );
}
开发者ID:LavenderMoon,项目名称:mint-arena,代码行数:14,代码来源:cg_consolecmds.c

示例10: CG_spLose_f

static void CG_spLose_f( void) {
	trap_Cvar_Set("cg_cameraOrbit", "2");
	trap_Cvar_Set("cg_cameraOrbitDelay", "35");
	trap_Cvar_Set("cg_thirdPerson", "1");
	trap_Cvar_Set("cg_thirdPersonAngle", "0");
	trap_Cvar_Set("cg_thirdPersonRange", "100");
	CG_AddBufferedSound(cgs.media.loserSound);
	//trap_S_StartLocalSound(cgs.media.loserSound, CHAN_ANNOUNCER);
	CG_CenterPrint("YOU LOSE...", SCREEN_HEIGHT * .30, 0);
}
开发者ID:0culus,项目名称:ioq3,代码行数:10,代码来源:cg_consolecmds.c

示例11: CG_CenterPrintSE_f

static void CG_CenterPrintSE_f( void ) {
	char strEd[MAX_STRINGED_SV_STRING] = {0};
	char *x = (char *)CG_Argv( 1 );

	if ( x[0] == '@' )
		x++;

	trap->SE_GetStringTextString( x, strEd, MAX_STRINGED_SV_STRING );
	CG_CenterPrint( strEd, SCREEN_HEIGHT * 0.30, BIGCHAR_WIDTH );
}
开发者ID:Malchio,项目名称:OpenJK,代码行数:10,代码来源:cg_servercmds.c

示例12: CG_spWin_f

static void CG_spWin_f( void) {
	trap_Cvar_Set("cg_cameraOrbit", "2");
	trap_Cvar_Set("cg_cameraOrbitDelay", "35");
	trap_Cvar_Set("cg_thirdPerson", "1");
	trap_Cvar_Set("cg_thirdPersonAngle", "0");
	trap_Cvar_Set("cg_thirdPersonRange", "100");
	CG_AddBufferedSound(cgs.media.winnerSound);
	//trap_S_StartLocalSound(cgs.media.winnerSound, CHAN_ANNOUNCER);
	CG_CenterPrint(CG_GetStringEdString("MP_INGAME", "YOU_WIN"), SCREEN_HEIGHT * .30, 0);
}
开发者ID:mehmehsomeone,项目名称:OpenRP,代码行数:10,代码来源:cg_consolecmds.cpp

示例13: CG_BodyObituary

void CG_BodyObituary( entityState_t *ent, char *targetName ) {
	int	target, attacker;
	char	*message;
	char	*message2;
	const char	*attackerInfo;
	char	attackerName[ 32 ];
	gender_t	gender;
	char	*s;

	target = ent->otherEntityNum;
	attacker = ent->otherEntityNum2;

	attackerInfo = CG_ConfigString( CS_PLAYERS + attacker );
	if ( !attackerInfo ) return;
	Q_strncpyz( attackerName, Info_ValueForKey( attackerInfo, "n" ), sizeof ( attackerName ) - 2 );
	strcat( attackerName, S_COLOR_WHITE );

	if ( rand() & 1 ) {
		message = "thawed";
		message2 = "like a package of frozen peas";
	} else {
		gender = cgs.clientinfo[ target ].gender;
		message = "evicted";
		if ( gender == GENDER_FEMALE ) {
			message2 = "from her igloo";
		} else if ( gender == GENDER_NEUTER ) {
			message2 = "from its igloo";
		} else {
			message2 = "from his igloo";
		}
	}

	if ( attacker == cg.snap->ps.clientNum ) {
		s = va( "You thawed %s", targetName );
		CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, BIGCHAR_WIDTH );
	}
	if ( target == cg.snap->ps.clientNum ) {
		s = va( "%s unfroze you", attackerName );
		CG_CenterPrint( s, SCREEN_HEIGHT * 0.25, BIGCHAR_WIDTH );
	}
	CG_Printf( "%s %s %s %s.\n", attackerName, message, targetName, message2 );
}
开发者ID:xzero450,项目名称:revolution,代码行数:42,代码来源:cg_freeze.c

示例14: CG_spWin_f

static void CG_spWin_f( void) {
    trap_Cvar_Set("cg_cameraOrbit", "2");
    trap_Cvar_Set("cg_cameraOrbitDelay", "35");
    trap_Cvar_Set("cg_thirdPerson", "1");
    trap_Cvar_Set("cg_thirdPersonAngle", "0");
    trap_Cvar_Set("cg_thirdPersonRange", "100");
#ifndef SMOKINGUNS
    CG_AddBufferedSound(cgs.media.winnerSound);
#endif
    //trap_S_StartLocalSound(cgs.media.winnerSound, CHAN_ANNOUNCER);
    CG_CenterPrint("YOU WIN!", SCREEN_HEIGHT * .30, 0);
}
开发者ID:smokin-guns,项目名称:SmokinGuns,代码行数:12,代码来源:cg_consolecmds.c

示例15: CG_spLose_f

static void
CG_spLose_f(void)
{
	trap_cvarsetstr("cg_cameraOrbit", "2");
	trap_cvarsetstr("cg_cameraOrbitDelay", "35");
	trap_cvarsetstr("cg_thirdperson", "1");
	trap_cvarsetstr("cg_thirdPersonAngle", "0");
	trap_cvarsetstr("cg_thirdpersonrange", "100");
	CG_AddBufferedSound(cgs.media.loserSound);
	/* trap_sndstartlocalsound(cgs.media.loserSound, CHAN_ANNOUNCER); */
	CG_CenterPrint("YOU LOSE...", SCREEN_HEIGHT * .30, 0);
}
开发者ID:icanhas,项目名称:yantar,代码行数:12,代码来源:consolecmds.c


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