當前位置: 首頁>>代碼示例>>C++>>正文


C++ COM_ParseString函數代碼示例

本文整理匯總了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
}
開發者ID:3ddy,項目名稱:Jedi-Academy,代碼行數:26,代碼來源:g_weaponLoad.cpp

示例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;
	}
}
開發者ID:3ddy,項目名稱:Jedi-Academy,代碼行數:36,代碼來源:g_weaponLoad.cpp

示例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);
}
開發者ID:Techokami,項目名稱:OpenJK,代碼行數:28,代碼來源:g_weaponLoad.cpp

示例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
}
開發者ID:3ddy,項目名稱:Jedi-Academy,代碼行數:31,代碼來源:g_weaponLoad.cpp

示例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;

}
開發者ID:5Quintessential,項目名稱:jedioutcast,代碼行數:35,代碼來源:g_itemLoad.cpp

示例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 );
}
開發者ID:BSzili,項目名稱:OpenJK,代碼行數:16,代碼來源:g_itemLoad.cpp

示例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 );
}
開發者ID:BSzili,項目名稱:OpenJK,代碼行數:16,代碼來源:g_itemLoad.cpp

示例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);
}
開發者ID:BSzili,項目名稱:OpenJK,代碼行數:16,代碼來源:g_itemLoad.cpp

示例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);
	}
}
開發者ID:kikili,項目名稱:OpenJK,代碼行數:20,代碼來源:g_weaponLoad.cpp

示例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);
}
開發者ID:3ddy,項目名稱:Jedi-Academy,代碼行數:21,代碼來源:g_weaponLoad.cpp

示例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);
}
開發者ID:5Quintessential,項目名稱:jedioutcast,代碼行數:20,代碼來源:g_itemLoad.cpp

示例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);
}
開發者ID:3ddy,項目名稱:Jedi-Academy,代碼行數:21,代碼來源:g_weaponLoad.cpp

示例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);

}
開發者ID:3ddy,項目名稱:Jedi-Academy,代碼行數:22,代碼來源:g_weaponLoad.cpp

示例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);
}
開發者ID:Techokami,項目名稱:OpenJK,代碼行數:22,代碼來源:g_weaponLoad.cpp

示例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);

}
開發者ID:3ddy,項目名稱:Jedi-Academy,代碼行數:22,代碼來源:g_weaponLoad.cpp


注:本文中的COM_ParseString函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。