当前位置: 首页>>代码示例>>C++>>正文


C++ VPROF函数代码示例

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


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

示例1: SpawnAllEntities

void SpawnAllEntities( int nEntities, HierarchicalSpawn_t *pSpawnList, bool bActivateEntities )
{
	int nEntity;
	for (nEntity = 0; nEntity < nEntities; nEntity++)
	{
		VPROF( "MapEntity_ParseAllEntities_Spawn");
		CBaseEntity *pEntity = pSpawnList[nEntity].m_pEntity;

		if ( pSpawnList[nEntity].m_pDeferredParent )
		{
			// UNDONE: Promote this up to the root of this function?
			MDLCACHE_CRITICAL_SECTION();
			CBaseEntity *pParent = pSpawnList[nEntity].m_pDeferredParent;
			int iAttachment = -1;
			CBaseAnimating *pAnim = pParent->GetBaseAnimating();
			if ( pAnim )
			{
				iAttachment = pAnim->LookupAttachment(pSpawnList[nEntity].m_pDeferredParentAttachment);
			}
			pEntity->SetParent( pParent, iAttachment );
		}
		if ( pEntity )
		{
			if (DispatchSpawn(pEntity) < 0)
			{
				for ( int i = nEntity+1; i < nEntities; i++ )
				{
					// this is a child object that will be deleted now
					if ( pSpawnList[i].m_pEntity && pSpawnList[i].m_pEntity->IsMarkedForDeletion() )
					{
						pSpawnList[i].m_pEntity = NULL;
					}
				}
				// Spawn failed.
				gEntList.CleanupDeleteList();
				// Remove the entity from the spawn list
				pSpawnList[nEntity].m_pEntity = NULL;
			}
		}
	}

	if ( bActivateEntities )
	{
		VPROF( "MapEntity_ParseAllEntities_Activate");
		bool bAsyncAnims = mdlcache->SetAsyncLoad( MDLCACHE_ANIMBLOCK, false );
		for (nEntity = 0; nEntity < nEntities; nEntity++)
		{
			CBaseEntity *pEntity = pSpawnList[nEntity].m_pEntity;

			if ( pEntity )
			{
				MDLCACHE_CRITICAL_SECTION();
				pEntity->Activate();
			}
		}
		mdlcache->SetAsyncLoad( MDLCACHE_ANIMBLOCK, bAsyncAnims );
	}
}
开发者ID:Adidasman1,项目名称:source-sdk-2013,代码行数:58,代码来源:mapentities.cpp

示例2: Assert

void CMeshOES2::RenderPass(void)
{
    Assert(m_Type != MATERIAL_HETEROGENOUS);
    VPROF("CMeshOES2::RenderPass");

    int i;
    const CPrimList *pPrim = s_pPrims;
    bool applied = false;
    if (m_Type == MATERIAL_POINTS)
    {
        for (i = 0; i < s_nPrims; ++i, ++pPrim)
        {
            if (!(pPrim->m_NumIndices))
                continue;
            if (!applied)
            {
                applied = true;
                MeshMgr()->ApplyStreamState();
            }
            glDrawArrays(GL_POINTS, 0, pPrim->m_NumIndices);
        }
    }
    else
    {
        MeshMgr()->BindOESBuffer(OES_BUFFER_TARGET_INDEX, m_pIndexBuffer->GetOESBuffer());
        for (i = 0; i < s_nPrims; ++i, ++pPrim)
        {
            if (!(pPrim->m_NumIndices))
                continue;
#ifdef VPROF_ENABLED
            int numPrimitives;
            switch (m_Type)
            {
            case MATERIAL_LINES:
                numPrimitives = pPrim->m_NumIndices >> 1;
                break;
            case MATERIAL_TRIANGLES:
                numPrimitives = pPrim->m_NumIndices / 3;
                break;
            case MATERIAL_TRIANGLE_STRIP:
                numPrimitives = pPrim->m_NumIndices - 2;
                break;
                NO_DEFAULT
            }
            VPROF("glDrawElements");
            VPROF_INCREMENT_COUNTER("DrawElements", 1);
            VPROF_INCREMENT_COUNTER("numPrimitives", numPrimitives);
#endif
            if (!applied)
            {
                applied = true;
                MeshMgr()->ApplyStreamState();
            }
            glDrawElements(m_Mode, pPrim->m_NumIndices, GL_UNSIGNED_SHORT, (void *)(pPrim->m_FirstIndex << 1));
        }
    }
}
开发者ID:TrentSterling,项目名称:D0G,代码行数:57,代码来源:oes2_mesh_static.cpp

示例3: SelectWeightedSequence

int SelectWeightedSequence( CStudioHdr *pstudiohdr, int activity, int curSequence )
{
	VPROF( "SelectWeightedSequence" );
#ifdef CLIENT_DLL
	VPROF_INCREMENT_COUNTER( "Client SelectWeightedSequence", 1 );
#else // ifdef GAME_DLL
	VPROF_INCREMENT_COUNTER( "Server SelectWeightedSequence", 1 );
#endif

	if (! pstudiohdr)
		return 0;

	if (!pstudiohdr->SequencesAvailable())
		return 0;

	VerifySequenceIndex( pstudiohdr );

	int numSeq = pstudiohdr->GetNumSeq();
	if ( numSeq == 1 )
	{
		return ( GetSequenceActivity( pstudiohdr, 0, NULL ) == activity ) ? 0 : ACTIVITY_NOT_AVAILABLE;
	}

	return pstudiohdr->SelectWeightedSequence( activity, curSequence );
}
开发者ID:detoxhby,项目名称:lambdawars,代码行数:25,代码来源:animation.cpp

示例4: VPROF

/**
 * Cache the sequence numbers for the first ACT_HOP activities, since the CS player doesn't have multiple
 * sequences per activity.
 */
int CCSPlayerAnimState::SelectWeightedSequence( Activity activity )
{
	VPROF( "CCSPlayerAnimState::ComputeMainSequence" );

	if ( activity > ACT_CROUCHIDLE || activity < 1 )
	{
		return GetOuter()->SelectWeightedSequence( activity );
	}

	CheckCachedSequenceValidity();

	int sequence = m_sequenceCache[ activity - 1 ];
	if ( sequence < 0 )
	{
		// just in case, look up the sequence if we didn't precache it above
		sequence = m_sequenceCache[ activity - 1 ] = GetOuter()->SelectWeightedSequence( activity );
	}

#if defined(CLIENT_DLL) && defined(_DEBUG)
	int realSequence = GetOuter()->SelectWeightedSequence( activity );
	Assert( realSequence == sequence );
#endif

	return sequence;
}
开发者ID:Asunaya,项目名称:game,代码行数:29,代码来源:cs_playeranimstate.cpp

示例5: VPROF

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : bool - 
//-----------------------------------------------------------------------------
void C_TEMetalSparks::PostDataUpdate( DataUpdateType_t updateType )
{
	VPROF( "C_TEMetalSparks::PostDataUpdate" );

	g_pEffects->MetalSparks( m_vecPos, m_vecDir );
	RecordMetalSparks( m_vecPos, m_vecDir );
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:11,代码来源:c_te_armorricochet.cpp

示例6: VPROF

void IGameSystem::FrameUpdatePostEntityThinkAllSystems()
{
	VPROF("FrameUpdatePostEntityThinkAllSystems");
	SafeRemoveIfDesiredAllSystems();

	InvokePerFrameMethod( &IGameSystemPerFrame::FrameUpdatePostEntityThink );
}
开发者ID:Cre3per,项目名称:hl2sdk-csgo,代码行数:7,代码来源:igamesystem.cpp

示例7: VPROF

//-----------------------------------------------------------------------------
// Purpose: 
// Input  : bool - 
//-----------------------------------------------------------------------------
void C_TEDynamicLight::PostDataUpdate( DataUpdateType_t updateType )
{
	VPROF( "C_TEDynamicLight::PostDataUpdate" );

	CBroadcastRecipientFilter filter;
	TE_DynamicLight( filter, 0.0f, &m_vecOrigin, r, g, b, exponent, m_fRadius, m_fTime, m_fDecay, LIGHT_INDEX_TE_DYNAMIC );
}
开发者ID:0xFEEDC0DE64,项目名称:UltraGame,代码行数:11,代码来源:c_te_dynamiclight.cpp

示例8: VPROF

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_TEWorldDecal::PostDataUpdate( DataUpdateType_t updateType )
{
	VPROF( "C_TEWorldDecal::PostDataUpdate" );

	if ( r_decals.GetInt() )
	{
		C_BaseEntity *ent = cl_entitylist->GetEnt( 0 );
		if ( ent )
		{
			bool bNoBlood = UTIL_IsLowViolence();
			bool bIsBlood = false;

			if ( bNoBlood )
			{
				const char *pchDecalName = decalsystem->GetDecalNameForIndex( m_nIndex );
				if ( pchDecalName && V_stristr( pchDecalName, "blood" ) )
				{
					bIsBlood = true;
				}
			}

			if ( !( bNoBlood && bIsBlood ) )
			{
				effects->DecalShoot( m_nIndex, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), m_vecOrigin, 0, 0 );
			}
		}
	}
	RecordWorldDecal( &m_vecOrigin, m_nIndex );
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:32,代码来源:c_te_worlddecal.cpp

示例9: VPROF

void CPortalGameMovement::TracePlayerBBox( const Vector& start, const Vector& end, unsigned int fMask, int collisionGroup, trace_t& pm )
{
	VPROF( "CGameMovement::TracePlayerBBox" );
	
	CPortal_Player *pPortalPlayer = (CPortal_Player *)((CBaseEntity *)mv->m_nPlayerHandle.Get());

	Ray_t ray;
	ray.Init( start, end, GetPlayerMins(), GetPlayerMaxs() );

#ifdef CLIENT_DLL
	CTraceFilterSimple traceFilter( mv->m_nPlayerHandle.Get(), collisionGroup );
#else
	CTraceFilterSimple baseFilter( mv->m_nPlayerHandle.Get(), collisionGroup );
	CTraceFilterTranslateClones traceFilter( &baseFilter );
#endif

	UTIL_Portal_TraceRay_With( pPortalPlayer->m_hPortalEnvironment, ray, fMask, &traceFilter, &pm );

	// If we're moving through a portal and failed to hit anything with the above ray trace
	// Use UTIL_Portal_TraceEntity to test this movement through a portal and override the trace with the result
	if ( pm.fraction == 1.0f && UTIL_DidTraceTouchPortals( ray, pm ) && sv_player_trace_through_portals.GetBool() )
	{
		trace_t tempTrace;
		UTIL_Portal_TraceEntity( pPortalPlayer, start, end, fMask, &traceFilter, &tempTrace );

		if ( tempTrace.DidHit() && tempTrace.fraction < pm.fraction && !tempTrace.startsolid && !tempTrace.allsolid )
		{
			pm = tempTrace;
		}
	}
}
开发者ID:RubberWar,项目名称:Portal-2,代码行数:31,代码来源:portal_gamemovement.cpp

示例10: VPROF

//-----------------------------------------------------------------------------
// Inherited from IParticleSystemQuery
//-----------------------------------------------------------------------------
void CParticleSystemQuery::GetLightingAtPoint( const Vector& vecOrigin, Color &cTint )
{
	VPROF("CParticleSystemQuery::GetLightingAtPoint");
#ifdef GAME_DLL

	// FIXME: Go through to the engine from the server to get these values
	cTint.SetColor( 255, 255, 255, 255 );

#else

	if ( engine->IsInGame() )
	{
		s_LightMutex.Lock();
		// Compute our lighting at our position
		Vector totalColor = engine->GetLightForPoint( vecOrigin, true );
		s_LightMutex.Unlock();

		// Get our lighting information
		cTint.SetColor( totalColor.x*255, totalColor.y*255, totalColor.z*255, 0 );
	}
	else
	{
		// FIXME: Go through to the engine from the server to get these values
		cTint.SetColor( 255, 255, 255, 255 );
 	}

#endif
}
开发者ID:gamenew09,项目名称:SourceSDK2010,代码行数:31,代码来源:particlesystemquery.cpp

示例11: VPROF

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_TETFParticleEffect::PostDataUpdate( DataUpdateType_t updateType )
{
	VPROF( "C_TETFParticleEffect::PostDataUpdate" );

	CEffectData	data;

	data.m_nHitBox = m_iParticleSystemIndex;

	data.m_vOrigin = m_vecOrigin;
	data.m_vStart = m_vecStart;
	data.m_vAngles = m_vecAngles;

	if ( m_hEntity != INVALID_EHANDLE_INDEX )
	{
		data.m_hEntity = m_hEntity;
		data.m_fFlags |= PARTICLE_DISPATCH_FROM_ENTITY;
	}
	else
	{
		data.m_hEntity = NULL;
	}

	data.m_nDamageType = m_iAttachType;
	data.m_nAttachmentIndex = m_iAttachmentPointIndex;

	if ( m_bResetParticles )
	{
		data.m_fFlags |= PARTICLE_DISPATCH_RESET_PARTICLES;
	}

	DispatchEffect( "ParticleEffect", data );
}
开发者ID:Axitonium,项目名称:SourceEngine2007,代码行数:35,代码来源:tf_fx_particleeffect.cpp

示例12: VPROF

//-----------------------------------------------------------------------------
// Purpose: 
//-----------------------------------------------------------------------------
void C_TEPhysicsProp::PostDataUpdate( DataUpdateType_t updateType )
{
	VPROF( "C_TEPhysicsProp::PostDataUpdate" );

	tempents->PhysicsProp( m_nModelIndex, m_nSkin, m_vecOrigin, m_angRotation, m_vecVelocity, m_nFlags, m_nEffects );
	RecordPhysicsProp( m_vecOrigin, m_angRotation, m_vecVelocity, m_nModelIndex, m_nFlags, m_nSkin, m_nEffects );
}
开发者ID:BenLubar,项目名称:SwarmDirector2,代码行数:10,代码来源:c_te_physicsprop.cpp

示例13: GameStartFrame

void GameStartFrame( void )
{
    VPROF( "GameStartFrame" );

    if ( g_pGameRules )
        g_pGameRules->Think();
}
开发者ID:jlwitthuhn,项目名称:DoubleAction,代码行数:7,代码来源:sdk_client.cpp

示例14: LookupSequence

//-----------------------------------------------------------------------------
// Purpose: Looks up a sequence by sequence name first, then by activity name.
// Input  : label - The sequence name or activity name to look up.
// Output : Returns the sequence index of the matching sequence, or ACT_INVALID.
//-----------------------------------------------------------------------------
int LookupSequence( CStudioHdr *pstudiohdr, const char *label )
{
	VPROF( "LookupSequence" );

	if (! pstudiohdr)
		return 0;

	if (!pstudiohdr->SequencesAvailable())
		return 0;

	//
	// Look up by sequence name.
	//
	for (int i = 0; i < pstudiohdr->GetNumSeq(); i++)
	{
		mstudioseqdesc_t	&seqdesc = pstudiohdr->pSeqdesc( i );
		if (stricmp( seqdesc.pszLabel(), label ) == 0)
			return i;
	}

	//
	// Not found, look up by activity name.
	//
	int nActivity = LookupActivity( pstudiohdr, label );
	if (nActivity != ACT_INVALID )
	{
		return SelectWeightedSequence( pstudiohdr, nActivity );
	}

	return ACT_INVALID;
}
开发者ID:Au-heppa,项目名称:source-sdk-2013,代码行数:36,代码来源:animation.cpp

示例15: VPROF

void CBaseShader::DrawElements( IMaterialVar **ppParams, int nModulationFlags,
	IShaderShadow* pShaderShadow, IShaderDynamicAPI* pShaderAPI )
{
	VPROF("CBaseShader::DrawElements");
	// Re-entrancy check
	Assert( !s_ppParams );

	s_ppParams = ppParams;
	s_pShaderAPI = pShaderAPI;
	s_pShaderShadow = pShaderShadow;
	s_nModulationFlags = nModulationFlags;
	s_pMeshBuilder = IsXbox() ? NULL : (pShaderAPI ? pShaderAPI->GetVertexModifyBuilder() : NULL);

	if ( IsSnapshotting() )
	{
		// Set up the shadow state
		SetInitialShadowState( );
	}

	OnDrawElements( ppParams, pShaderShadow, pShaderAPI );

	s_nModulationFlags = 0;
	s_ppParams = NULL;
	s_pShaderAPI = NULL;
	s_pShaderShadow = NULL;
	s_pMeshBuilder = NULL;
}
开发者ID:Bubbasacs,项目名称:FinalProj,代码行数:27,代码来源:baseshader.cpp


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