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


C++ ActivateOutput函数代码示例

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


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

示例1: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			pActInfo->pGraph->SetRegularlyUpdated( pActInfo->myID, true );
			break;
		case eFE_Update:
			{
				ISystem *pSystem = GetISystem();
				IRenderer *pRenderer = gEnv->pRenderer;

				int sysMem = pSystem->GetUsedMemory();
				size_t vidMemThisFrame( 0 );
				size_t vidMemRecently( 0 );
				pRenderer->GetVideoMemoryUsageStats( vidMemThisFrame, vidMemRecently );
				int meshMem = 0;
				pRenderer->EF_Query(EFQ_Alloc_APIMesh, meshMem);
				
				ActivateOutput(pActInfo, OUT_SYSMEM, sysMem);
				// potentially unsafe if we start using >2gb of video memory...?
				ActivateOutput(pActInfo, OUT_VIDEOMEM_THISFRAME, int(vidMemThisFrame));
				ActivateOutput(pActInfo, OUT_VIDEOMEM_RECENTLY, int(vidMemRecently));
				ActivateOutput(pActInfo, OUT_MESHMEM, meshMem);
			}
			break;
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:28,代码来源:FlowStatsNodes.cpp

示例2: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Activate:
			if (IsPortActive(pActInfo,eIP_Get))
			{
				ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay();
				if (pTOD)
				{
					ActivateOutput(pActInfo, eOP_Latitude, pTOD->GetSunLatitude());
					ActivateOutput(pActInfo, eOP_Longitude, pTOD->GetSunLongitude());
				}
			}
			if (IsPortActive(pActInfo, eIP_Set))
			{
				ITimeOfDay* pTOD = gEnv->p3DEngine->GetTimeOfDay();
				if (pTOD)
				{
					float latitude = GetPortFloat(pActInfo, eIP_Latitude);
					float longitude = GetPortFloat(pActInfo, eIP_Longitude);

					pTOD->SetSunPos( longitude, latitude );
					bool forceUpdate = GetPortBool( pActInfo, eIP_ForceUpdate );
					pTOD->Update(true, forceUpdate);
					
					ActivateOutput(pActInfo, eOP_Latitude, latitude);
					ActivateOutput(pActInfo, eOP_Longitude, longitude);
				}
			}
			break;
		}
	}
开发者ID:NightOwlsEntertainment,项目名称:PetBox_A_Journey_to_Conquer_Elementary_Algebra,代码行数:33,代码来源:FlowEnvironmentNodes.cpp

示例3: ProcessEvent

	void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		if(eFE_Activate == event)
		{
			const bool bAttach = IsPortActive(pActInfo, EIP_ATTACH);
			const bool bDetach = IsPortActive(pActInfo, EIP_DETACH);
			if (!bAttach && !bDetach)
				return;

			IActor* pActor = GetActor(pActInfo);
			if (pActor == 0)
				return;

			const string& className = GetPortString(pActInfo, EIP_WEAPON);

			CWeapon* pWeapon = static_cast<CWeapon*> ( className.empty() ? GetWeapon(pActor) : GetWeapon(pActor, className.c_str()) );
			if (pWeapon != 0)
			{
				ItemString acc = ItemString(GetPortString(pActInfo, EIP_ACCESSORY));
				if (bAttach && pWeapon->GetAccessory(acc) == 0)
				{
					pWeapon->SwitchAccessory(acc);
					ActivateOutput(pActInfo, EOP_ATTACHED, true);
				}
				else if (bDetach && pWeapon->GetAccessory(acc) != 0)
				{
					pWeapon->SwitchAccessory(acc);
					ActivateOutput(pActInfo, EOP_DETACHED, true);
				}
			}
		}
	}
开发者ID:RenEvo,项目名称:dead6,代码行数:32,代码来源:WeaponNodes.cpp

示例4: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event,SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			{
				m_bResult = 2;
				break;
			}

		case eFE_Activate:
			{
				bool a = GetPortBool(pActInfo,INP_A);
				bool b = GetPortBool(pActInfo,INP_B);
				int result = Execute(a,b)? 1 : 0;
				bool activateOutputs = GetPortBool( pActInfo, INP_Always ) || m_bResult!=result;
				m_bResult = result;
				if (activateOutputs)
				{
					ActivateOutput( pActInfo,0,result );
					if(result)
						ActivateOutput( pActInfo,1,true );
					else
						ActivateOutput( pActInfo,2,true );
				}
			}
		};
	};
开发者ID:aronarts,项目名称:FireNET,代码行数:28,代码来源:FlowLogicNodes.cpp

示例5: args

void CFlashUIFromArrayNode::ProcessEvent( EFlowEvent event,SActivationInfo* pActInfo )
{
	if (event == eFE_Activate && IsPortActive( pActInfo, eI_Array ))
	{
		SUIArguments args( GetPortString( pActInfo, eI_Array ).c_str());
		ActivateOutput( pActInfo, eO_Count, args.GetArgCount());

		SUIArguments leftOver;
		int          port = eO_Val1;

		for (int i = 0; i < args.GetArgCount(); ++i)
		{
			string arg;
			args.GetArg( i, arg );
			if (port + i < eO_LeftOver)
			{
				ActivateOutput( pActInfo, port + i, arg );
			}
			else
			{
				leftOver.AddArgument( arg );
			}
		}
		if (leftOver.GetArgCount() > 0)
		{
			ActivateOutput( pActInfo, eO_LeftOver, string( leftOver.GetAsString()));
		}
	}
}
开发者ID:joewan,项目名称:pycmake,代码行数:29,代码来源:FlashUIArrayNodes.cpp

示例6: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch(event)
		{
		case eFE_Activate:
			CGameRules *pGR = g_pGame->GetGameRules();

			if(!pGR)
				return;

			if(!pActInfo->pEntity)
				return;

			const bool bUseVapor = GetPortBool(pActInfo, EIP_Vapor);

			if(IsPortActive(pActInfo, EIP_Freeze))
			{
				pGR->FreezeEntity(pActInfo->pEntity->GetId(), true, bUseVapor, true);
				ActivateOutput(pActInfo, EOP_Frozen, true);
			}
			else if(IsPortActive(pActInfo, EIP_UnFreeze))
			{
				pGR->FreezeEntity(pActInfo->pEntity->GetId(), false, bUseVapor);
				ActivateOutput(pActInfo, EOP_UnFrozen, true);
			}

			break;
		}
	}
开发者ID:super-nova,项目名称:NovaRepo,代码行数:29,代码来源:FlowHitInfoNode.cpp

示例7: OnHUDEvent

	void OnHUDEvent(const SHUDEvent& event)
	{
		switch(event.eventType)
		{
		case eHUDEvent_OnScanningComplete:
			{
				if(m_enabled)
				{
					EntityId scannedEntityId = static_cast<EntityId>(event.GetData(0).m_int);

					if (scannedEntityId != m_entityId) // Only selected entity
						break;

					IEntity* pScannedEntity = gEnv->pEntitySystem->GetEntity(scannedEntityId);
					if(!pScannedEntity)
					{
						SetEnabled(false);
						break;
					}
						
					if (m_delayResult)
					{
						SHUDEvent _event(eHUDEvent_OnControlCurrentTacticalScan);
						_event.AddData(SHUDEventData(true)); // Delay result
						CHUDEventDispatcher::CallEvent(_event);
					}

					ActivateOutput(&m_actInfo, EOP_OnEvent, true);
					ActivateOutput(&m_actInfo, EOP_EntityID, m_entityId);
				}
				break;
			}
		}
	}
开发者ID:Xydrel,项目名称:Infected,代码行数:34,代码来源:TacticalScanNode.cpp

示例8: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			{
			}
			break;
		case eFE_Activate:
#if CRY_PLATFORM_DURANGO

			if(IsPortActive(pActInfo, EIP_Poll))
			{

				std::shared_ptr<Live::State::User> cur_user = MatchmakingUtils::GetCurrentUser();
				size_t memberCountSession = cur_user->GetSessionMembers().size();

				CryLogAlways("SessionMembers: %d", memberCountSession);

				static MatchmakingUtils::INetworkingUser_impl s_networkingUser;
				bool isHost = s_networkingUser.IsHost();
				if(isHost)
				{
					ActivateOutput(pActInfo, EOP_Host, 1);
				}
				else
				{
					ActivateOutput(pActInfo, EOP_Client, 1);
				}
	
			}
#endif
			break;
		}
	}
开发者ID:amrhead,项目名称:eaascode,代码行数:35,代码来源:XboxOneLiveTestNodes.cpp

示例9: OnInputEvent

    // ~IInputEventListener
    virtual bool OnInputEvent( const SInputEvent &event )
    {
        if (true == m_bActive)
        {
#if defined(ORBIS)	// FIXME: Using PS3 inputs for ORBIS
            int nThisKey = event.keyId;
            int nKey = -1;
            int nInput = GetPortInt(&m_actInfo, EIP_Key);
            int tableSize = sizeof(PS3KeyTable)/sizeof(PS3KeyTable[0]);
            if ( nInput>=0 && nInput<tableSize )
                nKey = PS3KeyTable[nInput];
#else
            // Translate key, check value
            const int nThisKey = TranslateKey(event.keyId);
            const int nKey = GetPortInt(&m_actInfo, EIP_Key);
#endif
            if (nKey == nThisKey)
            {
                // Return based on state
                if (eIS_Pressed == event.state)
                    ActivateOutput(&m_actInfo, EOP_Pressed, true);
                else if (eIS_Released == event.state)
                    ActivateOutput(&m_actInfo, EOP_Released, true);
            }
        }

        // Let other listeners handle it
        return false;
    }
开发者ID:souxiaosou,项目名称:FireNET,代码行数:30,代码来源:FlowNodesInput.cpp

示例10: UpdateUIElement

void CFlashUIScreenPosNode::ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
{
    if ( event == eFE_Initialize )
    {
        UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
    }
    else if ( event == eFE_Activate )
    {
        if ( IsPortActive( pActInfo, eI_UIElement ) )
        {
            UpdateUIElement( GetPortString( pActInfo, eI_UIElement ), pActInfo );
        }

        if ( IsPortActive( pActInfo, eI_Get ) )
        {
            const int instanceId = GetPortInt(pActInfo, eI_InstanceID);
            float px = GetPortFloat(pActInfo, eI_PX);
            float py = GetPortFloat(pActInfo, eI_PY);
            const bool scaleMode = GetPortBool(pActInfo, eI_ScaleMode);

            SPerInstanceCall3< float&, float&, bool > caller;
            if ( !caller.Execute(GetElement(), instanceId, functor(*this, &CFlashUIScreenPosNode::GetScreenPos), px, py, scaleMode, false) )
            {
                UIACTION_WARNING( "FG: UIElement \"%s\" called get screenpos for multiple instances! (passed instanceId %i), referenced at node \"%s\"", GetPortString(pActInfo, eI_UIElement).c_str(), instanceId, pActInfo->pGraph->GetNodeTypeName( pActInfo->myID ) );
            }

            ActivateOutput( pActInfo, eO_OnGet, true );
            ActivateOutput(pActInfo, eO_PX, px);
            ActivateOutput(pActInfo, eO_PY, py);
        }
    }
}
开发者ID:souxiaosou,项目名称:FireNET,代码行数:32,代码来源:FlashUIDisplayNodes.cpp

示例11: Execute

	virtual void Execute(SActivationInfo *pActInfo)
	{
		bool bResult = false;

		// did the socket connect okay?
		if (socketWorking) {
			if (ReceiveLine() != -1) {
				string r = recMessage;
				//string value = r.c_str();
				int indice = r.find("|",0);
				string cvar = r.substr(0,indice);//r.Left(r.find("|",0));
				string value = r.substr(indice+1,r.length()-(indice+1));
				CryLogAlways(r);
				ActivateOutput(pActInfo, EOP_CVAR, cvar);
				ActivateOutput(pActInfo, EOP_Value, value);

				bResult = true;
			}
		}
	
		// return false if socket error, or no message
		
		if (bResult) ActivateOutput(pActInfo, EOP_Received, true);
		return;
	}
开发者ID:amyvmiwei,项目名称:CryVR,代码行数:25,代码来源:FlowUDPNodeListener.cpp

示例12: DialogCallback

	virtual void DialogCallback(uint32 dialogId, EDialogResponse response, const char* input)
	{
		assert(m_id == dialogId && m_bDisplayed);
		ActivateOutput(&m_ActInfo, eO_Param, string(input));
		ActivateOutput(&m_ActInfo, eO_Result, (int)response);
		m_bDisplayed = false;
	}
开发者ID:Orav,项目名称:CryMono,代码行数:7,代码来源:UIDialogs.cpp

示例13: switch

void CD6PlayerCreditRangeNode::ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
{
    switch (event)
    {
    case eFE_Activate:
    {
        if (true == IsPortActive(pActInfo, EIP_Trigger))
        {
            // Get D6 Player
            CD6Player *pPlayer = GetD6Player((NULL != pActInfo->pEntity ? pActInfo->pEntity->GetId() : 0));
            if (NULL == pPlayer) break;

            // Get range
            unsigned int nMinRange = GetPortFloat(pActInfo, EIP_MinAmount);
            unsigned int nMaxRange = GetPortFloat(pActInfo, EIP_MaxAmount);

            // Get credits and test
            unsigned int nCredits = pPlayer->GetCredits();
            if (nCredits >= nMinRange && nCredits <= nMaxRange)
                ActivateOutput(pActInfo, EOP_Pass, true);
            else
                ActivateOutput(pActInfo, EOP_Fail, true);
        }
    }
    break;
    }
}
开发者ID:RenEvo,项目名称:dead6,代码行数:27,代码来源:FlowD6PlayerNodes.cpp

示例14: ProcessEvent

	virtual void ProcessEvent(EFlowEvent event, SActivationInfo *pActInfo)
	{
		switch (event)
		{
		case eFE_Activate:
			{
				if(IsPortActive(pActInfo, EIP_RecenterPose))
				{
					bool triggered = false;
					IHMDManager* pHmDManager = gEnv->pSystem->GetHMDManager();
					IHMDDevice* pDev = pHmDManager ? pHmDManager->GetHMDDevice() : NULL;
					if (pDev && pHmDManager->IsStereoSetupOk())
					{
						const HMDTrackingState& sensorState = pDev->GetTrackingState();
						if (sensorState.CheckStatusFlags(HS_IsUsable))
						{
							pDev->RecenterPose();
							triggered = true;
						}
					}

					ActivateOutput(pActInfo, triggered ? EOP_Triggered : EOP_Failed, true);
					ActivateOutput(pActInfo, EOP_Done, true);
				}
			}
			break;
		}
	}
开发者ID:danielasun,项目名称:dbho-GameSDK,代码行数:28,代码来源:OculusFlowNodes.cpp

示例15: ProcessEvent

    virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
    {
        if (event == eFE_Activate)
        {
            if (!IsPortActive(pActInfo, Get))
                return;

            EControlScheme curControlScheme = g_pGame->GetUI()->GetCurControlScheme();

            switch (curControlScheme)
            {
            case eControlScheme_Keyboard:
                ActivateOutput(pActInfo, Keyboard, GetPortAny(pActInfo, Get));
                break;
            case eControlScheme_KeyboardMouse:
                ActivateOutput(pActInfo, KeyboardMouse, GetPortAny(pActInfo, Get));
                break;
            case eControlScheme_XBoxOneController:
                ActivateOutput(pActInfo, XBoxOneController, GetPortAny(pActInfo, Get));
                break;
            case eControlScheme_PS4Controller:
                ActivateOutput(pActInfo, PS4Controller, GetPortAny(pActInfo, Get));
                break;

            default:
                GameWarning("CFlowNode_InputControlScheme::ProcessEvent: Failed to activate output port, unhandled control scheme type");
            }
        }
    }
开发者ID:souxiaosou,项目名称:FireNET,代码行数:29,代码来源:FlowNodesInput.cpp


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