BVB Source Codes

CRYENGINE Show ParamTraitsImpl.h Source code

Return Download CRYENGINE: download ParamTraitsImpl.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  Created:     04/03/2015 by Filipe amim
  5. //  Description:
  6. // -------------------------------------------------------------------------
  7. //
  8. ////////////////////////////////////////////////////////////////////////////
  9.  
  10. #ifndef PARAMTRAITSIMPL_H
  11. #define PARAMTRAITSIMPL_H
  12.  
  13. #pragma once
  14.  
  15. namespace pfx2
  16. {
  17.  
  18. ILINE bool Serialize(Serialization::IArchive& ar, SEnable& val, const char* name, const char* label)
  19. {
  20.         name = (name && *name != 0) ? name : "Enabled";
  21.         if (!ar.isEdit())
  22.         {
  23.                 if (ar.isInput() || (ar.isOutput() && val.m_value == false))
  24.                 {
  25.                         if (!ar(val.m_value, name, label))
  26.                         {
  27.                                 if (ar.isInput())
  28.                                         val.m_value = true;
  29.                                 else
  30.                                         return false;
  31.                         }
  32.                 }
  33.         }
  34.         else
  35.         {
  36.                 return ar(val.m_value, name, name);
  37.         }
  38.         return true;
  39. }
  40.  
  41. template<typename T, typename D>
  42. ILINE bool IsDefault(const T& value, D defaultValue)
  43. {
  44.         return (value.Min() == value.Max()) && (value.Max() == defaultValue);
  45. }
  46.  
  47. }
  48.  
  49. #endif // PARAMTRAITSIMPL_H
  50.  
downloadParamTraitsImpl.h 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