本文整理汇总了C++中MAKE_STRING函数的典型用法代码示例。如果您正苦于以下问题:C++ MAKE_STRING函数的具体用法?C++ MAKE_STRING怎么用?C++ MAKE_STRING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MAKE_STRING函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitBodyQue
static void InitBodyQue(void)
{
string_t istrClassname = MAKE_STRING("bodyque");
g_pBodyQueueHead = CREATE_NAMED_ENTITY( istrClassname );
entvars_t *pev = VARS(g_pBodyQueueHead);
// Reserve 3 more slots for dead bodies
for ( int i = 0; i < 3; i++ )
{
pev->owner = CREATE_NAMED_ENTITY( istrClassname );
pev = VARS(pev->owner);
}
pev->owner = g_pBodyQueueHead;
}
示例2: Precache
void AvHKnife::Spawn()
{
AvHMarineWeapon::Spawn();
Precache();
this->m_iId = AVH_WEAPON_KNIFE;
//this->m_iDefaultAmmo = kKNMaxClip;
// Set our class name
this->pev->classname = MAKE_STRING(kwsKnife);
SET_MODEL(ENT(this->pev), kNullModel);
FallInit();// get ready to fall down.
}
示例3: httpapp_send_all_usage
static void httpapp_send_all_usage( tcp_sock sock )
{
str_t content = { 0, 0 };
str_t content_type = MAKE_STRING( "application/x-json" );
user_t * u = 0;
while( (u = get_next_user(u)) != 0 )
{
str_t usage = httpapp_user_usage(u, get_next_user(u) != 0);
append_string( &content, &usage );
free( usage.str );
}
httpserv_send_content(sock, content_type, content, 1, 0 );
log_printf( "200 OK %d bytes\n", content.len );
}
示例4: httpapp_send_stat_counts
static void httpapp_send_stat_counts( tcp_sock sock )
{
str_t content = { 0, 0 };
str_t content_type = MAKE_STRING( "application/x-json" );
void * c = 0;
while( 0 != (c = stats_get_next_counter(c) ))
{
str_t counter = httpapp_make_counter_json(c, stats_get_next_counter(c) != 0);
append_string( &content, &counter );
free( counter.str );
}
httpserv_send_content(sock, content_type, content, 1, 0);
log_printf( "200 OK %d bytes\n", content.len );
}
示例5: MAKE_STRING
void CAWP::Spawn( )
{
pev->classname = MAKE_STRING( "weapon_awp" );
Precache( );
SET_MODEL( ENT(pev), "models/weapons/awp/w_awp.mdl" );
m_iId = WEAPON_AWP;
m_iDefaultAmmo = 120;
FallInit();
wepspread_s.MaxSpreadX = 5;
wepspread_s.MaxSpreadY = 5;
wepspread_s.SpreadX = 5;
wepspread_s.SpreadY = 5;
scope = false;
}
示例6: MAKE_STRING
void CM249::Spawn(void)
{
BINTRACE
pev->classname = MAKE_STRING("weapon_m249");
Precache();
m_iId = WEAPON_M249;
SET_MODEL(ENT(pev), "models/w_m249.mdl");
m_iDefaultAmmo = M249_DEFAULT_GIVE;
m_flAccuracy = 0.2;
m_iShotsFired = 0;
FallInit();
}
示例7: GetClassPtr
void CBaseDelay::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value)
{
if (FStringNull(pev->target) && !m_iszKillTarget)
return;
if (m_flDelay != 0)
{
CBaseDelay *pTemp = GetClassPtr((CBaseDelay *)NULL);
if (pTemp->pev->classname)
RemoveEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
pTemp->pev->classname = MAKE_STRING("DelayedUse");
AddEntityHashValue(pTemp->pev, STRING(pTemp->pev->classname), CLASSNAME);
pTemp->pev->nextthink = gpGlobals->time + m_flDelay;
pTemp->SetThink(&CBaseDelay::DelayThink);
pTemp->pev->button = (int)useType;
pTemp->m_iszKillTarget = m_iszKillTarget;
pTemp->m_flDelay = 0;
pTemp->pev->target = pev->target;
if (pActivator && pActivator->IsPlayer())
pTemp->pev->owner = pActivator->edict();
else
pTemp->pev->owner = NULL;
return;
}
if (m_iszKillTarget)
{
ALERT(at_aiconsole, "KillTarget: %s\n", STRING(m_iszKillTarget));
edict_t *pentKillTarget = FIND_ENTITY_BY_TARGETNAME(NULL, STRING(m_iszKillTarget));
while (!FNullEnt(pentKillTarget))
{
UTIL_Remove(CBaseEntity::Instance(pentKillTarget));
ALERT(at_aiconsole, "killing %s\n", STRING(pentKillTarget->v.classname));
pentKillTarget = FIND_ENTITY_BY_TARGETNAME(pentKillTarget, STRING(m_iszKillTarget));
}
}
if (!FStringNull(pev->target))
FireTargets(STRING(pev->target), pActivator, this, useType, value);
}
示例8: httpapp_send_user_bindings
static void httpapp_send_user_bindings( tcp_sock sock )
{
str_t content = { 0, 0 };
str_t content_type = MAKE_STRING( "application/x-json" );
user_t * u = 0;
while( 0 != (u = get_next_user(u) ))
{
str_t binding = httpapp_user_binding(u, get_next_user(u) != 0);
append_string( &content, &binding );
free( binding.str );
}
httpserv_send_content(sock, content_type, content, 1, 0);
log_printf( "200 OK %d bytes\n", content.len );
}
示例9: CreateHull
CXenHull *CXenHull :: CreateHull( CBaseEntity *source, const Vector &mins, const Vector &maxs, const Vector &offset )
{
CXenHull *pHull = GetClassPtr( (CXenHull *)NULL );
UTIL_SetOrigin( pHull->pev, source->pev->origin + offset );
SET_MODEL( pHull->edict(), STRING(source->pev->model) );
pHull->pev->solid = SOLID_BBOX;
pHull->pev->classname = MAKE_STRING("xen_hull");
pHull->pev->movetype = MOVETYPE_NONE;
pHull->pev->owner = source->edict();
UTIL_SetSize( pHull->pev, mins, maxs );
pHull->pev->renderamt = 0;
pHull->pev->rendermode = kRenderTransTexture;
// pHull->pev->effects = EF_NODRAW;
return pHull;
}
示例10: if
void CTeamSpawn::Spawn( void )
{
pev->solid = SOLID_NOT;
if( !stricmp( STRING( pev->classname ), "info_player_start" ) )
{
pev->team = TEAM_EARTH;
}
else if( !stricmp( STRING( pev->classname ), "info_player_deathmatch" ) )
{
pev->team = TEAM_SPACE;
}
pev->classname = MAKE_STRING( "info_team_spawn" );
// ALERT( at_console, "SPAWNS %i\n", pev->team );
}
示例11: Spawn
void CSquidSpit:: Spawn( void )
{
pev->movetype = MOVETYPE_FLY;
pev->classname = MAKE_STRING( "squidspit" );
pev->solid = SOLID_BBOX;
pev->rendermode = kRenderTransAlpha;
pev->renderamt = 255;
SET_MODEL(ENT(pev), "sprites/bigspit.spr");
pev->frame = 0;
pev->scale = 0.5;
UTIL_SetSize( pev, Vector( 0, 0, 0), Vector(0, 0, 0) );
m_maxFrame = (float) MODEL_FRAMES( pev->modelindex ) - 1;
}
示例12: Precache
void AvHFlameGun::Spawn()
{
AvHMarineWeapon::Spawn();
Precache();
//this->m_iId = AVH_WEAPON_FLAMER;
ASSERT(false);
this->m_iDefaultAmmo = kFGMaxClip;
// Set our class name
this->pev->classname = MAKE_STRING(kwsFlameGun);
SET_MODEL(ENT(this->pev), kFGWModel);
FallInit();// get ready to fall down.
}
示例13: MAKE_STRING
void CHostage::Precache(void)
{
BINTRACE
m_whichModel = 0;
if (FStringNull(pev->model))
pev->model = MAKE_STRING("models/scientist.mdl");
PRECACHE_MODEL((char *)STRING(pev->model));
PRECACHE_SOUND("hostage/hos1.wav");
PRECACHE_SOUND("hostage/hos2.wav");
PRECACHE_SOUND("hostage/hos3.wav");
PRECACHE_SOUND("hostage/hos4.wav");
PRECACHE_SOUND("hostage/hos5.wav");
PRECACHE_MODEL("sprites/smoke.spr");
}
示例14: Save
void Save( ISave *pSave )
{
pSave->StartBlock( "Squads" );
short nSquads = (short)g_AI_SquadManager.NumSquads();
pSave->WriteShort( &nSquads );
AISquadsIter_t iter;
string_t squadName;
CAI_Squad* pSquad = g_AI_SquadManager.GetFirstSquad( &iter );
while (pSquad)
{
squadName = MAKE_STRING( pSquad->GetName() );
pSave->WriteString( "", &squadName ); // Strings require a header to be read properly
pSave->WriteAll( pSquad );
pSquad = g_AI_SquadManager.GetNextSquad( &iter );
}
pSave->EndBlock();
//---------------------------------
pSave->StartBlock( "Enemies" );
short nMemories = 0;
CAI_BaseNPC **ppAIs = g_AI_Manager.AccessAIs();
int i;
for ( i = 0; i < g_AI_Manager.NumAIs(); i++ )
{
if ( ppAIs[i]->GetEnemies() )
nMemories++;
}
pSave->WriteShort( &nMemories );
for ( i = 0; i < g_AI_Manager.NumAIs(); i++ )
{
if ( ppAIs[i]->GetEnemies() )
{
CBaseEntity *p = ppAIs[i];
pSave->WriteEntityPtr( &p );
pSave->WriteAll( ppAIs[i]->GetEnemies() );
}
}
pSave->EndBlock();
}
示例15: GenericCyclerSpawn
void CCycler :: GenericCyclerSpawn(char *szModel, Vector vecMin, Vector vecMax)
{
if (!szModel || !*szModel)
{
ALERT(at_error, "cycler at %.0f %.0f %0.f missing modelname", pev->origin.x, pev->origin.y, pev->origin.z );
REMOVE_ENTITY(ENT(pev));
return;
}
pev->classname = MAKE_STRING("cycler");
PRECACHE_MODEL( szModel );
SET_MODEL(ENT(pev), szModel);
CCycler::Spawn( );
UTIL_SetSize(pev, vecMin, vecMax);
}