Commit graph

137 commits

Author SHA1 Message Date
Kp f3d31a6d27 Use enum class for Difficulty_level_type 2022-07-16 15:26:12 +00:00
Kp 6215ef8e06 Pass LevelSharedRobotInfoState to various functions that need it 2022-07-09 13:39:29 +00:00
Kp 8be306efa7 Use enum class for cockpit_mode_t 2022-02-12 18:57:12 +00:00
Kp 2be1a8ca85 Split game.h to fwd-game.h 2022-02-12 18:57:12 +00:00
Kp fbe3bbd0fa Use enum sidenum_t in more places 2022-01-09 15:25:42 +00:00
Kp 9fc7a14777 Fix LTO build of Descent 2
enum game_mode_flags must be visible in common code, which does not
define DXX_BUILD_DESCENT_II.  To avoid One Definition Rule errors,
game_mode_flags must have the same definition in all files.
Fortunately, the DXX_BUILD_DESCENT_II definition is a superset of the
common definition, so the preprocessor guards can be replaced with
advisory comments.

Fixes: 2b718da343 ("Use enum class for Game_mode, Newdemo_game_mode")
2021-11-01 03:37:20 +00:00
Kp 0c34a48418 Move Last_level_path_created to LevelUniqueObjectState.Level_path_created
Change it from the level number on which the path was created to a
true/false flag.  The previous logic only tested whether the number was
equal to the current level number.

This also fixes a bug where the action was not available on the first
secret level, since that level is `-1`, and the value was set to `-1` to
indicate that it should be enabled.
2021-11-01 03:37:19 +00:00
Kp 1a08ecc8c6 Remove window subfunction types
These were type safety mechanisms, which are obsolete now that all
window handlers are implemented through virtual function dispatch.
2021-10-13 02:37:51 +00:00
Kp bb29e6fca8 Propagate canvas through more layers 2021-09-12 16:20:52 +00:00
Kp 4b60205b2f Propagate up show_boxed_message RenderFlag
It is always constant.  Explicitly propagate its effects into callers,
then remove the argument.
2021-09-12 16:20:52 +00:00
Kp df6777c632 Expand game_init_render_buffers inline
It is a single function, to add 2 arguments.  Using a wrapper obfuscates
the logic.
2021-09-12 16:20:52 +00:00
Kp 2b718da343 Use enum class for Game_mode, Newdemo_game_mode 2021-09-12 16:20:52 +00:00
Kp 7f51fa3ac5 Use enum class for VR StereoFormat 2021-09-12 16:20:52 +00:00
Kp 8eabce8f27 Disallow direct construction of grs_canvas
Require use of grs_main_canvas or grs_subcanvas instead.
2021-09-04 12:17:14 +00:00
Dave Milici ea6379de2d Add above/below option sync blank interval for external sync doubler. 2021-04-08 14:07:35 -07:00
Kp 02c99b7645 Consolidate stereo dimension math
Remove VR_half_width, VR_half_height.  Their values are directly derived
from VR_stereo, and can be computed on demand.
2021-04-04 22:01:25 +00:00
Dave Milici 6bc0e822d2 Handle HUD overlays in separate screen rects for stereo renderings. 2021-03-17 16:30:31 -07:00
Dave Milici f51e7b86b9 Reorganize & consolidate stereo vars per PR suggestions. 2021-03-15 11:32:10 -07:00
Dave Milici 509da82ee8 Add -gl_stereoview option for selecting stereo viewport modes. 2021-03-12 10:07:45 -08:00
Dave Milici 8c8b7419b6 Improved conditionals for stereo vs non-stereo modes.
Hot-key handling for cycling thru stereo modes & parallax adjustments.
Simplified stereo adjustments for left/right eye separation & offsets.
Not quite compatible yet with Bob Akka stereo method from Descent 1.5.
Function key assignments different (F5..F8) due to pre-empted hot-keys.

ALT+SHIFT+F5:	decrease eye separation (VR_eye_width)
ALT+SHIFT+F6:	increase eye separation (VR_eye_width)
    SHIFT+F5:	decrease image shift (VR_eye_offset)
    SHIFT+F6:	increase image shift (VR_eye_offset)
ALT|SHIFT+F7:	reset eye separation + image shift
ALT|SHIFT+F8:	cycle thru half-width + half-height formats

Note for compiling dxx-rebirth snapshot on MacOSX:

export CXXFLAGS=-Wno-uninitialized
scons macos_add_frameworks=False
2021-03-11 12:32:01 -08:00
Dave Milici bb903a1d80 Support stereo viewport rendering in half-height & half-width formats.
Enable stereo mode when launched via -gl_stereo option.
GL_STEREO quad buffering may not be available unless OGL layer
supports stereo pixel format descriptors.
Half-height viewport rendering for above/below format.
Half-width viewport rendering for side/by/side formats.
HUD & cockpit elements disabled when stereo views active.
2021-03-11 12:32:01 -08:00
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp f1cfbaa982 Use enum class for cockpit_3d_view 2021-01-25 00:45:07 +00:00
Kp ffb653c0b8 Pass control_info & to various functions
Switch from a direct global reference to passing control_info& as a
parameter.
2020-10-12 03:28:26 +00:00
Kp 7de81a7293 Move Afterburner_charge to dsx 2020-09-11 03:08:02 +00:00
Kp 0f2c1cdd45 Make game window inherit from dcx::window 2020-08-28 00:18:45 +00:00
Kp 637efae03a Use enum class for gauges window indexing 2020-08-10 03:45:13 +00:00
Kp 1c42f69ff2 Use enum class for object_signature_t 2020-08-10 03:45:13 +00:00
Kp 111b655b09 Remove GM_GAME_OVER
Various sites assign GM_GAME_OVER to Game_mode, but no sites test for
it.  Its only value would be to clear out other flags, but that can be
done by clearing Game_mode.
2020-08-06 03:47:56 +00:00
Kp ec6a78c481 Use enum class for marker index types 2020-07-22 03:11:18 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp a431f23817 Use enumerated constant for save slot indexes 2020-04-26 17:26:23 +00:00
Kp 5fa8c06914 Add experimental support for autosaves
Set autosave interval to 10 minutes, unless specified in the player's
configuration file.  Players can change the autosave to 0 minutes to
disable it.
2020-04-19 20:47:07 +00:00
Kp a1b3a86cba Use std::chrono::duration for ThisLevelTime, PlayTimeAllowed
Store PlayTimeAllowed in ticks since it is frequently accessed for logic
tests, but only rarely accessed for display.
2020-04-19 20:47:07 +00:00
Kp 714c13b3c1 Move WallAnims into d_game_shared_state 2020-04-04 19:30:22 +00:00
Kp 075b14373a Change Difficulty_level_type from unsigned to signed
Difficulty_level_type is used in arithmetic expressions.  If
Difficulty_level_type is unsigned, then those expressions use unsigned
terms, but some of the expressions were designed to use signed terms and
produce incorrect results when used with unsigned terms.  There is no
strong reason to make Difficulty_level_type unsigned, so switch it to
signed instead of trying to fix every site that uses it.

Reported-by: AlumiuN <https://github.com/dxx-rebirth/dxx-rebirth/issues/471>
Fixes: 1eaaff3016 ("Move Difficulty_level to GameUniqueState")
2019-11-17 23:27:13 +00:00
Kp f0faac66d4 Move Seismic_tremor_magnitude to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 625d863c55 Move Smega_detonate_times to d_level_unique_seismic_state::Earthshaker_detonate_times 2019-08-06 02:59:41 +00:00
Kp 140711cb35 Move Next_seismic_sound_time to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 8fd231e501 Move Seismic_tremor_volume to d_level_unique_seismic_state 2019-08-06 02:59:41 +00:00
Kp 42778ff7fa Move Level_shake_duration to d_level_shared_seismic_state 2019-08-06 02:59:41 +00:00
Kp b8fa75c8cb Move Level_shake_frequency to d_level_shared_seismic_state 2019-08-06 02:59:41 +00:00
Kp 184337e6e1 Move Seismic_disturbance_end_time to d_level_unique_seismic_state 2019-08-06 02:59:40 +00:00
Kp 215252b8ca Fold Final_boss_is_dead into Final_boss_countdown_time 2019-08-06 02:59:40 +00:00
Kp 5455a65d33 Move Final_boss_countdown_time to d_game_unique_state 2019-08-06 02:59:40 +00:00
Kp 3d8c02fefa Move Final_boss_is_dead to d_game_unique_state 2019-08-06 02:59:40 +00:00
Kp 635ae0b595 Use typedef for savegame description 2019-07-28 21:09:07 +00:00
Kp f43141f738 Use typedef for savegame file path 2019-07-28 21:09:07 +00:00
Kp 91bb7e533c Move player::hostages_total to d_game_unique_state
The number of hostages in a game is a function of the the game's levels,
not any particular player.  Move it to d_game_unique_state and rename it
to total_hostages.
2019-07-16 04:00:50 +00:00
Kp 2ca2de6ee7 Move player::num_robots_total to d_game_unique_state
The number of robots accumulated in a game is a function of the the
game's levels, not any particular player.  Move it to
d_game_unique_state and rename it to accumulated_robots.
2019-07-16 04:00:50 +00:00