BVB Source Codes

CRYENGINE Show MaterialEffectsCVars.cpp Source code

Return Download CRYENGINE: download MaterialEffectsCVars.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4.    -------------------------------------------------------------------------
  5.    $Id$
  6.    $DateTime$
  7.    Description: CVars for the MaterialEffects subsystem
  8.    -------------------------------------------------------------------------
  9.    History:
  10.    - 02:03:2006  12:00 : Created by AlexL
  11.  
  12. *************************************************************************/
  13.  
  14. #include "StdAfx.h"
  15. #include "MaterialEffectsCVars.h"
  16. #include <CryAction.h>
  17.  
  18. #include "MaterialEffects.h"
  19. #include "MaterialFGManager.h"
  20.  
  21. CMaterialEffectsCVars* CMaterialEffectsCVars::s_pThis = 0;
  22.  
  23. namespace
  24. {
  25. void FGEffectsReload(IConsoleCmdArgs* pArgs)
  26. {
  27.         CMaterialEffects* pMaterialFX = static_cast<CMaterialEffects*>(CCryAction::GetCryAction()->GetIMaterialEffects());
  28.  
  29.         if (pMaterialFX)
  30.         {
  31.                 pMaterialFX->GetFGManager()->ReloadFlowGraphs();
  32.         }
  33. }
  34.  
  35. void MFXReload(IConsoleCmdArgs* pArgs)
  36. {
  37.         CMaterialEffects* pMaterialEffects = static_cast<CMaterialEffects*>(CCryAction::GetCryAction()->GetIMaterialEffects());
  38.  
  39.         if (pMaterialEffects)
  40.         {
  41.                 pMaterialEffects->FullReload();
  42.         }
  43. }
  44.  
  45. };
  46.  
  47. CMaterialEffectsCVars::CMaterialEffectsCVars()
  48. {
  49.         assert(s_pThis == 0);
  50.         s_pThis = this;
  51.  
  52.         REGISTER_CVAR(mfx_ParticleImpactThresh, 2.0f, VF_CHEAT, "Impact threshold for particle effects. Default: 2.0");
  53.         REGISTER_CVAR(mfx_SoundImpactThresh, 1.5f, VF_CHEAT, "Impact threshold for sound effects. Default: 1.5");
  54.         REGISTER_CVAR(mfx_RaisedSoundImpactThresh, 3.5f, VF_CHEAT, "Impact threshold for sound effects if we're rolling. Default: 3.5");
  55.         REGISTER_CVAR(mfx_Debug, 0, 0, "Turns on MaterialEffects debug messages. 1=Collisions, 2=Breakage, 3=Both");
  56.         REGISTER_CVAR(mfx_DebugVisual, 0, 0, "Turns on/off visual debugging for MFX system");
  57.         mfx_DebugVisualFilter = REGISTER_STRING("mfx_DebugVisualFilter", "", VF_CHEAT, "");
  58.         REGISTER_CVAR(mfx_DebugFlowGraphFX, 0, 0, "Turns on Material FlowGraph FX manager debug messages.");
  59.         REGISTER_CVAR(mfx_Enable, 1, VF_CHEAT, "Enables MaterialEffects.");
  60.         REGISTER_CVAR(mfx_pfx_minScale, .5f, 0, "Min scale (when particle is close)");
  61.         REGISTER_CVAR(mfx_pfx_maxScale, 1.5f, 0, "Max scale (when particle is far)");
  62.         REGISTER_CVAR(mfx_pfx_maxDist, 35.0f, 0, "Max dist (how far away before scale is clamped)");
  63.         REGISTER_CVAR(mfx_Timeout, 0.01f, 0, "Timeout (in seconds) to avoid playing effects too often");
  64.         REGISTER_CVAR(mfx_EnableFGEffects, 1, VF_CHEAT, "Enabled Flowgraph based Material effects. Default: On");
  65.         REGISTER_CVAR(mfx_EnableAttachedEffects, 1, VF_CHEAT, "Enable attached effects (characters, entities...)");
  66.         REGISTER_CVAR(mfx_SerializeFGEffects, 1, VF_CHEAT, "Serialize Flowgraph based effects. Default: On");
  67.  
  68.         //FlowGraph HUD effects
  69.         REGISTER_COMMAND("mfx_ReloadFGEffects", FGEffectsReload, 0, "Reload MaterialEffect's FlowGraphs");
  70.         //Reload Excel Spreadsheet
  71.         REGISTER_COMMAND("mfx_Reload", MFXReload, 0, "Reload MFX Spreadsheet");
  72. }
  73.  
  74. CMaterialEffectsCVars::~CMaterialEffectsCVars()
  75. {
  76.         assert(s_pThis != 0);
  77.         s_pThis = 0;
  78.  
  79.         IConsole* pConsole = gEnv->pConsole;
  80.  
  81.         pConsole->RemoveCommand("mfx_Reload");
  82.         pConsole->RemoveCommand("mfx_ReloadHUDEffects");
  83.  
  84.         pConsole->UnregisterVariable("mfx_ParticleImpactThresh", true);
  85.         pConsole->UnregisterVariable("mfx_SoundImpactThresh", true);
  86.         pConsole->UnregisterVariable("mfx_RaisedSoundImpactThresh", true);
  87.         pConsole->UnregisterVariable("mfx_Debug", true);
  88.         pConsole->UnregisterVariable("mfx_DebugVisual", true);
  89.         pConsole->UnregisterVariable("mfx_DebugVisualFilter", true);
  90.         pConsole->UnregisterVariable("mfx_Enable", true);
  91.         pConsole->UnregisterVariable("mfx_pfx_minScale", true);
  92.         pConsole->UnregisterVariable("mfx_pfx_maxScale", true);
  93.         pConsole->UnregisterVariable("mfx_pfx_maxDist", true);
  94.         pConsole->UnregisterVariable("mfx_Timeout", true);
  95.         pConsole->UnregisterVariable("mfx_EnableFGEffects", true);
  96.         pConsole->UnregisterVariable("mfx_EnableAttachedEffects", true);
  97.         pConsole->UnregisterVariable("mfx_SerializeFGEffects", true);
  98. }
  99.  
downloadMaterialEffectsCVars.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