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

223 lines
5.7 KiB

  1. /*
  2. * Copyright (C) 2020 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_GAME_CONTEXT_HPP
  20. #define ANTKEEPER_GAME_CONTEXT_HPP
  21. #include "utility/fundamental-types.hpp"
  22. #include <optional>
  23. #include <entt/entt.hpp>
  24. #include <fstream>
  25. #include <string>
  26. // Forward declarations
  27. class ambient_light;
  28. class animator;
  29. class application;
  30. class behavior_system;
  31. class billboard;
  32. class bloom_pass;
  33. class camera;
  34. class camera_system;
  35. class clear_pass;
  36. class collision_system;
  37. class compositor;
  38. class config_file;
  39. class constraint_system;
  40. class control;
  41. class control_set;
  42. class control_system;
  43. class directional_light;
  44. class final_pass;
  45. class framebuffer;
  46. class locomotion_system;
  47. class logger;
  48. class material;
  49. class material_pass;
  50. class nest_system;
  51. class orbit_cam;
  52. class pheromone_matrix;
  53. class placement_system;
  54. class point_light;
  55. class rasterizer;
  56. class render_system;
  57. class resource_manager;
  58. class samara_system;
  59. class scene;
  60. class screen_transition;
  61. class shadow_map_pass;
  62. class simple_render_pass;
  63. class sky_pass;
  64. class spotlight;
  65. class subterrain_system;
  66. class terrain_system;
  67. class texture_2d;
  68. class timeline;
  69. class tool_system;
  70. class ui_system;
  71. class vegetation_system;
  72. class vertex_array;
  73. class vertex_buffer;
  74. class renderer;
  75. class model_instance;
  76. class input_event_router;
  77. class input_mapper;
  78. class cli;
  79. template <typename T> class animation;
  80. template <typename T> class material_property;
  81. template <typename T> class tween;
  82. /**
  83. *
  84. */
  85. struct game_context
  86. {
  87. application* app;
  88. logger* logger;
  89. std::ofstream log_filestream;
  90. // Command-line options
  91. std::optional<bool> option_continue;
  92. std::optional<std::string> option_data;
  93. std::optional<bool> option_fullscreen;
  94. std::optional<bool> option_new_game;
  95. std::optional<bool> option_quick_start;
  96. std::optional<bool> option_reset;
  97. std::optional<int> option_vsync;
  98. std::optional<bool> option_windowed;
  99. // Paths
  100. std::string data_path;
  101. std::string config_path;
  102. std::string mods_path;
  103. std::string saves_path;
  104. std::string screenshots_path;
  105. std::string data_package_path;
  106. // Config
  107. config_file* config;
  108. // Resources
  109. resource_manager* resource_manager;
  110. // Framebuffers
  111. framebuffer* shadow_map_framebuffer;
  112. texture_2d* shadow_map_depth_texture;
  113. framebuffer* framebuffer_hdr;
  114. texture_2d* framebuffer_hdr_color;
  115. texture_2d* framebuffer_hdr_depth;
  116. framebuffer* framebuffer_bloom; // General purpose framebuffer A
  117. texture_2d* bloom_texture;
  118. // Rendering
  119. rasterizer* rasterizer;
  120. renderer* renderer;
  121. vertex_buffer* billboard_vbo;
  122. vertex_array* billboard_vao;
  123. material* fallback_material;
  124. material* splash_billboard_material;
  125. // Compositing
  126. bloom_pass* overworld_bloom_pass;
  127. clear_pass* overworld_clear_pass;
  128. clear_pass* overworld_shadow_map_clear_pass;
  129. clear_pass* ui_clear_pass;
  130. clear_pass* underworld_clear_pass;
  131. final_pass* overworld_final_pass;
  132. material_pass* overworld_material_pass;
  133. material_pass* ui_material_pass;
  134. material_pass* underworld_material_pass;
  135. shadow_map_pass* overworld_shadow_map_pass;
  136. simple_render_pass* underworld_final_pass;
  137. sky_pass* overworld_sky_pass;
  138. material_property<const texture_2d*>* underground_color_texture_property;
  139. compositor* overworld_compositor;
  140. compositor* underworld_compositor;
  141. compositor* ui_compositor;
  142. // Scene
  143. scene* active_scene;
  144. scene* overworld_scene;
  145. scene* underworld_scene;
  146. scene* ui_scene;
  147. camera* overworld_camera;
  148. camera* underworld_camera;
  149. camera* ui_camera;
  150. ambient_light* sun_indirect;
  151. directional_light* sun_direct;
  152. point_light* subterrain_light;
  153. ambient_light* underworld_ambient_light;
  154. spotlight* spotlight;
  155. billboard* splash_billboard;
  156. // Animation
  157. timeline* timeline;
  158. animator* animator;
  159. tween<double>* time_tween;
  160. tween<float3>* focal_point_tween;
  161. animation<float>* radial_transition_in;
  162. animation<float>* radial_transition_out;
  163. screen_transition* fade_transition;
  164. screen_transition* radial_transition_inner;
  165. screen_transition* radial_transition_outer;
  166. // Controls
  167. input_event_router* input_event_router;
  168. input_mapper* input_mapper;
  169. control_set* application_controls;
  170. control_set* camera_controls;
  171. control_set* menu_controls;
  172. control* menu_back_control;
  173. control* menu_select_control;
  174. control* screenshot_control;
  175. control* toggle_fullscreen_control;
  176. // Entities
  177. entt::registry* ecs_registry;
  178. entt::entity brush_entity;
  179. entt::entity flashlight_entity;
  180. entt::entity forceps_entity;
  181. entt::entity lens_entity;
  182. // Systems
  183. behavior_system* behavior_system;
  184. camera_system* camera_system;
  185. collision_system* collision_system;
  186. constraint_system* constraint_system;
  187. control_system* control_system;
  188. locomotion_system* locomotion_system;
  189. nest_system* nest_system;
  190. placement_system* placement_system;
  191. render_system* render_system;
  192. samara_system* samara_system;
  193. subterrain_system* subterrain_system;
  194. terrain_system* terrain_system;
  195. tool_system* tool_system;
  196. ui_system* ui_system;
  197. vegetation_system* vegetation_system;
  198. // Debug
  199. cli* cli;
  200. // Misc
  201. orbit_cam* orbit_cam;
  202. pheromone_matrix* pheromones;
  203. };
  204. #endif // ANTKEEPER_GAME_CONTEXT_HPP