Commit graph

313 commits

Author SHA1 Message Date
Kp afb7406127 Pass std::span to callsign_t::copy_lower 2022-12-10 18:09:54 +00:00
Kp 3d5de92058 Fix OS X clang build
OS X still uses clang-14, which lacks sufficient std::ranges support for
recent Rebirth changes.

- Rewrite uses of std::ranges::SYMBOL to ranges::SYMBOL
- Add a stub header that, on gcc, provides for each SYMBOL a statement
  `using std::ranges::SYMBOL;`, to delegate back to the standard library
  implementation.
- On clang, define a minimal implementation of the required symbols,
  without constraint enforcement.  Compile-testing with gcc will catch
  constraint violations.

Once OS X clang ships a standard library with the required features,
this stub header will be removed and the uses changed back to their full
names.
2022-10-31 00:51:32 +00:00
Kp b3a34f424f Pass std::ranges::subrange to drive_letter_menu 2022-10-09 23:15:21 +00:00
Kp 052dff6dae Pass std::ranges::subrange to menu selection functions 2022-10-09 23:15:21 +00:00
Kp acae546a90 Pass polymodel& to draw_model_picture, draw_polygon_model 2022-10-09 23:15:20 +00:00
Kp e385ff1c3b Use std::ranges::find_if instead of std::find_if
std::ranges::find_if permits use of a sentinel instead of a full
iterator, and supports std::ranges::find as an alternative to certain
simple uses of std::find_if.

Where possible, use the form that takes a range, rather than the form
that takes two iterators.

Add a declared, but not defined, default constructor for
self_return_iterator to satisfy the standard library's concept
`semiregular`, which insists that sentinels be default-constructible,
even for those functions that never need to do so.

Add a defined, but unused, operator++(postfix) for zip_iterator to
satisfy a standard library concept for `forward_iterator`.
2022-10-09 23:15:20 +00:00
Kp 0ebcc64ac5 Test whether change_filename_extension succeeded before using its output 2022-10-09 23:15:20 +00:00
Kp a9142bb65a Use std::span for change_filename_extension arguments 2022-10-09 23:15:20 +00:00
Kp e4e8259253 Reduce scope of callback_handler newpath
If select_file_recursive is not called again, then the handler returns
without reading newpath.  Skip defining it if it will not be read.
2022-09-24 17:47:52 +00:00
Kp 2ecad00e90 Pass std::span to load_palette 2022-09-24 17:47:52 +00:00
Kp 366b048879 Merge commit 'refs/pull/657/head' into master 2022-08-23 02:13:01 +00:00
Tylor 6fee36638d Feat: Pitch unlocker 2022-08-21 16:16:40 -05:00
Kp 51219d3607 Use enum class for PlayMovie flag must_have 2022-07-23 20:58:10 +00:00
Kp f3d31a6d27 Use enum class for Difficulty_level_type 2022-07-16 15:26:12 +00:00
Kp a70188e7a5 Move various static functions into anonymous namespace 2022-07-09 13:39:29 +00:00
Kp 9cdf9152bc Always check return value of PHYSFSX_getRealPath
The contents of the output buffer are undefined if PHYSFSX_getRealPath
fails, so mark the function as [[nodiscard]] and modify all callers to
check that the function succeeded.
2022-03-19 22:55:58 +00:00
Kp f51755c2e6 Use enum class for MBTN_* constants 2022-02-27 14:23:53 +00:00
Kp 9464bdf2e4 Use enumerated_array for indexing player input controls 2022-02-27 14:23:53 +00:00
Kp 43bdfac56a Store copy_sensitivity values as std::integral_constant
Lists of these objects are unrolled by a template parameter pack
regardless of whether they are type compatible, so keeping the types
compatible does not improve code size.  Store more precise types in the
structure, and avoid needing to store the constant values into a
structure at runtime.
2022-02-27 14:23:53 +00:00
Kp 8be306efa7 Use enum class for cockpit_mode_t 2022-02-12 18:57:12 +00:00
Kp b0103a1950 Allow non-developers to start on any level 2021-11-01 03:37:20 +00:00
Kp 3d878ce04d Expand macro Last_level 2021-11-01 03:37:19 +00:00
Kp 57780e0450 Move window_is_visible,window_set_visible to be window methods
Shrink w_visible to uint8_t.  Move it to pack better.
2021-11-01 03:37:18 +00:00
Kp 961aae074a Remove unused ogl_ubitmapm_cs argument scale
Every caller passes `F1_0`.  Remove the argument, and propagate its
results through the function.
2021-11-01 03:37:18 +00:00
Kp 21c530a3e2 Use enumerated_array for difficulty-level-specific arrays 2021-09-19 10:53:48 +00:00
Kp 4e75f8a933 Pass canvas to scores_view_menu 2021-09-19 10:53:48 +00:00
Kp 8d67bcddb0 Record parent canvas in newmenu
Use it to avoid resetting to the screen canvas when preparing the
layout.
2021-09-12 16:20:52 +00:00
Kp bb29e6fca8 Propagate canvas through more layers 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 7b12aac1bb Transpose returned values for enumerate() of non-tuple
Match the order used for tuple.
2021-06-28 03:37:50 +00:00
Kp 4c34875c84 Remove unused subfunction_handler
Previous commits eliminated all uses of it.  Remove the unused stubs.
2021-06-28 03:37:50 +00:00
Kp 0e9e88da87 Make file browser Windows drive selection menu inherit from newmenu 2021-06-28 03:37:50 +00:00
Kp 5f4e8da3b9 Move sandbox menu subfunction handling to event_handler 2021-06-28 03:37:50 +00:00
Kp 56ad2266da Move netgame menu subfunction handling to event_handler 2021-06-28 03:37:50 +00:00
Kp 52f9e29e82 Move gameplay menu subfunction handling to event_handler 2021-06-28 03:37:50 +00:00
Kp 71f05d987a Move sound menu subfunction handling to event_handler 2021-06-28 03:37:50 +00:00
Kp 431a2f99f1 Move graphics configuration menu subfunction handling to event_handler 2021-06-28 03:37:50 +00:00
Kp 3f8ef01dc7 Move hud configuration menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp 464e4e99fb Move hud style configuration menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp d8860549c4 Move reticle configuration menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp 8fc9778e5e Move input configuration menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp 8a3cd4c614 Move joystick configuration menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp f5e837d70b Move mouse configuration menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp c3a35fd952 Move keyboard configuration menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp f3d47c2b3c Move options_menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp 54456faf2a Move main_menu subfunction handling to event_handler 2021-06-28 03:37:49 +00:00
Kp 6cf6c62550 Convert some uses of nm_messagebox_str to run_blocking_newmenu
The latter more clearly shows that the code flow will not proceed past
this point while the menu is open.  This conversion sets the stage for
later changes to make these menus asynchronous.
2021-06-28 03:37:49 +00:00
Kp 93a7e34caf Move newmenu_item slider storage of saved_text out of line
When other newmenu_item private members also move, this will make
newmenu_item smaller.
2021-06-28 03:37:49 +00:00
Kp 1936b771e1 Construct nm_item_input in place 2021-06-28 03:37:49 +00:00
Kp 821e68527d Remove nm_set_item_input overload for char[]
Require use of std::array.  There is no need to support both overloads.
2021-06-28 03:37:49 +00:00