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

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