本文整理汇总了C++中game_import_t::SetConfigstring方法的典型用法代码示例。如果您正苦于以下问题:C++ game_import_t::SetConfigstring方法的具体用法?C++ game_import_t::SetConfigstring怎么用?C++ game_import_t::SetConfigstring使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_import_t
的用法示例。
在下文中一共展示了game_import_t::SetConfigstring方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: G_DynamicMusicUpdate
/*
static void G_DynamicMusicUpdate( usercmd_t *ucmd )
FIXME: can we merge any of this with the G_ChooseLookEnemy stuff?
*/
static void G_DynamicMusicUpdate( void )
{
gentity_t *ent;
gentity_t *entityList[MAX_GENTITIES];
int numListedEntities;
vec3_t mins, maxs;
int i, e;
int distSq, radius = 2048;
vec3_t center;
int danger = 0;
int battle = 0;
int entTeam;
qboolean dangerNear = qfalse;
qboolean suspicious = qfalse;
qboolean LOScalced = qfalse, clearLOS = qfalse;
//FIXME: intro and/or other cues? (one-shot music sounds)
//loops
//player-based
if ( !player )
{//WTF?
player = &g_entities[0];
return;
}
if ( !player->client
|| player->client->pers.teamState.state != TEAM_ACTIVE
|| level.time - player->client->pers.enterTime < 100 )
{//player hasn't spawned yet
return;
}
if ( player->health <= 0 && player->max_health > 0 )
{//defeat music
if ( level.dmState != DM_DEATH )
{
level.dmState = DM_DEATH;
}
}
if ( level.dmState == DM_DEATH )
{
gi.SetConfigstring( CS_DYNAMIC_MUSIC_STATE, "death" );
return;
}
if ( level.dmState == DM_BOSS )
{
gi.SetConfigstring( CS_DYNAMIC_MUSIC_STATE, "boss" );
return;
}
if ( level.dmState == DM_SILENCE )
{
gi.SetConfigstring( CS_DYNAMIC_MUSIC_STATE, "silence" );
return;
}
if ( level.dmBeatTime > level.time )
{//not on a beat
return;
}
level.dmBeatTime = level.time + 1000;//1 second beats
if ( player->health <= 20 )
{
danger = 1;
}
//enemy-based
VectorCopy( player->currentOrigin, center );
for ( i = 0 ; i < 3 ; i++ )
{
mins[i] = center[i] - radius;
maxs[i] = center[i] + radius;
}
numListedEntities = gi.EntitiesInBox( mins, maxs, entityList, MAX_GENTITIES );
for ( e = 0 ; e < numListedEntities ; e++ )
{
ent = entityList[ e ];
if ( !ent || !ent->inuse )
{
continue;
}
if ( !ent->client || !ent->NPC )
{
if ( ent->classname && (!Q_stricmp( "PAS", ent->classname )||!Q_stricmp( "misc_turret", ent->classname )) )
{//a turret
entTeam = ent->noDamageTeam;
}
//.........这里部分代码省略.........