BVB Source Codes

CRYENGINE Show SurfaceTypeManager.h Source code

Return Download CRYENGINE: download SurfaceTypeManager.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:   SurfaceManager.h
  5. //  Version:     v1.00
  6. //  Created:     29/9/2004 by Timur.
  7. //  Compilers:   Visual Studio.NET
  8. //  Description:
  9. // -------------------------------------------------------------------------
  10. //  History:
  11. //
  12. ////////////////////////////////////////////////////////////////////////////
  13.  
  14. #ifndef __SurfaceManager_h__
  15. #define __SurfaceManager_h__
  16. #pragma once
  17.  
  18. #include <Cry3DEngine/I3DEngine.h>
  19.  
  20. #define MAX_SURFACE_ID 255
  21.  
  22. //////////////////////////////////////////////////////////////////////////
  23. // SurfaceManager is implementing ISurfaceManager interface.
  24. // Register and manages all known to game surface typs.
  25. //////////////////////////////////////////////////////////////////////////
  26. class CSurfaceTypeManager : public ISurfaceTypeManager, public Cry3DEngineBase
  27. {
  28. public:
  29.         CSurfaceTypeManager();
  30.         virtual ~CSurfaceTypeManager();
  31.  
  32.         virtual void                    LoadSurfaceTypes();
  33.  
  34.         virtual ISurfaceType*           GetSurfaceTypeByName(const char* sName, const char* sWhy = NULL, bool warn = true);
  35.         virtual ISurfaceType*           GetSurfaceType(int nSurfaceId, const char* sWhy = NULL);
  36.         virtual ISurfaceTypeEnumerator* GetEnumerator();
  37.  
  38.         bool                            RegisterSurfaceType(ISurfaceType* pSurfaceType, bool bDefault = false);
  39.         void                            UnregisterSurfaceType(ISurfaceType* pSurfaceType);
  40.  
  41.         ISurfaceType*                   GetSurfaceTypeFast(int nSurfaceId, const char* sWhy = NULL);
  42.  
  43.         void                            RemoveAll();
  44.  
  45.         void                            GetMemoryUsage(ICrySizer* pSizer) const
  46.         {
  47.                 pSizer->AddObject(this, sizeof(*this));
  48.                 pSizer->AddObject(m_nameToSurface);
  49.                 for (int i = 0; i < MAX_SURFACE_ID + 1; ++i)
  50.                         pSizer->AddObject(m_idToSurface[i]);
  51.         }
  52. private:
  53.         int                         m_lastSurfaceId;
  54.  
  55.         class CMaterialSurfaceType* m_pDefaultSurfaceType;
  56.  
  57.         struct SSurfaceRecord
  58.         {
  59.                 bool          bLoaded;
  60.                 ISurfaceType* pSurfaceType;
  61.  
  62.                 void          GetMemoryUsage(ICrySizer* pSizer) const
  63.                 {
  64.                         pSizer->AddObject(this, sizeof(*this));
  65.                 }
  66.         };
  67.  
  68.         SSurfaceRecord* m_idToSurface[MAX_SURFACE_ID + 1];
  69.  
  70.         typedef std::map<string, SSurfaceRecord*> NameToSurfaceMap;
  71.         NameToSurfaceMap m_nameToSurface;
  72. };
  73.  
  74. #endif //__SurfaceManager_h__
  75.  
downloadSurfaceTypeManager.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