💿🐜 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.

145 lines
4.8 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 <engine/math/vector.hpp>
  28. #include <engine/color/aces.hpp>
  29. /// Global configuration constants.
  30. namespace config {
  31. /// @name Application config
  32. /// @{
  33. /// Application name string.
  34. inline constexpr const char* application_name = "@APPLICATION_NAME@";
  35. /// Application slug string.
  36. inline constexpr const char* application_slug = "@APPLICATION_SLUG@";
  37. /// Application major version number.
  38. inline constexpr int application_version_major = @APPLICATION_VERSION_MAJOR@;
  39. /// Application minor version number.
  40. inline constexpr int application_version_minor = @APPLICATION_VERSION_MINOR@;
  41. /// Application patch version number.
  42. inline constexpr int application_version_patch = @APPLICATION_VERSION_PATCH@;
  43. /// Application version string ("`major.minor.patch`")
  44. inline constexpr const char* application_version_string = "@APPLICATION_VERSION@";
  45. /// @}
  46. /// @name Debug config
  47. /// @{
  48. /// Maximum number of debug logs to archive.
  49. inline constexpr std::size_t debug_log_archive_capacity = 5;
  50. /// @}
  51. /// @name OpenGL config
  52. /// @{
  53. /// OpenGL major version number, used when creating OpenGL contexts.
  54. inline constexpr int opengl_version_major = 4;
  55. /// OpenGL minor version number, used when creating OpenGL contexts.
  56. inline constexpr int opengl_version_minor = 6;
  57. /// Minimum number of bits in the red channel of the color attachment of the OpenGL default framebuffer.
  58. inline constexpr int opengl_min_red_size = 8;
  59. /// Minimum number of bits in the green channel of the color attachment of the OpenGL default framebuffer.
  60. inline constexpr int opengl_min_green_size = 8;
  61. /// Minimum number of bits in the blue channel of the color attachment of the OpenGL default framebuffer.
  62. inline constexpr int opengl_min_blue_size = 8;
  63. /// Minimum number of bits in the alpha channel of the color attachment of the OpenGL default framebuffer.
  64. inline constexpr int opengl_min_alpha_size = 0;
  65. /// Minimum number of bits in the depth attachment, if any, of the OpenGL default framebuffer.
  66. inline constexpr int opengl_min_depth_size = 0;
  67. /// Minimum number of bits in the stencil attachment, if any, of the OpenGL default framebuffer.
  68. inline constexpr int opengl_min_stencil_size = 0;
  69. /// @}
  70. /// @name Rendering config
  71. /// @{
  72. /**
  73. * Scene-linear color space.
  74. *
  75. * @tparam T Scalar type.
  76. */
  77. template <class T>
  78. inline constexpr color::rgb_color_space<T> scene_linear_color_space = color::aces_ap1<T>;
  79. /// @}
  80. inline constexpr math::vector<float, 3> global_forward = {0.0f, 0.0f, -1.0f};
  81. inline constexpr math::vector<float, 3> global_up = {0.0f, 1.0f, 0.0f};
  82. inline constexpr math::vector<float, 3> global_right = {1.0f, 0.0f, 0.0f};
  83. /// Duration of the menu fade in animation, in seconds.
  84. inline constexpr float menu_fade_in_duration = 0.25f;
  85. /// Duration of the menu fade out animation, in seconds.
  86. inline constexpr float menu_fade_out_duration = 0.125f;
  87. /// Padding of the a menu item mouseover bounds, as a percentage of the font size.
  88. inline constexpr float menu_mouseover_padding = 0.1f;
  89. /// Opacity of the menu background.
  90. inline constexpr float menu_bg_opacity = 2.0f / 4.0f;
  91. /// RGBA color of active menu items.
  92. inline constexpr math::vector<float, 4> menu_active_color{1.0f, 1.0f, 1.0f, 1.0f};
  93. /// RGBA color of inactive menu items.
  94. inline constexpr math::vector<float, 4> menu_inactive_color{1.0f, 1.0f, 1.0f, 0.5f};
  95. /// Duration of the title screen fade in, in seconds.
  96. inline constexpr float title_fade_in_duration = 1.0f;
  97. /// Duration of the fade out when quitting the game or returning to the main menu, in seconds.
  98. inline constexpr float quit_fade_out_duration = 0.5f;
  99. /// Duration of the fade out when a new colony is started, in seconds.
  100. inline constexpr float new_colony_fade_out_duration = 1.0f;
  101. /// Duration of the nuptial flight fade in, in seconds.
  102. inline constexpr float nuptial_flight_fade_in_duration = 5.0f;
  103. } // namespace config
  104. #endif // ANTKEEPER_CONFIG_HPP