本文整理汇总了C++中MDLCACHE_CRITICAL_SECTION函数的典型用法代码示例。如果您正苦于以下问题:C++ MDLCACHE_CRITICAL_SECTION函数的具体用法?C++ MDLCACHE_CRITICAL_SECTION怎么用?C++ MDLCACHE_CRITICAL_SECTION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MDLCACHE_CRITICAL_SECTION函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
}
示例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 );
}
}
示例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 );
}
}
示例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)();
}
}
示例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();
}
}
示例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)();
}
}
示例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 );
}
}
}
示例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]);
}
}
示例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 ));
}
}
示例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)();
}
}
示例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();
}
示例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();
}
}
示例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;
}
示例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)();
}
}