💿🐜 Antkeeper source code https://antkeeper.com
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.

137 lines
4.6 KiB

  1. /*
  2. * Copyright (C) 2023 Christopher J. Howard
  3. *
  4. * This file is part of Antkeeper source code.
  5. *
  6. * Antkeeper source code is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Antkeeper source code is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Antkeeper source code. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef ANTKEEPER_CONFIG_HPP
  20. #define ANTKEEPER_CONFIG_HPP
  21. // Disable trace message logging on release builds
  22. #if defined(NDEBUG)
  23. #define ANTKEEPER_DEBUG_LOG_MIN_MESSAGE_SEVERITY 1
  24. #else
  25. #define ANTKEEPER_DEBUG_LOG_MIN_MESSAGE_SEVERITY 0
  26. #endif
  27. #include "math/vector.hpp"
  28. /// Global configuration constants.
  29. namespace config {
  30. /// @name Application config
  31. /// @{
  32. /// Application name string.
  33. constexpr const char* application_name = "@PROJECT_NAME@";
  34. /// Application major version number.
  35. constexpr int application_version_major = @PROJECT_VERSION_MAJOR@;
  36. /// Application minor version number.
  37. constexpr int application_version_minor = @PROJECT_VERSION_MINOR@;
  38. /// Application patch version number.
  39. constexpr int application_version_patch = @PROJECT_VERSION_PATCH@;
  40. /// Application version string ("`major.minor.patch`")
  41. constexpr const char* application_version_string = "@PROJECT_VERSION@";
  42. /// @}
  43. /// @name Debug config
  44. /// @{
  45. /// Maximum number of debug logs to archive.
  46. constexpr std::size_t debug_log_archive_capacity = 5;
  47. /// @}
  48. /// @name OpenGL config
  49. /// @{
  50. /// OpenGL major version number, used when creating OpenGL contexts.
  51. constexpr int opengl_version_major = 3;
  52. /// OpenGL minor version number, used when creating OpenGL contexts.
  53. constexpr int opengl_version_minor = 3;
  54. /// Minimum number of bits in the red channel of the color attachment of the OpenGL default framebuffer.
  55. constexpr int opengl_min_red_size = 8;
  56. /// Minimum number of bits in the green channel of the color attachment of the OpenGL default framebuffer.
  57. constexpr int opengl_min_green_size = 8;
  58. /// Minimum number of bits in the blue channel of the color attachment of the OpenGL default framebuffer.
  59. constexpr int opengl_min_blue_size = 8;
  60. /// Minimum number of bits in the alpha channel of the color attachment of the OpenGL default framebuffer.
  61. constexpr int opengl_min_alpha_size = 0;
  62. /// Minimum number of bits in the depth attachment, if any, of the OpenGL default framebuffer.
  63. constexpr int opengl_min_depth_size = 0;
  64. /// Minimum number of bits in the stencil attachment, if any, of the OpenGL default framebuffer.
  65. constexpr int opengl_min_stencil_size = 0;
  66. /// @}
  67. constexpr math::vector<float, 3> global_forward = {0.0f, 0.0f, -1.0f};
  68. constexpr math::vector<float, 3> global_up = {0.0f, 1.0f, 0.0f};
  69. constexpr math::vector<float, 3> global_right = {1.0f, 0.0f, 0.0f};
  70. /// Duration of the menu fade in animation, in seconds.
  71. constexpr float menu_fade_in_duration = 0.25f;
  72. /// Duration of the menu fade out animation, in seconds.
  73. constexpr float menu_fade_out_duration = 0.125f;
  74. /// Padding of the a menu item mouseover bounds, as a percentage of the font size.
  75. constexpr float menu_mouseover_padding = 0.1f;
  76. /// Opacity of the menu background.
  77. constexpr float menu_bg_opacity = 2.0f / 4.0f;
  78. /// RGBA color of active menu items.
  79. constexpr math::vector<float, 4> menu_active_color{1.0f, 1.0f, 1.0f, 1.0f};
  80. /// RGBA color of inactive menu items.
  81. constexpr math::vector<float, 4> menu_inactive_color{1.0f, 1.0f, 1.0f, 0.5f};
  82. /// Duration of the title screen fade in, in seconds.
  83. constexpr float title_fade_in_duration = 1.0f;
  84. /// Duration of the fade out when quitting the game or returning to the main menu, in seconds.
  85. constexpr float quit_fade_out_duration = 0.5f;
  86. /// Duration of the fade out when a new colony is started, in seconds.
  87. constexpr float new_colony_fade_out_duration = 1.0f;
  88. /// Duration of the nuptial flight fade in, in seconds.
  89. constexpr float nuptial_flight_fade_in_duration = 5.0f;
  90. #define MATERIAL_PASS_MAX_AMBIENT_LIGHT_COUNT 1
  91. #define MATERIAL_PASS_MAX_POINT_LIGHT_COUNT 1
  92. #define MATERIAL_PASS_MAX_DIRECTIONAL_LIGHT_COUNT 3
  93. #define MATERIAL_PASS_MAX_SPOTLIGHT_COUNT 1
  94. #define MATERIAL_PASS_MAX_BONE_COUNT 64
  95. #define TERRAIN_PATCH_SIZE 200.0f
  96. #define TERRAIN_PATCH_RESOLUTION 4
  97. #define VEGETATION_PATCH_RESOLUTION 1
  98. } // namespace config
  99. #endif // ANTKEEPER_CONFIG_HPP