DisplaySettings.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. // Description : Display Settings definition.
  9. #ifndef CRYINCLUDE_EDITOR_DISPLAYSETTINGS_H
  10. #define CRYINCLUDE_EDITOR_DISPLAYSETTINGS_H
  11. #pragma once
  12. //////////////////////////////////////////////////////////////////////////
  13. enum EDisplayRenderFlags
  14. {
  15. RENDER_FLAG_BBOX = 1 << 0,
  16. RENDER_FLAG_ROADS = 1 << 1,
  17. RENDER_FLAG_DECALS = 1 << 2,
  18. RENDER_FLAG_DETAILTEX = 1 << 3,
  19. RENDER_FLAG_FOG = 1 << 4,
  20. RENDER_FLAG_INDOORS = 1 << 5,
  21. RENDER_FLAG_LIVINGOBJ = 1 << 6,
  22. RENDER_FLAG_STATICOBJ = 1 << 7,
  23. RENDER_FLAG_SHADOWMAPS = 1 << 8,
  24. RENDER_FLAG_SKYBOX = 1 << 9,
  25. RENDER_FLAG_TERRAIN = 1 << 10,
  26. RENDER_FLAG_WATER = 1 << 11,
  27. RENDER_FLAG_DETAILOBJ = 1 << 12,
  28. RENDER_FLAG_PARTICLES = 1 << 14,
  29. RENDER_FLAG_VOXELS = 1 << 15,
  30. RENDER_FLAG_CLOUDS = 1 << 16,
  31. RENDER_FLAG_IMPOSTERS = 1 << 17,
  32. RENDER_FLAG_BEAMS = 1 << 18,
  33. RENDER_FLAG_GI = 1 << 19,
  34. RENDER_FLAG_ALPHABLEND = 1 << 20,
  35. //update this!
  36. RENDER_FLAG_LAST_ONE = 1 << 21
  37. // Debugging options.
  38. //RENDER_FLAG_PROFILE = 1<<22,
  39. //RENDER_FLAG_AIDEBUGDRAW = 1<<23,
  40. //RENDER_FLAG_MEMINFO = 1<<24,
  41. };
  42. //////////////////////////////////////////////////////////////////////////
  43. enum EDisplaySettingsFlags
  44. {
  45. SETTINGS_NOCOLLISION = 0x01,//!< Disable collision with terrain.
  46. SETTINGS_NOLABELS = 0x02, //!< Do not draw labels.
  47. SETTINGS_PHYSICS = 0x04, //!< Physics simulation is enabled.
  48. SETTINGS_HIDE_TRACKS = 0x08, //!< Enable displaying of animation tracks in views.
  49. SETTINGS_HIDE_LINKS = 0x10, //!< Enable displaying of links between objects.
  50. SETTINGS_HIDE_HELPERS = 0x20, //!< Disable displaying of all object helpers.
  51. SETTINGS_SHOW_DIMENSIONFIGURES = 0x40, //!< Enable displaying of dimension figures.
  52. SETTINGS_SERIALIZABLE_FLAGS_MASK = ~(SETTINGS_PHYSICS),
  53. };
  54. //////////////////////////////////////////////////////////////////////////
  55. enum EDebugSettingsFlags
  56. {
  57. DBG_MEMINFO = 0x002,
  58. DBG_MEMSTATS = 0x004,
  59. DBG_TEXTURE_MEMINFO = 0x008,
  60. DBG_AI_DEBUGDRAW = 0x010,
  61. DBG_PHYSICS_DEBUGDRAW = 0x020,
  62. DBG_RENDERER_PROFILE = 0x040,
  63. DBG_RENDERER_PROFILESHADERS = 0x080,
  64. DBG_RENDERER_OVERDRAW = 0x100,
  65. DBG_RENDERER_RESOURCES = 0x200,
  66. DBG_FRAMEPROFILE = 0x400,
  67. DBG_DEBUG_LIGHTS = 0x800,
  68. DBG_BUDGET_MONITORING = 0x1000,
  69. DBG_HIGHLIGHT_BREAKABLE = 0x2000,
  70. DBG_HIGHLIGHT_MISSING_SURFACE_TYPE = 0x4000
  71. };
  72. /*!
  73. * CDisplaySettings is a collection of information about how to display current views.
  74. */
  75. class SANDBOX_API CDisplaySettings
  76. {
  77. public:
  78. CDisplaySettings();
  79. ~CDisplaySettings();
  80. void PostInitApply();
  81. void SetSettings(int flags) { m_flags = flags; };
  82. int GetSettings() const { return m_flags; };
  83. void SetObjectHideMask(int m_objectHideMask);
  84. int GetObjectHideMask() const { return m_objectHideMask; }
  85. void SetRenderFlags(int flags);
  86. int GetRenderFlags() const { return m_renderFlags; }
  87. void SetDebugFlags(int flags);
  88. int GetDebugFlags() const { return m_debugFlags; }
  89. void DisplayLabels(bool bEnable);
  90. bool IsDisplayLabels() const { return (m_flags & SETTINGS_NOLABELS) == 0; };
  91. void DisplayTracks(bool bEnable);
  92. bool IsDisplayTracks() const { return (m_flags & SETTINGS_HIDE_TRACKS) == 0; };
  93. void DisplayLinks(bool bEnable);
  94. bool IsDisplayLinks() const { return (m_flags & SETTINGS_HIDE_LINKS) == 0; };
  95. void DisplayHelpers(bool bEnable);
  96. bool IsDisplayHelpers() const { return (m_flags & SETTINGS_HIDE_HELPERS) == 0; };
  97. void DisplayDimensionFigures(bool bEnable);
  98. bool IsDisplayDimensionFigures() const { return m_flags & SETTINGS_SHOW_DIMENSIONFIGURES; };
  99. void SetLabelsDistance(float dist) { m_labelsDistance = dist; };
  100. float GetLabelsDistance() const { return m_labelsDistance; };
  101. bool IsHighlightBreakable() const { return (m_debugFlags & DBG_HIGHLIGHT_BREAKABLE) != 0; }
  102. void SetHighlightBreakable(bool bEnable);
  103. bool IsHighlightMissingSurfaceType() const { return (m_debugFlags & DBG_HIGHLIGHT_MISSING_SURFACE_TYPE) != 0; }
  104. void SetHighlightMissingSurfaceType(bool bEnable);
  105. void SaveRegistry();
  106. void LoadRegistry();
  107. private:
  108. // Restrict access.
  109. CDisplaySettings(const CDisplaySettings&) {}
  110. void operator=(const CDisplaySettings&) {}
  111. void SetCVar(const char* cvar, bool val);
  112. void SetCVarInt(const char* cvar, int val);
  113. void SaveValue(const char* sSection, const char* sKey, int value);
  114. void LoadValue(const char* sSection, const char* sKey, int& value);
  115. void LoadValue(const char* sSection, const char* sKey, bool& value);
  116. int m_objectHideMask;
  117. int m_renderFlags;
  118. int m_flags;
  119. //! Debug/profile settings.
  120. //! @see EDebugSettingsFlags.
  121. int m_debugFlags;
  122. float m_labelsDistance;
  123. };
  124. #endif // CRYINCLUDE_EDITOR_DISPLAYSETTINGS_H