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

C++ MDLCACHE_CRITICAL_SECTION函数代码示例

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

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



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

示例1: CreateSDKPlayerAnimState

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *pPlayer - 
// Output : CMultiPlayerAnimState*
//-----------------------------------------------------------------------------
CSDKPlayerAnimState* CreateSDKPlayerAnimState( CSDKPlayer *pPlayer )
{
	MDLCACHE_CRITICAL_SECTION();

	// Create animation state for this player.
	CSDKPlayerAnimState *pRet = new CSDKPlayerAnimState( pPlayer );

	// Specific SDK player initialization.
	//pRet->InitSDKAnimState( pPlayer );

	return pRet;
}
开发者ID:ziming,项目名称:IOS,代码行数:17,代码来源:sdk_playeranimstate.cpp


示例2: RecvProxy_SequenceNum

void RecvProxy_SequenceNum( const CRecvProxyData *pData, void *pStruct, void *pOut )
{
	CBaseViewModel *model = (CBaseViewModel *)pStruct;
	if (pData->m_Value.m_Int != model->GetSequence())
	{
		MDLCACHE_CRITICAL_SECTION();

		model->SetSequence(pData->m_Value.m_Int);
		model->m_flAnimTime = gpGlobals->curtime;
		model->SetCycle(0);
	}
}
开发者ID:Denzeriko,项目名称:hl2-mod,代码行数:12,代码来源:baseviewmodel_shared.cpp


示例3: MDLCACHE_CRITICAL_SECTION

//-----------------------------------------------------------------------------
// Purpose: This is called post player movement to copy back all data that
//          movement could have modified and that is necessary for future
//          movement. (Server-side, the client-side version of this code can 
//          be found in prediction.cpp.)
//-----------------------------------------------------------------------------
void CCFPlayerMove::FinishMove( CBasePlayer *player, CUserCmd *ucmd, CMoveData *move )
{
	MDLCACHE_CRITICAL_SECTION();

	// Call the default FinishMove code.
	BaseClass::FinishMove( player, ucmd, move );

	IServerVehicle *pVehicle = player->GetVehicle();
	if (pVehicle && gpGlobals->frametime != 0)
	{
		pVehicle->FinishMove( player, ucmd, move );
	}
}
开发者ID:BSVino,项目名称:Arcon,代码行数:19,代码来源:cf_playermove.cpp


示例4: SafeRemoveIfDesiredAllSystems

void IGameSystem::UpdateAllSystems( float frametime )
{
	SafeRemoveIfDesiredAllSystems();

	int i;
	int c = s_GameSystemsPerFrame.Count();
	for ( i = 0; i < c; ++i )
	{
		IGameSystemPerFrame *sys = s_GameSystemsPerFrame[i];
		MDLCACHE_CRITICAL_SECTION();
		sys->Update( frametime );
	}
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:13,代码来源:igamesystem.cpp


示例5: InvokePerFrameMethod

//-----------------------------------------------------------------------------
// Invokes a method on all installed game systems in proper order
//-----------------------------------------------------------------------------
void InvokePerFrameMethod( PerFrameGameSystemFunc_t f, char const *timed /*=0*/ )
{
	NOTE_UNUSED( timed );

	int i;
	int c = s_GameSystemsPerFrame.Count();
	for ( i = 0; i < c ; ++i )
	{
		IGameSystemPerFrame *sys  = s_GameSystemsPerFrame[i];
		MDLCACHE_CRITICAL_SECTION();
		(sys->*f)();
	}
}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:16,代码来源:igamesystem.cpp


示例6: RestoreBlock

	void RestoreBlock( IRestore *pRestore, const PhysObjectHeader_t &header ) 
	{
		CBaseEntity *  pOwner  = header.hEntity.Get();
		unsigned short iQueued = m_QueuedRestores.Find( pOwner );
		
		if ( iQueued != m_QueuedRestores.InvalidIndex() )
		{
			MDLCACHE_CRITICAL_SECTION();
			if ( pOwner->ShouldSavePhysics() && header.nObjects > 0 )
			{
				QueuedItem_t *pItem = m_QueuedRestores[iQueued]->FindItem( header.fieldName );
				
				if ( pItem )
				{
					int nObjects = MIN( header.nObjects, pItem->header.nObjects );
					if ( pItem->header.type == PIID_IPHYSICSOBJECT && nObjects == 1 )
					{
						RestorePhysicsObjectAndModel( pRestore, header, pItem, nObjects );
					}
					else
					{
						void **ppPhysObj = pItem->ppPhysObj;
						
						for ( int i = 0; i < nObjects; i++ )
						{
							pRestore->StartBlock();
							RestorePhysicsObject( pRestore, header, ppPhysObj + i );
							pRestore->EndBlock();
							if ( header.type == PIID_IPHYSICSMOTIONCONTROLLER )
							{
								void *pObj = ppPhysObj[i];
								IPhysicsMotionController *pController = (IPhysicsMotionController *)pObj;
								if ( pController )
								{
									// If the entity is the motion callback handler, then automatically set it
									// NOTE: This is usually the case
									IMotionEvent *pEvent = dynamic_cast<IMotionEvent *>(pOwner);
									if ( pEvent )
									{
										pController->SetEventHandler( pEvent );
									}
								}
							}
						}
					}
				}
			}
			else
				pOwner->CreateVPhysics();
		}
	}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:51,代码来源:physics_saverestore.cpp


示例7: InvokeMethod

//-----------------------------------------------------------------------------
// Invokes a method on all installed game systems in proper order
//-----------------------------------------------------------------------------
void InvokeMethod( GameSystemFunc_t f, char const *timed /*=0*/ )
{
	NOTE_UNUSED( timed );

	int i;
	int c = s_GameSystems.Count();
	for ( i = 0; i < c ; ++i )
	{
		IGameSystem *sys = s_GameSystems[i];

		MDLCACHE_COARSE_LOCK();
		MDLCACHE_CRITICAL_SECTION();

		(sys->*f)();
	}
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:19,代码来源:igamesystem.cpp


示例8: Q_memset

void SEditModelRender::GetModelCenter( float *pFl3_ViewOffset )
{
	Q_memset( pFl3_ViewOffset, 0, sizeof(float) * 3 );
	if ( IsModelReady() )
	{
		MDLCACHE_CRITICAL_SECTION();
		if ( pModelInstance->GetModelPtr() )
		{
			const Vector &vecMin = pModelInstance->GetModelPtr()->hull_min();
			const Vector &vecMax = pModelInstance->GetModelPtr()->hull_max();
			Vector vecPos = ( vecMin + ( vecMax - vecMin ) * 0.5f );
			if ( pFl3_ViewOffset )
				Q_memcpy( pFl3_ViewOffset, vecPos.Base(), sizeof(float) * 3 );
		}
	}
}
开发者ID:InfoSmart,项目名称:InSource,代码行数:16,代码来源:SEdit_ModelRender.cpp


示例9: UpdateModelWidthScale

void CRagdollProp::SetupBones( matrix3x4_t *pBoneToWorld, int boneMask )
{
	// no ragdoll, fall through to base class 
	if ( !m_ragdoll.listCount )
	{
		BaseClass::SetupBones( pBoneToWorld, boneMask );
		return;
	}

	// Not really ideal, but it'll work for now
	UpdateModelWidthScale();

	MDLCACHE_CRITICAL_SECTION();
	CStudioHdr *pStudioHdr = GetModelPtr( );
	bool sim[MAXSTUDIOBONES];
	memset( sim, 0, pStudioHdr->numbones() );

	int i;

	CBoneAccessor boneaccessor( pBoneToWorld );
	for ( i = 0; i < m_ragdoll.listCount; i++ )
	{
		// during restore this may be NULL
		if ( !m_ragdoll.list[i].pObject )
			continue;

		if ( RagdollGetBoneMatrix( m_ragdoll, boneaccessor, i ) )
		{
			sim[m_ragdoll.boneIndex[i]] = true;
		}
	}

	mstudiobone_t *pbones = pStudioHdr->pBone( 0 );
	for ( i = 0; i < pStudioHdr->numbones(); i++ )
	{
		if ( sim[i] )
			continue;
		
		if ( !(pbones[i].flags & boneMask) )
			continue;

		matrix3x4_t matBoneLocal;
		AngleMatrix( pbones[i].rot, pbones[i].pos, matBoneLocal );
		ConcatTransforms( pBoneToWorld[pbones[i].parent], matBoneLocal, pBoneToWorld[i]);
	}
}
开发者ID:paralin,项目名称:hl2sdk,代码行数:46,代码来源:physics_prop_ragdoll.cpp


示例10: MDLCACHE_CRITICAL_SECTION

void C_CFPlayer::ShowHandMagic(C_BaseEntity* pEnt, CUtlVector<CNewParticleEffect*>& aHandComboEffects, element_t eElements, const char* pszAttachment)
{
	MDLCACHE_CRITICAL_SECTION();
	int i;
	for (i = 0; i < aHandComboEffects.Count(); i++)
		pEnt->ParticleProp()->StopEmission(aHandComboEffects[i]);

	aHandComboEffects.RemoveAll();

	for (i = 0; i < TOTAL_ELEMENTS; i++)
	{
		if (!(eElements&(1<<i)))
			continue;

		aHandComboEffects.AddToTail(pEnt->ParticleProp()->Create( VarArgs("hand_%s", ElementToString((element_t)(1<<i))), PATTACH_POINT_FOLLOW, pszAttachment ));
	}
}
开发者ID:BSVino,项目名称:Arcon,代码行数:17,代码来源:c_cf_player.cpp


示例11: InvokeMethodTickProgress

//-----------------------------------------------------------------------------
// Invokes a method on all installed game systems in proper order
//-----------------------------------------------------------------------------
void InvokeMethodTickProgress( GameSystemFunc_t f, char const *timed /*=0*/ )
{
	NOTE_UNUSED( timed );

	int i;
	int c = s_GameSystems.Count();
	for ( i = 0; i < c ; ++i )
	{
		IGameSystem *sys = s_GameSystems[i];

		MDLCACHE_COARSE_LOCK();
		MDLCACHE_CRITICAL_SECTION();
#if defined( CLIENT_DLL )
		engine->TickProgressBar();
#endif
		(sys->*f)();
	}
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:21,代码来源:igamesystem.cpp


示例12: entData

const char *C_ASW_Snow_Volume::ParseEntity( const char *pEntData )
{
	CEntityMapData entData( (char*)pEntData );
	char className[MAPKEY_MAXLENGTH];
	
	MDLCACHE_CRITICAL_SECTION();

	if (!entData.ExtractValue("classname", className))
	{
		Error( "classname missing from entity!\n" );
	}

	if ( !Q_strcmp( className, "asw_snow_volume" ) )
	{
		// always force clientside entitis placed in maps
		C_ASW_Snow_Volume *pEntity = C_ASW_Snow_Volume::CreateNew( true ); 

		if ( pEntity )
		{	// Set up keyvalues.
			pEntity->ParseMapData(&entData);
			
			if ( !pEntity->Initialize() )
				pEntity->Release();
		
			return entData.CurrentBufferPosition();
		}
	}
	
	// Just skip past all the keys.
	char keyName[MAPKEY_MAXLENGTH];
	char value[MAPKEY_MAXLENGTH];
	if ( entData.GetFirstKey(keyName, value) )
	{
		do 
		{
		} 
		while ( entData.GetNextKey(keyName, value) );
	}

	//
	// Return the current parser position in the data block
	//
	return entData.CurrentBufferPosition();
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:44,代码来源:c_asw_snow_volume.cpp


示例13: VPROF_BUDGET

void CASWHud3DMarineNames::Paint()
{
	VPROF_BUDGET( "CASWHud3DMarineNames::Paint", VPROF_BUDGETGROUP_ASW_CLIENT );

	BaseClass::Paint();
	//PaintFontTest();
	MDLCACHE_CRITICAL_SECTION();
	PaintMarineNameLabels();
	PaintBoxesAroundUseEntities();
	C_ASW_Player* pPlayer = C_ASW_Player::GetLocalASWPlayer();
	if (pPlayer)
	{
		/*
		// check for drawing autoaim crosshair
		if (pPlayer->m_ASWLocal.m_hAutoAimTarget.Get() && pPlayer->GetMarine())
		{
			C_ASW_Marine *pMarine = pPlayer->GetMarine();
			C_ASW_Marine_Resource *pMR = pMarine->GetMarineResource();
			if (pMR && pMR->IsFiring())
			{
				C_ASW_Weapon *pWeapon = pMarine->GetActiveASWWeapon();
				if (pWeapon->IsOffensiveWeapon())
					PaintAutoaimCrosshairOn(pPlayer->m_ASWLocal.m_hAutoAimTarget.Get());
			}			
		}
		*/
		if (pPlayer->GetHighlightEntity())
		{
			PaintBoxAround(pPlayer->GetHighlightEntity(), 6);
		}
	}

	if ( ASWInput() && ASWInput()->GetAutoaimEntity() )
	{
		PaintAutoaimCrosshairOn( ASWInput()->GetAutoaimEntity() );
	}

	PaintTrackedHealth();
	if ( asw_DebugAutoAim.GetBool() )
	{
		PaintAimingDebug();
	}

}
开发者ID:Nightgunner5,项目名称:Jastian-Summer,代码行数:44,代码来源:asw_hud_3dmarinenames.cpp


示例14: CreateSDKPlayerAnimState

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : *pPlayer - 
// Output : CMultiPlayerAnimState*
//-----------------------------------------------------------------------------
CSDKPlayerAnimState* CreateSDKPlayerAnimState( CSDKPlayer *pPlayer )
{
	MDLCACHE_CRITICAL_SECTION();

	// Setup the movement data.
	MultiPlayerMovementData_t movementData;
	movementData.m_flBodyYawRate = 720.0f;
	movementData.m_flRunSpeed = SDK_RUN_SPEED;
	movementData.m_flWalkSpeed = SDK_WALK_SPEED;
	movementData.m_flSprintSpeed = -1.0f;

	// Create animation state for this player.
	CSDKPlayerAnimState *pRet = new CSDKPlayerAnimState( pPlayer, movementData );

	// Specific SDK player initialization.
	pRet->InitSDKAnimState( pPlayer );

	return pRet;
}
开发者ID:jlwitthuhn,项目名称:DoubleAction,代码行数:24,代码来源:sdk_playeranimstate.cpp


示例15: InvokeMethodReverseOrder

//-----------------------------------------------------------------------------
// Invokes a method on all installed game systems in reverse order
//-----------------------------------------------------------------------------
void InvokeMethodReverseOrder( GameSystemFunc_t f )
{
	int i;
	int c = s_GameSystems.Count();
	for ( i = c; --i >= 0; )
	{
		IGameSystem *sys = s_GameSystems[i];
#if (VPROF_LEVEL > 0) && defined(VPROF_ACCOUNT_GAMESYSTEMS)   // make sure each game system is individually attributed
		// because vprof nodes must really be constructed with a pointer to a static
		// string, we can't create a temporary char[] here and sprintf a distinctive
		// V_snprintf( buf, 63, "gamesys_preframe_%s", sys->Name() ). We'll have to
		// settle for just the system name, and distinguish between pre and post frame
		// in hierarchy.
		VPROF( sys->Name() );
#endif
		MDLCACHE_CRITICAL_SECTION();
		(sys->*f)();
	}
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:22,代码来源:igamesystem.cpp


示例16: MDLCACHE_CRITICAL_SECTION

void SEditModelRender::ExecRender()
{
	if ( !IsModelReady() )
		return;

	MDLCACHE_CRITICAL_SECTION();
	for ( int i = 0; i < m_iNumPoseParams; i++ )
		pModelInstance->SetPoseParameter( i, 0 );

#ifdef SWARM_DLL
	RenderableInstance_t instance;
	instance.m_nAlpha = 255;
#endif
	pModelInstance->DrawModel( STUDIO_RENDER
#ifdef SWARM_DLL
		, instance
#endif
		);
}
开发者ID:InfoSmart,项目名称:InSource,代码行数:19,代码来源:SEdit_ModelRender.cpp


示例17: RecvProxy_SequenceNum

void RecvProxy_SequenceNum( const CRecvProxyData *pData, void *pStruct, void *pOut )
{
	CDAViewModel *model = (CDAViewModel *)pStruct;
	if (pData->m_Value.m_Int != model->GetSequence())
	{
		MDLCACHE_CRITICAL_SECTION();

		model->SetSequence(pData->m_Value.m_Int);

		if (model->m_flResumeAnimTime)
			model->m_flAnimTime = model->m_flResumeAnimTime;
		else
			model->m_flAnimTime = gpGlobals->curtime;
		model->m_flResumeAnimTime = 0;

		model->SetCycle(model->m_flResumeCycle);
		model->m_flResumeCycle = 0;
	}
}
开发者ID:JorgeChimendes,项目名称:DoubleAction,代码行数:19,代码来源:da_viewmodel.cpp


示例18: MDLCACHE_CRITICAL_SECTION

// Add support for CS:S player animations
void C_SO_Player::DoAnimationEvent( PlayerAnimEvent_t event, int nData )
{
	if ( IsLocalPlayer() )
	{
		if ( ( prediction->InPrediction() && !prediction->IsFirstTimePredicted() ) )
			return;
	}

	MDLCACHE_CRITICAL_SECTION();

	// Add support for CS:S player animations
	if ( event == PLAYERANIMEVENT_ATTACK_GRENADE )
	{
		// Let the server handle this event. It will update m_iThrowGrenadeCounter and the client will
		// pick up the event in CCSPlayerAnimState.
	}
	else
	{
		m_SOPlayerAnimState->DoAnimationEvent( event, nData );
	}
}
开发者ID:ThirdEye7,项目名称:situation-outbreak-two,代码行数:22,代码来源:c_so_player.cpp


示例19: MDLCACHE_CRITICAL_SECTION

void C_ASW_Sentry_Top::ASWSentryTracer( const Vector &vecEnd )
{
	MDLCACHE_CRITICAL_SECTION();
	Vector vecStart;
	QAngle vecAngles;

	if ( IsDormant() )
		return;

	C_BaseAnimating::PushAllowBoneAccess( true, false, "sentgun" );

	// Get the muzzle origin
	if ( !GetAttachment( GetMuzzleAttachment(), vecStart, vecAngles ) )
	{
		return;
	}
	
	ASWDoParticleTracer( "tracer_autogun", vecStart, vecEnd, false );

	C_BaseAnimating::PopBoneAccess( "sentgun" );
}
开发者ID:Au-heppa,项目名称:swarm-sdk,代码行数:21,代码来源:c_asw_sentry_top.cpp


示例20: ShouldPredict

void C_ASW_Hack::PostDataUpdate( DataUpdateType_t updateType )
{
	bool bPredict = ShouldPredict();
	if ( bPredict )
	{
		SetSimulatedEveryTick( true );	
		SetPredictionEligible( true );
	}
	else
	{
		SetSimulatedEveryTick( false );
		SetPredictionEligible( false );
	}

	BaseClass::PostDataUpdate( updateType );

	if ( GetPredictable() && !bPredict )
	{
		MDLCACHE_CRITICAL_SECTION();
		ShutdownPredictable();
	}
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:22,代码来源:c_asw_hack.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ MDP3_REG_WRITE函数代码示例发布时间:2022-05-30
下一篇:
C++ MDIGetActive函数代码示例发布时间: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