BVB Source Codes

CRYENGINE Show ParticleMemory.cpp Source code

Return Download CRYENGINE: download ParticleMemory.cpp Source code - Download CRYENGINE Source code - Type:.cpp
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. // -------------------------------------------------------------------------
  4. //  File name:   ParticleMemory.cpp
  5. //  Version:     v1.00
  6. //  Created:     18/03/2010 by Corey Spink
  7. //  Compilers:   Visual Studio.NET
  8. //  Description: All the particle system's specific memory needs
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #include "StdAfx.h"
  15. #include "ParticleMemory.h"
  16. #include "Particle.h"
  17. #include "Cry3DEngineBase.h"
  18.  
  19. bool g_bParticleObjectPoolInitialized = false;
  20. CRY_ALIGN(128) char sStorageParticleObjectPool[sizeof(ParticleObjectPool)];
  21. CryCriticalSection g_ParticlePoolInitLock;
  22.  
  23. ///////////////////////////////////////////////////////////////////////////////
  24. ParticleObjectPool& ParticleObjectAllocator()
  25. {
  26.         IF (g_bParticleObjectPoolInitialized == false, 0)
  27.         {
  28.                 AUTO_LOCK(g_ParticlePoolInitLock);
  29.                 IF (g_bParticleObjectPoolInitialized == false, 0)
  30.                 {
  31.                         new(sStorageParticleObjectPool) ParticleObjectPool();
  32.                         alias_cast<ParticleObjectPool*>(sStorageParticleObjectPool)->Init(Cry3DEngineBase::GetCVars()->e_ParticlesPoolSize << 10);
  33.                         MemoryBarrier();
  34.                         g_bParticleObjectPoolInitialized = true;
  35.                 }
  36.         }
  37.  
  38.         return *alias_cast<ParticleObjectPool*>(sStorageParticleObjectPool);
  39. }
  40.  
downloadParticleMemory.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