BVB Source Codes

CRYENGINE Show FlowPlatformNode.cpp Source code

Return Download CRYENGINE: download FlowPlatformNode.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. #include "StdAfx.h"
  4.  
  5. #include <CryFlowGraph/IFlowBaseNode.h>
  6.  
  7. class CFlowNode_Platform : public CFlowBaseNode<eNCT_Singleton>
  8. {
  9. public:
  10.         CFlowNode_Platform(SActivationInfo* pActInfo) {}
  11.  
  12.         enum EInPort
  13.         {
  14.                 eInPort_Get = 0
  15.         };
  16.         enum EOutPort
  17.         {
  18.                 eOutPort_Pc = 0,
  19.                 eOutPort_PS4,
  20.                 eOutPort_XboxOne
  21.         };
  22.  
  23.         virtual void GetConfiguration(SFlowNodeConfig& config)
  24.         {
  25.                 static const SInputPortConfig in_config[] =
  26.                 {
  27.                         InputPortConfig_AnyType("Check", _HELP("Triggers a check of the current platform")),
  28.                         { 0 }
  29.                 };
  30.                 static const SOutputPortConfig out_config[] =
  31.                 {
  32.                         OutputPortConfig_AnyType("PC",      _HELP("Outputs the signal from Check input if the game runs on PC")),
  33.                         OutputPortConfig_AnyType("PS4",     _HELP("Outputs the signal from Check input if the game runs on PS4")),
  34.                         OutputPortConfig_AnyType("XboxOne", _HELP("Outputs the signal from Check input if the game runs on XboxOne")),
  35.                         { 0 }
  36.                 };
  37.                 config.sDescription = _HELP("Provides branching logic for different platforms");
  38.                 config.pInputPorts = in_config;
  39.                 config.pOutputPorts = out_config;
  40.                 config.SetCategory(EFLN_APPROVED);
  41.         }
  42.  
  43.         virtual void ProcessEvent(EFlowEvent event, SActivationInfo* pActInfo)
  44.         {
  45.                 if (event == eFE_Activate)
  46.                 {
  47.                         if (!IsPortActive(pActInfo, eInPort_Get))
  48.                                 return;
  49. #if CRY_PLATFORM_ORBIS
  50.                         ActivateOutput(pActInfo, eOutPort_PS4, GetPortAny(pActInfo, eInPort_Get));
  51. #elif CRY_PLATFORM_DURANGO
  52.                         ActivateOutput(pActInfo, eOutPort_XboxOne, GetPortAny(pActInfo, eInPort_Get));
  53. #else
  54.                         ActivateOutput(pActInfo, eOutPort_Pc, GetPortAny(pActInfo, eInPort_Get));
  55. #endif
  56.                 }
  57.         }
  58.  
  59.         virtual void GetMemoryUsage(ICrySizer* s) const
  60.         {
  61.                 s->Add(*this);
  62.         }
  63. };
  64.  
  65. REGISTER_FLOW_NODE("Game:CheckPlatform", CFlowNode_Platform);
  66.  
downloadFlowPlatformNode.cpp Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top