这篇教程C++ MDLCACHE_CRITICAL_SECTION函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中MDLCACHE_CRITICAL_SECTION函数的典型用法代码示例。如果您正苦于以下问题:C++ MDLCACHE_CRITICAL_SECTION函数的具体用法?C++ MDLCACHE_CRITICAL_SECTION怎么用?C++ MDLCACHE_CRITICAL_SECTION使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了MDLCACHE_CRITICAL_SECTION函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,
示例2: RecvProxy_SequenceNumvoid 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,
示例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,
示例4: SafeRemoveIfDesiredAllSystemsvoid 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,
示例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,
示例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,
示例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,
示例8: Q_memsetvoid 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,
示例9: UpdateModelWidthScalevoid 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,
示例10: MDLCACHE_CRITICAL_SECTIONvoid 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,
示例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,
示例12: entDataconst 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,
示例13: VPROF_BUDGETvoid 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,
示例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,
示例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,
示例16: MDLCACHE_CRITICAL_SECTIONvoid 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,
示例17: RecvProxy_SequenceNumvoid 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,
示例18: MDLCACHE_CRITICAL_SECTION// Add support for CS:S player animationsvoid 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,
示例19: MDLCACHE_CRITICAL_SECTIONvoid 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,
示例20: ShouldPredictvoid 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,
示例21: DestroyModelbool SEditModelRender::LoadModel( const char *localPath ){ DestroyModel(); const model_t *mdl = modelinfo->FindOrLoadModel( localPath ); if ( !mdl ) return false; Q_strcpy( m_szModelPath, localPath ); C_BaseFlex *pEnt = new C_BaseFlex(); pEnt->InitializeAsClientEntity( NULL,#ifdef SWARM_DLL false#else RENDER_GROUP_OPAQUE_ENTITY#endif ); MDLCACHE_CRITICAL_SECTION(); pEnt->SetModelPointer( mdl ); pEnt->Spawn(); pEnt->SetAbsAngles( vec3_angle ); pEnt->SetAbsOrigin( vec3_origin ); pEnt->AddEffects( EF_NODRAW | EF_NOINTERP ); pEnt->m_EntClientFlags |= ENTCLIENTFLAG_DONTUSEIK; // leave it alone. pEnt->RemoveFromLeafSystem(); cl_entitylist->RemoveEntity( pEnt->GetRefEHandle() ); pEnt->CollisionProp()->DestroyPartitionHandle(); CStudioHdr *pHdr = pEnt->GetModelPtr(); m_iNumPoseParams = pHdr ? pHdr->GetNumPoseParameters() : 0; pModelInstance = pEnt; return true;}
开发者ID:InfoSmart,项目名称:InSource,代码行数:39,
示例22: InvokeMethod//-----------------------------------------------------------------------------// Invokes a method on all installed game systems in proper order//-----------------------------------------------------------------------------void InvokeMethod( GameSystemFunc_t f, char const *timed /*=0*/ ){#if defined( _XBOX )#if !defined( _RETAIL ) char sz[ 128 ];#endif#else NOTE_UNUSED( timed );#endif int i; int c = s_GameSystems.Count(); for ( i = 0; i < c ; ++i ) { IGameSystem *sys = s_GameSystems[i]; MDLCACHE_CRITICAL_SECTION();#if !defined( _RETAIL )#if defined( _XBOX ) if ( timed ) { Q_snprintf( sz, sizeof( sz ), "%s->%s():Start", sys->Name(), timed ); XBX_rTimeStampLog( Plat_FloatTime(), sz ); }#endif#endif (sys->*f)();#if !defined( _RETAIL )#if defined( _XBOX ) if ( timed ) { Q_snprintf( sz, sizeof( sz ), "%s->%s():Finish", sys->Name(), timed ); XBX_rTimeStampLog( Plat_FloatTime(), sz ); }#endif#endif }}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:41,
示例23: SetMoveTypevoid CBasePlayer::SharedSpawn(){ SetMoveType( MOVETYPE_WALK ); SetSolid( SOLID_BBOX ); AddSolidFlags( FSOLID_NOT_STANDABLE ); SetFriction( 1.0f ); pl.deadflag = false; m_lifeState = LIFE_ALIVE; m_iHealth = 100; m_takedamage = DAMAGE_YES; m_Local.m_bDrawViewmodel = true; m_Local.m_flStepSize = sv_stepsize.GetFloat(); m_Local.m_bAllowAutoMovement = true; m_nRenderFX = kRenderFxNone; m_flNextAttack = gpGlobals->curtime; m_flMaxspeed = 0.0f; MDLCACHE_CRITICAL_SECTION(); SetSequence( SelectWeightedSequence( ACT_IDLE ) ); if ( GetFlags() & FL_DUCKING ) SetCollisionBounds( VEC_DUCK_HULL_MIN, VEC_DUCK_HULL_MAX ); else SetCollisionBounds( VEC_HULL_MIN, VEC_HULL_MAX ); // dont let uninitialized value here hurt the player m_Local.m_flFallVelocity = 0; SetBloodColor( BLOOD_COLOR_RED ); // NVNT inform haptic dll we have just spawned local player#ifdef CLIENT_DLL if(IsLocalPlayer() &&haptics) haptics->LocalPlayerReset();#endif}
开发者ID:EspyEspurr,项目名称:game,代码行数:38,
示例24: SpawnBuzzerAboveMevoid SpawnBuzzerAboveMe( const CCommand &args ){ if ( args.ArgC() < 2 ) { Msg( "Format: asw_spawn_buzzer <z height above marine>/n" ); return; } MDLCACHE_CRITICAL_SECTION(); bool allowPrecache = CBaseEntity::IsPrecacheAllowed(); CBaseEntity::SetAllowPrecache( true ); // Try to create entity CBaseEntity *entity = dynamic_cast< CBaseEntity * >( CreateEntityByName( "asw_buzzer" ) ); if (entity) { entity->Precache(); // Now attempt to drop into the world CASW_Player* pPlayer = ToASW_Player( UTIL_GetCommandClient() ); if (!pPlayer) return; CASW_Marine *pMarine = pPlayer->GetMarine(); if ( !pMarine ) return; Vector vecPos = pMarine->GetAbsOrigin(); vecPos.z += atof( args[1] ); entity->Teleport( &vecPos, NULL, NULL ); DispatchSpawn(entity); } CBaseEntity::SetAllowPrecache( allowPrecache );}
开发者ID:Nightgunner5,项目名称:Jastian-Summer,代码行数:36,
示例25: MDLCACHE_CRITICAL_SECTIONvoid C_BaseAnimatingOverlay::DoAnimationEvents( CStudioHdr *pStudioHdr ){ if ( !pStudioHdr || !pStudioHdr->SequencesAvailable() ) return; MDLCACHE_CRITICAL_SECTION(); int nSequences = pStudioHdr->GetNumSeq(); BaseClass::DoAnimationEvents( pStudioHdr ); bool watch = false; // Q_strstr( hdr->name, "rifle" ) ? true : false; CheckForLayerChanges( pStudioHdr, gpGlobals->curtime ); // !!! int j; for (j = 0; j < m_AnimOverlay.Count(); j++) { if ( m_AnimOverlay[j].m_nSequence >= nSequences ) { continue; } mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( m_AnimOverlay[j].m_nSequence ); if ( seqdesc.numevents == 0 ) continue; // stalled? if (m_AnimOverlay[j].m_flCycle == m_flOverlayPrevEventCycle[j]) continue; // check for looping BOOL bLooped = false; if (m_AnimOverlay[j].m_flCycle <= m_flOverlayPrevEventCycle[j]) { if (m_flOverlayPrevEventCycle[j] - m_AnimOverlay[j].m_flCycle > 0.5) { bLooped = true; } else { // things have backed up, which is bad since it'll probably result in a hitch in the animation playback // but, don't play events again for the same time slice return; } } mstudioevent_t *pevent = seqdesc.pEvent( 0 ); // This makes sure events that occur at the end of a sequence occur are // sent before events that occur at the beginning of a sequence. if (bLooped) { for (int i = 0; i < (int)seqdesc.numevents; i++) { // ignore all non-client-side events if ( pevent[i].type & AE_TYPE_NEWEVENTSYSTEM ) { //TGB: added shared //if ( !( pevent[i].type & AE_TYPE_CLIENT ) ) if ( !( pevent[i].type & AE_TYPE_CLIENT|AE_TYPE_SHARED ) ) continue; } else if ( pevent[i].event < 5000 ) //Adrian - Support the old event system continue; if ( pevent[i].cycle <= m_flOverlayPrevEventCycle[j] ) continue; if ( watch ) { Msg( "%i FE %i Looped cycle %f, prev %f ev %f (time %.3f)/n", gpGlobals->tickcount, pevent[i].event, pevent[i].cycle, m_flOverlayPrevEventCycle[j], m_AnimOverlay[j].m_flCycle, gpGlobals->curtime ); } FireEvent( GetAbsOrigin(), GetAbsAngles(), pevent[ i ].event, pevent[ i ].pszOptions() ); } // Necessary to get the next loop working m_flOverlayPrevEventCycle[j] = -0.01; } for (int i = 0; i < (int)seqdesc.numevents; i++) { if ( pevent[i].type & AE_TYPE_NEWEVENTSYSTEM ) { //TGB: added shared //if ( !( pevent[i].type & AE_TYPE_CLIENT ) ) if ( !( pevent[i].type & AE_TYPE_CLIENT|AE_TYPE_SHARED ) ) continue; } else if ( pevent[i].event < 5000 ) //Adrian - Support the old event system continue;//.........这里部分代码省略.........
开发者ID:TotallyMehis,项目名称:ZM-Updated,代码行数:101,
示例26: while//-----------------------------------------------------------------------------// Invokes methods on all installed game systems//-----------------------------------------------------------------------------bool IGameSystem::InitAllSystems(){ int i; { // first add any auto systems to the end CAutoGameSystem *pSystem = s_pSystemList; while ( pSystem ) { if ( s_GameSystems.Find( pSystem ) == s_GameSystems.InvalidIndex() ) { Add( pSystem ); } else { DevWarning( 1, "AutoGameSystem already added to game system list!!!/n" ); } pSystem = pSystem->m_pNext; } s_pSystemList = NULL; } { CAutoGameSystemPerFrame *pSystem = s_pPerFrameSystemList; while ( pSystem ) { if ( s_GameSystems.Find( pSystem ) == s_GameSystems.InvalidIndex() ) { Add( pSystem ); } else { DevWarning( 1, "AutoGameSystem already added to game system list!!!/n" ); } pSystem = pSystem->m_pNext; } s_pSystemList = NULL; } // Now remember that we are initted so new CAutoGameSystems will add themselves automatically. s_bSystemsInitted = true; for ( i = 0; i < s_GameSystems.Count(); ++i ) { MDLCACHE_CRITICAL_SECTION(); IGameSystem *sys = s_GameSystems[i];#if defined( _X360 ) char sz[128]; Q_snprintf( sz, sizeof( sz ), "%s->Init():Start", sys->Name() ); XBX_rTimeStampLog( Plat_FloatTime(), sz );#endif bool valid = sys->Init();#if defined( _X360 ) Q_snprintf( sz, sizeof( sz ), "%s->Init():Finish", sys->Name() ); XBX_rTimeStampLog( Plat_FloatTime(), sz );#endif if ( !valid ) return false; } return true;}
开发者ID:AluminumKen,项目名称:hl2sb-src,代码行数:68,
示例27: defined//-----------------------------------------------------------------------------// This is called by the base object when it's time to spawn the control panels//-----------------------------------------------------------------------------void CBaseViewModel::SpawnControlPanels(){#if defined( VGUI_CONTROL_PANELS ) char buf[64]; // Destroy existing panels DestroyControlPanels(); CBaseCombatWeapon *weapon = m_hWeapon.Get(); if ( weapon == NULL ) { return; } MDLCACHE_CRITICAL_SECTION(); // FIXME: Deal with dynamically resizing control panels? // If we're attached to an entity, spawn control panels on it instead of use CBaseAnimating *pEntityToSpawnOn = this; char *pOrgLL = "controlpanel%d_ll"; char *pOrgUR = "controlpanel%d_ur"; char *pAttachmentNameLL = pOrgLL; char *pAttachmentNameUR = pOrgUR; /* if ( IsBuiltOnAttachment() ) { pEntityToSpawnOn = dynamic_cast<CBaseAnimating*>((CBaseEntity*)m_hBuiltOnEntity.Get()); if ( pEntityToSpawnOn ) { char sBuildPointLL[64]; char sBuildPointUR[64]; Q_snprintf( sBuildPointLL, sizeof( sBuildPointLL ), "bp%d_controlpanel%%d_ll", m_iBuiltOnPoint ); Q_snprintf( sBuildPointUR, sizeof( sBuildPointUR ), "bp%d_controlpanel%%d_ur", m_iBuiltOnPoint ); pAttachmentNameLL = sBuildPointLL; pAttachmentNameUR = sBuildPointUR; } else { pEntityToSpawnOn = this; } } */ Assert( pEntityToSpawnOn ); // Lookup the attachment point... int nPanel; for ( nPanel = 0; true; ++nPanel ) { Q_snprintf( buf, sizeof( buf ), pAttachmentNameLL, nPanel ); int nLLAttachmentIndex = pEntityToSpawnOn->LookupAttachment(buf); if (nLLAttachmentIndex <= 0) { // Try and use my panels then pEntityToSpawnOn = this; Q_snprintf( buf, sizeof( buf ), pOrgLL, nPanel ); nLLAttachmentIndex = pEntityToSpawnOn->LookupAttachment(buf); if (nLLAttachmentIndex <= 0) return; } Q_snprintf( buf, sizeof( buf ), pAttachmentNameUR, nPanel ); int nURAttachmentIndex = pEntityToSpawnOn->LookupAttachment(buf); if (nURAttachmentIndex <= 0) { // Try and use my panels then Q_snprintf( buf, sizeof( buf ), pOrgUR, nPanel ); nURAttachmentIndex = pEntityToSpawnOn->LookupAttachment(buf); if (nURAttachmentIndex <= 0) return; } const char *pScreenName; weapon->GetControlPanelInfo( nPanel, pScreenName ); if (!pScreenName) continue; const char *pScreenClassname; weapon->GetControlPanelClassName( nPanel, pScreenClassname ); if ( !pScreenClassname ) continue; // Compute the screen size from the attachment points... matrix3x4_t panelToWorld; pEntityToSpawnOn->GetAttachment( nLLAttachmentIndex, panelToWorld ); matrix3x4_t worldToPanel; MatrixInvert( panelToWorld, worldToPanel ); // Now get the lower right position + transform into panel space Vector lr, lrlocal; pEntityToSpawnOn->GetAttachment( nURAttachmentIndex, panelToWorld ); MatrixGetColumn( panelToWorld, 3, lr ); VectorTransform( lr, worldToPanel, lrlocal );//.........这里部分代码省略.........
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:101,
示例28: Assertvoid CCSPlayerAnimState::DoAnimationEvent( PlayerAnimEvent_t event, int nData ){ Assert( event != PLAYERANIMEVENT_THROW_GRENADE ); MDLCACHE_CRITICAL_SECTION(); switch ( event ) { case PLAYERANIMEVENT_FIRE_GUN_PRIMARY: case PLAYERANIMEVENT_FIRE_GUN_SECONDARY: // Regardless of what we're doing in the fire layer, restart it. m_flFireCycle = 0; m_iFireSequence = CalcFireLayerSequence( event ); m_bFiring = m_iFireSequence != -1; // If we are interrupting a (shotgun) reload, cancel the reload, and fire next frame. if ( m_bFiring && m_bReloading ) { m_bReloading = false; m_iReloadSequence = -1; m_delayedFire = event; m_bFiring = false; m_iFireSequence = -1; CAnimationLayer *pLayer = m_pOuter->GetAnimOverlay( RELOADSEQUENCE_LAYER ); if ( pLayer ) { pLayer->m_flWeight = 0.0f; pLayer->m_nOrder = 15; } }#ifdef CLIENT_DLL if ( m_bFiring && !m_bReloading ) { if ( m_pPlayer ) { m_pPlayer->ProcessMuzzleFlashEvent(); } }#endif break; case PLAYERANIMEVENT_JUMP: // Play the jump animation. m_bJumping = true; m_bFirstJumpFrame = true; m_flJumpStartTime = gpGlobals->curtime; break; case PLAYERANIMEVENT_RELOAD: { // ignore normal reload events for shotguns - they get sent to trigger sounds etc only CWeaponCSBase *pWeapon = m_pHelpers->CSAnim_GetActiveWeapon(); if ( pWeapon && pWeapon->GetCSWpnData().m_WeaponType != WEAPONTYPE_SHOTGUN ) { m_iReloadSequence = CalcReloadLayerSequence( event ); if ( m_iReloadSequence != -1 ) { m_bReloading = true; m_flReloadCycle = 0; } else { m_bReloading = false; } } } break; case PLAYERANIMEVENT_RELOAD_START: case PLAYERANIMEVENT_RELOAD_LOOP: // Set the hold time for _start and _loop anims, then fall through to the _end case m_flReloadHoldEndTime = gpGlobals->curtime + 0.75f; case PLAYERANIMEVENT_RELOAD_END: { // ignore shotgun reload events for non-shotguns CWeaponCSBase *pWeapon = m_pHelpers->CSAnim_GetActiveWeapon(); if ( pWeapon && pWeapon->GetCSWpnData().m_WeaponType != WEAPONTYPE_SHOTGUN ) { m_flReloadHoldEndTime = 0.0f; // clear this out in case we set it in _START or _LOOP above } else { m_iReloadSequence = CalcReloadLayerSequence( event ); if ( m_iReloadSequence != -1 ) { m_bReloading = true; m_flReloadCycle = 0; } else { m_bReloading = false; } } } break; default://.........这里部分代码省略.........
开发者ID:Asunaya,项目名称:game,代码行数:101,
示例29: while//-----------------------------------------------------------------------------// Purpose: fires off any events in the queue who's fire time is (or before) the present time//-----------------------------------------------------------------------------void CEventQueue::ServiceEvents( void ){ if (!CBaseEntity::Debug_ShouldStep()) { return; } EventQueuePrioritizedEvent_t *pe = m_Events.m_pNext; while ( pe != NULL && pe->m_flFireTime <= gpGlobals->curtime ) { MDLCACHE_CRITICAL_SECTION(); bool targetFound = false; // find the targets if ( pe->m_iTarget != NULL_STRING ) { // In the context the event, the searching entity is also the caller CBaseEntity *pSearchingEntity = pe->m_pCaller; CBaseEntity *target = NULL; while ( 1 ) { target = gEntList.FindEntityByName( target, pe->m_iTarget, pSearchingEntity, pe->m_pActivator, pe->m_pCaller ); if ( !target ) break; // pump the action into the target target->AcceptInput( STRING(pe->m_iTargetInput), pe->m_pActivator, pe->m_pCaller, pe->m_VariantValue, pe->m_iOutputID ); targetFound = true; } } // direct pointer if ( pe->m_pEntTarget != NULL ) { pe->m_pEntTarget->AcceptInput( STRING(pe->m_iTargetInput), pe->m_pActivator, pe->m_pCaller, pe->m_VariantValue, pe->m_iOutputID ); targetFound = true; } if ( !targetFound ) { // See if we can find a target if we treat the target as a classname if ( pe->m_iTarget != NULL_STRING ) { CBaseEntity *target = NULL; while ( 1 ) { target = gEntList.FindEntityByClassname( target, STRING(pe->m_iTarget) ); if ( !target ) break; // pump the action into the target target->AcceptInput( STRING(pe->m_iTargetInput), pe->m_pActivator, pe->m_pCaller, pe->m_VariantValue, pe->m_iOutputID ); targetFound = true; } } } if ( !targetFound ) { const char *pClass ="", *pName = ""; // might be NULL if ( pe->m_pCaller ) { pClass = STRING(pe->m_pCaller->m_iClassname); pName = STRING(pe->m_pCaller->GetEntityName()); } char szBuffer[256]; Q_snprintf( szBuffer, sizeof(szBuffer), "unhandled input: (%s) -> (%s), from (%s,%s); target entity not found/n", STRING(pe->m_iTargetInput), STRING(pe->m_iTarget), pClass, pName ); DevMsg( 2, "%s", szBuffer ); ADD_DEBUG_HISTORY( HISTORY_ENTITY_IO, szBuffer ); } // remove the event from the list (remembering that the queue may have been added to) RemoveEvent( pe ); delete pe; // // If we are in debug mode, exit the loop if we have fired the correct number of events. // if (CBaseEntity::Debug_IsPaused()) { if (!CBaseEntity::Debug_Step()) { break; } } // restart the list (to catch any new items have probably been added to the queue) pe = m_Events.m_pNext; }}
开发者ID:FlaminSarge,项目名称:source-sdk-2013,代码行数:98,
示例30: GetColorModulation//-----------------------------------------------------------------------------// Purpose: Render the weapon. Draw the Viewmodel if the weapon's being carried// by this player, otherwise draw the worldmodel.//-----------------------------------------------------------------------------int C_BaseViewModel::DrawModel( int flags, const RenderableInstance_t &instance ){ if ( !m_bReadyToDraw ) return 0; if ( flags & STUDIO_RENDER ) { // Determine blending amount and tell engine float blend = (float)( instance.m_nAlpha / 255.0f ); // Totally gone if ( blend <= 0.0f ) return 0; // Tell engine render->SetBlend( blend ); float color[3]; GetColorModulation( color ); render->SetColorModulation( color ); } CMatRenderContextPtr pRenderContext( materials ); if ( ShouldFlipViewModel() ) pRenderContext->CullMode( MATERIAL_CULLMODE_CW ); int ret = 0; C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer(); C_BaseCombatWeapon *pWeapon = GetOwningWeapon(); // If the local player's overriding the viewmodel rendering, let him do it if ( pPlayer && pPlayer->IsOverridingViewmodel() ) { ret = pPlayer->DrawOverriddenViewmodel( this, flags, instance ); } else if ( pWeapon && pWeapon->IsOverridingViewmodel() ) { ret = pWeapon->DrawOverriddenViewmodel( this, flags, instance ); } else { ret = BaseClass::DrawModel( flags, instance ); } pRenderContext->CullMode( MATERIAL_CULLMODE_CCW ); // Now that we've rendered, reset the animation restart flag if ( flags & STUDIO_RENDER ) { if ( m_nOldAnimationParity != m_nAnimationParity ) { m_nOldAnimationParity = m_nAnimationParity; } // Tell the weapon itself that we've rendered, in case it wants to do something if ( pWeapon ) { pWeapon->ViewModelDrawn( this ); } if ( vm_debug.GetBool() ) { MDLCACHE_CRITICAL_SECTION(); int line = 16; CStudioHdr *hdr = GetModelPtr(); engine->Con_NPrintf( line++, "%s: %s(%d), cycle: %.2f cyclerate: %.2f playbackrate: %.2f/n", (hdr)?hdr->pszName():"(null)", GetSequenceName( GetSequence() ), GetSequence(), GetCycle(), GetSequenceCycleRate( hdr, GetSequence() ), GetPlaybackRate() ); if ( hdr ) { for( int i=0; i < hdr->GetNumPoseParameters(); ++i ) { const mstudioposeparamdesc_t &Pose = hdr->pPoseParameter( i ); engine->Con_NPrintf( line++, "pose_param %s: %f", Pose.pszName(), GetPoseParameter( i ) ); } } // Determine blending amount and tell engine float blend = (float)( instance.m_nAlpha / 255.0f ); float color[3]; GetColorModulation( color ); engine->Con_NPrintf( line++, "blend=%f, color=%f,%f,%f", blend, color[0], color[1], color[2] ); engine->Con_NPrintf( line++, "GetRenderMode()=%d", GetRenderMode() ); engine->Con_NPrintf( line++, "m_nRenderFX=0x%8.8X", GetRenderFX() ); color24 c = GetRenderColor(); unsigned char a = GetRenderAlpha(); engine->Con_NPrintf( line++, "rendercolor=%d,%d,%d,%d", c.r, c.g, c.b, a );//.........这里部分代码省略.........
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:101,
注:本文中的MDLCACHE_CRITICAL_SECTION函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ MDP3_REG_WRITE函数代码示例 C++ MDIGetActive函数代码示例 |