Commit graph

11223 commits

Author SHA1 Message Date
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp b0338164f7 Remove SDLMain.m
According to @raptor, this is not needed on modern OSX for SDL1 or SDL2,
and breaks the build on SDL2.  Remove it.

Reported-by: raptor <https://github.com/dxx-rebirth/dxx-rebirth/issues/565>
2021-02-06 17:53:53 +00:00
Kp 081024eb8f Fix build for screenshot=legacy opengl=0
Reported-by: dimag0g <https://github.com/dxx-rebirth/dxx-rebirth/pull/568>
2021-02-06 17:53:53 +00:00
Kp 6e52dc8db2 Shrink newmenu_item::right_offset
Its value never exceeds UINT8_MAX.
2021-02-06 17:53:53 +00:00
Kp a4bc997be3 Pack newmenu_item more tightly
Move value down to eliminate one area of padding on 64-bit systems.
2021-02-06 17:53:53 +00:00
Kp 747a0f531d Factor out mouse button scroll processing 2021-02-06 17:53:53 +00:00
Dmitry Grigoryev 5bc927be5b Fix alignment of difficulty menu text 2021-02-02 14:15:34 +01:00
Kp 1afd0eeae2 Move NETFLAG_DOPOWERUP to netgame_info and clarify name 2021-01-25 00:45:07 +00:00
Kp 81a2d92ee9 Move ResolutionX, ResolutionY to CCfg 2021-01-25 00:45:07 +00:00
Kp 4a8d7c7574 Default to 1024x768 for new users, not 640x480
640x480 is too small to render some dialogs correctly, and is much
smaller than even a small laptop screen.  Smaller resolutions are still
supported, if the user chooses to switch.
2021-01-25 00:45:07 +00:00
Kp 11d7344625 Fix alignment of select_start_level_menu text
When the user opens the menu via the mouse, grd_curcanv points to a
canvas other than the top level canvas.  When the user opens the menu
via the keyboard, grd_curcanv points to the top level canvas.  For this
menu, the top level canvas must be used in order to get correct
alignment.  Switch the constructor to always use the top level canvas.

Reported-by: dimag0g <https://github.com/dxx-rebirth/dxx-rebirth/issues/564>
Fixes: e45ba0b4a9 ("Make new game menu inherit from newmenu")
2021-01-25 00:45:07 +00:00
Kp 49944a3fbf Use enum, not integral_constant, for netflag/netgrant constants 2021-01-25 00:45:07 +00:00
Kp 5d0d9dcc1a Use primary_weapon_index_t for pick_up_primary 2021-01-25 00:45:07 +00:00
Kp 2196f6add5 Use enumerated_array for Secondary_ammo_max 2021-01-25 00:45:07 +00:00
Kp 6c63e11caa Use enumerated_array for Secondary_weapon_to_weapon_info 2021-01-25 00:45:07 +00:00
Kp b20fa0d77d Use enumerated_array for Primary_weapon_to_weapon_info 2021-01-25 00:45:07 +00:00
Kp 9abf81c77a Factor out logic for toggling between base/super weapons 2021-01-25 00:45:07 +00:00
Kp f1cfbaa982 Use enum class for cockpit_3d_view 2021-01-25 00:45:07 +00:00
Kp 775d039083 Expand gcc memcpy workaround to gcc-10
The upstream bug is still not fixed.
2021-01-17 22:23:23 +00:00
Kp 77acae6510 Use enum class for weapon_box_user 2021-01-17 22:23:23 +00:00
Kp 423e513a4a Move overlap_dirty to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp 977684ba29 Move static_time to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp 977714c93f Move weapon_box_user to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp b4ba47f7bc Move weapon_box_fade_values to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp 8bc06dc700 Move weapon_box_states to gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp d40a587628 Move old_weapon into gauge_inset_window 2021-01-17 22:23:23 +00:00
Kp b70f569178 Use enum class for OGL_TEXFILT_* constants 2021-01-17 22:23:23 +00:00
Kp 3f413f15e5 Fix Descent 2 delayed crash when movies are enabled
Commit 479884288c unintentionally caused the movie window to linger in
the background after a movie was played, which causes a crash when the
window is used later, because part of its state has been cleared.
Use window::track to detect its termination in the usual way, and
eliminate the special logic that tried to track the window by deferring
its deletion.  This causes the window to close at the proper time,
thereby avoiding a later crash.

Fixes: 479884288c ("Always delegate to window_create for send_creation_events")
2021-01-17 22:23:23 +00:00
Kp a682d2bacb Simplify movie_play_status
Callers only ever test for whether the movie was skipped, and never
distinguish between a movie that ran to completion versus a movie that
the user interrupted.  Combine these two statuses into one value, and
eliminate the logic in RunMovie that picked which of the two to return.
2021-01-17 22:23:23 +00:00
Kp 6f7b0b4743 Use enum class for PlayMovie result 2021-01-17 22:23:23 +00:00
Kp 208b18de99 Initialize movie::pMovie at construction time 2021-01-17 22:23:23 +00:00
Kp 12aed869bf Remove indirection for movie memory management 2021-01-17 22:23:23 +00:00
Kp 062b2fb480 Remove indirection for movie file reading 2021-01-17 22:23:23 +00:00
Kp 8491c96069 Remove indirection for movie frame processing 2021-01-17 22:23:23 +00:00
Kp 6ffc86ef5f Remove indirection for movie palette processing
It existed to support the freestanding mve player, which has not been
maintained in years.  Even there, the support can be retained by
aligning the name of the function among the source files.  mve_main.c
would need to be converted to C++ to enable full support.
2021-01-17 22:23:23 +00:00
Kp 7b99654379 Use enum class for weapon_box_states 2021-01-17 22:23:23 +00:00
Kp 1843d375f2 Use enumerated_array for Secondary_weapon_to_powerup 2021-01-17 22:23:22 +00:00
Kp e9f590eeb1 Use enumerated_array for Primary_weapon_to_powerup 2021-01-17 22:23:22 +00:00
Kp baa2823953 Pass player_info to which_bomb
Previously, rendering the preferred bomb type could also change it if
the active type was exhausted.  This is undesirable, since it depends on
the user to have a HUD mode which causes the bomb type to render.
Switch to only change the active type if the user tries to drop a bomb
while the active type is unavailable.  Some call sites already switch
bomb types automatically on depletion.  Those sites will still do so.
2021-01-17 22:23:22 +00:00
Kp c7680621a8 Switch mine type if only alternate mine is available
v0.58.1 did this, but the functionality was accidentally removed in
859b399d20.  Restore it.

Fixes: 859b399d20 ("Use mask for Secondary_last_was_super")
2021-01-17 22:23:22 +00:00
Kp b51da25a42 Add quick-exit path for robot awareness in no-robot games
If no awareness events are pending, skip scanning objects for robots
to inform about the awareness events.
2021-01-17 22:23:22 +00:00
Kp 93bef60b79 Improve D1 emulation of process_awareness_events
When D2 emulates D1, use the D1 recursion limit.
2021-01-17 22:23:22 +00:00
Kp 1d5afd34ce Improve post-level score screen message
Use a special message when the timeout has elapsed, and the game is
waiting for the user to restore focus to the score screen.
2021-01-17 22:23:22 +00:00
dimag0g 7204b91e1a
Merge 1338ddab34 into c868d32eba 2020-12-28 22:46:15 +01:00
Dmitry Grigoryev 1338ddab34 Add menu page for HUD style and cockpit view 2020-12-28 22:39:36 +01:00
Kp c868d32eba Prevent copying class window 2020-12-27 22:03:09 +00:00
Kp 04c1d8cc57 Move marker deletion are-you-sure to a non-blocking window 2020-12-27 22:03:09 +00:00
Kp a45726d7e4 drop_robot_egg: return immediately if count-to-drop == 0
This suppresses a misleading warning when a robot is set to drop 0
objects of an invalid type.
2020-12-27 22:03:09 +00:00
Kp e4f8d02380 Make screen_resolution_menu inherit from newmenu 2020-12-27 22:03:09 +00:00
Kp ed2bc8e213 Use enum class for nm_type 2020-12-27 22:03:09 +00:00