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

C++ FUNCTION_PROFILER函数代码示例

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

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



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

示例1: FUNCTION_PROFILER

void CPlayerStateSwim_WaterTestProxy::RayTestBottomLevel( const CPlayer& player, const Vec3& referencePosition, float maxRelevantDepth )
{
	FUNCTION_PROFILER(gEnv->pSystem, PROFILE_GAME);

	const float terrainWorldZ = gEnv->p3DEngine->GetTerrainElevation(referencePosition.x, referencePosition.y);

	int rayFlags = geom_colltype_player<<rwi_colltype_bit | rwi_stop_at_pierceable;
	int entityFlags = ent_terrain|ent_static|ent_sleeping_rigid|ent_rigid;
	const float padding = 0.2f;
	// NOTE: Terrain is above m_referencePos, so m_referencePos is probably inside a voxel or something.
	const float fPosWorldDiff = referencePosition.z - terrainWorldZ;
	float rayLength = (float)__fsel(fPosWorldDiff, min(maxRelevantDepth, fPosWorldDiff), maxRelevantDepth) + (padding * 2.0f);

	//We should not have entered this function if still waiting for the last result
	CRY_ASSERT(m_bottomLevelRayID == 0); 

	m_bottomLevelRayID = g_pGame->GetRayCaster().Queue(
		player.IsClient() ? RayCastRequest::HighPriority : RayCastRequest::MediumPriority,
		RayCastRequest(referencePosition + Vec3(0,0,padding), Vec3(0,0,-rayLength),
		entityFlags,
		rayFlags,
		0,
		0),
		functor(*this, &CPlayerStateSwim_WaterTestProxy::OnRayCastBottomLevelDataReceived));
}
开发者ID:aronarts,项目名称:FireNET,代码行数:25,代码来源:PlayerStateSwim_WaterTestProxy.cpp


示例2: FUNCTION_PROFILER

/*static*/ void CHUDEventDispatcher::CallEvent( const SHUDEvent& event )
{
#if !defined(DEDICATED_SERVER)
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);
	CRY_ASSERT_MESSAGE(s_safe, "HUD: Can't send HUDEvent whilst initialising the HUD! i.e. from CHUDObject() or CHUDObject::Init()!" );
	if( s_safe )
	{
		s_stlSafe = false;
		THUDEventListeners& listeners = s_eventVec[event.eventType];
		THUDEventListeners::const_iterator it = listeners.begin();
		THUDEventListeners::const_iterator end = listeners.end();
		for(; it!=end; ++it)
		{
			IHUDEventListener* listener = *it;
			SOFTCODE_RETRY(listener, listener->OnHUDEvent(event));
		}
		s_stlSafe = true;
	}
	else
	{
		// HUD Event Sending is now unsafe and should not be done!
		// If you want to send HUD Events on initialization then use OnHUDLoadDone.
		return;
	}
#endif
}
开发者ID:PiratesAhoy,项目名称:HeartsOfOak-Core,代码行数:26,代码来源:HUDEventDispatcher.cpp


示例3: FUNCTION_PROFILER

//------------------------------------------------------------------------
void CGameRules::ClientHit(const HitInfo &hitInfo)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	IActor *pClientActor = g_pGame->GetIGameFramework()->GetClientActor();
	IActor *pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(hitInfo.targetId);
	
	if(pActor == pClientActor)
		if (gEnv->pInput) gEnv->pInput->ForceFeedbackEvent( SFFOutputEvent(eDI_XI, eFF_Rumble_Basic, 0.5f * hitInfo.damage * 0.01f, hitInfo.damage * 0.02f, 0.0f));

	CreateScriptHitInfo(m_scriptHitInfo, hitInfo);
	CallScript(m_clientStateScript, "OnHit", m_scriptHitInfo);

	bool backface = hitInfo.dir.Dot(hitInfo.normal)>0;
	if (!hitInfo.remote && hitInfo.targetId && !backface)
	{
		if (!gEnv->bServer)
		{
			GetGameObject()->InvokeRMI(SvRequestHit(), hitInfo, eRMI_ToServer);
		}
		else
		{
			ServerHit(hitInfo);
		}

		if(gEnv->IsClient())
			ProcessLocalHit(hitInfo);
	}
}
开发者ID:jjiezheng,项目名称:oohh,代码行数:30,代码来源:GameRulesClientServer.cpp


示例4: FUNCTION_PROFILER

//------------------------------------------------------------------------
void CVehicleDamagesGroup::Update(float frameTime)
{
  FUNCTION_PROFILER( gEnv->pSystem, PROFILE_ACTION );
  
	TDelayedDamagesSubGroupList::iterator ite = m_delayedSubGroups.begin();
	TDelayedDamagesSubGroupList::iterator next;
  for (; ite != m_delayedSubGroups.end(); ite = next)
	{
		next = ite; ++next;

		SDelayedDamagesSubGroupInfo& delayedInfo = *ite;
		delayedInfo.delay -= frameTime;

		if (delayedInfo.delay <= 0.0f)
		{
			TDamagesSubGroupId id = delayedInfo.subGroupId;
			SDamagesSubGroup* pSubGroup = &m_damageSubGroups[id];
			delayedInfo.behaviorParams.randomness = pSubGroup->m_randomness;
			TVehicleDamageBehaviorVector& damageBehaviors =  pSubGroup->m_damageBehaviors;

			for (TVehicleDamageBehaviorVector::iterator behaviorIte = damageBehaviors.begin(); behaviorIte != damageBehaviors.end(); ++behaviorIte)
			{
				IVehicleDamageBehavior* pBehavior = *behaviorIte;
				pBehavior->OnDamageEvent(eVDBE_ComponentDestroyed, delayedInfo.behaviorParams);
			}

      m_delayedSubGroups.erase(ite);
		}        
	}

  if (!m_delayedSubGroups.empty())
    m_pVehicle->NeedsUpdate();
}
开发者ID:aronarts,项目名称:FireNET,代码行数:34,代码来源:VehicleDamagesGroup.cpp


示例5: FUNCTION_PROFILER

void CGameQueryListener::GetCurrentServers(char*** pastrServers, int &o_amount)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_NETWORK);
	if(m_servers.size() == 0)
	{
		o_amount = 0;
		return;
	}
	o_amount = m_servers.size();

	if(o_amount > m_iServers)// || o_amount < 0.1f*m_iServers)
	{
		for(int iServer=0; iServer<m_iServers; iServer++)
		{
			delete [] m_astrServers[iServer];
		}
		m_iServers = std::max(o_amount, int(120));
		for(int iServer=0; iServer<m_iServers; iServer++)
		{
			m_astrServers[iServer] = new char[256];
		}
	}

	//servers = new char*[m_servers.size()];
	*pastrServers = m_astrServers;

	std::vector<SGameServer>::iterator it = m_servers.begin();
	for(int s = 0; it != m_servers.end(); ++it, ++s)		//copy server address to return-vector
	{
		strcpy(m_astrServers[s],(*it).m_target.c_str());
	}
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:32,代码来源:GameQueryListener.cpp


示例6: FUNCTION_PROFILER

//------------------------------------------------------------------------
void CProjectile::Update(SEntityUpdateContext &ctx, int updateSlot)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	if (updateSlot!=0)
		return;

	float color[4] = {1,1,1,1};
	bool bDebug = g_pGameCVars->i_debug_projectiles > 0;

	if(bDebug)
		gEnv->pRenderer->Draw2dLabel(50,15,2.0f,color,false,"Projectile: %s",GetEntity()->GetClass()->GetName());

	Vec3 pos = GetEntity()->GetWorldPos();

	ScaledEffect(m_pAmmoParams->pScaledEffect);

	// update whiz
	if(m_pAmmoParams->pWhiz)
	{
		if (m_whizSoundId == INVALID_SOUNDID)
		{
			IActor *pActor = g_pGame->GetIGameFramework()->GetClientActor();
			if (pActor && (m_ownerId != pActor->GetEntityId()))
			{
				float probability = 0.85f;

				if (Random()<=probability)
				{
					Lineseg line(m_last, pos);
					Vec3 player = pActor->GetEntity()->GetWorldPos();

					float t;
					float distanceSq=Distance::Point_LinesegSq(player, line, t);

					if (distanceSq < 4.7f*4.7f && (t>=0.0f && t<=1.0f))
					{
						if (distanceSq >= 0.65*0.65)
						{
							Sphere s;
							s.center = player;
							s.radius = 4.7f;

							Vec3 entry,exit;
							int intersect=Intersect::Lineseg_Sphere(line, s, entry,exit);
							if (intersect==0x1 || intersect==0x3) // one entry or one entry and one exit
								WhizSound(true, entry, (pos-m_last).GetNormalized());
						}
					}
				}
			}
		}
	}

	if (m_trailSoundId==INVALID_SOUNDID)
		TrailSound(true);

	m_totalLifetime += ctx.fFrameTime;
	m_last = pos;
}
开发者ID:mrwonko,项目名称:CrysisVR,代码行数:61,代码来源:Projectile.cpp


示例7: FUNCTION_PROFILER

void CG15LCD::Update(float frameTime)
{
	FUNCTION_PROFILER(GetISystem(),PROFILE_GAME);
	if (g_pGameCVars->cl_g15lcdEnable == 0)
		return;

	m_tick -= frameTime;
	if (m_tick < 0)
	{
		if (g_pGameCVars->cl_g15lcdTick > 0)
			m_tick = g_pGameCVars->cl_g15lcdTick/1000.0f;
		else
			m_tick = 0;

		if (IsConnected() && m_currentPage != -1)
		{
			if(m_currentPage > 1 && !g_pGame->GetIGameFramework()->IsGameStarted())
				m_currentPage = 0;
			else if(m_currentPage == 0 && g_pGame->GetIGameFramework()->IsGameStarted())
				m_currentPage = 2;

			if (m_pages[m_currentPage]->PreUpdate())
			{
				m_pages[m_currentPage]->Update(frameTime);
				m_pImpl->ShowPage(m_currentPage);
			}
		}
		m_pImpl->Update();
	}
}
开发者ID:MrHankey,项目名称:destructionderby,代码行数:30,代码来源:LCDWrapper.cpp


示例8: FUNCTION_PROFILER

//------------------------------------------------------------------------
void CItem::InitGeometry()
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	//skip loading the first person geometry for now, it may never be used
	m_sharedparams->LoadGeometryForItem(this, eIGS_FirstPerson);
}
开发者ID:Xydrel,项目名称:Infected,代码行数:8,代码来源:ItemParams.cpp


示例9: FUNCTION_PROFILER

void CTagBullet::HandleEvent(const SGameObjectEvent &event)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	CProjectile::HandleEvent(event);

	if (event.event == eGFE_OnCollision)
	{
		if (m_destroying)
			return;

		EventPhysCollision *pCollision = reinterpret_cast<EventPhysCollision *>(event.ptr);
		if (!pCollision)
			return;

		IEntity *pTarget = pCollision->iForeignData[1]==PHYS_FOREIGN_ID_ENTITY ? (IEntity*)pCollision->pForeignData[1]:0;
		if (pTarget)
		{
			EntityId targetId = pTarget->GetId();

			CHUD *pHUD = g_pGame->GetHUD();
			pHUD->AddToRadar(targetId);

			SimpleHitInfo info(m_ownerId, targetId, m_weaponId, 0); // 0=tag,1=tac
			info.remote=IsRemote();

			g_pGame->GetGameRules()->ClientSimpleHit(info);
		}

		Destroy();
	}
}
开发者ID:wang1986one,项目名称:remod,代码行数:32,代码来源:TagBullet.cpp


示例10: FUNCTION_PROFILER

bool CVisibleObjectsHelper::CheckObjectViewDist(const Agent& agent, const SVisibleObject &visibleObject) const
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	assert(agent.IsValid());

	bool bInViewDist = true;

	IEntitySystem *pEntitySystem = gEnv->pEntitySystem;
	assert(pEntitySystem);

	IEntity *pAIEntity = pEntitySystem->GetEntity(agent.GetEntityID());
	IEntity *pObjectEntity = pEntitySystem->GetEntity(visibleObject.entityId);

	IComponentRender *pObjectRenderProxy = (pAIEntity != NULL && pObjectEntity ? static_cast<IComponentRender *>(pObjectEntity->GetComponent<IComponentRender>().get()) : NULL);
	if (pObjectRenderProxy != NULL)
	{
		IRenderNode *pObjectRenderNode = pObjectRenderProxy->GetRenderNode();
		if (pObjectRenderNode != NULL)
		{
			const float fDistanceSq = pAIEntity->GetWorldPos().GetSquaredDistance(pObjectEntity->GetWorldPos());
			const float fMaxViewDistSq = sqr(pObjectRenderNode->GetMaxViewDist());
			
			bInViewDist = (fDistanceSq <= fMaxViewDistSq);
		}
	}

	return bInViewDist;
}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:29,代码来源:VisibleObjectsHelper.cpp


示例11: FUNCTION_PROFILER

void CMFXForceFeedbackEffect::Execute(SMFXRunTimeEffectParams& params)
{
	FUNCTION_PROFILER(gEnv->pSystem, PROFILE_ACTION);

	if (params.playflags & MFX_PLAY_FORCEFEEDBACK)
	{
		float distanceToPlayerSqr = FLT_MAX;
		IActor *pClientActor = gEnv->pGame->GetIGameFramework()->GetClientActor();
		if (pClientActor)
		{
			distanceToPlayerSqr = (pClientActor->GetEntity()->GetWorldPos() - params.pos).GetLengthSquared();
		}

		const float testDistanceSqr = clamp_tpl(distanceToPlayerSqr, m_forceFeedbackParams.intensityFallOffMinDistanceSqr, m_forceFeedbackParams.intensityFallOffMaxDistanceSqr);
		const float minMaxDiffSqr = m_forceFeedbackParams.intensityFallOffMaxDistanceSqr - m_forceFeedbackParams.intensityFallOffMinDistanceSqr;
		
		float effectIntensity = (float)__fsel(-minMaxDiffSqr, 0.0f, 1.0f - (testDistanceSqr - m_forceFeedbackParams.intensityFallOffMinDistanceSqr) / (minMaxDiffSqr + FLT_EPSILON));
		effectIntensity *= effectIntensity;
		if (effectIntensity > 0.01f)
		{
			IForceFeedbackSystem* pForceFeedback = CCryAction::GetCryAction()->GetIForceFeedbackSystem();
			assert(pForceFeedback);
			ForceFeedbackFxId fxId = pForceFeedback->GetEffectIdByName(m_forceFeedbackParams.forceFeedbackEventName.c_str());
			pForceFeedback->PlayForceFeedbackEffect(fxId, SForceFeedbackRuntimeParams(effectIntensity, 0.0f));
		}
	}

}
开发者ID:aronarts,项目名称:FireNET,代码行数:28,代码来源:MFXForceFeedbackFX.cpp


示例12: FUNCTION_PROFILER

bool CEntityPoolSignature::CalculateFromEntity(CEntity *pEntity)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_ENTITY);
	LOADING_TIME_PROFILE_SECTION(GetISystem());

	assert(pEntity);

	if (!m_bGenerated && pEntity)
	{
		m_bGenerated = true;

		ISerialize *pWriter = m_pSignatureSerializer->GetWriter(m_Signature);
		TSerialize signatureWriter(pWriter);

		m_bGenerated &= pEntity->GetSignature(signatureWriter);

		if (!m_bGenerated)
		{
			m_Signature->removeAllChilds();
			m_Signature->removeAllAttributes();
		}
	}

	return m_bGenerated;
}
开发者ID:aronarts,项目名称:FireNET,代码行数:25,代码来源:EntityPoolSignature.cpp


示例13: FUNCTION_PROFILER

bool CMPTutorial::CheckVehicles(const CPlayer* pPlayer)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	bool showPrompt = false;
	if(!pPlayer)
		return showPrompt;

	IVehicle* pVehicle = pPlayer->GetLinkedVehicle();

	if(m_wasInVehicle && !pVehicle)
	{
		// got out of vehicle. Move HUD box back to normal place.
		SAFE_HUD_FUNC(SetTutorialTextPosition(2));
		m_wasInVehicle = false;
		return showPrompt;
	}
 
 	if(pVehicle && !m_wasInVehicle)
 	{
		// just got in. Move HUD box up so it doesn't overlap vehicle hud.
		SAFE_HUD_FUNC(SetTutorialTextPosition(1));

		m_wasInVehicle = true;

		// generic 'boarding a vehicle' message
		TriggerEvent(eTE_BoardVehicle);
	}

	return showPrompt;
}
开发者ID:RenEvo,项目名称:dead6,代码行数:31,代码来源:MPTutorial.cpp


示例14: FUNCTION_PROFILER

//------------------------------------------------------------------------
void CRapid::UpdateFiring(CActor* pOwnerActor, bool ownerIsClient, bool ownerIsPlayer, float frameTime)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_AI);

	if (m_speed >= 0.00001f)
	{			
		const uint32 decelAndRapid = eRapidFlag_decelerating|eRapidFlag_rapidFiring;

		if ((m_speed >= m_fireParams->rapidparams.min_speed) && !(m_rapidFlags & decelAndRapid))
		{
			m_rapidFlags |= eRapidFlag_rapidFiring;

			uint32 flags = CItem::eIPAF_Default;
			float speedOverride = -1.0f;
			PlayRapidFire(speedOverride, (flags & CItem::eIPAF_ConcentratedFire) != 0);		
		}
		else if ((m_speed < m_fireParams->rapidparams.min_speed) && ((m_rapidFlags & decelAndRapid) ==  decelAndRapid))
		{
			m_rapidFlags &= ~eRapidFlag_rapidFiring;
		}
	}

	if(ownerIsClient && gEnv->bMultiplayer)
	{
		CRY_ASSERT(pOwnerActor);

		const CTimeValue currentTime = gEnv->pTimer->GetFrameStartTime();
		const float startFiringSeconds = m_startFiringTime.GetSeconds();
		const float secondsFiring = gEnv->pTimer->GetAsyncTime().GetSeconds() - startFiringSeconds;
		if(startFiringSeconds != 0.0f && secondsFiring > 3.0f)
		{
			NET_BATTLECHATTER(BC_Battlecry, static_cast<CPlayer*>(pOwnerActor));
		}
	}
}
开发者ID:Kufusonic,项目名称:Work-in-Progress-Sonic-Fangame,代码行数:36,代码来源:Rapid.cpp


示例15: FUNCTION_PROFILER

//------------------------------------------------------------------------
void CGameRules::ClientHit(const HitInfo &hitInfo)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	IActor *pClientActor = g_pGame->GetIGameFramework()->GetClientActor();
	IActor *pActor = g_pGame->GetIGameFramework()->GetIActorSystem()->GetActor(hitInfo.targetId);
	
	if(pActor == pClientActor)
		if (gEnv->pInput) gEnv->pInput->ForceFeedbackEvent( SFFOutputEvent(eDI_XI, eFF_Rumble_Basic, 0.5f * hitInfo.damage * 0.01f, hitInfo.damage * 0.02f, 0.0f));

	//m_pScript->CallMethod( "OnHit", gEnv->pMonoScriptSystem->GetConverter()->ToManagedType(eCMT_HitInfo, &const_cast<HitInfo &>(hitInfo)));

	bool backface = hitInfo.dir.Dot(hitInfo.normal)>0;
	if (!hitInfo.remote && hitInfo.targetId && !backface)
	{
		if (!gEnv->bServer)
		{
			GetGameObject()->InvokeRMI(SvRequestHit(), hitInfo, eRMI_ToServer);
		}
		else
		{
			ServerHit(hitInfo);
		}

		if(gEnv->IsClient())
			ProcessLocalHit(hitInfo);
	}
}
开发者ID:nhnam,项目名称:Seasons,代码行数:29,代码来源:GameRulesClientServer.cpp


示例16: FUNCTION_PROFILER

CEntity* CEntityPool::GetPoolEntityFromInactiveSet()
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_ENTITY);

	assert(!gEnv->IsEditor());

	CEntity* pPoolEntity = NULL;

	assert(m_pEntityPoolManager);
	CEntitySystem* pEntitySystem = m_pEntityPoolManager->GetEntitySystem();

	// Get the next empty entity to use
	TPoolIdsVec::iterator itPoolSlot    = m_InactivePoolIds.begin();
	TPoolIdsVec::iterator itPoolSlotEnd = m_InactivePoolIds.end();
	for (; itPoolSlot != itPoolSlotEnd; ++itPoolSlot)
	{
		CEntity* pEntity = (CEntity*)pEntitySystem->GetEntity(itPoolSlot->poolId);

		// Don't use active ones
		if (!pEntity)
		{
			CRY_ASSERT_MESSAGE(false, "NULL Pool Entity in Inactive set");
			continue;
		}

		// Use this one
		pPoolEntity = pEntity;
		break;
	}

	return pPoolEntity;
}
开发者ID:joewan,项目名称:pycmake,代码行数:32,代码来源:EntityPool.cpp


示例17: FUNCTION_PROFILER

void CBaseInput::PostHoldEvents()
{
	FUNCTION_PROFILER( GetISystem(),PROFILE_INPUT );
	SInputEvent event;

	// DARIO_NOTE: In this loop, m_holdSymbols size and content is changed so previous
	// code was resulting in occasional index out of bounds.
	// The desired behaviour as I understand it is as follows:
	// (PRESSED) symbols should be added to the to the end of m_holdSymbols but not 
	// processed this frame (thus the keep the loop comparison as is).
	// On the other hand, (RELEASED) symbols need to be removed from the m_holdSymbols this frame
	// so the size of m_holdSymbols may decrease. The search for a RELEASED symbol is done backwards
	// i.e. from m_holdSymbols.end() - 1 to 0 thus it will never go before the sending index (i.e. i)
	// In order to allow for this behaviour, the (i < kCurrentCount) check is added.
	
	const size_t kInitialCount = m_holdSymbols.size();
	for (size_t i=0; i < kInitialCount; ++i)
	{
		const size_t kCurrentCount = m_holdSymbols.size();
		if (i < kCurrentCount)
		{
			m_holdSymbols[i]->AssignTo(event, GetModifiers());
			event.deviceIndex = m_holdSymbols[i]->deviceIndex;

		if (g_pInputCVars->i_debug)
		{
			gEnv->pLog->Log("InputDebug: 0x%p PostHoldEvent Symbol %d %s", this, m_holdSymbols[i]->keyId, m_holdSymbols[i]->name.c_str() );
		}

			PostInputEvent(event);
		}
	}
}
开发者ID:aronarts,项目名称:FireNET,代码行数:33,代码来源:BaseInput.cpp


示例18: FUNCTION_PROFILER

//------------------------------------------------------------------------------------
void CUIActionManager::Update()
{
    FUNCTION_PROFILER(GetISystem(), PROFILE_ACTION);

    if (!m_actionEnableMap.empty())
    {
        TActionMap actionEnableMap = m_actionEnableMap;
        m_actionEnableMap.clear();
        for ( TActionMap::iterator it = actionEnableMap.begin(); it != actionEnableMap.end(); ++it)
        {
            EnableActionInt(it->first, it->second);
        }
    }

    if (!m_actionEndMap.empty())
    {
        TActionArgMap actionEndMap = m_actionEndMap;
        m_actionEndMap.clear();
        for ( TActionArgMap::iterator it = actionEndMap.begin(); it != actionEndMap.end(); ++it)
        {
            EndActionInt(it->first, it->second);
        }
    }

    if (!m_actionStartMap.empty())
    {
        TActionArgMap actionStartMap = m_actionStartMap;
        m_actionStartMap.clear();
        for ( TActionArgMap::iterator it = actionStartMap.begin(); it != actionStartMap.end(); ++it)
        {
            StartActionInt(it->first, it->second);
        }
    }
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:35,代码来源:FlashUIAction.cpp


示例19: FUNCTION_PROFILER

bool CBattleDust::CheckForMerging(CBattleEvent* pEvent)
{
	FUNCTION_PROFILER(GetISystem(), PROFILE_GAME);

	if(!g_pGameCVars->g_battleDust_enable)
		return false;

	if(!pEvent)
		return false;

	if(!gEnv->bServer)
		return false;

	// check if area can merge with nearby areas
	for(std::list<EntityId>::iterator it = m_eventIdList.begin(); it != m_eventIdList.end(); ++it)
	{
		EntityId areaId = (*it);
		CBattleEvent *pBattleArea = FindEvent(areaId);
		if(!pBattleArea)
			continue;

		if(CheckIntersection(pEvent, pBattleArea->m_worldPos, pBattleArea->m_radius) && pBattleArea->m_radius > 0 && (pBattleArea != pEvent) && pBattleArea->GetEntity())
		{
			MergeAreas(pBattleArea, pEvent->m_worldPos, pEvent->m_radius);
			return true;
		}
	}

	return false;
}
开发者ID:kitnet,项目名称:project-o,代码行数:30,代码来源:BattleDust.cpp


示例20: FUNCTION_PROFILER

void CMFXParticleEffect::Execute(const SMFXRunTimeEffectParams& params)
{
  FUNCTION_PROFILER(gEnv->pSystem, PROFILE_ACTION);

  Vec3 pos = params.pos;
	Vec3 dir = ZERO;
	Vec3 inDir = params.dir[0];
	Vec3 reverso = inDir * -1.0f;
	switch (m_particleParams.directionType)
	{
	case SMFXParticleParams::eDT_Normal:
		dir = params.normal;
		break;
	case SMFXParticleParams::eDT_Ricochet:
		dir = reverso.GetRotated(params.normal, gf_PI).normalize();
		break;
	default:
		dir = params.normal;
		break;
	}
 
  bool tryToAttachEffect = (CMaterialEffectsCVars::Get().mfx_EnableAttachedEffects != 0);
  float distToPlayer = 0.f;
  IActor *pClientActor = gEnv->pGame->GetIGameFramework()->GetClientActor();
  if (pClientActor)
  {
    distToPlayer = (pClientActor->GetEntity()->GetWorldPos() - params.pos).GetLength();
	tryToAttachEffect = tryToAttachEffect && (pClientActor->GetEntityId() != params.trg);
  }
  
  SMFXParticleEntries::const_iterator end = m_particleParams.m_entries.end();
  for (SMFXParticleEntries::const_iterator it = m_particleParams.m_entries.begin(); it!=end; ++it)
  {
    // choose effect based on distance
    if ((it->maxdist == 0.f) || (distToPlayer <= it->maxdist) && !it->name.empty() )
    { 
      IParticleEffect *pParticle = gEnv->pParticleManager->FindEffect(it->name.c_str());

      if (pParticle)
      {
        const float pfx_minscale = (it->minscale != 0.f) ? it->minscale : CMaterialEffectsCVars::Get().mfx_pfx_minScale;
        const float pfx_maxscale = (it->maxscale != 0.f) ? it->maxscale : CMaterialEffectsCVars::Get().mfx_pfx_maxScale; 
        const float pfx_maxdist = (it->maxscaledist != 0.f) ? it->maxscaledist : CMaterialEffectsCVars::Get().mfx_pfx_maxDist; 
                
        const float truscale = pfx_minscale + ((pfx_maxscale - pfx_minscale) * (distToPlayer!=0.f ? min(1.0f, distToPlayer/pfx_maxdist) : 1.f));  

		bool particleSpawnedAndAttached = tryToAttachEffect ? AttachToTarget(*it, params, pParticle, dir, truscale) : false;

        // If not attached, just spawn the particle
		if (particleSpawnedAndAttached == false)
		{
			pParticle->Spawn( true, IParticleEffect::ParticleLoc(pos, dir, truscale) );
		}
      }
      
      break;
    }
  }
}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:59,代码来源:MFXParticleEffect.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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