本文整理汇总了C++中CG_ConfigString函数的典型用法代码示例。如果您正苦于以下问题:C++ CG_ConfigString函数的具体用法?C++ CG_ConfigString怎么用?C++ CG_ConfigString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CG_ConfigString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CG_RegisterSounds
//.........这里部分代码省略.........
cgs.media.enemyTookTheFlagSound = trap_S_RegisterSound( "sound/teamplay/voc_enemy_1flag.wav", qtrue );
}
cgs.media.tracerSound = trap_S_RegisterSound( "sound/weapons/machinegun/buletby1.wav", qfalse );
cgs.media.selectSound = trap_S_RegisterSound( "sound/weapons/change.wav", qfalse );
cgs.media.wearOffSound = trap_S_RegisterSound( "sound/items/wearoff.wav", qfalse );
cgs.media.useNothingSound = trap_S_RegisterSound( "sound/items/use_nothing.wav", qfalse );
cgs.media.gibSound = trap_S_RegisterSound( "sound/player/gibsplt1.wav", qfalse );
cgs.media.gibBounce1Sound = trap_S_RegisterSound( "sound/player/gibimp1.wav", qfalse );
cgs.media.gibBounce2Sound = trap_S_RegisterSound( "sound/player/gibimp2.wav", qfalse );
cgs.media.gibBounce3Sound = trap_S_RegisterSound( "sound/player/gibimp3.wav", qfalse );
cgs.media.teleInSound = trap_S_RegisterSound( "sound/world/telein.wav", qfalse );
cgs.media.teleOutSound = trap_S_RegisterSound( "sound/world/teleout.wav", qfalse );
cgs.media.respawnSound = trap_S_RegisterSound( "sound/items/respawn1.wav", qfalse );
cgs.media.noAmmoSound = trap_S_RegisterSound( "sound/weapons/noammo.wav", qfalse );
cgs.media.talkSound = trap_S_RegisterSound( "sound/player/talk.wav", qfalse );
cgs.media.landSound = trap_S_RegisterSound( "sound/player/land1.wav", qfalse);
cgs.media.hitSound = trap_S_RegisterSound( "sound/feedback/hit.wav", qfalse );
cgs.media.impressiveSound = trap_S_RegisterSound( "sound/feedback/impressive.wav", qtrue );
cgs.media.excellentSound = trap_S_RegisterSound( "sound/feedback/excellent.wav", qtrue );
cgs.media.deniedSound = trap_S_RegisterSound( "sound/feedback/denied.wav", qtrue );
cgs.media.humiliationSound = trap_S_RegisterSound( "sound/feedback/humiliation.wav", qtrue );
cgs.media.assistSound = trap_S_RegisterSound( "sound/feedback/assist.wav", qtrue );
cgs.media.defendSound = trap_S_RegisterSound( "sound/feedback/defense.wav", qtrue );
cgs.media.takenLeadSound = trap_S_RegisterSound( "sound/feedback/takenlead.wav", qtrue);
cgs.media.tiedLeadSound = trap_S_RegisterSound( "sound/feedback/tiedlead.wav", qtrue);
cgs.media.lostLeadSound = trap_S_RegisterSound( "sound/feedback/lostlead.wav", qtrue);
cgs.media.watrInSound = trap_S_RegisterSound( "sound/player/watr_in.wav", qfalse);
cgs.media.watrOutSound = trap_S_RegisterSound( "sound/player/watr_out.wav", qfalse);
cgs.media.watrUnSound = trap_S_RegisterSound( "sound/player/watr_un.wav", qfalse);
cgs.media.jumpPadSound = trap_S_RegisterSound ("sound/world/jumppad.wav", qfalse );
for (i=0 ; i<4 ; i++) {
Com_sprintf (name, sizeof(name), "sound/player/footsteps/step%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_NORMAL][i] = trap_S_RegisterSound (name, qfalse);
Com_sprintf (name, sizeof(name), "sound/player/footsteps/boot%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_BOOT][i] = trap_S_RegisterSound (name, qfalse);
Com_sprintf (name, sizeof(name), "sound/player/footsteps/flesh%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_FLESH][i] = trap_S_RegisterSound (name, qfalse);
Com_sprintf (name, sizeof(name), "sound/player/footsteps/mech%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_MECH][i] = trap_S_RegisterSound (name, qfalse);
Com_sprintf (name, sizeof(name), "sound/player/footsteps/energy%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_ENERGY][i] = trap_S_RegisterSound (name, qfalse);
Com_sprintf (name, sizeof(name), "sound/player/footsteps/splash%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_SPLASH][i] = trap_S_RegisterSound (name, qfalse);
Com_sprintf (name, sizeof(name), "sound/player/footsteps/clank%i.wav", i+1);
cgs.media.footsteps[FOOTSTEP_METAL][i] = trap_S_RegisterSound (name, qfalse);
}
// only register the items that the server says we need
strcpy( items, CG_ConfigString( CS_ITEMS ) );
for ( i = 1 ; i < bg_numItems ; i++ ) {
// if ( items[ i ] == '1' || cg_buildScript.integer ) {
CG_RegisterItemSounds( i );
// }
}
for ( i = 1 ; i < MAX_SOUNDS ; i++ ) {
soundName = CG_ConfigString( CS_SOUNDS+i );
if ( !soundName[0] ) {
break;
}
if ( soundName[0] == '*' ) {
continue; // custom sound
}
cgs.gameSounds[i] = trap_S_RegisterSound( soundName, qfalse );
}
// FIXME: only needed with item
cgs.media.flightSound = trap_S_RegisterSound( "sound/items/flight.wav", qfalse );
cgs.media.medkitSound = trap_S_RegisterSound ("sound/items/use_medkit.wav", qfalse);
cgs.media.quadSound = trap_S_RegisterSound("sound/items/damage3.wav", qfalse);
cgs.media.sfx_ric1 = trap_S_RegisterSound ("sound/weapons/machinegun/ric1.wav", qfalse);
cgs.media.sfx_ric2 = trap_S_RegisterSound ("sound/weapons/machinegun/ric2.wav", qfalse);
cgs.media.sfx_ric3 = trap_S_RegisterSound ("sound/weapons/machinegun/ric3.wav", qfalse);
cgs.media.sfx_railg = trap_S_RegisterSound ("sound/weapons/railgun/railgf1a.wav", qfalse);
cgs.media.sfx_rockexp = trap_S_RegisterSound ("sound/weapons/rocket/rocklx1a.wav", qfalse);
cgs.media.sfx_plasmaexp = trap_S_RegisterSound ("sound/weapons/plasma/plasmx1a.wav", qfalse);
cgs.media.regenSound = trap_S_RegisterSound("sound/items/regen.wav", qfalse);
cgs.media.protectSound = trap_S_RegisterSound("sound/items/protect3.wav", qfalse);
cgs.media.n_healthSound = trap_S_RegisterSound("sound/items/n_health.wav", qfalse );
cgs.media.hgrenb1aSound = trap_S_RegisterSound("sound/weapons/grenade/hgrenb1a.wav", qfalse);
cgs.media.hgrenb2aSound = trap_S_RegisterSound("sound/weapons/grenade/hgrenb2a.wav", qfalse);
}
示例2: WM_DrawObjectives
int WM_DrawObjectives( int x, int y, int width, float fade ) {
const char *s, *str;
int tempy, rows;
int msec, mins, seconds, tens; // JPW NERVE
vec4_t tclr = { 0.6f, 0.6f, 0.6f, 1.0f };
if ( cg.snap->ps.pm_type == PM_INTERMISSION ) {
const char *s, *buf, *shader = NULL, *flagshader = NULL, *nameshader = NULL;
// Moved to CG_DrawIntermission
/* static int doScreenshot = 0, doDemostop = 0;
// OSP - End-of-level autoactions
if(!cg.demoPlayback) {
if(!cg.latchVictorySound) {
if(cg_autoAction.integer & AA_SCREENSHOT) {
doScreenshot = cg.time + 1000;
}
if(cg_autoAction.integer & AA_STATSDUMP) {
CG_dumpStats_f();
}
if((cg_autoAction.integer & AA_DEMORECORD) && (cgs.gametype == GT_WOLF_STOPWATCH && cgs.currentRound != 1)) {
doDemostop = cg.time + 5000; // stats should show up within 5 seconds
}
}
if(doScreenshot > 0 && doScreenshot < cg.time) {
CG_autoScreenShot_f();
doScreenshot = 0;
}
if(doDemostop > 0 && doDemostop < cg.time) {
trap_SendConsoleCommand("stoprecord\n");
doDemostop = 0;
}
}
*/
rows = 8;
y += SMALLCHAR_HEIGHT * ( rows - 1 );
s = CG_ConfigString( CS_MULTI_MAPWINNER );
buf = Info_ValueForKey( s, "winner" );
if ( atoi( buf ) == -1 )
str = "ITS A TIE!";
else if ( atoi( buf ) ) {
str = "ALLIES";
// shader = "ui/assets/portraits/allies_win";
flagshader = "ui/assets/portraits/allies_win_flag.tga";
nameshader = "ui/assets/portraits/text_allies.tga";
/* if ( !cg.latchVictorySound ) {
cg.latchVictorySound = qtrue;
trap_S_StartLocalSound( trap_S_RegisterSound( "sound/music/allies_win.wav", qtrue ), CHAN_LOCAL_SOUND ); // FIXME: stream
}*/
}
else {
str = "AXIS";
// shader = "ui/assets/portraits/axis_win";
flagshader = "ui/assets/portraits/axis_win_flag.tga";
nameshader = "ui/assets/portraits/text_axis.tga";
/* if ( !cg.latchVictorySound ) {
cg.latchVictorySound = qtrue;
trap_S_StartLocalSound( trap_S_RegisterSound( "sound/music/axis_win.wav", qtrue ), CHAN_LOCAL_SOUND ); // FIXME: stream
}*/
}
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 {
//.........这里部分代码省略.........
示例3: CG_Obituary
/*
=============
CG_Obituary
=============
*/
static void CG_Obituary( entityState_t *ent ) {
int mod;
int target, attacker;
char *message;
char *message2;
const char *targetInfo;
const char *attackerInfo;
char targetName[32];
char attackerName[32];
gender_t gender;
clientInfo_t *ci;
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
if ( target < 0 || target >= MAX_CLIENTS ) {
CG_Error( "CG_Obituary: target out of range" );
}
ci = &cgs.clientinfo[target];
if ( attacker < 0 || attacker >= MAX_CLIENTS ) {
attacker = ENTITYNUM_WORLD;
attackerInfo = NULL;
} else {
attackerInfo = CG_ConfigString( CS_PLAYERS + attacker );
}
targetInfo = CG_ConfigString( CS_PLAYERS + target );
if ( !targetInfo ) {
return;
}
Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof(targetName) - 2);
strcat( targetName, S_COLOR_WHITE );
message2 = "";
// check for single client messages
switch( mod ) {
case MOD_SUICIDE:
message = "suicides";
break;
case MOD_FALLING:
message = "cratered";
break;
case MOD_CRUSH:
message = "was squished";
break;
case MOD_WATER:
message = "sank like a rock";
break;
case MOD_SLIME:
message = "melted";
break;
case MOD_LAVA:
message = "does a back flip into the lava";
break;
case MOD_TARGET_LASER:
message = "saw the light";
break;
case MOD_TRIGGER_HURT:
message = "was in the wrong place";
break;
default:
message = NULL;
break;
}
if (attacker == target) {
gender = ci->gender;
switch (mod) {
#ifdef MISSIONPACK
case MOD_KAMIKAZE:
message = "goes out with a bang";
break;
#endif
case MOD_GRENADE_SPLASH:
if ( gender == GENDER_FEMALE )
message = "tripped on her own grenade";
else if ( gender == GENDER_NEUTER )
message = "tripped on its own grenade";
else
message = "tripped on his own grenade";
break;
case MOD_ROCKET_SPLASH:
if ( gender == GENDER_FEMALE )
message = "blew herself up";
else if ( gender == GENDER_NEUTER )
message = "blew itself up";
else
message = "blew himself up";
break;
case MOD_PLASMA_SPLASH:
if ( gender == GENDER_FEMALE )
//.........这里部分代码省略.........
示例4: CG_NewParticleArea
int CG_NewParticleArea(int num)
{
// const char *str;
char *str;
char *token;
int type;
vec3_t origin, origin2;
int i;
float range = 0;
int turb;
int numparticles;
int snum;
str = (char *)CG_ConfigString(num);
if(!str[0])
{
return (0);
}
// returns type 128 64 or 32
token = COM_Parse(&str);
type = atoi(token);
if(type == 1)
{
range = 128;
}
else if(type == 2)
{
range = 64;
}
else if(type == 3)
{
range = 32;
}
else if(type == 0)
{
range = 256;
}
else if(type == 4)
{
range = 8;
}
else if(type == 5)
{
range = 16;
}
else if(type == 6)
{
range = 32;
}
else if(type == 7)
{
range = 64;
}
for(i = 0; i < 3; i++)
{
token = COM_Parse(&str);
origin[i] = atof(token);
}
for(i = 0; i < 3; i++)
{
token = COM_Parse(&str);
origin2[i] = atof(token);
}
token = COM_Parse(&str);
numparticles = atoi(token);
token = COM_Parse(&str);
turb = atoi(token);
token = COM_Parse(&str);
snum = atoi(token);
for(i = 0; i < numparticles; i++)
{
if(type >= 4)
{
CG_ParticleBubble(cgs.media.waterBubbleShader, origin, origin2, turb, range, snum);
}
else
{
CG_ParticleSnow(cgs.media.snowShader, origin, origin2, turb, range, snum);
}
}
return (1);
}
示例5: TurretClientRun
void TurretClientRun(centity_t *ent)
{
if (!ent->ghoul2)
{
weaponInfo_t *weaponInfo;
trap_G2API_InitGhoul2Model(&ent->ghoul2, CG_ConfigString( CS_MODELS+ent->currentState.modelindex ), 0, 0, 0, 0, 0);
if (!ent->ghoul2)
{ //bad
return;
}
ent->torsoBolt = trap_G2API_AddBolt( ent->ghoul2, 0, "*flash02" );
trap_G2API_SetBoneAngles( ent->ghoul2, 0, "bone_hinge", vec3_origin, BONE_ANGLES_POSTMULT, POSITIVE_Y, POSITIVE_Z, POSITIVE_X, NULL, 100, cg->time );
trap_G2API_SetBoneAngles( ent->ghoul2, 0, "bone_gback", vec3_origin, BONE_ANGLES_POSTMULT, POSITIVE_Y, POSITIVE_Z, POSITIVE_X, NULL, 100, cg->time );
trap_G2API_SetBoneAngles( ent->ghoul2, 0, "bone_barrel", vec3_origin, BONE_ANGLES_POSTMULT, POSITIVE_Y, POSITIVE_Z, POSITIVE_X, NULL, 100, cg->time );
trap_G2API_SetBoneAnim( ent->ghoul2, 0, "model_root", 0, 11, BONE_ANIM_OVERRIDE_FREEZE, 0.8f, cg->time, 0, 0 );
ent->turAngles[ROLL] = 0;
ent->turAngles[PITCH] = 90;
ent->turAngles[YAW] = 0;
weaponInfo = &cg_weapons[WP_TURRET];
if ( !weaponInfo->registered )
{
CG_RegisterWeapon(WP_TURRET);
}
}
if (ent->currentState.fireflag == 2)
{ //I'm about to blow
if (ent->turAngles)
{
trap_G2API_SetBoneAngles( ent->ghoul2, 0, "bone_hinge", ent->turAngles, BONE_ANGLES_REPLACE, NEGATIVE_Y, NEGATIVE_Z, NEGATIVE_X, NULL, 100, cg->time );
}
return;
}
else if (ent->currentState.fireflag && ent->bolt4 != ent->currentState.fireflag)
{
vec3_t muzzleOrg, muzzleDir;
mdxaBone_t boltMatrix;
trap_G2API_GetBoltMatrix(ent->ghoul2, 0, ent->torsoBolt, &boltMatrix, /*ent->lerpAngles*/vec3_origin, ent->lerpOrigin, cg->time, cgs.gameModels, ent->modelScale);
BG_GiveMeVectorFromMatrix(&boltMatrix, ORIGIN, muzzleOrg);
BG_GiveMeVectorFromMatrix(&boltMatrix, NEGATIVE_X, muzzleDir);
trap_FX_PlayEffectID(cgs.effects.mTurretMuzzleFlash, muzzleOrg, muzzleDir, -1, -1);
ent->bolt4 = ent->currentState.fireflag;
}
else if (!ent->currentState.fireflag)
{
ent->bolt4 = 0;
}
if (ent->currentState.bolt2 != ENTITYNUM_NONE)
{ //turn toward the enemy
centity_t *enemy = &cg_entities[ent->currentState.bolt2];
if (enemy)
{
vec3_t enAng;
vec3_t enPos;
VectorCopy(enemy->currentState.pos.trBase, enPos);
VectorSubtract(enPos, ent->lerpOrigin, enAng);
VectorNormalize(enAng);
vectoangles(enAng, enAng);
enAng[ROLL] = 0;
enAng[PITCH] += 90;
CreepToPosition(enAng, ent->turAngles);
}
}
else
{
vec3_t idleAng;
float turnAmount;
if (ent->turAngles[YAW] > 360)
{
ent->turAngles[YAW] -= 361;
}
if (!ent->dustTrailTime)
{
ent->dustTrailTime = cg->time;
}
turnAmount = (cg->time-ent->dustTrailTime)*0.03;
if (turnAmount > 360)
{
turnAmount = 360;
}
//.........这里部分代码省略.........
示例6: CG_ConfigStringModified
/*
================
CG_ConfigStringModified
================
*/
static void CG_ConfigStringModified( void ) {
const char *str;
int num;
num = atoi( CG_Argv( 1 ) );
// get the gamestate from the client system, which will have the
// new configstring already integrated
trap_GetGameState( &cgs.gameState );
// look up the individual string that was modified
str = CG_ConfigString( num );
// do something with it if necessary
if ( num == CS_MUSIC ) {
CG_StartMusic();
} else if ( num == CS_SERVERINFO ) {
CG_ParseServerinfo();
} else if ( num == CS_WARMUP ) {
CG_ParseWarmup();
} else if ( num == CS_SCORES1 ) {
cgs.scores1 = atoi( str );
} else if ( num == CS_SCORES2 ) {
cgs.scores2 = atoi( str );
} else if ( num == CS_LEVEL_START_TIME ) {
cgs.levelStartTime = atoi( str );
} else if ( num == CS_VOTE_TIME ) {
cgs.voteTime = atoi( str );
cgs.voteModified = qtrue;
} else if ( num == CS_VOTE_YES ) {
cgs.voteYes = atoi( str );
cgs.voteModified = qtrue;
} else if ( num == CS_VOTE_NO ) {
cgs.voteNo = atoi( str );
cgs.voteModified = qtrue;
} else if ( num == CS_VOTE_STRING ) {
Q_strncpyz( cgs.voteString, str, sizeof( cgs.voteString ) );
#ifdef MISSIONPACK
trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER );
#endif //MISSIONPACK
} else if ( num >= CS_TEAMVOTE_TIME && num <= CS_TEAMVOTE_TIME + 1) {
cgs.teamVoteTime[num-CS_TEAMVOTE_TIME] = atoi( str );
cgs.teamVoteModified[num-CS_TEAMVOTE_TIME] = qtrue;
} else if ( num >= CS_TEAMVOTE_YES && num <= CS_TEAMVOTE_YES + 1) {
cgs.teamVoteYes[num-CS_TEAMVOTE_YES] = atoi( str );
cgs.teamVoteModified[num-CS_TEAMVOTE_YES] = qtrue;
} else if ( num >= CS_TEAMVOTE_NO && num <= CS_TEAMVOTE_NO + 1) {
cgs.teamVoteNo[num-CS_TEAMVOTE_NO] = atoi( str );
cgs.teamVoteModified[num-CS_TEAMVOTE_NO] = qtrue;
} else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1) {
Q_strncpyz( cgs.teamVoteString[num-CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString ) );
#ifdef MISSIONPACK
trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER );
#endif
} else if ( num == CS_INTERMISSION ) {
cg.intermissionStarted = atoi( str );
} else if ( num >= CS_MODELS && num < CS_MODELS+MAX_MODELS ) {
cgs.gameModels[ num-CS_MODELS ] = trap_R_RegisterModel( str );
} else if ( num >= CS_SOUNDS && num < CS_SOUNDS+MAX_MODELS ) {
if ( str[0] != '*' ) { // player specific sounds don't register here
cgs.gameSounds[ num-CS_SOUNDS] = trap_S_RegisterSound( str, qfalse );
}
} else if ( num >= CS_PLAYERS && num < CS_PLAYERS+MAX_CLIENTS ) {
CG_NewClientInfo( num - CS_PLAYERS );
CG_BuildSpectatorString();
} else if ( num == CS_FLAGSTATUS ) {
if( cgs.gametype == GT_CTF ) {
// format is rb where its red/blue, 0 is at base, 1 is taken, 2 is dropped
cgs.redflag = str[0] - '0';
cgs.blueflag = str[1] - '0';
}
#ifdef MISSIONPACK
else if( cgs.gametype == GT_1FCTF ) {
cgs.flagStatus = str[0] - '0';
}
#endif
}
else if ( num == CS_SHADERSTATE ) {
CG_ShaderStateChanged();
}
}
示例7: CG_HandleNPCSounds
void CG_HandleNPCSounds(centity_t *cent)
{
if (!cent->npcClient)
{
return;
}
//standard
if (cent->currentState.csSounds_Std)
{
const char *s = CG_ConfigString( CS_SOUNDS + cent->currentState.csSounds_Std );
if (s && s[0])
{
char sEnd[MAX_QPATH];
int i = 2;
int j = 0;
//Parse past the initial "*" which indicates this is a custom sound, and the $ which indicates
//it is an NPC custom sound dir.
while (s[i])
{
sEnd[j] = s[i];
j++;
i++;
}
sEnd[j] = 0;
CG_RegisterCustomSounds(cent->npcClient, 1, sEnd);
}
}
else
{
memset(¢->npcClient->sounds, 0, sizeof(cent->npcClient->sounds));
}
//combat
if (cent->currentState.csSounds_Combat)
{
const char *s = CG_ConfigString( CS_SOUNDS + cent->currentState.csSounds_Combat );
if (s && s[0])
{
char sEnd[MAX_QPATH];
int i = 2;
int j = 0;
//Parse past the initial "*" which indicates this is a custom sound, and the $ which indicates
//it is an NPC custom sound dir.
while (s[i])
{
sEnd[j] = s[i];
j++;
i++;
}
sEnd[j] = 0;
CG_RegisterCustomSounds(cent->npcClient, 2, sEnd);
}
}
else
{
memset(¢->npcClient->combatSounds, 0, sizeof(cent->npcClient->combatSounds));
}
//extra
if (cent->currentState.csSounds_Extra)
{
const char *s = CG_ConfigString( CS_SOUNDS + cent->currentState.csSounds_Extra );
if (s && s[0])
{
char sEnd[MAX_QPATH];
int i = 2;
int j = 0;
//Parse past the initial "*" which indicates this is a custom sound, and the $ which indicates
//it is an NPC custom sound dir.
while (s[i])
{
sEnd[j] = s[i];
j++;
i++;
}
sEnd[j] = 0;
CG_RegisterCustomSounds(cent->npcClient, 3, sEnd);
}
}
else
{
memset(¢->npcClient->extraSounds, 0, sizeof(cent->npcClient->extraSounds));
}
//jedi
if (cent->currentState.csSounds_Jedi)
{
const char *s = CG_ConfigString( CS_SOUNDS + cent->currentState.csSounds_Jedi );
if (s && s[0])
//.........这里部分代码省略.........
示例8: CG_DrawInformation
/*
====================
CG_DrawInformation
Draw all the status / pacifier stuff during level loading
====================
*/
void CG_DrawInformation(void)
{
const char *s;
const char *info;
const char *sysInfo;
int y;
int value;
qhandle_t levelshot;
qhandle_t detail;
char buf[1024];
info = CG_ConfigString(CS_SERVERINFO);
sysInfo = CG_ConfigString(CS_SYSTEMINFO);
s = Info_ValueForKey(info, "mapname");
levelshot = trap_R_RegisterShaderNoMip(va("levelshots/%s.tga", s));
if (!levelshot)
{
levelshot = trap_R_RegisterShaderNoMip("menu/art/unknownmap");
}
trap_R_SetColor(NULL);
CG_DrawPic(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, levelshot);
// blend a detail texture over it
detail = trap_R_RegisterShader("levelShotDetail");
trap_R_DrawStretchPic(0, 0, cgs.glconfig.vidWidth, cgs.glconfig.vidHeight, 0, 0, 2.5, 2, detail);
// draw the icons of things as they are loaded
CG_DrawLoadingIcons();
// the first 150 rows are reserved for the client connection
// screen to write into
if (cg.infoScreenText[0])
{
UI_DrawProportionalString(320, 128-32, va("Loading... %s", cg.infoScreenText),
UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, colorWhite);
}
else
{
UI_DrawProportionalString(320, 128-32, "Awaiting snapshot...",
UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, colorWhite);
}
// draw info string information
y = 180-32;
// don't print server lines if playing a local game
trap_Cvar_VariableStringBuffer("sv_running", buf, sizeof(buf));
if (!atoi(buf))
{
// server hostname
Q_strncpyz(buf, Info_ValueForKey(info, "sv_hostname"), 1024);
Q_CleanStr(buf);
UI_DrawProportionalString(320, y, buf,
UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, colorWhite);
y += PROP_HEIGHT;
// pure server
s = Info_ValueForKey(sysInfo, "sv_pure");
if (s[0] == '1')
{
UI_DrawProportionalString(320, y, "Pure Server",
UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, colorWhite);
y += PROP_HEIGHT;
}
// server-specific message of the day
s = CG_ConfigString(CS_MOTD);
if (s[0])
{
UI_DrawProportionalString(320, y, s,
UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, colorWhite);
y += PROP_HEIGHT;
}
// some extra space after hostname and motd
y += 10;
}
// map-specific message (long map name)
s = CG_ConfigString(CS_MESSAGE);
if (s[0])
{
UI_DrawProportionalString(320, y, s,
UI_CENTER|UI_SMALLFONT|UI_DROPSHADOW, colorWhite);
y += PROP_HEIGHT;
}
// cheats warning
s = Info_ValueForKey(sysInfo, "sv_cheats");
if (s[0] == '1')
{
//.........这里部分代码省略.........
示例9: CG_LoadingClient
/*
===================
CG_LoadingClient
===================
*/
void CG_LoadingClient(int clientNum)
{
const char *info;
char *skin;
char personality[MAX_QPATH];
char model[MAX_QPATH];
char iconName[MAX_QPATH];
info = CG_ConfigString(CS_PLAYERS + clientNum);
if (loadingPlayerIconCount < MAX_LOADING_PLAYER_ICONS)
{
Q_strncpyz(model, Info_ValueForKey(info, "model"), sizeof(model));
skin = Q_strrchr(model, '/');
if (skin)
{
*skin++ = '\0';
}
else
{
switch (atoi(Info_ValueForKey(info, "t")))
{
case TEAM_BLUE:
skin = "default";
break;
default:
skin = "red";
break;
}
}
if (!model[0])
strcpy(model, DEFAULT_MODEL);
Com_sprintf(iconName, MAX_QPATH, "models/players/%s/icon_%s.tga", model, skin);
loadingPlayerIcons[loadingPlayerIconCount] = trap_R_RegisterShaderNoMip(iconName);
if (!loadingPlayerIcons[loadingPlayerIconCount])
{
Com_sprintf( iconName, MAX_QPATH, "models/players/characters/%s/icon_%s.tga", model, skin );
loadingPlayerIcons[loadingPlayerIconCount] = trap_R_RegisterShaderNoMip( iconName );
}
if (!loadingPlayerIcons[loadingPlayerIconCount])
{
Com_sprintf(iconName, MAX_QPATH, "models/players/%s/icon_%s.tga", DEFAULT_MODEL, "default");
loadingPlayerIcons[loadingPlayerIconCount] = trap_R_RegisterShaderNoMip(iconName);
}
if (loadingPlayerIcons[loadingPlayerIconCount])
{
loadingPlayerIconCount++;
}
}
Q_strncpyz(personality, Info_ValueForKey(info, "n"), sizeof(personality));
Q_CleanStr(personality);
if (cgs.gametype == GT_SINGLE_PLAYER)
{
trap_S_RegisterSound(va("sound/player/announce/%s.wav", personality), qtrue);
}
CG_LoadingString(personality);
}
示例10: CG_LQMObituary
/*
=============
CG_GroundVehicleObituary
General ugly function, needs to be made prettier some day...
=============
*/
void CG_LQMObituary( entityState_t *ent, clientInfo_t *ci )
{
// add some cool stuff here :-)
int mod;
int target, attacker;
char *message;
char *message2;
const char *targetInfo;
const char *attackerInfo;
char targetName[32];
char attackerName[32];
gender_t gender;
target = ent->otherEntityNum;
attacker = ent->otherEntityNum2;
mod = ent->eventParm;
if ( attacker < 0 || attacker >= MAX_CLIENTS ) {
attacker = ENTITYNUM_WORLD;
attackerInfo = NULL;
} else {
attackerInfo = CG_ConfigString( CS_PLAYERS + attacker );
}
targetInfo = CG_ConfigString( CS_PLAYERS + target );
if ( !targetInfo ) {
return;
}
#pragma message("remove the problem checking here!")
if( Info_ValueForKey( targetInfo, "n" ) != 0 ) {
Q_strncpyz( targetName, Info_ValueForKey( targetInfo, "n" ), sizeof(targetName) - 2);
}
else {
Com_Error( ERR_DROP, "MFQ3 Error (3): Invalid targetinfo\n" );
}
strcat( targetName, S_COLOR_WHITE );
message2 = "";
// check for single client messages
switch( mod ) {
case MOD_SUICIDE:
message = "suicides";
break;
case MOD_FALLING:
message = "cratered";
break;
case MOD_CRUSH:
message = "was squished";
break;
case MOD_WATER:
message = "sank like a rock";
break;
case MOD_SLIME:
message = "melted";
break;
case MOD_LAVA:
message = "does a back flip into the lava";
break;
default:
message = NULL;
break;
}
if (attacker == target) {
gender = ci->gender;
switch (mod) {
case MOD_CRASH:
message = "was unable to control his vehicle";
break;
default:
if ( gender == GENDER_FEMALE )
message = "killed herself";
else if ( gender == GENDER_NEUTER )
message = "killed itself";
else
message = "killed himself";
break;
}
}
if (message) {
CG_Printf( "%s %s.\n", targetName, message);
return;
}
// check for kill messages from the current clientNum
if ( attacker == cg.snap->ps.clientNum ) {
char *s;
if ( cgs.gametype < GT_TEAM ) {
//.........这里部分代码省略.........
示例11: CG_DrawInformation
void CG_DrawInformation( void ) {
const char *s;
const char *info;
const char *sysInfo;
int y;
int value, valueNOFP;
qhandle_t levelshot;
char buf[1024];
int iPropHeight = 18; // I know, this is total crap, but as a post release asian-hack.... -Ste
info = CG_ConfigString( CS_SERVERINFO );
sysInfo = CG_ConfigString( CS_SYSTEMINFO );
s = Info_ValueForKey( info, "mapname" );
levelshot = trap_R_RegisterShaderNoMip( va( "levelshots/%s", s ) );
if ( !levelshot ) {
levelshot = trap_R_RegisterShaderNoMip( "menu/art/unknownmap" );
}
trap_R_SetColor( NULL );
CG_DrawPic( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, levelshot );
CG_LoadBar();
// draw the icons of things as they are loaded
// CG_DrawLoadingIcons();
// the first 150 rows are reserved for the client connection
// screen to write into
if ( cg.infoScreenText[0] ) {
const char *psLoading = CG_GetStripEdString("MENUS3", "LOADING_MAPNAME");
UI_DrawProportionalString( 320, 128-32, va(/*"Loading... %s"*/ psLoading, cg.infoScreenText),
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
} else {
const char *psAwaitingSnapshot = CG_GetStripEdString("MENUS3", "AWAITING_SNAPSHOT");
UI_DrawProportionalString( 320, 128-32, /*"Awaiting snapshot..."*/psAwaitingSnapshot,
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
}
// draw info string information
y = 180-32;
// don't print server lines if playing a local game
trap_Cvar_VariableStringBuffer( "sv_running", buf, sizeof( buf ) );
if ( !atoi( buf ) ) {
// server hostname
Q_strncpyz(buf, Info_ValueForKey( info, "sv_hostname" ), 1024);
Q_CleanStr(buf);
UI_DrawProportionalString( 320, y, buf,
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
y += iPropHeight;
// pure server
s = Info_ValueForKey( sysInfo, "sv_pure" );
if ( s[0] == '1' ) {
const char *psPure = CG_GetStripEdString("INGAMETEXT", "PURE_SERVER");
UI_DrawProportionalString( 320, y, psPure,
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
y += iPropHeight;
}
// server-specific message of the day
s = CG_ConfigString( CS_MOTD );
if ( s[0] ) {
UI_DrawProportionalString( 320, y, s,
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
y += iPropHeight;
}
{ // display global MOTD at bottom (mirrors ui_main UI_DrawConnectScreen
char motdString[1024];
trap_Cvar_VariableStringBuffer( "cl_motdString", motdString, sizeof( motdString ) );
if (motdString[0])
{
UI_DrawProportionalString( 320, 425, motdString,
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
}
}
// some extra space after hostname and motd
y += 10;
}
// map-specific message (long map name)
s = CG_ConfigString( CS_MESSAGE );
if ( s[0] ) {
UI_DrawProportionalString( 320, y, s,
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
y += iPropHeight;
}
// cheats warning
s = Info_ValueForKey( sysInfo, "sv_cheats" );
if ( s[0] == '1' ) {
UI_DrawProportionalString( 320, y, CG_GetStripEdString("INGAMETEXT", "CHEATSAREENABLED"),
UI_CENTER|UI_INFOFONT|UI_DROPSHADOW, colorWhite );
y += iPropHeight;
}
//.........这里部分代码省略.........
示例12: CG_DrawConnectScreen
void CG_DrawConnectScreen(qboolean interactive, qboolean forcerefresh)
{
static qboolean inside = qfalse;
char buffer[1024];
bg_loadscreeninteractive = interactive;
if (!DC)
{
return;
}
if (inside)
{
return;
}
inside = qtrue;
if (!bg_loadscreeninited)
{
trap_Cvar_Set("ui_connecting", "0");
DC->registerFont("ariblk", 27, &bg_loadscreenfont1);
DC->registerFont("courbd", 30, &bg_loadscreenfont2);
bg_axispin = DC->registerShaderNoMip("gfx/loading/pin_axis");
bg_alliedpin = DC->registerShaderNoMip("gfx/loading/pin_allied");
bg_neutralpin = DC->registerShaderNoMip("gfx/loading/pin_neutral");
bg_pin = DC->registerShaderNoMip("gfx/loading/pin_shot");
bg_filter_bo = DC->registerShaderNoMip("ui/assets/filter_bots");
bg_filter_ff = DC->registerShaderNoMip("ui/assets/filter_ff");
bg_filter_hw = DC->registerShaderNoMip("ui/assets/filter_weap");
bg_filter_lv = DC->registerShaderNoMip("ui/assets/filter_lives");
bg_filter_al = DC->registerShaderNoMip("ui/assets/filter_antilag");
bg_filter_bt = DC->registerShaderNoMip("ui/assets/filter_balance");
bg_mappic = 0;
BG_PanelButtonsSetup(loadpanelButtons);
C_PanelButtonsSetup(loadpanelButtons, cgs.wideXoffset);
bg_loadscreeninited = qtrue;
}
BG_PanelButtonsRender(loadpanelButtons);
if (interactive)
{
DC->drawHandlePic(DC->cursorx, DC->cursory, 32, 32, DC->Assets.cursor);
}
DC->getConfigString(CS_SERVERINFO, buffer, sizeof(buffer));
if (*buffer)
{
const char *str;
float x = 540.0f + cgs.wideXoffset;
float y = 322;
int i;
qboolean enabled = qfalse;
CG_Text_Paint_Centred_Ext(x, y, 0.22f, 0.22f, clr3, ("^1" LEGACY_MOD " ^0" LEGACY_MOD_VERSION), 0, 0, 0, &bg_loadscreenfont1);
y = 340;
str = Info_ValueForKey(buffer, "sv_hostname");
CG_Text_Paint_Centred_Ext(x, y, 0.2f, 0.2f, colorWhite, str && *str ? str : "ETHost", 0, 26, 0, &bg_loadscreenfont2);
y += 14;
for (i = 0; i < MAX_MOTDLINES; i++)
{
str = CG_ConfigString(CS_CUSTMOTD + i);
if (!str || !*str)
{
break;
}
CG_Text_Paint_Centred_Ext(x, y, 0.2f, 0.2f, colorWhite, str, 0, 26, 0, &bg_loadscreenfont2);
y += 10;
}
y = 417;
str = Info_ValueForKey(buffer, "g_friendlyfire");
if (str && *str && atoi(str))
{
x = 461 + cgs.wideXoffset;
CG_DrawPic(x, y, 16, 16, bg_filter_ff);
}
if (atoi(Info_ValueForKey(buffer, "g_gametype")) != GT_WOLF_LMS)
{
str = Info_ValueForKey(buffer, "g_maxlives");
if (str && *str && atoi(str))
{
enabled = qtrue;
}
//.........这里部分代码省略.........
示例13: CG_DrawOldTourneyScoreboard
/*
=================
CG_DrawTourneyScoreboard
Draw the oversize scoreboard for tournements
=================
*/
void CG_DrawOldTourneyScoreboard( void ) {
const char *s;
vec4_t color;
int min, tens, ones;
clientInfo_t *ci;
int y;
int i;
// request more scores regularly
if ( cg.scoresRequestTime + 2000 < cg.time ) {
cg.scoresRequestTime = cg.time;
_CG_trap_SendClientCommand( "score" );
}
color[0] = GFIXED_1;
color[1] = GFIXED_1;
color[2] = GFIXED_1;
color[3] = GFIXED_1;
// draw the dialog background
color[0] = color[1] = color[2] = GFIXED_0;
color[3] = GFIXED_1;
CG_FillRect( GFIXED_0, GFIXED_0, GFIXED(SCREEN_WIDTH,0), GFIXED(SCREEN_HEIGHT,0), color );
// print the mesage of the day
s = CG_ConfigString( CS_MOTD );
if ( !s[0] ) {
s = "Scoreboard";
}
// print optional title
CG_CenterGiantLine( GFIXED(8,0), s );
// print server time
ones = cg.time / 1000;
min = ones / 60;
ones %= 60;
tens = ones / 10;
ones %= 10;
s = va("%i:%i%i", min, tens, ones );
CG_CenterGiantLine( GFIXED(64,0), s );
// print the two scores
y = 160;
if ( cgs.gametype >= GT_TEAM ) {
//
// teamplay scoreboard
//
CG_DrawStringExt( 8, y, "Red Team", color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
s = va("%i", cg.teamScores[0] );
CG_DrawStringExt( 632 - GIANT_WIDTH * strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
y += 64;
CG_DrawStringExt( 8, y, "Blue Team", color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
s = va("%i", cg.teamScores[1] );
CG_DrawStringExt( 632 - GIANT_WIDTH * strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
} else {
//
// free for all scoreboard
//
for ( i = 0 ; i < MAX_CLIENTS ; i++ ) {
ci = &cgs.clientinfo[i];
if ( !ci->infoValid ) {
continue;
}
if ( ci->team != TEAM_FREE ) {
continue;
}
CG_DrawStringExt( 8, y, ci->name, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
s = va("%i", ci->score );
CG_DrawStringExt( 632 - GIANT_WIDTH * strlen(s), y, s, color, qtrue, qtrue, GIANT_WIDTH, GIANT_HEIGHT, 0 );
y += 64;
}
}
}
示例14: CG_RegisterGraphics
/*
=================
CG_RegisterGraphics
This function may execute for a couple of minutes with a slow disk.
=================
*/
static void CG_RegisterGraphics( void ) {
gitem_t *backpack;
int i;
char items[MAX_ITEMS+1];
static char *sb_nums[11] = {
"gfx/2d/numbers/zero_32b",
"gfx/2d/numbers/one_32b",
"gfx/2d/numbers/two_32b",
"gfx/2d/numbers/three_32b",
"gfx/2d/numbers/four_32b",
"gfx/2d/numbers/five_32b",
"gfx/2d/numbers/six_32b",
"gfx/2d/numbers/seven_32b",
"gfx/2d/numbers/eight_32b",
"gfx/2d/numbers/nine_32b",
"gfx/2d/numbers/minus_32b",
};
// clear any references to old media
memset( &cg.refdef, 0, sizeof( cg.refdef ) );
trap_R_ClearScene();
CG_LoadingString( cgs.mapname );
trap_R_LoadWorldMap( cgs.mapname );
// precache status bar pics
CG_LoadingString( "game media" );
for ( i=0 ; i<11 ; i++) {
cgs.media.numberShaders[i] = trap_R_RegisterShader( sb_nums[i] );
}
cgs.media.botSkillShaders[0] = trap_R_RegisterShader( "menu/art/skill1.tga" );
cgs.media.botSkillShaders[1] = trap_R_RegisterShader( "menu/art/skill2.tga" );
cgs.media.botSkillShaders[2] = trap_R_RegisterShader( "menu/art/skill3.tga" );
cgs.media.botSkillShaders[3] = trap_R_RegisterShader( "menu/art/skill4.tga" );
cgs.media.botSkillShaders[4] = trap_R_RegisterShader( "menu/art/skill5.tga" );
cgs.media.viewBloodShader = trap_R_RegisterShader( "viewBloodBlend" );
cgs.media.deferShader = trap_R_RegisterShaderNoMip( "gfx/2d/defer.tga" );
cgs.media.scoreboardName = trap_R_RegisterShaderNoMip( "menu/tab/name.tga" );
cgs.media.scoreboardPing = trap_R_RegisterShaderNoMip( "menu/tab/ping.tga" );
cgs.media.scoreboardScore = trap_R_RegisterShaderNoMip( "menu/tab/score.tga" );
cgs.media.scoreboardTime = trap_R_RegisterShaderNoMip( "menu/tab/time.tga" );
cgs.media.objectivesOverlay = trap_R_RegisterShaderNoMip( CG_ConfigString(CS_OBJECTIVESOVERLAY) );
cgs.media.objectivesUpdated = trap_R_RegisterShaderNoMip( "menu/objectives/updated.tga" );
cgs.media.objectivesUpdatedSound = trap_S_RegisterSound( "sound/misc/objective_update_01.wav", qfalse );
cgs.media.deathImage = trap_R_RegisterShaderNoMip( "menu/art/level_complete5" );
cgs.media.scoreShow = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse );
cgs.media.finalScoreShow = trap_S_RegisterSound( "sound/weapons/rocket/rocklx1a.wav", qfalse );
cgs.media.smokePuffShader = trap_R_RegisterShader( "smokePuff" );
cgs.media.smokePuffRageProShader = trap_R_RegisterShader( "smokePuffRagePro" );
cgs.media.shotgunSmokePuffShader = trap_R_RegisterShader( "shotgunSmokePuff" );
cgs.media.plasmaBallShader = trap_R_RegisterShader( "sprites/plasma1" );
cgs.media.bloodTrailShader = trap_R_RegisterShader( "bloodTrail" );
cgs.media.lagometerShader = trap_R_RegisterShader("lagometer" );
cgs.media.connectionShader = trap_R_RegisterShader( "disconnected" );
cgs.media.waterBubbleShader = trap_R_RegisterShader( "waterBubble" );
cgs.media.tracerShader = trap_R_RegisterShader( "gfx/misc/tracer" );
cgs.media.selectShader = trap_R_RegisterShader( "gfx/2d/select" );
for ( i = 0 ; i < NUM_CROSSHAIRS ; i++ ) {
cgs.media.crosshairShader[i] = trap_R_RegisterShader( va("gfx/2d/crosshair%c", 'a'+i) );
}
cgs.media.backTileShader = trap_R_RegisterShader( "gfx/2d/backtile" );
cgs.media.noammoShader = trap_R_RegisterShader( "icons/noammo" );
// powerup shaders
cgs.media.quadShader = trap_R_RegisterShader("powerups/quad" );
cgs.media.quadWeaponShader = trap_R_RegisterShader("powerups/quadWeapon" );
cgs.media.battleSuitShader = trap_R_RegisterShader("powerups/battleSuit" );
cgs.media.battleWeaponShader = trap_R_RegisterShader("powerups/battleWeapon" );
cgs.media.invisShader = trap_R_RegisterShader("powerups/invisibility" );
cgs.media.regenShader = trap_R_RegisterShader("powerups/regen" );
cgs.media.hastePuffShader = trap_R_RegisterShader("hasteSmokePuff" );
if ( cg_buildScript.integer ) {
cgs.media.redCubeModel = trap_R_RegisterModel( "models/powerups/orb/r_orb.md3" );
cgs.media.blueCubeModel = trap_R_RegisterModel( "models/powerups/orb/b_orb.md3" );
cgs.media.redCubeIcon = trap_R_RegisterShader( "icons/skull_red" );
cgs.media.blueCubeIcon = trap_R_RegisterShader( "icons/skull_blue" );
}
//.........这里部分代码省略.........
示例15: CG_DrawSkyBoxPortal
/*
==============
CG_DrawSkyBoxPortal
==============
*/
void CG_DrawSkyBoxPortal( void ) {
static float lastfov = 90; // for transitions back from zoomed in modes
refdef_t backuprefdef;
float fov_x;
float fov_y;
float x;
char *cstr;
char *token;
float zoomFov;
float f;
static qboolean foginited = qfalse; // only set the portal fog values once
if ( !cg_skybox.integer ) {
return;
}
if ( !( cstr = (char *)CG_ConfigString( CS_SKYBOXORG ) ) || !strlen( cstr ) ) {
// no skybox in this map
return;
}
// if they are waiting at the mission stats screen, show the stats
if ( cg_gameType.integer == GT_SINGLE_PLAYER ) {
if ( strlen( cg_missionStats.string ) > 1 ) {
return;
}
}
backuprefdef = cg.refdef;
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n" );
}
cg.refdef.vieworg[0] = atof( token );
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n" );
}
cg.refdef.vieworg[1] = atof( token );
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n" );
}
cg.refdef.vieworg[2] = atof( token );
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring\n" );
}
fov_x = atoi( token );
if ( !fov_x ) {
fov_x = 90;
}
// setup fog the first time, ignore this part of the configstring after that
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog state\n" );
} else {
vec4_t fogColor;
int fogStart, fogEnd;
if ( atoi( token ) ) { // this camera has fog
if ( !foginited ) {
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog[0]\n" );
}
fogColor[0] = atof( token );
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog[1]\n" );
}
fogColor[1] = atof( token );
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
CG_Error( "CG_DrawSkyBoxPortal: error parsing skybox configstring. No fog[2]\n" );
}
fogColor[2] = atof( token );
token = COM_ParseExt( &cstr, qfalse );
if ( !token || !token[0] ) {
fogStart = 0;
} else {
fogStart = atoi( token );
}
token = COM_ParseExt( &cstr, qfalse );
//.........这里部分代码省略.........