Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
3.8 KiB

  1. //====== Copyright � 1996-2004, Valve Corporation, All rights reserved. =======
  2. //
  3. // A class representing a world node
  4. //
  5. //=============================================================================
  6. #ifndef DMEWORLD_H
  7. #define DMEWORLD_H
  8. #ifdef COMPILER_MSVC
  9. #pragma once
  10. #endif
  11. #include "dmeworldnode.h"
  12. //-----------------------------------------------------------------------------
  13. // Forward declarations
  14. //-----------------------------------------------------------------------------
  15. //-----------------------------------------------------------------------------
  16. // Parameters used to construct the world
  17. //-----------------------------------------------------------------------------
  18. class CDmeWorldBuilderParams : public CDmElement
  19. {
  20. DEFINE_ELEMENT( CDmeWorldBuilderParams, CDmElement );
  21. public:
  22. CDmaVar< int32 > m_nSizeBytesPerVoxel; // target size per-voxel
  23. CDmaVar< float > m_flMinDrawVolumeSize; // minimum size of any draw call
  24. CDmaVar< float > m_flMinDistToCamera; // minimum distance to camera for near objects
  25. CDmaVar< float > m_flMinAtlasDist; // minimum distance at which any atlased node can be visible
  26. CDmaVar< float > m_flMinSimplifiedDist; // minimum distance at which any simplified node can be visible
  27. CDmaVar< float > m_flHorzFOV; // horizontal fov used for texel to screenspace calcs
  28. CDmaVar< float > m_flHalfScreenWidth; // half target screen res used for texel to screenspace calcs
  29. CDmaVar< int32 > m_nAtlasTextureSizeX; // X res of atlas textures
  30. CDmaVar< int32 > m_nAtlasTextureSizeY; // Y res of atlas textures
  31. CDmaVar< int32 > m_nUniqueTextureSizeX; // X res of uniquely atlased textures
  32. CDmaVar< int32 > m_nUniqueTextureSizeY; // Y res of uniquely atlased textures
  33. CDmaVar< int32 > m_nCompressedAtlasSize; // approx size of a compressed atlas texture
  34. CDmaVar< float > m_flGutterSize; // gutter size (in texels)
  35. CDmaVar< float > m_flUVMapThreshold; // cos( angle ) threshold between faces when creating a unique uv parameterization
  36. CDmaVar< Vector > m_vWorldUnitsPerTile; // world units per tile for tiled coordinates
  37. CDmaVar< int32 > m_nMaxTexScaleSlots; // maximum number of gpu registers we can take up with texture scaling
  38. CDmaVar< bool > m_bWrapInAtlas; // true == handle wrapping texcoords by tiling the texture in the atlas
  39. };
  40. //-----------------------------------------------------------------------------
  41. // Bounds for a node
  42. //-----------------------------------------------------------------------------
  43. class CDmeNodeData : public CDmElement
  44. {
  45. DEFINE_ELEMENT( CDmeNodeData, CDmElement );
  46. public:
  47. CDmaVar< int32 > m_nID;
  48. CDmaVar< int32 > m_Flags;
  49. CDmaVar< int32 > m_nParent;
  50. CDmaVar< Vector > m_vOrigin;
  51. CDmaVar< Vector > m_vMinBounds;
  52. CDmaVar< Vector > m_vMaxBounds;
  53. CDmaVar< float > m_flMinimumDistance;
  54. CDmaArray< int32 > m_ChildNodeIndices;
  55. };
  56. //-----------------------------------------------------------------------------
  57. // World node reference
  58. //-----------------------------------------------------------------------------
  59. class CDmeWorldNodeReference : public CDmElement
  60. {
  61. DEFINE_ELEMENT( CDmeWorldNodeReference, CDmElement );
  62. public:
  63. CDmaString m_worldNodeFileName;
  64. CDmaElement< CDmeNodeData > m_nodeData;
  65. };
  66. //-----------------------------------------------------------------------------
  67. // The whole world in DME format
  68. //-----------------------------------------------------------------------------
  69. class CDmeWorld : public CDmElement
  70. {
  71. DEFINE_ELEMENT( CDmeWorld, CDmElement );
  72. public:
  73. CDmaElement< CDmeWorldBuilderParams > m_builderParams;
  74. CDmaElementArray< CDmeWorldNodeReference > m_worldNodes;
  75. CDmaString m_entityString; // All of the entity text
  76. };
  77. #endif // DMEWORLD_H