Antkeeper  0.0.1
game.hpp
Go to the documentation of this file.
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 
20 #ifndef ANTKEEPER_GAME_HPP
21 #define ANTKEEPER_GAME_HPP
22 
23 #include "game/ecoregion.hpp"
25 #include <AL/al.h>
26 #include <AL/alc.h>
30 #include <engine/entity/id.hpp>
34 #include <engine/gl/texture.hpp>
37 #include <engine/input/action.hpp>
38 #include <engine/input/mapper.hpp>
44 #include <engine/type/typeface.hpp>
45 #include <engine/utility/dict.hpp>
46 #include <engine/math/vector.hpp>
49 #include <engine/scene/text.hpp>
53 #include <engine/scene/camera.hpp>
56 #include <engine/scene/text.hpp>
57 #include <engine/math/angles.hpp>
58 #include <entt/entt.hpp>
59 #include <filesystem>
60 #include <memory>
61 #include <optional>
62 #include <queue>
63 #include <string>
64 #include <unordered_map>
65 #include <random>
66 #include <vector>
67 
68 // Forward declarations
69 class animator;
70 class resource_manager;
71 class screen_transition;
72 class timeline;
73 
74 template <typename T> class animation;
75 
76 namespace debug
77 {
78  class cli;
79 }
80 
81 namespace render
82 {
83  class bloom_pass;
84  class compositor;
85  class final_pass;
86  class resample_pass;
87  class material_pass;
88  class renderer;
89  class simple_render_pass;
90  class sky_pass;
91 }
92 
93 
94 // Forward declarations of system types.
95 class astronomy_system;
96 class atmosphere_system;
97 class behavior_system;
98 class blackbody_system;
99 class camera_system;
100 class collision_system;
101 class constraint_system;
102 class locomotion_system;
103 class animation_system;
104 class nest_system;
105 class orbit_system;
106 class render_system;
107 class spatial_system;
108 class steering_system;
109 class reproductive_system;
110 class metabolic_system;
112 class physics_system;
113 class subterrain_system;
114 class terrain_system;
115 class ik_system;
116 
117 struct control_profile;
118 
119 
120 class game
121 {
122 public:
129  game(int argc, const char* const* argv);
130 
134  ~game();
135 
139  void execute();
140 
141  // Command-line options
142  std::optional<bool> option_continue;
143  std::optional<std::string> option_data;
144  std::optional<bool> option_fullscreen;
145  std::optional<bool> option_new_game;
146  std::optional<bool> option_quick_start;
147  std::optional<bool> option_reset;
148  std::optional<bool> option_v_sync;
149  std::optional<bool> option_windowed;
150 
151  // Resource management and paths
152  std::unique_ptr<resource_manager> resource_manager;
153  std::filesystem::path data_package_path;
154  std::filesystem::path mods_path;
155  std::filesystem::path local_config_path;
156  std::filesystem::path shared_config_path;
157  std::filesystem::path saves_path;
158  std::filesystem::path screenshots_path;
159  std::filesystem::path controls_path;
160 
161  // Persistent settings
162  std::shared_ptr<dict<hash::fnv1a32_t>> settings;
163 
164  // Window management and window event handling
165  std::unique_ptr<app::window_manager> window_manager;
166  std::shared_ptr<app::window> window;
167  bool closed;
168  std::shared_ptr<::event::subscription> window_closed_subscription;
169  std::shared_ptr<::event::subscription> window_resized_subscription;
170 
171  // Input management and input event handling
172  std::unique_ptr<app::input_manager> input_manager;
173  std::shared_ptr<::event::subscription> application_quit_subscription;
174  std::shared_ptr<::event::subscription> gamepad_axis_moved_subscription;
175  std::shared_ptr<::event::subscription> gamepad_button_pressed_subscription;
176  std::shared_ptr<::event::subscription> mouse_button_pressed_subscription;
177  std::shared_ptr<::event::subscription> mouse_moved_subscription;
178  std::shared_ptr<::event::subscription> mouse_scrolled_subscription;
180 
181  // Localization and internationalization
182  std::string language_tag;
183  std::shared_ptr<i18n::string_map> string_map;
184 
185  // Fonts
186  std::unordered_map<hash::fnv1a32_t, std::shared_ptr<type::typeface>> typefaces;
190  std::shared_ptr<render::material> debug_font_material;
191  std::shared_ptr<render::material> menu_font_material;
192  std::shared_ptr<render::material> title_font_material;
193 
194  // Action maps, actions, and action event handling
196  std::shared_ptr<::control_profile> control_profile;
197 
198  std::unordered_map<hash::fnv1a32_t, input::action> actions;
199 
203 
212 
215 
225 
249 
259 
264 
265  std::vector<std::shared_ptr<::event::subscription>> event_subscriptions;
266 
267  std::vector<std::shared_ptr<::event::subscription>> menu_action_subscriptions;
268  std::vector<std::shared_ptr<::event::subscription>> menu_mouse_subscriptions;
269  std::vector<std::shared_ptr<::event::subscription>> movement_action_subscriptions;
270 
271  // Mouse settings
275  bool mouse_invert_pan{false};
276  bool mouse_invert_tilt{false};
277  double mouse_pan_factor{1.0};
278  double mouse_tilt_factor{1.0};
279  bool toggle_mouse_look{false};
280  bool toggle_mouse_grip{false};
281  bool toggle_mouse_zoom{false};
282  float zoom_steps{6.0};
283 
284  // Gamepad settings
288  bool gamepad_invert_pan{false};
289  bool gamepad_invert_tilt{false};
290  double gamepad_pan_factor{1.0};
291  double gamepad_tilt_factor{1.0};
292 
293  // Debugging
294  bool debug_ui_visible{false};
295  std::unique_ptr<scene::text> frame_time_text;
296  std::unique_ptr<debug::cli> cli;
297 
298  // Hierarchichal state machine
300  std::function<void()> resume_callback;
301 
302  // Queue for scheduling "next frame" function calls
303  std::queue<std::function<void()>> function_queue;
304 
305  // Framebuffers
306  std::shared_ptr<gl::texture_2d> hdr_color_texture;
307  std::shared_ptr<gl::texture_2d> hdr_depth_texture;
308  std::shared_ptr<gl::framebuffer> hdr_framebuffer;
309  std::shared_ptr<gl::texture_2d> ldr_color_texture_a;
310  std::shared_ptr<gl::framebuffer> ldr_framebuffer_a;
311  std::shared_ptr<gl::texture_2d> ldr_color_texture_b;
312  std::shared_ptr<gl::framebuffer> ldr_framebuffer_b;
313  std::shared_ptr<gl::texture_2d> shadow_map_depth_texture;
314  std::shared_ptr<gl::framebuffer> shadow_map_framebuffer;
315 
316  // Rendering
320  std::unique_ptr<render::material_pass> ui_material_pass;
321  std::unique_ptr<render::compositor> ui_compositor;
322  std::unique_ptr<render::bloom_pass> bloom_pass;
323  std::unique_ptr<render::final_pass> common_final_pass;
324  std::unique_ptr<render::resample_pass> resample_pass;
325  std::unique_ptr<render::material_pass> underground_material_pass;
326  std::unique_ptr<render::compositor> underground_compositor;
327  std::unique_ptr<render::sky_pass> sky_pass;
328  std::unique_ptr<render::material_pass> surface_material_pass;
329  std::unique_ptr<render::compositor> surface_compositor;
330  std::unique_ptr<render::renderer> renderer;
331 
332  // UI
333  std::unique_ptr<scene::collection> ui_scene;
334  std::unique_ptr<scene::camera> ui_camera;
335  std::unique_ptr<scene::billboard> menu_bg_billboard;
336  std::shared_ptr<render::material> menu_bg_material;
337  std::unique_ptr<animation<float>> menu_fade_animation;
338  std::unique_ptr<animation<float>> menu_bg_fade_in_animation;
339  std::unique_ptr<animation<float>> menu_bg_fade_out_animation;
340 
341  float font_scale;
346 
347  std::vector<std::function<void()>> menu_select_callbacks;
348  std::vector<std::function<void()>> menu_left_callbacks;
349  std::vector<std::function<void()>> menu_right_callbacks;
350  std::function<void()> menu_back_callback;
351  std::vector<std::tuple<scene::text*, scene::text*>> menu_item_texts;
352  std::unordered_map<hash::fnv1a32_t, int> menu_item_indices;
354 
355  // Scene
356  std::unique_ptr<scene::collection> surface_scene;
357  std::shared_ptr<scene::camera> surface_camera;
358  std::unique_ptr<scene::directional_light> sun_light;
359  std::unique_ptr<scene::directional_light> moon_light;
360  std::unique_ptr<scene::collection> underground_scene;
361  std::shared_ptr<scene::camera> underground_camera;
362  std::unique_ptr<scene::directional_light> underground_directional_light;
363  std::unique_ptr<scene::rectangle_light> underground_rectangle_light;
365 
366  // Animation
367  std::unique_ptr<timeline> timeline;
368  std::unique_ptr<animator> animator;
369  std::unique_ptr<animation<float>> radial_transition_in;
370  std::unique_ptr<animation<float>> radial_transition_out;
371  std::unique_ptr<screen_transition> fade_transition;
372  std::shared_ptr<render::matvar_fvec3> fade_transition_color;
373  std::unique_ptr<screen_transition> radial_transition_inner;
374  std::unique_ptr<screen_transition> radial_transition_outer;
375  std::unique_ptr<animation<float>> equip_tool_animation;
376  std::unique_ptr<animation<float>> unequip_tool_animation;
377 
378  // Sound
379  ALCdevice* alc_device;
380  ALCcontext* alc_context;
385  bool captions;
387 
388  // Random number generation
389  std::mt19937 rng;
390 
391  // Entities
392  std::unique_ptr<entity::registry> entity_registry;
393  std::unordered_map<hash::fnv1a32_t, entity::id> entities;
396 
397  // Systems
398  std::unique_ptr<::behavior_system> behavior_system;
399  std::unique_ptr<::camera_system> camera_system;
400  std::unique_ptr<::collision_system> collision_system;
401  std::unique_ptr<::constraint_system> constraint_system;
402  std::unique_ptr<::steering_system> steering_system;
403  std::unique_ptr<::reproductive_system> reproductive_system;
404  std::unique_ptr<::metabolic_system> metabolic_system;
405  std::unique_ptr<::metamorphosis_system> metamorphosis_system;
406  std::unique_ptr<::locomotion_system> locomotion_system;
407  std::unique_ptr<::ik_system> ik_system;
408  std::unique_ptr<::animation_system> animation_system;
409  std::unique_ptr<::physics_system> physics_system;
410  std::unique_ptr<::render_system> render_system;
411  std::unique_ptr<::subterrain_system> subterrain_system;
412  std::unique_ptr<::terrain_system> terrain_system;
413  std::unique_ptr<::spatial_system> spatial_system;
414  std::unique_ptr<::blackbody_system> blackbody_system;
415  std::unique_ptr<::atmosphere_system> atmosphere_system;
416  std::unique_ptr<::astronomy_system> astronomy_system;
417  std::unique_ptr<::orbit_system> orbit_system;
418 
419  // Frame timing
420  float fixed_update_rate{60.0};
421  float max_frame_rate{120.0};
422  bool limit_frame_rate{false};
425 
426  std::shared_ptr<ecoregion> active_ecoregion;
428 
429 private:
430  void parse_options(int argc, const char* const* argv);
431  void setup_resources();
432  void load_settings();
433  void setup_window();
434  void setup_input();
435  void load_strings();
436  void setup_rendering();
437  void setup_audio();
438  void setup_scenes();
439  void setup_animation();
440  void setup_ui();
441  void setup_rng();
442  void setup_entities();
443  void setup_systems();
444  void setup_controls();
445  void setup_debugging();
446  void setup_timing();
447 
448  void shutdown_audio();
449 
450  void fixed_update(::frame_scheduler::duration_type fixed_update_time, ::frame_scheduler::duration_type fixed_update_interval);
451  void variable_update(::frame_scheduler::duration_type fixed_update_time, ::frame_scheduler::duration_type fixed_update_interval, ::frame_scheduler::duration_type accumulated_time);
452 };
453 
454 #endif // ANTKEEPER_GAME_HPP
Keyframe animation.
Definition: animation.hpp:149
Progresses a set of animations.
Definition: animator.hpp:32
Calculates apparent properties of celestial bodies as seen by an observer.
Updates variables related to atmospheric scattering.
Calculates the color and luminance of blackbody radiators.
Maintains a spatially partitioned set of collision meshes.
Applies constraint stacks to transform components.
Schedules fixed- and variable-rate updates.
clock_type::duration duration_type
Duration type matches the clock's duration type.
Definition: game.hpp:121
std::shared_ptr< gl::texture_2d > shadow_map_depth_texture
Definition: game.hpp:313
std::unique_ptr< app::window_manager > window_manager
Definition: game.hpp:165
std::unique_ptr<::terrain_system > terrain_system
Definition: game.hpp:412
input::action camera_preset_3_action
Definition: game.hpp:240
input::action ant_move_fast_action
Definition: game.hpp:255
std::shared_ptr< gl::texture_2d > ldr_color_texture_a
Definition: game.hpp:309
std::shared_ptr<::event::subscription > mouse_scrolled_subscription
Definition: game.hpp:178
std::unique_ptr< animation< float > > equip_tool_animation
Definition: game.hpp:375
bool mono_audio
Definition: game.hpp:384
std::shared_ptr< gl::texture_2d > hdr_color_texture
Definition: game.hpp:306
bool mouse_invert_pan
Definition: game.hpp:275
std::unique_ptr<::constraint_system > constraint_system
Definition: game.hpp:401
std::unique_ptr< debug::cli > cli
Definition: game.hpp:296
input::action ant_move_back_action
Definition: game.hpp:252
std::shared_ptr<::event::subscription > mouse_moved_subscription
Definition: game.hpp:177
input::action camera_preset_6_action
Definition: game.hpp:243
std::unique_ptr< scene::rectangle_light > underground_rectangle_light
Definition: game.hpp:363
std::shared_ptr<::event::subscription > gamepad_button_pressed_subscription
Definition: game.hpp:175
input::action camera_preset_8_action
Definition: game.hpp:245
input::action_map window_action_map
Definition: game.hpp:200
std::shared_ptr< gl::framebuffer > hdr_framebuffer
Definition: game.hpp:308
std::unique_ptr< animation< float > > radial_transition_out
Definition: game.hpp:370
std::shared_ptr< gl::framebuffer > shadow_map_framebuffer
Definition: game.hpp:314
std::filesystem::path saves_path
Definition: game.hpp:157
std::shared_ptr<::event::subscription > window_closed_subscription
Definition: game.hpp:168
float ambience_volume
Definition: game.hpp:382
std::optional< bool > option_quick_start
Definition: game.hpp:146
bool mouse_invert_tilt
Definition: game.hpp:276
input::action camera_preset_4_action
Definition: game.hpp:241
std::shared_ptr<::event::subscription > mouse_button_pressed_subscription
Definition: game.hpp:176
std::unique_ptr< scene::collection > ui_scene
Definition: game.hpp:333
std::unique_ptr< render::material_pass > surface_material_pass
Definition: game.hpp:328
std::vector< std::shared_ptr<::event::subscription > > menu_mouse_subscriptions
Definition: game.hpp:268
std::unique_ptr< animation< float > > menu_bg_fade_in_animation
Definition: game.hpp:338
std::unique_ptr<::blackbody_system > blackbody_system
Definition: game.hpp:414
std::unique_ptr< screen_transition > radial_transition_outer
Definition: game.hpp:374
std::unique_ptr< scene::directional_light > underground_directional_light
Definition: game.hpp:362
input::action camera_look_ahead_action
Definition: game.hpp:237
std::vector< std::function< void()> > menu_left_callbacks
Definition: game.hpp:348
std::shared_ptr<::event::subscription > window_resized_subscription
Definition: game.hpp:169
input::action menu_modifier_action
Definition: game.hpp:211
std::unique_ptr< scene::collection > surface_scene
Definition: game.hpp:356
std::unique_ptr< animation< float > > radial_transition_in
Definition: game.hpp:369
std::unique_ptr<::reproductive_system > reproductive_system
Definition: game.hpp:403
float captions_size
Definition: game.hpp:386
bool toggle_mouse_look
Definition: game.hpp:279
double gamepad_pan_sensitivity
Definition: game.hpp:286
double mouse_radians_per_pixel
Definition: game.hpp:272
input::action move_up_action
Definition: game.hpp:220
::frame_scheduler frame_scheduler
Definition: game.hpp:423
std::unique_ptr< scene::camera > ui_camera
Definition: game.hpp:334
input::action move_down_action
Definition: game.hpp:221
std::vector< std::function< void()> > menu_right_callbacks
Definition: game.hpp:349
hsm::state_machine< game_state > state_machine
Definition: game.hpp:299
float debug_font_size_pt
Definition: game.hpp:343
input::action move_right_action
Definition: game.hpp:219
input::action ant_oviposit_action
Definition: game.hpp:258
bool debug_ui_visible
Definition: game.hpp:294
std::shared_ptr<::event::subscription > gamepad_axis_moved_subscription
Definition: game.hpp:174
std::unique_ptr< screen_transition > radial_transition_inner
Definition: game.hpp:373
float title_font_size_pt
Definition: game.hpp:345
std::unique_ptr<::metamorphosis_system > metamorphosis_system
Definition: game.hpp:405
std::unique_ptr< scene::text > frame_time_text
Definition: game.hpp:295
input::action menu_left_action
Definition: game.hpp:207
std::shared_ptr< scene::camera > underground_camera
Definition: game.hpp:361
std::unique_ptr<::steering_system > steering_system
Definition: game.hpp:402
float render_scale
Definition: game.hpp:318
entity::id active_camera_eid
Definition: game.hpp:395
std::shared_ptr< gl::texture_2d > hdr_depth_texture
Definition: game.hpp:307
input::action menu_up_action
Definition: game.hpp:205
bool toggle_mouse_grip
Definition: game.hpp:280
float master_volume
Definition: game.hpp:381
input::action ant_interact_action
Definition: game.hpp:257
std::unique_ptr< screen_transition > fade_transition
Definition: game.hpp:371
std::unordered_map< hash::fnv1a32_t, input::action > actions
Definition: game.hpp:198
std::unique_ptr< render::bloom_pass > bloom_pass
Definition: game.hpp:322
double gamepad_tilt_sensitivity
Definition: game.hpp:287
std::shared_ptr< render::material > menu_bg_material
Definition: game.hpp:336
std::shared_ptr< scene::camera > surface_camera
Definition: game.hpp:357
std::optional< bool > option_v_sync
Definition: game.hpp:148
input::action toggle_debug_ui_action
Definition: game.hpp:261
std::unique_ptr<::behavior_system > behavior_system
Definition: game.hpp:398
std::shared_ptr< gl::texture_2d > ldr_color_texture_b
Definition: game.hpp:311
ALCdevice * alc_device
Definition: game.hpp:379
std::shared_ptr<::event::subscription > application_quit_subscription
Definition: game.hpp:173
std::unique_ptr< render::compositor > underground_compositor
Definition: game.hpp:326
std::shared_ptr< i18n::string_map > string_map
Definition: game.hpp:183
std::unique_ptr< animator > animator
Definition: game.hpp:368
input::action_map ant_action_map
Definition: game.hpp:250
scene::collection * active_scene
Definition: game.hpp:364
input::action adjust_exposure_action
Definition: game.hpp:262
input::action pause_action
Definition: game.hpp:224
input::action ant_move_slow_action
Definition: game.hpp:256
input::action camera_preset_9_action
Definition: game.hpp:246
std::vector< std::function< void()> > menu_select_callbacks
Definition: game.hpp:347
std::vector< std::shared_ptr<::event::subscription > > event_subscriptions
Definition: game.hpp:265
std::shared_ptr< gl::framebuffer > ldr_framebuffer_a
Definition: game.hpp:310
std::unique_ptr< scene::directional_light > sun_light
Definition: game.hpp:358
type::bitmap_font menu_font
Definition: game.hpp:188
void execute()
Executes the game.
Definition: game.cpp:1268
input::action camera_preset_7_action
Definition: game.hpp:244
input::action camera_save_preset_action
Definition: game.hpp:248
std::unique_ptr< scene::directional_light > moon_light
Definition: game.hpp:359
input::action menu_back_action
Definition: game.hpp:210
std::unique_ptr<::camera_system > camera_system
Definition: game.hpp:399
float font_scale
Definition: game.hpp:341
double gamepad_tilt_factor
Definition: game.hpp:291
input::action_map camera_action_map
Definition: game.hpp:226
std::filesystem::path screenshots_path
Definition: game.hpp:158
input::action camera_orbit_right_action
Definition: game.hpp:234
std::unique_ptr<::animation_system > animation_system
Definition: game.hpp:408
std::string language_tag
Definition: game.hpp:182
std::filesystem::path controls_path
Definition: game.hpp:159
input::action menu_select_action
Definition: game.hpp:209
std::vector< std::shared_ptr<::event::subscription > > movement_action_subscriptions
Definition: game.hpp:269
std::unique_ptr<::collision_system > collision_system
Definition: game.hpp:400
std::string control_profile_filename
Definition: game.hpp:195
std::unique_ptr< render::resample_pass > resample_pass
Definition: game.hpp:324
input::action camera_mouse_drag_action
Definition: game.hpp:229
std::vector< std::shared_ptr<::event::subscription > > menu_action_subscriptions
Definition: game.hpp:267
std::unique_ptr< scene::billboard > menu_bg_billboard
Definition: game.hpp:335
float zoom_steps
Definition: game.hpp:282
input::action camera_preset_1_action
Definition: game.hpp:238
std::shared_ptr< ecoregion > active_ecoregion
Definition: game.hpp:426
std::unique_ptr<::ik_system > ik_system
Definition: game.hpp:407
std::optional< std::string > option_data
Definition: game.hpp:143
render::anti_aliasing_method anti_aliasing_method
Definition: game.hpp:427
std::unique_ptr< render::material_pass > underground_material_pass
Definition: game.hpp:325
std::unique_ptr< render::material_pass > ui_material_pass
Definition: game.hpp:320
input::action move_left_action
Definition: game.hpp:218
float menu_font_size_pt
Definition: game.hpp:344
ALCcontext * alc_context
Definition: game.hpp:380
input::action camera_orbit_left_action
Definition: game.hpp:233
std::shared_ptr< dict< hash::fnv1a32_t > > settings
Definition: game.hpp:162
input::action move_forward_action
Definition: game.hpp:216
input::action ant_move_right_action
Definition: game.hpp:254
std::unique_ptr<::locomotion_system > locomotion_system
Definition: game.hpp:406
double gamepad_radians_per_second
Definition: game.hpp:285
std::unique_ptr<::astronomy_system > astronomy_system
Definition: game.hpp:416
std::mt19937 rng
Definition: game.hpp:389
std::vector< std::tuple< scene::text *, scene::text * > > menu_item_texts
Definition: game.hpp:351
std::unique_ptr< animation< float > > menu_bg_fade_out_animation
Definition: game.hpp:339
input::action camera_preset_5_action
Definition: game.hpp:242
input::action fullscreen_action
Definition: game.hpp:201
std::unique_ptr<::render_system > render_system
Definition: game.hpp:410
std::unique_ptr< resource_manager > resource_manager
Definition: game.hpp:152
std::unique_ptr< render::sky_pass > sky_pass
Definition: game.hpp:327
std::filesystem::path data_package_path
Definition: game.hpp:153
std::shared_ptr< app::window > window
Definition: game.hpp:166
input::action screenshot_action
Definition: game.hpp:202
float effects_volume
Definition: game.hpp:383
std::filesystem::path mods_path
Definition: game.hpp:154
std::queue< std::function< void()> > function_queue
Definition: game.hpp:303
std::unique_ptr< render::final_pass > common_final_pass
Definition: game.hpp:323
std::optional< bool > option_reset
Definition: game.hpp:147
float fixed_update_rate
Definition: game.hpp:420
input::action camera_mouse_look_action
Definition: game.hpp:228
std::unique_ptr< timeline > timeline
Definition: game.hpp:367
input::action adjust_time_action
Definition: game.hpp:263
double gamepad_pan_factor
Definition: game.hpp:290
double mouse_tilt_factor
Definition: game.hpp:278
double mouse_pan_sensitivity
Definition: game.hpp:273
std::optional< bool > option_fullscreen
Definition: game.hpp:144
std::unordered_map< hash::fnv1a32_t, int > menu_item_indices
Definition: game.hpp:352
std::unique_ptr<::spatial_system > spatial_system
Definition: game.hpp:413
std::unique_ptr<::metabolic_system > metabolic_system
Definition: game.hpp:404
std::optional< bool > option_windowed
Definition: game.hpp:149
input::action_map menu_action_map
Definition: game.hpp:204
std::shared_ptr< render::matvar_fvec3 > fade_transition_color
Definition: game.hpp:372
input::action camera_mouse_pick_action
Definition: game.hpp:227
input::action ant_move_forward_action
Definition: game.hpp:251
bool gamepad_invert_tilt
Definition: game.hpp:289
input::action camera_preset_10_action
Definition: game.hpp:247
type::bitmap_font title_font
Definition: game.hpp:189
std::shared_ptr< render::material > debug_font_material
Definition: game.hpp:190
input::action camera_orbit_up_action
Definition: game.hpp:235
std::optional< bool > option_new_game
Definition: game.hpp:145
std::unique_ptr< render::compositor > ui_compositor
Definition: game.hpp:321
input::action camera_preset_2_action
Definition: game.hpp:239
type::bitmap_font debug_font
Definition: game.hpp:187
std::unique_ptr<::physics_system > physics_system
Definition: game.hpp:409
bool dyslexia_font
Definition: game.hpp:342
bool limit_frame_rate
Definition: game.hpp:422
bool gamepad_active
Definition: game.hpp:179
std::unique_ptr< render::renderer > renderer
Definition: game.hpp:330
std::unique_ptr< render::compositor > surface_compositor
Definition: game.hpp:329
std::unique_ptr<::subterrain_system > subterrain_system
Definition: game.hpp:411
std::shared_ptr< render::material > menu_font_material
Definition: game.hpp:191
bool gamepad_invert_pan
Definition: game.hpp:288
entity::id controlled_ant_eid
Definition: game.hpp:394
bool captions
Definition: game.hpp:385
std::filesystem::path local_config_path
Definition: game.hpp:155
std::unique_ptr<::atmosphere_system > atmosphere_system
Definition: game.hpp:415
float max_frame_rate
Definition: game.hpp:421
input::action menu_down_action
Definition: game.hpp:206
input::action camera_orbit_down_action
Definition: game.hpp:236
int shadow_map_resolution
Definition: game.hpp:319
input::action move_slow_action
Definition: game.hpp:223
bool toggle_mouse_zoom
Definition: game.hpp:281
std::unordered_map< hash::fnv1a32_t, std::shared_ptr< type::typeface > > typefaces
Definition: game.hpp:186
std::unique_ptr< entity::registry > entity_registry
Definition: game.hpp:392
input::action move_back_action
Definition: game.hpp:217
std::shared_ptr< render::material > title_font_material
Definition: game.hpp:192
input::action move_fast_action
Definition: game.hpp:222
std::unique_ptr< scene::collection > underground_scene
Definition: game.hpp:360
std::unique_ptr<::orbit_system > orbit_system
Definition: game.hpp:417
std::unique_ptr< animation< float > > menu_fade_animation
Definition: game.hpp:337
std::function< void()> menu_back_callback
Definition: game.hpp:350
input::action camera_zoom_in_action
Definition: game.hpp:231
std::unique_ptr< animation< float > > unequip_tool_animation
Definition: game.hpp:376
input::action menu_right_action
Definition: game.hpp:208
~game()
Boots down the game.
Definition: game.cpp:147
double mouse_tilt_sensitivity
Definition: game.hpp:274
std::optional< bool > option_continue
Definition: game.hpp:142
math::ivec2 render_resolution
Definition: game.hpp:317
input::action ant_move_left_action
Definition: game.hpp:253
input::action_map movement_action_map
Definition: game.hpp:213
input::mapper input_mapper
Definition: game.hpp:214
std::unique_ptr< app::input_manager > input_manager
Definition: game.hpp:172
std::unordered_map< hash::fnv1a32_t, entity::id > entities
Definition: game.hpp:393
bool closed
Definition: game.hpp:167
game(int argc, const char *const *argv)
Boots up the game.
Definition: game.cpp:103
int * menu_item_index
Definition: game.hpp:353
std::function< void()> resume_callback
Definition: game.hpp:300
std::shared_ptr<::control_profile > control_profile
Definition: game.hpp:196
input::action camera_mouse_zoom_action
Definition: game.hpp:230
std::filesystem::path shared_config_path
Definition: game.hpp:156
double mouse_pan_factor
Definition: game.hpp:277
input::action_map debug_action_map
Definition: game.hpp:260
input::action camera_zoom_out_action
Definition: game.hpp:232
math::moving_average< float > average_frame_duration
Definition: game.hpp:424
std::shared_ptr< gl::framebuffer > ldr_framebuffer_b
Definition: game.hpp:312
Maps input to a set of contextually-related actions.
Definition: action-map.hpp:43
Evaluates an activation state given input values and publishes events on activation state changes.
Definition: action.hpp:33
Listens for input events and generates corresponding input mappings.
Definition: mapper.hpp:39
Updates the Cartesian position and velocity of orbiting bodies given their Keplerian orbital elements...
Manages the loading, caching, and saving of resources.
Collection of scene objects.
Definition: collection.hpp:33
Encapsulates a shader-based animated screen transition.
Generates terrain patches and performs terrain patch LOD selection.
Timeline which executes cues (scheduled functions) when advanced over their respective positions in t...
Definition: timeline.hpp:31
Raster font in which glyphs are stored as arrays of pixels.
Definition: bitmap-font.hpp:39
Debugging functions and classes.
Definition: cli.cpp:22
entt::entity id
Entity ID type.
Definition: id.hpp:28
std::stack< std::unique_ptr< T > > state_machine
Stack-based hierarchical state machine.
constexpr T radians(T degrees) noexcept
Converts an angle given in degrees to radians.
Definition: angles.hpp:48
High-level rendering.
anti_aliasing_method
Anti-aliasing methods.
n-dimensional vector.
Definition: vector.hpp:44