本文整理汇总了C++中COM_ParseString函数的典型用法代码示例。如果您正苦于以下问题:C++ COM_ParseString函数的具体用法?C++ COM_ParseString怎么用?C++ COM_ParseString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了COM_ParseString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WPN_AltMuzzleEffect
//--------------------------------------------
void WPN_AltMuzzleEffect(const char **holdBuf)
{
const char *tokenStr;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
// ONLY DO THIS ON THE GAME SIDE
#ifndef _USRDLL
int len = strlen(tokenStr);
len++;
if (len > 64)
{
len = 64;
gi.Printf(S_COLOR_YELLOW"WARNING: AltMuzzleEffect '%s' too long in external WEAPONS.DAT\n", tokenStr);
}
G_EffectIndex( tokenStr );
Q_strncpyz(weaponData[wpnParms.weaponNum].mAltMuzzleEffect,tokenStr,len);
#endif
}
示例2: WPN_Ammo
//--------------------------------------------
void WPN_Ammo(const char **holdBuf)
{
const char *tokenStr;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
if (!Q_stricmp(tokenStr,"AMMO_NONE"))
wpnParms.ammoNum = AMMO_NONE;
else if (!Q_stricmp(tokenStr,"AMMO_FORCE"))
wpnParms.ammoNum = AMMO_FORCE;
else if (!Q_stricmp(tokenStr,"AMMO_BLASTER"))
wpnParms.ammoNum = AMMO_BLASTER;
else if (!Q_stricmp(tokenStr,"AMMO_POWERCELL"))
wpnParms.ammoNum = AMMO_POWERCELL;
else if (!Q_stricmp(tokenStr,"AMMO_METAL_BOLTS"))
wpnParms.ammoNum = AMMO_METAL_BOLTS;
else if (!Q_stricmp(tokenStr,"AMMO_ROCKETS"))
wpnParms.ammoNum = AMMO_ROCKETS;
else if (!Q_stricmp(tokenStr,"AMMO_EMPLACED"))
wpnParms.ammoNum = AMMO_EMPLACED;
else if (!Q_stricmp(tokenStr,"AMMO_THERMAL"))
wpnParms.ammoNum = AMMO_THERMAL;
else if (!Q_stricmp(tokenStr,"AMMO_TRIPMINE"))
wpnParms.ammoNum = AMMO_TRIPMINE;
else if (!Q_stricmp(tokenStr,"AMMO_DETPACK"))
wpnParms.ammoNum = AMMO_DETPACK;
else
{
gi.Printf(S_COLOR_YELLOW"WARNING: bad ammotype in external weapon data '%s'\n", tokenStr);
wpnParms.ammoNum = 0;
}
}
示例3: WPN_FuncName
//--------------------------------------------
void WPN_FuncName(const char **holdBuf)
{
const char *tokenStr;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
size_t len = strlen(tokenStr);
len++;
if (len > 64)
{
len = 64;
gi.Printf(S_COLOR_YELLOW"WARNING: FuncName '%s' too long in external WEAPONS.DAT\n", tokenStr);
}
for ( func_t* s=funcs ; s->name ; s++ ) {
if ( !Q_stricmp(s->name, tokenStr) ) {
// found it
weaponData[wpnParms.weaponNum].func = (void*)s->func;
return;
}
}
gi.Printf(S_COLOR_YELLOW"WARNING: FuncName '%s' in external WEAPONS.DAT does not exist\n", tokenStr);
}
示例4: WPN_AltFuncName
//--------------------------------------------
void WPN_AltFuncName(const char **holdBuf)
{
const char *tokenStr;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
// ONLY DO THIS ON THE GAME SIDE
#ifndef _USRDLL
int len = strlen(tokenStr);
len++;
if (len > 64)
{
len = 64;
gi.Printf(S_COLOR_YELLOW"WARNING: AltFuncName '%s' too long in external WEAPONS.DAT\n", tokenStr);
}
for ( func_t* s=funcs ; s->name ; s++ ) {
if ( !Q_stricmp(s->name, tokenStr) ) {
// found it
weaponData[wpnParms.weaponNum].altfunc = (void*)s->func;
return;
}
}
gi.Printf(S_COLOR_YELLOW"WARNING: AltFuncName %s in external WEAPONS.DAT does not exist\n", tokenStr);
#endif
}
示例5: IT_Type
static void IT_Type(const char **holdBuf)
{
int type;
const char *tokenStr;
if (COM_ParseString(holdBuf,&tokenStr))
{
return;
}
if (!Q_stricmp(tokenStr,"IT_BAD"))
type = IT_BAD;
else if (!Q_stricmp(tokenStr,"IT_WEAPON"))
type = IT_WEAPON;
else if (!Q_stricmp(tokenStr,"IT_AMMO"))
type = IT_AMMO;
else if (!Q_stricmp(tokenStr,"IT_ARMOR"))
type = IT_ARMOR;
else if (!Q_stricmp(tokenStr,"IT_HEALTH"))
type = IT_HEALTH;
else if (!Q_stricmp(tokenStr,"IT_HOLDABLE"))
type = IT_HOLDABLE;
else if (!Q_stricmp(tokenStr,"IT_BATTERY"))
type = IT_BATTERY;
else if (!Q_stricmp(tokenStr,"IT_HOLOCRON"))
type = IT_HOLOCRON;
else
{
type = IT_BAD;
gi.Printf("WARNING: bad itemname in external item data '%s'\n", tokenStr);
}
bg_itemlist[itemParms.itemNum].giType = (itemType_t) type;
}
示例6: IT_ClassName
static void IT_ClassName( const char **holdBuf ) {
int len;
const char *tokenStr;
if ( COM_ParseString( holdBuf, &tokenStr ) ) {
return;
}
len = strlen( tokenStr ) + 1;
if ( len > 32 ) {
len = 32;
gi.Printf( "WARNING: weaponclass too long in external ITEMS.DAT '%s'\n", tokenStr );
}
bg_itemlist[itemNum].classname = G_NewString( tokenStr );
}
示例7: IT_WorldModel
static void IT_WorldModel( const char **holdBuf ) {
int len;
const char *tokenStr;
if ( COM_ParseString( holdBuf, &tokenStr ) ) {
return;
}
len = strlen( tokenStr ) + 1;
if ( len > 64 ) {
len = 64;
gi.Printf( "WARNING: world model too long in external ITEMS.DAT '%s'\n", tokenStr );
}
bg_itemlist[itemNum].world_model = G_NewString( tokenStr );
}
示例8: IT_PickupSound
static void IT_PickupSound( const char **holdBuf ) {
int len;
const char *tokenStr;
if ( COM_ParseString( holdBuf, &tokenStr ) ) {
return;
}
len = strlen( tokenStr ) + 1;
if ( len > 32 ) {
len = 32;
gi.Printf("WARNING: Pickup Sound too long in external ITEMS.DAT '%s'\n", tokenStr);
}
bg_itemlist[itemNum].pickup_sound = G_NewString(tokenStr);
}
示例9: WPN_SelectFrc
//--------------------------------------------
void WPN_SelectFrc( const char **holdBuf )
{
const char *tokenStr;
int len;
if ( COM_ParseString( holdBuf,&tokenStr ))
{
return;
}
len = strlen( tokenStr );
len++;
if (len > 64)
{
len = 64;
gi.Printf(S_COLOR_YELLOW"WARNING: selectFrc too long in external WEAPONS.DAT '%s'\n", tokenStr);
}
}
示例10: WPN_WeaponClass
//--------------------------------------------
void WPN_WeaponClass(const char **holdBuf)
{
int len;
const char *tokenStr;
if (COM_ParseString(holdBuf,&tokenStr))
{
return;
}
len = strlen(tokenStr);
len++;
if (len > 32)
{
len = 32;
gi.Printf(S_COLOR_YELLOW"WARNING: weaponclass too long in external WEAPONS.DAT '%s'\n", tokenStr);
}
Q_strncpyz(weaponData[wpnParms.weaponNum].classname,tokenStr,len);
}
示例11: IT_Icon
static void IT_Icon(const char **holdBuf)
{
int len;
const char *tokenStr;
if (COM_ParseString(holdBuf,&tokenStr))
{
return;
}
len = strlen(tokenStr);
len++;
if (len > 32)
{
len = 32;
gi.Printf("WARNING: icon too long in external ITEMS.DAT '%s'\n", tokenStr);
}
bg_itemlist[itemParms.itemNum].icon = G_NewString(tokenStr);
}
示例12: WPN_AltChargeSnd
//--------------------------------------------
void WPN_AltChargeSnd(const char **holdBuf)
{
const char *tokenStr;
int len;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
len = strlen(tokenStr);
len++;
if (len > 64)
{
len = 64;
gi.Printf(S_COLOR_YELLOW"WARNING: altChargeSnd too long in external WEAPONS.DAT '%s'\n", tokenStr);
}
Q_strncpyz(weaponData[wpnParms.weaponNum].altChargeSnd,tokenStr,len);
}
示例13: WPN_MissileName
//--------------------------------------------
void WPN_MissileName(const char **holdBuf)
{
int len;
const char *tokenStr;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
len = strlen(tokenStr);
len++;
if (len > 64)
{
len = 64;
gi.Printf(S_COLOR_YELLOW"WARNING: MissileName too long in external WEAPONS.DAT '%s'\n", tokenStr);
}
Q_strncpyz(weaponData[wpnParms.weaponNum].missileMdl,tokenStr,len);
}
示例14: WPN_MuzzleEffect
//--------------------------------------------
void WPN_MuzzleEffect(const char **holdBuf)
{
const char *tokenStr;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
size_t len = strlen(tokenStr);
len++;
if (len > 64)
{
len = 64;
gi.Printf(S_COLOR_YELLOW"WARNING: MuzzleEffect '%s' too long in external WEAPONS.DAT\n", tokenStr);
}
G_EffectIndex( tokenStr );
Q_strncpyz(weaponData[wpnParms.weaponNum].mMuzzleEffect,tokenStr,len);
}
示例15: WPN_AmmoIcon
//--------------------------------------------
void WPN_AmmoIcon(const char **holdBuf)
{
const char *tokenStr;
int len;
if ( COM_ParseString(holdBuf,&tokenStr))
{
return;
}
len = strlen(tokenStr);
len++;
if (len > 32)
{
len = 32;
gi.Printf(S_COLOR_YELLOW"WARNING: ammoicon too long in external WEAPONS.DAT '%s'\n", tokenStr);
}
Q_strncpyz(ammoData[wpnParms.ammoNum].icon,tokenStr,len);
}