本文整理汇总了C++中ALERT函数的典型用法代码示例。如果您正苦于以下问题:C++ ALERT函数的具体用法?C++ ALERT怎么用?C++ ALERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ALERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SERVER_COMMAND
CGameRules *InstallGameRules( void )
{
SERVER_COMMAND( "exec game.rc\n" );
g_engfuncs.pfnServerExecute();
ALERT( at_aiconsole, "InstallGameRules\n" );
if ( !gpGlobals->deathmatch )
{
// generic half-life
g_teamplay = 0;
return new CHalfLifeRules;
}
else
{
if( CVAR_GET_FLOAT( "mp_teamplay" ) > 0 )
{
// teamplay
g_teamplay = 1;
return new CHalfLifeTeamplay;
}
if ((int)gpGlobals->deathmatch == 1)
{
// vanilla deathmatch
g_teamplay = 0;
return new CHalfLifeMultiplay;
}
else
{
// vanilla deathmatch??
g_teamplay = 0;
return new CHalfLifeMultiplay;
}
}
}
示例2: ALERT
// sets the round state
// ben notes : bSkipAutoRoundThink will avoid calling the round think function
// ben notes : after updating the status
void CBaseRoundRules::SetRoundState(ROUND_STATE iRoundState, bool bSkipAutoRoundThink)
{
// check validity of what we have been sent
if((iRoundState < ROUND_NOTSTARTED) || (iRoundState > ROUND_NOPLAYERS))
{
// - report the error
ALERT(at_console, "Bad Round State being set - (%i)\n", (int)iRoundState);
UTIL_LogPrintf(ROUND_LOGGING, "World triggered \"Bad Round State\" (round_state \"%i\") (old_round_state \"%i\")\n", (int)iRoundState, (int)m_iRoundState);
// - give the round state a dummy value to keep it going
iRoundState = ROUND_WAITING_FOR_PLAYERS;
}
// - log the change
UTIL_LogPrintf(ALL_LOGGING, "World triggered \"Round State Change\" (round_state \"%i\") (old_round_state \"%i\")\n", (int)iRoundState, (int)m_iRoundState);
// - set the round state
m_iRoundState = iRoundState;
// - call round think to update the round progress.
// ben notes : after set round state is called we should leave the round think
// ben notes : function or wierd bugs could creep in
if(GetRoundState() != ROUND_NOPLAYERS && bSkipAutoRoundThink == false)
this->RoundThink();
}
示例3: Spawn
//=========================================================
// ********** DeadGenericMonster SPAWN **********
//=========================================================
void CDeadGenericMonster :: Spawn( void )
{
Precache();
SET_MODEL(ENT(pev), STRING(pev->model));
pev->effects = 0;
pev->yaw_speed = 8; //LRC -- what?
pev->sequence = 0;
if (pev->netname)
{
pev->sequence = LookupSequence( STRING(pev->netname) );
if (pev->sequence == -1)
{
ALERT ( at_debug, "Invalid sequence name \"%s\" in monster_generic_dead\n", STRING(pev->netname) );
}
}
else
{
pev->sequence = LookupActivity( pev->frags );
// if (pev->sequence == -1)
// {
// ALERT ( at_error, "monster_generic_dead - specify a sequence name or choose a different death type: model \"%s\" has no available death sequences.\n", STRING(pev->model) );
// }
//...and if that doesn't work, forget it.
}
// Corpses have less health
pev->health = 8;
MonsterInitDead();
ResetSequenceInfo( );
pev->frame = 255; // pose at the _end_ of its death sequence.
}
示例4: ALERT
void CGrappleHook::Killed(entvars_t *pev, int gib)
{
ALERT( at_console, "^2HLU -> ^3weapon_grapple ^2-> Tongue was killed.\n");
// Fograin92: Clear player
myowner->pev->movetype = MOVETYPE_WALK; //Re-apply gravity
myowner->m_afPhysicsFlags &= ~PFLAG_ON_GRAPPLE; //Remove "on grapple" flag
myowner->m_iGrappleExists = 0;
myowner->m_flNextAttack = UTIL_WeaponTimeBase() + 1.0;
// Fograin92: Clear monster
if( (m_iHitMonster == 2) && (myHitMonster->IsAlive()) )
myHitMonster->pev->movetype = MOVETYPE_STEP; // Re-apply gravity to the pulled monster, if it's alive
// Fograin92: Clear tongue leftovers
bPullBack = false;
UTIL_Remove( m_pTongue );
m_pTongue = NULL;
m_iHitMonster = 0;
SetThink(NULL);
SetTouch(NULL);
SUB_Remove( );
}
示例5: R_AllocateCinematicTexture
int R_AllocateCinematicTexture( unsigned int txFlags )
{
int i = tr.num_cin_used;
if( i >= MAX_MOVIE_TEXTURES )
{
ALERT( at_error, "R_AllocateCinematicTexture: cine textures limit exceeded!\n" );
return 0; // disable
}
tr.num_cin_used++;
if( !tr.cinTextures[i] )
{
char txName[16];
Q_snprintf( txName, sizeof( txName ), "*cinematic%i", i );
// create new cinematic texture
// NOTE: dimension of texture is no matter because CIN_UPLOAD_FRAME will be rescale texture
tr.cinTextures[i] = CREATE_TEXTURE( txName, 256, 256, NULL, txFlags );
}
return (i+1);
}
示例6: eeReadAll
void eeReadAll()
{
fill_file_index() ;
if (!eeLoadGeneral() )
{
generalDefault();
modelDefault(0);
ALERT(STR_EEPROMWARN, STR_BADEEPROMDATA, AU_BAD_EEPROM);
MESSAGE(STR_EEPROMWARN, STR_EEPROMFORMATTING, NULL, AU_EEPROM_FORMATTING);
/* we remove all models */
for (uint32_t i=0; i<MAX_MODELS; i++)
eeDeleteModel(i);
eeDirty(EE_GENERAL);
eeDirty(EE_MODEL);
}
else {
eeLoadModelHeaders() ;
}
// TODO common!
stickMode = g_eeGeneral.stickMode;
#if defined(CPUARM)
for (uint8_t i=0; languagePacks[i]!=NULL; i++) {
if (!strncmp(g_eeGeneral.ttsLanguage, languagePacks[i]->id, 2)) {
currentLanguagePackIdx = i;
currentLanguagePack = languagePacks[i];
}
}
#endif
}
示例7: DispatchSave
void DispatchSave( edict_t *pent, SAVERESTOREDATA *pSaveData )
{
CBaseEntity *pEntity = (CBaseEntity *)GET_PRIVATE(pent);
if( pEntity && pSaveData )
{
// ALERT( at_console, "DispatchSave( %s, %i )\n", STRING( pent->v.classname ), pent->serialnumber );
ENTITYTABLE *pTable = &pSaveData->pTable[ pSaveData->currentIndex ];
if( pTable->pent != pent )
ALERT( at_error, "ENTITY TABLE OR INDEX IS WRONG!!!!\n" );
if( pEntity->ObjectCaps() & FCAP_DONT_SAVE ) return;
// These don't use ltime & nextthink as times really, but we'll fudge around it.
if( pEntity->pev->movetype == MOVETYPE_PUSH )
{
float delta = gpGlobals->time - pEntity->pev->ltime;
pEntity->pev->ltime += delta;
pEntity->pev->nextthink += delta;
pEntity->m_fPevNextThink = pEntity->pev->nextthink;
pEntity->m_fNextThink += delta;
}
if( gpGlobals->changelevel )
pEntity->ClearPointers();
pTable->location = pSaveData->size; // Remember entity position for file I/O
pTable->classname = pEntity->pev->classname; // Remember entity class for respawn
CSave saveHelper( pSaveData );
pEntity->Save( saveHelper );
pTable->size = pSaveData->size - pTable->location;// Size of entity block is data size written to block
}
}
示例8: ioctl_unload_vmm
static long
ioctl_unload_vmm(void)
{
int i;
int64_t ret;
long status = BF_IOCTL_SUCCESS;
ret = common_unload_vmm();
if (ret != BF_SUCCESS)
{
ALERT("IOCTL_UNLOAD_VMM: failed to unload vmm: %lld\n", ret);
status = BF_IOCTL_FAILURE;
}
for (i = 0; i < g_num_files; i++)
platform_free(files[i], files_sizes[i]);
g_num_files = 0;
if (status == BF_IOCTL_SUCCESS)
DEBUG("IOCTL_UNLOAD_VMM: succeeded\n");
return status;
}
示例9: FIND_ENTITY_BY_TARGETNAME
void CBigMomma::NodeStart( int iszNextNode )
{
pev->netname = iszNextNode;
CBaseEntity *pTarget = NULL;
if ( pev->netname )
{
edict_t *pentTarget = FIND_ENTITY_BY_TARGETNAME ( NULL, STRING(pev->netname) );
if ( !FNullEnt(pentTarget) )
pTarget = Instance( pentTarget );
}
if ( !pTarget )
{
ALERT( at_aiconsole, "BM: Finished the path!!\n" );
Remember( bits_MEMORY_PATH_FINISHED );
return;
}
Remember( bits_MEMORY_ON_PATH );
m_hTargetEnt = pTarget;
}
示例10: CallForHelp
void CISlave :: CallForHelp( char *szClassname, float flDist, EHANDLE hEnemy, Vector &vecLocation )
{
ALERT( at_aiconsole, "help " );
// skip ones not on my netname
if ( FStringNull( pev->netname ))
return;
CBaseEntity *pEntity = NULL;
while ((pEntity = UTIL_FindEntityByString( pEntity, "netname", STRING( pev->netname ))) != NULL)
{
float d = (pev->origin - pEntity->pev->origin).Length();
if (d < flDist)
{
CBaseMonster *pMonster = pEntity->MyMonsterPointer( );
if (pMonster)
{
pMonster->m_afMemory |= bits_MEMORY_PROVOKED;
pMonster->PushEnemy( hEnemy, vecLocation );
}
}
}
}
示例11: IAllocSound
//=========================================================
// IAllocSound - moves a sound from the Free list to the
// Active list returns the index of the alloc'd sound
//=========================================================
int CSoundEnt :: IAllocSound( void )
{
int iNewSound;
if ( m_iFreeSound == SOUNDLIST_EMPTY )
{
// no free sound!
ALERT ( at_console, "Free Sound List is full!\n" );
return SOUNDLIST_EMPTY;
}
// there is at least one sound available, so move it to the
// Active sound list, and return its SoundPool index.
iNewSound = m_iFreeSound;// copy the index of the next free sound
m_iFreeSound = m_SoundPool[ m_iFreeSound ].m_iNext;// move the index down into the free list.
m_SoundPool[ iNewSound ].m_iNext = m_iActiveSound;// point the new sound at the top of the active list.
m_iActiveSound = iNewSound;// now make the new sound the top of the active list. You're done.
return iNewSound;
}
示例12: Nearest
// Assumes this is ALWAYS enabled
CPathTrack *CPathTrack :: Nearest( Vector origin )
{
int deadCount;
float minDist, dist;
Vector delta;
CPathTrack *ppath, *pnearest;
delta = origin - pev->origin;
delta.z = 0;
minDist = delta.Length();
pnearest = this;
ppath = GetNext();
// Hey, I could use the old 2 racing pointers solution to this, but I'm lazy :)
deadCount = 0;
while ( ppath && ppath != this )
{
deadCount++;
if ( deadCount > 9999 )
{
ALERT( at_error, "Bad sequence of path_tracks from %s", STRING(pev->targetname) );
return NULL;
}
delta = origin - ppath->pev->origin;
delta.z = 0;
dist = delta.Length();
if ( dist < minDist )
{
minDist = dist;
pnearest = ppath;
}
ppath = ppath->GetNext();
}
return pnearest;
}
示例13: snd_init
int snd_init(void)
{
char info_buf[256];
PaError p_err;
if((p_err = Pa_Initialize()) != paNoError)
{
snprintf(info_buf, sizeof(info_buf),
_("PortAudio init failed:\n%s\n"),
Pa_GetErrorText(p_err));
ALERT(info_buf);
return 1;
}
srconv_stream.data_in = (float*)malloc(pa_frames*2 * sizeof(float));
srconv_stream.data_out = (float*)malloc(pa_frames*2 * 10 * sizeof(float));
srconv_record.data_in = (float*)malloc(pa_frames*2 * sizeof(float));
srconv_record.data_out = (float*)malloc(pa_frames*2 * 10 * sizeof(float));
reconnect = 0;
buf_index = 0;
return 0;
}
示例14: CHalfLifeMultiplay
CHalfLifeMultiplay :: CHalfLifeMultiplay()
{
g_VoiceGameMgr.Init(&g_GameMgrHelper, gpGlobals->maxClients);
RefreshSkillData();
m_flIntermissionEndTime = 0;
g_flIntermissionStartTime = 0;
// 11/8/98
// Modified by YWB: Server .cfg file is now a cvar, so that
// server ops can run multiple game servers, with different server .cfg files,
// from a single installed directory.
// Mapcyclefile is already a cvar.
// 3/31/99
// Added lservercfg file cvar, since listen and dedicated servers should not
// share a single config file. (sjb)
if ( IS_DEDICATED_SERVER() )
{
// this code has been moved into engine, to only run server.cfg once
}
else
{
// listen server
char *lservercfgfile = (char *)CVAR_GET_STRING( "lservercfgfile" );
if ( lservercfgfile && lservercfgfile[0] )
{
char szCommand[256];
ALERT( at_console, "Executing listen server config file\n" );
sprintf( szCommand, "exec %s\n", lservercfgfile );
SERVER_COMMAND( szCommand );
}
}
}
示例15: TakeDamage
int CFuncCollideWall :: TakeDamage( entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType )
{
ALERT ( at_notice, "TakeDamage()\n");
TraceResult trace = UTIL_GetGlobalTrace( );
//== 1) //metal
//== 5) //wood
//== 5) //water
//== -1/0) //not defined (default concrete)
float flVolume = RANDOM_FLOAT ( 0.7 , 1.0 );//random volume range
BOOL b_CanMakeParticles = TRUE;
if ( CVAR_GET_FLOAT( "r_paintball" ) == 0 )
if ( CVAR_GET_FLOAT( "cl_wallpuff" ) >= 1 )
{
if (pev->frags == 1) //metal
{
UTIL_Ricochet( trace.vecEndPos, 0.5 );
switch ( RANDOM_LONG(0,2) )
{
case 0: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/metal1.wav", flVolume, ATTN_NORM, 0, 100); break;
case 1: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/metal2.wav", flVolume, ATTN_NORM, 0, 100); break;
case 2: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/metal3.wav", flVolume, ATTN_NORM, 0, 100); break;
}
if (RANDOM_LONG( 0, 99 ) < 40)
UTIL_WhiteSparks( trace.vecEndPos, trace.vecPlaneNormal, 0, 5, 500, 500 );//chispas
UTIL_WhiteSparks( trace.vecEndPos, trace.vecPlaneNormal, 9, 5, 5, 100 );//puntos
UTIL_WhiteSparks( trace.vecEndPos, trace.vecPlaneNormal, 0, 5, 500, 20 );//chispas
b_CanMakeParticles = FALSE;
}
if (pev->frags == 5) //wood
{
switch ( RANDOM_LONG(0,2) )
{
case 0: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/wood1.wav", flVolume, ATTN_NORM, 0, 100); break;
case 1: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/wood2.wav", flVolume, ATTN_NORM, 0, 100); break;
case 2: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/wood3.wav", flVolume, ATTN_NORM, 0, 100); break;
}
}
else if (pev->frags == 6) //water
{
switch ( RANDOM_LONG(0,2) )
{
case 0: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/water1.wav", flVolume, ATTN_NORM, 0, 100); break;
case 1: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/water2.wav", flVolume, ATTN_NORM, 0, 100); break;
case 2: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/water3.wav", flVolume, ATTN_NORM, 0, 100); break;
}
}
else if (pev->frags == 7) //gas canister
{
switch ( RANDOM_LONG(0,1) )
{
case 0: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/gascan1.wav", flVolume, ATTN_NORM, 0, 100); break;
case 1: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/gascan2.wav", flVolume, ATTN_NORM, 0, 100); break;
}
}
else
{
switch ( RANDOM_LONG(0,2) )
{
case 0: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/concrete1.wav", flVolume, ATTN_NORM, 0, 100); break;
case 1: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/concrete2.wav", flVolume, ATTN_NORM, 0, 100); break;
case 2: UTIL_EmitAmbientSound(ENT(0), trace.vecEndPos, "weapons/bulletimpact/concrete3.wav", flVolume, ATTN_NORM, 0, 100); break;
}
}
if (b_CanMakeParticles)
{
if ( CVAR_GET_FLOAT("r_particles" ) != 0 )
{
MESSAGE_BEGIN(MSG_ALL, gmsgParticles);
WRITE_SHORT(0);
WRITE_BYTE(0);
WRITE_COORD( trace.vecEndPos.x );
WRITE_COORD( trace.vecEndPos.y );
WRITE_COORD( trace.vecEndPos.z );
WRITE_COORD( 0 );
WRITE_COORD( 0 );
WRITE_COORD( 0 );
if (pev->frags == 5) //wood
WRITE_SHORT(iDefaultHitWood1);
else if (pev->frags == 6) //water
WRITE_SHORT(iDefaultWaterSplash);
else if (pev->frags == 7) //gas canister
WRITE_SHORT(iDefaultGasCanister);
else
WRITE_SHORT(iDefaultWallSmoke);
MESSAGE_END();
}
}
}//eo cvar check
return 1;
}