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.

84 lines
4.2 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===============================================================================//
  8. #ifndef WORLD_SCHEMA_H
  9. #define WORLD_SCHEMA_H
  10. #ifdef COMPILER_MSVC
  11. #pragma once
  12. #endif
  13. #include "worldnodeschema.h"
  14. //--------------------------------------------------------------------------------------
  15. // Enum related
  16. //--------------------------------------------------------------------------------------
  17. enum WorldNodeFlags_t
  18. {
  19. WORLD_NODE_SIMPLIFIED = 0x0001, // The geometry is simplified
  20. WORLD_NODE_UNIQUE_UV = 0x0002, // The geometry is uniquely mapped (likely, we're a higher LOD)
  21. WORLD_NODE_ATLASED = 0x0004, // This node was atlased but not uniquely mapped
  22. WORLD_NODE_KDTREE = 0x0008, // Node contains a kd-tree for raycasts
  23. WORLD_NODE_NODRAW = 0x0010, // Node has no actual draw calls... it's just a container for stuff and other nodes
  24. WORLD_NODE_START_TRAVERSAL = 0x0020, // Start a traversal at this node (add a check to ensure that the KDTREE flag also exists with this one)
  25. WORLD_NODE_CAN_SEE_SKY = 0x0040, // Can this node see the sky?
  26. WORLD_NODE_MOST_DETAILED = 0x0080, // Node is the most detailed node containing the original geometry and textures
  27. };
  28. schema struct WorldBuilderParams_t
  29. {
  30. int32 m_nSizeBytesPerVoxel; // target size per-voxel
  31. float m_flMinDrawVolumeSize; // minimum size of any draw call
  32. float m_flMinDistToCamera; // minimum distance to camera for near objects
  33. float m_flMinAtlasDist; // minimum distance at which any atlased node can be visible
  34. float m_flMinSimplifiedDist; // minimum distance at which any simplified node can be visible
  35. float m_flHorzFOV; // horizontal fov used for texel to screenspace calcs
  36. float m_flHalfScreenWidth; // half target screen res used for texel to screenspace calcs
  37. int32 m_nAtlasTextureSizeX; // X res of atlas textures
  38. int32 m_nAtlasTextureSizeY; // Y res of atlas textures
  39. int32 m_nUniqueTextureSizeX; // X res of uniquely atlased textures
  40. int32 m_nUniqueTextureSizeY; // Y res of uniquely atlased textures
  41. int32 m_nCompressedAtlasSize; // approx size of a compressed atlas texture
  42. float m_flGutterSize; // gutter size (in texels)
  43. float m_flUVMapThreshold; // cos( angle ) threshold between faces when creating a unique uv parameterization
  44. Vector m_vWorldUnitsPerTile; // world units per tile for tiled coordinates
  45. int32 m_nMaxTexScaleSlots; // maximum number of gpu registers we can take up with texture scaling
  46. bool m_bWrapInAtlas; // true == handle wrapping texcoords by tiling the texture in the atlas
  47. // false == handle wrapping by a frac in the pixel shader
  48. uint8 m_padding[3]; // pad this structure out to a mutiple of 4 bytes
  49. };
  50. schema struct NodeData_t
  51. {
  52. int32 m_Flags; // One of WorldNodeFlags_t
  53. int32 m_nParent; // Parent node index
  54. Vector m_vOrigin; // Origin placing us in the world
  55. Vector m_vMinBounds; // Axis-aligned bounding-box min
  56. Vector m_vMaxBounds; // Axis-aligned bounding-box max
  57. float m_flMinimumDistance; // Minimum camera distance at which this node renders (pull out and vectorize?)
  58. CResourceArray< int32 > m_ChildNodeIndices; // List of indices of the child nodes
  59. CResourceReference< WorldNode_t > m_hWorldNode; // Handle to the world node
  60. };
  61. schema struct World_t
  62. {
  63. WorldBuilderParams_t m_builderParams; // Original build parameters ( so we can potentially remake this file )
  64. CResourceArray< NodeData_t > m_worldNodes; // World nodes
  65. CResourceString m_entityString; // All of the entity text
  66. // Placeholder for visibility
  67. };
  68. class CWorld; // Forward declaration of associated runtime class
  69. DEFINE_RESOURCE_CLASS_TYPE( World_t, CWorld, RESOURCE_TYPE_WORLD );
  70. typedef const ResourceBinding_t< CWorld > *HWorld;
  71. typedef CStrongHandle< CWorld > HWorldStrong;
  72. #define WORLD_HANDLE_INVALID ( (HWorld)0 )
  73. #endif // WORLD_SCHEMA_H