• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ BEGIN_READ函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: BEGIN_READ

// Message handler for Secondary Ammo Icon
// Sets an ammo value
// takes two values:
//		byte:  ammo index
//		byte:  ammo value
int 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,代码来源:ammo_secondary.cpp


示例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,代码来源:health.cpp


示例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,代码来源:ammo.cpp


示例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,代码来源:motd.cpp


示例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,代码来源:hud.cpp


示例6: BEGIN_READ

//LRC
int 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,代码来源:hud_msg.cpp


示例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,代码来源:voice_status.cpp


示例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,代码来源:hud_msg.cpp


示例9: MsgFunc_SpecTank

// buz: special tank message
int 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,代码来源:hud_msg.cpp


示例10: MsgFunc_SetFog

//LRC
void 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,代码来源:hud_msg.cpp


示例11: MsgFunc_QItems

// QUAKECLASSIC
int CHud :: MsgFunc_QItems(const char *pszName, int iSize, void *pbuf)
{
	BEGIN_READ( pbuf, iSize );
	m_iQuakeItems = READ_LONG();

	return 1;
}
开发者ID:6779660,项目名称:halflife,代码行数:8,代码来源:hud_msg.cpp


示例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,代码来源:ammo.cpp


示例13: MsgFunc_KeyedDLight

//LRC
void 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,代码来源:hud_msg.cpp


示例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,代码来源:hud_msg.cpp


示例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,代码来源:hud_msg.cpp


示例16: BEGIN_READ

//LRC
int 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,代码来源:hud.cpp


示例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,代码来源:cdll_int.cpp


示例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,代码来源:battery.cpp


示例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,代码来源:hud_msg.cpp


示例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,代码来源:menu.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ BEGIN_RING函数代码示例发布时间:2022-05-30
下一篇:
C++ BEGIN_NVC0函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap