您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ BEGIN_READ函数代码示例

51自学网 2021-06-01 19:49:24
  C++
这篇教程C++ BEGIN_READ函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中BEGIN_READ函数的典型用法代码示例。如果您正苦于以下问题:C++ BEGIN_READ函数的具体用法?C++ BEGIN_READ怎么用?C++ BEGIN_READ使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了BEGIN_READ函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: BEGIN_READ

// Message handler for Secondary Ammo Icon// Sets an ammo value// takes two values://		byte:  ammo index//		byte:  ammo valueint CHudAmmoSecondary::MsgFunc_SecAmmoVal( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	int index = READ_BYTE();	if( index < 0 || index >= MAX_SEC_AMMO_VALUES )		return 1;	m_iAmmoAmounts[index] = READ_BYTE();	m_iFlags |= HUD_ACTIVE;	// check to see if there is anything left to draw	int count = 0;	for( int i = 0; i < MAX_SEC_AMMO_VALUES; i++ )	{		count += max( 0, m_iAmmoAmounts[i] );	}	if( count == 0 ) 	{		// the ammo fields are all empty, so turn off this hud area		m_iFlags &= ~HUD_ACTIVE;		return 1;	}	// make the icons light up	m_fFade = 200.0f;	return 1;}
开发者ID:FWGS,项目名称:hlsdk-xash3d,代码行数:35,


示例2: BEGIN_READ

int CHudHealth::MsgFunc_Damage( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	int armor = READ_BYTE();	// armor	int damageTaken = READ_BYTE();	// health	long bitsDamage = READ_LONG(); // damage bits	vec3_t vecFrom;	for( int i = 0; i < 3; i++ )		vecFrom[i] = READ_COORD();	UpdateTiles( gHUD.m_flTime, bitsDamage );	// Actually took damage?	if( damageTaken > 0 || armor > 0 )	{		CalcDamageDirection( vecFrom );                if( gMobileEngfuncs && damageTaken > 0 )                {			float time = damageTaken * 4.0f;			if( time > 200.0f )				time = 200.0f;			gMobileEngfuncs->pfnVibrate( time, 0 );                }	}	return 1;}
开发者ID:FWGS,项目名称:hlsdk-xash3d,代码行数:32,


示例3: BEGIN_READ

int CHudAmmo::MsgFunc_HideWeapon( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );		gHUD.m_iHideHUDDisplay = READ_BYTE();	if (gEngfuncs.IsSpectateOnly())		return 1;	if ( gHUD.m_iHideHUDDisplay & ( HIDEHUD_WEAPONS | HIDEHUD_ALL ) )	{		static wrect_t nullrc;		gpActiveSel = NULL;		// Removed by Pcjoe//		SetCrosshair( 0, nullrc, 0, 0, 0 );	}	else	{	/* Removed by Pcjoe		if ( m_pWeapon )			SetCrosshair( m_pWeapon->hCrosshair, m_pWeapon->rcCrosshair, 255, 255, 255 );	*/	}	return 1;}
开发者ID:vermagav,项目名称:mechmod,代码行数:26,


示例4: MsgFunc_MOTD

int CHudMOTD :: MsgFunc_MOTD( const char *pszName, int iSize, void *pbuf ){	if( m_iFlags & HUD_ACTIVE )	{		Reset(); // clear the current MOTD in prep for this one	}	BEGIN_READ( pszName, pbuf, iSize );	int is_finished = READ_BYTE();	Q_strcat( m_szMOTD, READ_STRING( ));	if( is_finished )	{		m_iFlags |= HUD_ACTIVE;		MOTD_DISPLAY_TIME = CVAR_GET_FLOAT( "motd_display_time" );		m_flActiveTill = gHUD.m_flTime + MOTD_DISPLAY_TIME;		// count the number of lines in the MOTD		for( char *sz = m_szMOTD; *sz != 0; sz++ )			if( *sz == '/n' ) m_iLines++;	}	END_READ();	return 1;}
开发者ID:XashDev,项目名称:XashXT,代码行数:29,


示例5: BEGIN_READ

int CHud::MsgFunc_SetFOV(const char *pszName,  int iSize, void *pbuf){	BEGIN_READ( pbuf, iSize );	int newfov = READ_BYTE();	int def_fov = CVAR_GET_FLOAT( "default_fov" );	if ( newfov == 0 )	{		m_iFOV = def_fov;	}	else	{		m_iFOV = newfov;	}	// the clients fov is actually set in the client data update section of the hud	// Set a new sensitivity	if ( m_iFOV == def_fov )	{  		// reset to saved sensitivity		m_flMouseSensitivity = 0;	}	else	{  		// set a new sensitivity that is proportional to the change from the FOV default		m_flMouseSensitivity = sensitivity->value * ((float)newfov / (float)def_fov) * CVAR_GET_FLOAT("zoom_sensitivity_ratio");	}	return 1;}
开发者ID:NoFreeWill,项目名称:MultiplayerSource,代码行数:32,


示例6: BEGIN_READ

//LRCint CHud::MsgFunc_SetFog( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	for ( int i = 0; i < 3; i++ )		 g_fFogColor[ i ] = READ_BYTE();	g_fFadeDuration = READ_SHORT();	g_fStartDist = READ_SHORT();	if (g_fFadeDuration > 0)	{//		// fading in		g_iFinalEndDist = READ_SHORT();		g_fEndDist = FOG_LIMIT;	}	else if (g_fFadeDuration < 0)	{//		// fading out		g_iFinalEndDist = g_fEndDist = READ_SHORT();	}	else	{		g_fEndDist = READ_SHORT();	}	return 1;}
开发者ID:BackupTheBerlios,项目名称:battlegrounds-svn,代码行数:28,


示例7: BEGIN_READ

void CVoiceStatus::HandleVoiceMaskMsg(int iSize, void *pbuf){	BEGIN_READ( pbuf, iSize );	uint32 dw;	for(dw=0; dw < VOICE_MAX_PLAYERS_DW; dw++)	{		m_AudiblePlayers.SetDWord(dw, (uint32)READ_LONG());		m_ServerBannedPlayers.SetDWord(dw, (uint32)READ_LONG());		if(gEngfuncs.pfnGetCvarFloat("voice_clientdebug"))		{			char str[256];			gEngfuncs.pfnConsolePrint("CVoiceStatus::HandleVoiceMaskMsg/n");						sprintf(str, "    - m_AudiblePlayers[%d] = %lu/n", dw, m_AudiblePlayers.GetDWord(dw));			gEngfuncs.pfnConsolePrint(str);						sprintf(str, "    - m_ServerBannedPlayers[%d] = %lu/n", dw, m_ServerBannedPlayers.GetDWord(dw));			gEngfuncs.pfnConsolePrint(str);		}	}	m_bServerModEnable = READ_BYTE();}
开发者ID:Skumek,项目名称:hlsdk,代码行数:25,


示例8: MsgFunc_SetSkin

void CHud :: MsgFunc_SetSkin( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	gHUD.m_iSkin = READ_BYTE();	cl_entity_s *view = gEngfuncs.GetViewModel();	view->curstate.skin = gHUD.m_iSkin;}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:7,


示例9: MsgFunc_SpecTank

// buz: special tank messageint CHud :: MsgFunc_SpecTank( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );		m_SpecTank_on = READ_BYTE();	if (m_SpecTank_on == 0) // turn off		return 1;	else if (m_SpecTank_on == 2) // only ammo update	{		m_SpecTank_Ammo = READ_LONG();		m_SpecTank_Ammo2 = READ_LONG();		m_SpecTank_CrossSize = READ_BYTE();	}	else // turn on	{		m_SpecTank_point.x = READ_COORD();		m_SpecTank_point.y = READ_COORD();		m_SpecTank_point.z = READ_COORD();		m_SpecTank_defYaw = READ_COORD();		m_SpecTank_coneHor = READ_COORD();		m_SpecTank_coneVer = READ_COORD();		m_SpecTank_distFwd = READ_COORD();		m_SpecTank_distUp = READ_COORD();		m_SpecTank_Ammo = READ_LONG();		m_SpecTank_Ammo2 = READ_LONG();		m_SpecTank_CrossSize = READ_BYTE();	}	return 1;}
开发者ID:mittorn,项目名称:hlwe_src,代码行数:30,


示例10: MsgFunc_SetFog

//LRCvoid CHud :: MsgFunc_SetFog( const char *pszName, int iSize, void *pbuf ){//	CONPRINT("MSG:SetFog");	BEGIN_READ( pbuf, iSize );	for ( int i = 0; i < 3; i++ )		 g_fFogColor[ i ] = READ_BYTE();	g_fFadeDuration = READ_SHORT();	g_fStartDist = READ_SHORT();	if (g_fFadeDuration > 0)	{//		// fading in//		g_fStartDist = READ_SHORT();		g_iFinalEndDist = READ_SHORT();//		g_fStartDist = FOG_LIMIT;		g_fEndDist = FOG_LIMIT;	}	else if (g_fFadeDuration < 0)	{//		// fading out//		g_iFinalStartDist =		g_iFinalEndDist = g_fEndDist = READ_SHORT();	}	else	{//		g_fStartDist = READ_SHORT();		g_fEndDist = READ_SHORT();	}}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:32,


示例11: MsgFunc_QItems

// QUAKECLASSICint CHud :: MsgFunc_QItems(const char *pszName, int iSize, void *pbuf){	BEGIN_READ( pbuf, iSize );	m_iQuakeItems = READ_LONG();	return 1;}
开发者ID:6779660,项目名称:halflife,代码行数:8,


示例12: BEGIN_READ

//// WeaponList -- Tells the hud about a new weapon type.//int CHudAmmo::MsgFunc_WeaponList(const char *pszName, int iSize, void *pbuf){	BEGIN_READ(pbuf, iSize);	WEAPON Weapon;	strcpy(Weapon.szName, READ_STRING());	Weapon.iAmmoType = (int)READ_CHAR();	Weapon.iMax1 = READ_BYTE();	if(Weapon.iMax1 == 255)		Weapon.iMax1 = -1;	Weapon.iAmmo2Type = READ_BYTE();	Weapon.iMax2      = READ_BYTE();	if(Weapon.iMax2 == 255)		Weapon.iMax2 = -1;	Weapon.iSlot    = READ_BYTE();	Weapon.iSlotPos = READ_BYTE();	Weapon.iId      = READ_LONG();	Weapon.iFlags = READ_BYTE();	Weapon.iClip = 0;	gWR.AddWeapon(&Weapon);	return 1;}
开发者ID:Sh1ft0x0EF,项目名称:HLSDKRevamp,代码行数:33,


示例13: MsgFunc_KeyedDLight

//LRCvoid CHud :: MsgFunc_KeyedDLight( const char *pszName, int iSize, void *pbuf ){//	CONPRINT("MSG:KeyedDLight");	BEGIN_READ( pbuf, iSize );// as-yet unused://	float	decay;				// drop this each second//	float	minlight;			// don't add when contributing less//	qboolean	dark;			// subtracts light instead of adding (doesn't seem to do anything?)	int iKey = READ_BYTE();	dlight_t *dl = gEngfuncs.pEfxAPI->CL_AllocDlight( iKey );	int bActive = READ_BYTE();	if (!bActive)	{		// die instantly		dl->die = gEngfuncs.GetClientTime();	}	else	{		// never die		dl->die = gEngfuncs.GetClientTime() + 1E6;		dl->origin[0] = READ_COORD();		dl->origin[1] = READ_COORD();		dl->origin[2] = READ_COORD();		dl->radius = READ_BYTE();		dl->color.r = READ_BYTE();		dl->color.g = READ_BYTE();		dl->color.b = READ_BYTE();	}}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:34,


示例14: MsgFunc_GameMode

int CHud :: MsgFunc_GameMode(const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	m_Teamplay = READ_BYTE();	return 1;}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:7,


示例15: MsgFunc_SetBody

void CHud :: MsgFunc_SetBody( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	gHUD.m_iBody = READ_BYTE();	cl_entity_s *view = gEngfuncs.GetViewModel();	view->curstate.body = gHUD.m_iBody;	//gEngfuncs.pfnWeaponAnim( 2, gHUD.m_iBody );//UNDONE: custom frame for view model don't working}
开发者ID:JoelTroch,项目名称:am_src_rebirth,代码行数:8,


示例16: BEGIN_READ

//LRCint CHud::MsgFunc_HUDColor(const char *pszName,  int iSize, void *pbuf){	BEGIN_READ( pbuf, iSize );	m_iHUDColor = READ_LONG();	return 1;}
开发者ID:mittorn,项目名称:SoHL-1.2,代码行数:9,


示例17: __MsgFunc_Bhopcap

int __MsgFunc_Bhopcap( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	g_bhopcap = READ_BYTE();	return 1;}
开发者ID:nekonomicon,项目名称:hlsdk-xash3d,代码行数:8,


示例18: BEGIN_READ

int CHudBattery::MsgFunc_ArmorType(const char *pszName,  int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	m_enArmorType = (armortype_t)READ_BYTE();	return 1;}
开发者ID:Avatarchik,项目名称:cs16-client,代码行数:8,


示例19: MsgFunc_Intermission

int CHud :: MsgFunc_Intermission( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pszName, iSize, pbuf );	m_iIntermission = 1;	END_READ();	return 1;}
开发者ID:a1batross,项目名称:Xash3D_ancient,代码行数:8,


示例20: BEGIN_READ

int CHudMenu::MsgFunc_AllowSpec(const char *pszName, int iSize, void *pbuf){	BEGIN_READ( pbuf, iSize );	m_bAllowSpec = !!READ_BYTE();	return 1;}
开发者ID:AlexCSilva,项目名称:cs16-client,代码行数:8,


示例21: MsgFunc_CamData

	// trigger_viewset messageint CHud :: MsgFunc_CamData( const char *pszName, int iSize, void *pbuf ) // rain stuff{	BEGIN_READ( pbuf, iSize );		gHUD.viewEntityIndex = READ_SHORT();		gHUD.viewFlags = READ_SHORT();//	gEngfuncs.Con_Printf( "Got view entity with index %i/n", gHUD.viewEntityIndex );	return 1;}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:9,


示例22: MsgFunc_PlayMP3

int CHud :: MsgFunc_PlayMP3( const char *pszName, int iSize, void *pbuf ) //AJH -Killar MP3{	BEGIN_READ( pbuf, iSize );	gMP3.PlayMP3( READ_STRING() );	return 1;}
开发者ID:Hammermaps-DEV,项目名称:Spirit-of-Half-Life-1.8--VC2010,代码行数:8,


示例23: BEGIN_READ

int CHudLensFlare::MsgFunc_LensFlare( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	int mode	= READ_BYTE();	if ( mode == 1 )	// allume	{		gruntlight_t *p = NULL;		p = new gruntlight_t;		p->index = READ_BYTE();		p->pNext = m_pLight;		m_pLight = p;		m_iFlags |= HUD_ACTIVE;	}	else if ( mode  == 0 )	{		int idx		= READ_BYTE();		// destruction d'une flamme		gruntlight_t *p = NULL;		gruntlight_t *q = NULL;		p = m_pLight;		while ( p != NULL )		{			if ( p->index == idx )			{				if ( q == NULL )				{					// première de la liste					m_pLight = p->pNext,					delete p;					break;				}				else				{					q->pNext = p->pNext;					delete p;					break;				}			}			q = p;			p = p->pNext;		}	}	return 1;}
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:58,


示例24: MsgFunc_SayText

int CHudSayText :: MsgFunc_SayText( const char *pszName, int iSize, void *pbuf ){	BEGIN_READ( pbuf, iSize );	int client_index = READ_BYTE();		// the client who spoke the message	SayTextPrint( READ_STRING(), iSize - 1,  client_index );		return 1;}
开发者ID:nekonomicon,项目名称:QuakeRemakeDevkit,代码行数:9,


示例25: MsgFunc_ShowMenu

// Message handler for ShowMenu message// takes four values:// short: a bitfield of keys that are valid input// char : the duration, in seconds, the menu should stay up. -1 means is stays until something is chosen.// byte : a boolean, TRUE if there is more string yet to be received before displaying the menu, FALSE if it's the last string// string: menu string to display// if this message is never received, then scores will simply be the combined totals of the players.int CHudMenu :: MsgFunc_ShowMenu( const char *pszName, int iSize, void *pbuf ){	char *temp = NULL;	BEGIN_READ( pszName, pbuf, iSize );	m_bitsValidSlots = READ_SHORT();	int DisplayTime = READ_CHAR();	int NeedMore = READ_BYTE();	if( DisplayTime > 0 )		m_flShutoffTime = DisplayTime + gHUD.m_flTime;	else		m_flShutoffTime = -1;	if( m_bitsValidSlots )	{		if( !m_fWaitingForMore )		{			// this is the start of a new menu			Q_strncpy( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING );		}		else		{			// append to the current menu string			Q_strncat( g_szPrelocalisedMenuString, READ_STRING(), MAX_MENU_STRING - Q_strlen( g_szPrelocalisedMenuString ));		}		g_szPrelocalisedMenuString[MAX_MENU_STRING-1] = 0;  // ensure null termination (strncat/strncpy does not)		if( !NeedMore )		{			// we have the whole string, so we can localise it now			Q_strcpy( g_szMenuString, gHUD.m_TextMessage.BufferedLocaliseTextString( g_szPrelocalisedMenuString ));			// Swap in characters			if( KB_ConvertString( g_szMenuString, &temp ))			{				Q_strcpy( g_szMenuString, temp );				free( temp );			}		}		m_fMenuDisplayed = 1;		m_iFlags |= HUD_ACTIVE;	}	else	{		m_fMenuDisplayed = 0; // no valid slots means that the menu should be turned off		m_iFlags &= ~HUD_ACTIVE;	}	m_fWaitingForMore = NeedMore;	END_READ();	return 1;}
开发者ID:emileb,项目名称:XashXT,代码行数:64,


示例26: BEGIN_READ

int CHud::MsgFunc_Logo(const char *pszName, int iSize, void *pbuf){	BEGIN_READ( pbuf, iSize );	// update Train data	m_iLogo = READ_BYTE();	return 1;}
开发者ID:YaLTeR,项目名称:OpenAG,代码行数:9,


示例27: __MsgFunc_SpikeCheck

int __MsgFunc_SpikeCheck(const char* name, int size, void* buf){	BEGIN_READ(buf, size);	const auto model = READ_STRING();	// Stub: no cheat checks in OpenAG.	return 1;}
开发者ID:YaLTeR,项目名称:OpenAG,代码行数:9,


示例28: __MsgFunc_WhString

int __MsgFunc_WhString(const char* name, int size, void* buf){	BEGIN_READ(buf, size);	const auto string = READ_STRING();	// Stub: no cheat checks in OpenAG.	return 1;}
开发者ID:YaLTeR,项目名称:OpenAG,代码行数:9,


示例29: __MsgFunc_CheatCheck

int __MsgFunc_CheatCheck(const char* name, int size, void* buf){	BEGIN_READ(buf, size);	const auto pure = READ_BYTE();	// Stub: no cheat checks in OpenAG.	return 1;}
开发者ID:YaLTeR,项目名称:OpenAG,代码行数:9,



注:本文中的BEGIN_READ函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ BEGIN_RING函数代码示例
C++ BEGIN_NVC0函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。