當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。