BVB Source Codes

CRYENGINE Show StdAfx.h Source code

Return Download CRYENGINE: download StdAfx.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  File name:   stdafx.h
  5. //  Version:     v1.00
  6. //  Created:     28/5/2001 by Vladimir Kajalin
  7. //  Compilers:   Visual Studio.NET
  8. //  Description:
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #if !defined(AFX_STDAFX_H__8B93AD4E_EE86_4127_9BED_37AC6D0F978B__INCLUDED_3DENGINE)
  15. #define AFX_STDAFX_H__8B93AD4E_EE86_4127_9BED_37AC6D0F978B__INCLUDED_3DENGINE
  16.  
  17. #if _MSC_VER > 1000
  18.         #pragma once
  19. #endif // _MSC_VER > 1000
  20.  
  21. #include <CryCore/Project/CryModuleDefs.h>
  22. #define eCryModule   eCryM_3DEngine
  23. #define RWI_NAME_TAG "RayWorldIntersection(3dEngine)"
  24. #define PWI_NAME_TAG "PrimitiveWorldIntersection(3dEngine)"
  25. #include <CryCore/Platform/platform.h>
  26.  
  27. #define CRY3DENGINE_EXPORTS
  28.  
  29. const int nThreadsNum = 3;
  30.  
  31. //#define DEFINE_MODULE_NAME "Cry3DEngine"
  32.  
  33. //////////////////////////////////////////////////////////////////////////////////////////////
  34. // Highlevel defines
  35.  
  36. // deferred cull queue handling - currently disabled
  37. // #define USE_CULL_QUEUE
  38.  
  39. // Crysis3 as it's dx11 only can simply use the zbufferculler everywhere
  40. // Older CCoverageBuffer currently does not compile
  41. #if 1
  42.         #define OCCLUSIONCULLER CZBufferCuller
  43. #endif
  44.  
  45. // Compilation (Export to Engine) not needed on consoles
  46. #if CRY_PLATFORM_DESKTOP
  47.         #define ENGINE_ENABLE_COMPILATION 1
  48. #else
  49.         #define ENGINE_ENABLE_COMPILATION 0
  50. #endif
  51.  
  52. #if !defined(_RELEASE) && CRY_PLATFORM_WINDOWS
  53.         #define ENABLE_CONSOLE_MTL_VIZ
  54. #endif
  55.  
  56. #pragma warning( error: 4018 )
  57.  
  58. #include <stdio.h>
  59.  
  60. #define MAX_PATH_LENGTH 512
  61.  
  62. #include <CrySystem/ITimer.h>
  63. #include <CrySystem/IProcess.h>
  64. #include <CryMath/Cry_Math.h>
  65. #include <CryMath/Cry_Camera.h>
  66. #include <CryMath/Cry_XOptimise.h>
  67. #include <CryMath/Cry_Geo.h>
  68. #include <CrySystem/ILog.h>
  69. #include <CrySystem/ISystem.h>
  70. #include <CrySystem/IConsole.h>
  71. #include <CryPhysics/IPhysics.h>
  72. #include <CryRenderer/IRenderer.h>
  73. #include <CryRenderer/IRenderAuxGeom.h>
  74. #include <Cry3DEngine/IRenderNode.h>
  75. #include <CryCore/Containers/StackContainer.h>
  76. #include <Cry3DEngine/I3DEngine.h>
  77. #include <CrySystem/File/ICryPak.h>
  78. #include <CrySystem/File/CryFile.h>
  79. #include <CryCore/smartptr.h>
  80. #include <CryCore/Containers/CryArray.h>
  81. #include <Cry3DEngine/CGF/CryHeaders.h>
  82. #include "Cry3DEngineBase.h"
  83. #include <float.h>
  84. #include <CryCore/Containers/CryArray.h>
  85. #include "cvars.h"
  86. #include <CryMemory/CrySizer.h>
  87. #include <CryCore/StlUtils.h>
  88. #include "Array2d.h"
  89. #include "Material.h"
  90. #include "3dEngine.h"
  91. #include "ObjMan.h"
  92. #include "Vegetation.h"
  93. #include "terrain.h"
  94. #include "ObjectsTree.h"
  95.  
  96. #include <CrySystem/Profilers/FrameProfiler/FrameProfiler_JobSystem.h>  // to be removed
  97.  
  98. template<class T>
  99. void AddToPtr(byte*& pPtr, T& rObj, EEndian eEndian)
  100. {
  101.         PREFAST_SUPPRESS_WARNING(6326) static_assert((sizeof(T) % 4) == 0, "Invalid type size!");
  102.         assert(!((INT_PTR)pPtr & 3));
  103.         memcpy(pPtr, &rObj, sizeof(rObj));
  104.         SwapEndian(*(T*)pPtr, eEndian);
  105.         pPtr += sizeof(rObj);
  106.         assert(!((INT_PTR)pPtr & 3));
  107. }
  108.  
  109. template<class T>
  110. void AddToPtr(byte*& pPtr, int& nDataSize, T& rObj, EEndian eEndian)
  111. {
  112.         PREFAST_SUPPRESS_WARNING(6326) static_assert((sizeof(T) % 4) == 0, "Invalid type size!");
  113.         assert(!((INT_PTR)pPtr & 3));
  114.         memcpy(pPtr, &rObj, sizeof(rObj));
  115.         SwapEndian(*(T*)pPtr, eEndian);
  116.         pPtr += sizeof(rObj);
  117.         nDataSize -= sizeof(rObj);
  118.         assert(nDataSize >= 0);
  119.         assert(!((INT_PTR)pPtr & 3));
  120. }
  121.  
  122. inline void FixAlignment(byte*& pPtr, int& nDataSize)
  123. {
  124.         while ((UINT_PTR)pPtr & 3)
  125.         {
  126.                 *pPtr = 222;
  127.                 pPtr++;
  128.                 nDataSize--;
  129.         }
  130. }
  131.  
  132. inline void FixAlignment(byte*& pPtr)
  133. {
  134.         while ((UINT_PTR)pPtr & 3)
  135.         {
  136.                 *pPtr = 222;
  137.                 pPtr++;
  138.         }
  139. }
  140.  
  141. template<class T>
  142. void AddToPtr(byte*& pPtr, int& nDataSize, const T* pArray, int nElemNum, EEndian eEndian, bool bFixAlignment = false)
  143. {
  144.         assert(!((INT_PTR)pPtr & 3));
  145.         memcpy(pPtr, pArray, nElemNum * sizeof(T));
  146.         SwapEndian((T*)pPtr, nElemNum, eEndian);
  147.         pPtr += nElemNum * sizeof(T);
  148.         nDataSize -= nElemNum * sizeof(T);
  149.         assert(nDataSize >= 0);
  150.  
  151.         if (bFixAlignment)
  152.                 FixAlignment(pPtr, nDataSize);
  153.         else
  154.                 assert(!((INT_PTR)pPtr & 3));
  155. }
  156.  
  157. template<class T>
  158. void AddToPtr(byte*& pPtr, const T* pArray, int nElemNum, EEndian eEndian, bool bFixAlignment = false)
  159. {
  160.         assert(!((INT_PTR)pPtr & 3));
  161.         memcpy(pPtr, pArray, nElemNum * sizeof(T));
  162.         SwapEndian((T*)pPtr, nElemNum, eEndian);
  163.         pPtr += nElemNum * sizeof(T);
  164.  
  165.         if (bFixAlignment)
  166.                 FixAlignment(pPtr);
  167.         else
  168.                 assert(!((INT_PTR)pPtr & 3));
  169. }
  170.  
  171. struct TriangleIndex
  172. {
  173.         TriangleIndex() { ZeroStruct(*this); }
  174.         uint16&       operator[](const int& n)       { assert(n >= 0 && n < 3); return idx[n]; }
  175.         const uint16& operator[](const int& n) const { assert(n >= 0 && n < 3); return idx[n]; }
  176.         uint16        idx[3];
  177.         uint16        nCull;
  178. };
  179.  
  180. #define FUNCTION_PROFILER_3DENGINE FUNCTION_PROFILER(gEnv->pSystem, PROFILE_3DENGINE)
  181.  
  182. #if CRY_PLATFORM_DESKTOP
  183.         #define INCLUDE_SAVECGF
  184. #endif
  185.  
  186. #define ENABLE_TYPE_INFO_NAMES 1
  187.  
  188. #endif // !defined(AFX_STDAFX_H__8B93AD4E_EE86_4127_9BED_37AC6D0F978B__INCLUDED_3DENGINE)
  189.  
downloadStdAfx.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