Commit graph

11542 commits

Author SHA1 Message Date
Kp ba01b2bdc1 Convert some math functions to fixang
The value was always truncated internally anyway.  Move the truncation
to the call boundary, since most callers started with a fixang.
2021-11-01 03:37:20 +00:00
Kp 164727db9a Pass segment sound flags to do_ambient_sounds 2021-11-01 03:37:20 +00:00
Kp 3862edfb6c Use enum class for segment_special 2021-11-01 03:37:19 +00:00
Kp b0b53c2711 Sanitize segment special in D2 also 2021-11-01 03:37:19 +00:00
Kp 12a0f8e8e0 Use enum class for wall_state 2021-11-01 03:37:19 +00:00
Kp 76e2f2c6d9 Use enum class for wall_flags 2021-11-01 03:37:19 +00:00
Kp f64ed06a9d Use enum class for wall flag constants 2021-11-01 03:37:19 +00:00
Kp 9823c2e33c Fix blastable wall test
WALL_BLASTABLE is a property of the wall flags, not the wall state.
2021-11-01 03:37:19 +00:00
Kp a6f2db2502 Use enum class for player ranking 2021-11-01 03:37:19 +00:00
Kp 8ddfbd17e0 Use enum class for show_kill_list_mode 2021-11-01 03:37:19 +00:00
Kp d22632ac48 Use enum class for msgsend_state 2021-11-01 03:37:19 +00:00
Kp 7cb34fda0c Use enum class for network_game_type 2021-11-01 03:37:19 +00:00
Kp 87cc8f0794 Simplify clearing UDP_Socket
Remove the workaround added for issue #289 [1].  That issue covered a
miscompilation by early versions of gcc-4.9.  gcc-4.9.x is no longer
supported, so the workaround is no longer needed.

[1]: https://github.com/dxx-rebirth/dxx-rebirth/issues/289
2021-11-01 03:37:19 +00:00
Kp eb7cedc35d Expand macro Current_mission_longname 2021-11-01 03:37:19 +00:00
Kp e69b7bd730 Expand macro Briefing_text_filename 2021-11-01 03:37:19 +00:00
Kp bcc8118dd5 Expand macro Ending_text_filename 2021-11-01 03:37:19 +00:00
Kp 3d878ce04d Expand macro Last_level 2021-11-01 03:37:19 +00:00
Kp e36c4a17ab Expand macro Last_secret_level 2021-11-01 03:37:19 +00:00
Kp 692c09bb7e Expand macro N_secret_levels 2021-11-01 03:37:19 +00:00
Kp 013ef0ded7 Expand macro Secret_level_table 2021-11-01 03:37:19 +00:00
Kp d10406c107 Expand macro Level_names 2021-11-01 03:37:19 +00:00
Kp 72cdb9b0cc Expand macro Secret_level_names 2021-11-01 03:37:19 +00:00
Kp e6ff0390c9 Initialize level names before putting them in Current_mission 2021-11-01 03:37:19 +00:00
Kp 30ff2de7ca Factor out building builtin level names 2021-11-01 03:37:19 +00:00
Kp 1e35584384 Remove unnecessary return value from mission shortcut functions 2021-11-01 03:37:19 +00:00
Kp c64d97307c Pass level counts to allocate_levels
Avoid reading them from a global.
2021-11-01 03:37:19 +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 0fcaa76fd1 Move Next_level_num to local scope
It does not need to be a global.  For each function that uses it, it is
assigned earlier in that same function.
2021-11-01 03:37:19 +00:00
Kp 1a44112907 Remove objnum_local_to_remote wrapper
Always use the form that returns both fields.
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 8eafbe6197 Shrink window::w_modal to uint8_t 2021-11-01 03:37:18 +00:00
Kp 3cca690728 Assign weakly-typed symbolic names to ogl_ubitmapm_cs special cases 2021-11-01 03:37:18 +00:00
Kp 7bb55dff22 Remove dead computations in ogl_ubitmapm_cs 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 50d2b14aed Move WinBoxOverlay+deccpt into a common structure
cockpit_decode_alpha::deccpt has static scope and is retained to support
the data in WinBoxOverlay.  Change WinBoxOverlay into a structure that
stores deccpt (and rename it to the more descriptive
`decoded_full_cockpit_image`) to keep the pieces together.
2021-11-01 03:37:18 +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
AlumiuN 7a90b1461d Fix rendering of "classic reboot" crosshair 2021-10-12 15:20:27 +13:00
C.W. Betts b42ab2aa2f
Update fireball.cpp
Add include optional.
Fixes build failure on macOS.
2021-09-22 15:11:42 -06:00
Kp 49dee72766 Preserve type of vm_vec_mag return value
Defer converting to `fix` until necessary.
2021-09-19 10:53:48 +00:00
Kp 87f7f8dcd6 Simplify player enumeration in do_powerup 2021-09-19 10:53:48 +00:00
Kp 04d1d577c1 Simplify powerup velocity setup
Avoid computing a random velocity on objects which are then forced to
zero velocity.
2021-09-19 10:53:48 +00:00
Kp 192988b004 Use enum class for weapon_info::persistent 2021-09-19 10:53:48 +00:00
Kp 21c530a3e2 Use enumerated_array for difficulty-level-specific arrays 2021-09-19 10:53:48 +00:00
Kp 7fc8c736b3 Pass Powerup_info to multi_prep_level_objects, filter_objects_from_level 2021-09-19 10:53:48 +00:00
Kp c01a51fd8b Remove PlayMovie special case for .MVE
Only one caller needed this special case.  Remove the special case, and
adjust that caller to include the `.MVE` as a static suffix on its
inputs.
2021-09-19 10:53:48 +00:00
Kp a0be3a8344 Factor out do_briefing_screens calls in ShowLevelIntro
The special cases do not need to be quite so special.
2021-09-19 10:53:48 +00:00
Kp 83fe347a03 Pass canvas to briefing functions 2021-09-19 10:53:48 +00:00
Kp 6a2b31cc6e Use padding of msgstream to store the required null byte
This avoids needing to make temporary local variables to place a null
terminator.
2021-09-19 10:53:48 +00:00
Kp e973dc0c4c Move small briefing members earlier in the structure 2021-09-19 10:53:48 +00:00
Kp 4e75f8a933 Pass canvas to scores_view_menu 2021-09-19 10:53:48 +00:00