Commit graph

221 commits

Author SHA1 Message Date
Kp 479884288c Always delegate to window_create for send_creation_events 2020-12-20 20:39:07 +00:00
Kp a4cfdba4d9 Make joystick_sensitivity::menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp f0b6a23e0e Make mouse_sensitivity::menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp c5a677817b Make keyboard_sensitivity::menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp 6cca4ab2ce Make main multiplayer menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp 131e5a257e Make options menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp 9edbf27300 Make sandbox menu inherit from newmenu 2020-12-20 20:39:07 +00:00
Kp 76acfdd38f Convert main menu to inherit from newmenu 2020-12-19 16:13:26 +00:00
Kp 137fd95ae0 Reduce indirection resolving chosen menu item
Instead of storing a hardcoded array of identifiers, use the index in
the main array as the identifier.  Split `enum MENUS` accordingly.
2020-12-19 16:13:26 +00:00
Kp 200952c3d9 Add type-specific tag wrappers for newmenu calls
Make the compiler check that title, subtitle, and filename are passed in
the right places.
2020-12-19 16:13:26 +00:00
Kp ddcf8c1798 Remove support for show_order_form
The original way to order the full version is defunct.  Remove the code
that showed that page.
2020-10-22 02:26:17 +00:00
Kp d309c141e7 Switch non-format uses of nm_messagebox to nm_messagebox_str 2020-10-22 02:26:16 +00:00
Kp ae657007fe Remove send_creation_events parameter
It is always nullptr.
2020-10-22 02:26:16 +00:00
Kp d2c5b4d64a Make listbox inherit from window 2020-10-22 02:26:16 +00:00
Kp 09531047b9 Use uint8_t for allow_abort_flag
It is only ever 0 or 1.
2020-10-22 02:26:16 +00:00
Kp e068c685f4 Make scores_menu inherit from window 2020-09-21 03:18:12 +00:00
Kp f0ae880e83 Make gamebitmaps_viewer_window inherit from window 2020-09-21 03:18:12 +00:00
Kp 9f4886c56d Make polygon_models_viewer inherit from window 2020-09-21 03:18:12 +00:00
Kp 39cb42b878 Push partial_range construction to newmenu callers
In some cases, callers know the length of the range and can apply better
checks than the called code.
2020-09-11 03:08:02 +00:00
Kp 18282d5b66 Move some menu code into namespaces 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 0eaabdb2fb Move N_polygon_models into d_level_shared_polygon_model_state 2020-08-24 01:31:28 +00:00
Kp 81119f0445 Use enum class for LevelMusicPlayOrder 2020-05-31 23:04:25 +00:00
Kp db7b4b3f88 Refer to <memory> directly, not through "compiler-make_unique.h" 2020-05-02 21:18:43 +00:00
Kp cc38cdf4b8 Qualify uses of std::make_unique 2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 9cee93abb1 Require support for C++14 std::exchange 2020-05-02 21:18:42 +00:00
Matt Montag 7ec771e89a Fix bug in select_file_handler
newpath is a std::array and does not decay to char* automatically.
Use data() method to get char[], which does decay to char*.

This compile-time issue only affected Mac OS X.
2020-04-26 11:39:03 -07: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 669c341147 Move d_level_unique_morph_object_state to d_level_unique_object_state 2020-02-01 22:33:31 +00:00
Kp 4b48e0cd14 Fix Windows build break
Commit d879fc7f6b changed the type of `newpath` and updated all uses
in common code.  A Windows-only block was skipped.  Update that now.

Fixes: d879fc7f6b ("Convert file selection to use array<char, N>, not char[N]")
2020-01-19 00:33:47 +00:00
Kp 99356e0cdb Use enum for include/exclude anarchy mode 2020-01-18 21:57:39 +00:00
Kp d879fc7f6b Convert file selection to use array<char, N>, not char[N]
Eliminate some uses of strncpy as part of the conversion.
2020-01-18 21:57:39 +00:00
ziplantil 2c5ab8e739 initial version of this, trying to catch MCI events 2019-10-27 02:47:45 +03:00
Kp 76cfe1368d do_new_game_menu: improve new game dialog text 2019-07-28 21:09:07 +00:00
Kp 98ad2402bf Fix Win32 build 2019-07-22 00:51:01 +00:00
Kp 4a9e027e02 Fix bug that ignored -pilot
Fixes: d03a6c44b8 ("Register new pilots on menu creation, not activation")
2019-07-16 04:00:50 +00:00
Kp 8d349dd0c1 Include pilot name in window caption 2019-07-07 22:00:02 +00:00
Kp 0c7de10512 Track chosen pilot name outside Players[]
Players need not be defined outside a game, but the pilot's name needs
to be available outside a game.  Therefore, track it outside Players[].
2019-07-07 22:00:02 +00:00
Kp 1eaaff3016 Move Difficulty_level to GameUniqueState 2019-06-27 03:26:20 +00:00
Kp d03a6c44b8 Register new pilots on menu creation, not activation 2019-06-27 03:26:20 +00:00
Kp 2243cd7f58 Use xrange for loops with zero start and constant numerical end
s/for\s*(\s*\(\w\+\)\s\+\(\w\+\)\s*=\s*0\+u\?\s*;\s*\2\s*\(!=\|<\)\s*\([0-9]\+\)u\?\s*;\s*\(++\s*\2\|\2\s*++\s*\))/range_for (const \1 \2, xrange(\4u))/
2019-05-04 18:27:36 +00:00
Kp 73772f54b2 Open advanced sub-menus as submenus
Requested-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/121>
2019-03-10 18:48:40 +00:00
Kp 9898d136f1 Fix fortification crash loading missions with long filenames
The highest-level tracking code assumed filenames would always fit in a
char[9].  This was true on DOS, but has not been true in Rebirth for
many years.  Builds without fortification caused silent memory
corruption in this case.

Refuse to create highest-level entries if they would cause corruption.
Log a diagnostic telling the user that this happened.
2019-03-09 23:39:16 +00:00
Kp f491059ed7 Enable building with SDL2
This commit enables Rebirth to build with SDL2, but the result is not
perfect.

- SDL2 removed some sticky key support.  Rebirth may behave differently
  now in this area.
- SDL2 removed some key-repeat related support.  Rebirth may behave
  differently now in this area.
- SDL2 gained the ability to make a window fullscreen by sizing it to
  the desktop instead of by changing the desktop resolution.  Rebirth
  uses this, and it mostly works.
  - Resizing while in the automap does not notify the automap code, so
    the view is wrong until the player switches out of automap mode and
    back in.
- SDL2 changed how to enumerate available resolutions.  Since
  fitting the window to the desktop is generally more useful than
  fitting the desktop to the window, I chose to drop support for
  enumerating resolutions instead of porting to the new API.  Users can
  now enter an arbitrary window dimension and Rebirth will make an
  attempt to use it.
  - It might be useful to cap the window dimension at the desktop
    dimension, but that is not done yet.
  - Entering fullscreen mode through the Controls->Graphics submenu
    failed to notify the relevant subsystems, causing the rendered
    content not to rescale.  For now, compile out the option to toggle
    full screen through that menu.  Toggling through Alt+Enter works
    properly.

Despite these quirks, this is a substantial improvement over the prior
commit, where SDL2 cannot be used at all.  The remaining issues can be
resolved in future work.

References: <https://github.com/dxx-rebirth/dxx-rebirth/issues/82>
2018-07-28 23:22:58 +00:00
Kp d355ef4030 Pass font to various drawing functions 2018-05-19 23:21:42 +00:00
Kp fda1eb851e Pass fonts to LINE_SPACING 2018-05-19 23:21:42 +00:00
Kp 08446f0ab6 Pass font to gr_string,gr_printf 2018-05-19 23:21:42 +00:00
Kp e63bbe8c52 Set d_event type at construction 2018-05-12 18:24:19 +00:00
Kp 6ab28cb8cb Use enum for Difficulty_level 2018-05-12 18:24:19 +00:00