Commit graph

10252 commits

Author SHA1 Message Date
Kp 4b125af449 Move ActiveDoors to d_level_unique_active_door_state 2018-12-30 00:43:58 +00:00
Kp 865bad8607 Move CloakingWalls to d_level_unique_cloaking_wall_state 2018-12-30 00:43:58 +00:00
Kp 9be3c8e2e8 Move Walls into d_level_unique_wall_state 2018-12-30 00:43:58 +00:00
Kp ac476be19b Pass wall &to blast_blastable_wall 2018-12-30 00:43:58 +00:00
Kp b3cd7588ef Move Delta_lights into d_level_shared_destructible_light_state 2018-12-30 00:43:58 +00:00
Kp 46644b4e91 Move Dl_indices into d_level_shared_destructible_light_state 2018-12-30 00:43:58 +00:00
Kp b08dac2971 Simplify handling warning function 2018-12-30 00:43:58 +00:00
Kp 82f2f17c66 Add comment to SConstruct __preferred_win32_linker_options 2018-12-30 00:43:58 +00:00
Kp 4ea1041600 Add more distributions to ISSUE_TEMPLATE.md 2018-12-30 00:43:58 +00:00
Kp 25baa1fbba Remove visited2
It is debug-only, and has never triggered.
2018-12-30 00:43:58 +00:00
Kp 40adccd56b Move subtitles into movie 2018-12-30 00:43:58 +00:00
Kp 040de5b10e Rename ObjectState to LevelUniqueObjectState for consistency 2018-12-30 00:43:57 +00:00
Kp e7e4970ba5 Move Vertex_active out of global scope 2018-12-30 00:43:57 +00:00
Kp 1a5844e218 Move Vertices out of global scope 2018-12-30 00:43:57 +00:00
Kp 696551a966 Drop editor-specific object fixups
If these are needed, they need to be done at edit time, not when the
game starts.
2018-12-30 00:43:57 +00:00
Kp 5873ccb71e Pass vcvertptr as context 2018-12-30 00:43:57 +00:00
Kp 317c56d683 Expand Highest_vertex_index inline
This will make future conversions easier.
2018-12-30 00:43:57 +00:00
Kp 65225680c1 Move Num_vertices into d_level_shared_vertex_state 2018-12-30 00:43:57 +00:00
Kp f87c503618 Move Viewer_eye to local scope 2018-12-30 00:43:57 +00:00
Kp 045afc2c56 Prefer const shared_segment & over vcsegptr_t 2018-12-30 00:43:57 +00:00
Kp 2f537133e8 Use vcobjidx_t for fvi ignore_obj_list
Enforce that callers provide vcobjidx_t, instead of permitting any type
compatible with objnum_t.
2018-12-30 00:43:57 +00:00
Kp aa9e6da297 Pass Dl_indices as context 2018-12-30 00:43:57 +00:00
Kp 25ecf31816 Pass context to bng_process_segment 2018-12-30 00:43:57 +00:00
Kp 7ffe09dd46 Pass context to wall_close_door_ref 2018-12-30 00:43:57 +00:00
Kp a9a9d1f26a Move WALL_IS_DOORWAY out of line
Writing it inline causes wall.h to depend on segment.h.
2018-12-30 00:43:57 +00:00
Kp fa654324ad Pass context to wall.cpp:cwframe, cw_removal_predicate 2018-12-30 00:43:57 +00:00
Kp 8db88cb2b5 Fix off-by-one in mvelib processing
When exactly four bytes remain, mvelib will attempt to compute a
past-the-end pointer.  Some handlers will dereference this pointer
without rechecking the length.  Adjust the header check to require a
non-empty body.

Reported-by: jwrdegoede <https://github.com/dxx-rebirth/dxx-rebirth/issues/413>
2018-12-18 03:36:34 +00:00
Kp 992f35feb8 Expand Num_walls to Walls.get_count()
This will simplify propagating use of Walls.
2018-12-13 02:31:39 +00:00
Kp 9745236c7e Expand Num_triggers to Triggers.get_count()
This will simplify propagating use of Triggers.
2018-12-13 02:31:39 +00:00
Kp 8425e75e62 Factor out RAII_Windows_DynamicSharedObject::Load common logic 2018-12-13 02:31:39 +00:00
Kp e8fdf2b669 Pass context to wall update functions 2018-12-13 02:31:38 +00:00
Kp d550cfe680 Remove struct side 2018-12-13 02:31:38 +00:00
Kp a54c323e45 Remove v16_segment definition
Support for v16_segment was declared broken in 6d0d68d188.  No one
objected.  Remove the definition to simplify future work.
2018-12-13 02:31:38 +00:00
Kp 706a704c6d Move unique_side to unique_segment 2018-12-13 02:31:38 +00:00
Kp 1d550ec0df Fix check_header_includes=1 build 2018-12-13 02:31:38 +00:00
Kp a705104e84 Check PHYSFS_init return value
PHYSFS_init is not guaranteed to succeed.  Using PHYSFS functions after
PHYSFS_init fails is likely to fail badly.  On Windows, failure may take
the form of a crash in ntdll.  Avoid this by exiting gracefully.
2018-12-08 23:36:18 +00:00
Kp d83972dfbb Hide game window when advancing a dead player to the next level
Commit 88b5e616a9 ("Replace calls to
window_set_visible in DoPlayerDead() with stop/start_time()") switched
from hiding the game window to only stopping time, and that only if
hiding the window would have stopped time.  In multiplayer, this allows
time to continue running.  This introduced a crash if the player dies
during the mine countdown.  When the player dies, the game checks if the
reactor has been destroyed.  If so, the game immediately advances to the
next level.  That advance will try to draw the game window if it is
visible.  When the window is drawn, if time is not stopped, then game
logic runs.  Some of that logic is not prepared to deal with the
inconsistent state present when a new level is only partially loaded.
That inconsistent state then causes a crash.  Call stack:

    #11 slew_frame () at similar/main/slew.cpp:152
    #12 in d2x::object_move_one () at similar/main/object.cpp:1758
    #13 in d2x::object_move_all () at similar/main/object.cpp:1956
    #14 in d2x::GameProcessFrame () at similar/main/game.cpp:1848
    #15 d2x::game_handler () at similar/main/game.cpp:1615
    #16 in dcx::window_send_event () at common/include/window.h:116
    #17 dcx::event_process () at common/arch/sdl/event.cpp:176
    #18 in newmenu_do2 () at similar/main/newmenu.cpp:498
    #19 in newmenu_do2<dcx::unused_newmenu_userdata_t> () at common/main/newmenu.h:184
    #20 newmenu_do<dcx::unused_newmenu_userdata_t const> () at common/main/newmenu.h:190
    #21 newmenu_do<1ul, dcx::unused_newmenu_userdata_t const> () at common/main/newmenu.h:196
    #22 net_udp_wait_for_requests () at similar/main/net_udp.cpp:4563
    #23 net_udp_level_sync () at similar/main/net_udp.cpp:4607
    #24 in multi_level_sync () at similar/main/multi.cpp:3458
    #25 in d2x::StartNewLevelSub () at similar/main/gameseq.cpp:1803
    #26 in d2x::StartNewLevel () at similar/main/gameseq.cpp:2018
    #27 in d2x::AdvanceLevel () at similar/main/gameseq.cpp:1648
    #28 in d2x::DoPlayerDead () at similar/main/gameseq.cpp:1721

The root cause of this is the layering violation:
- Killing the player can have the side effect of advancing the level
- Advancing the level can have the side effect of calling multiplayer code while the level data is in an inconsistent state
- Calling multiplayer code can cause the event system to redraw the game
- Redrawing the game can cause game logic to run

Hack around this by restoring the logic that hides the game window, so
that the window is not redrawn and the game logic is not run.  This does
not fix the layering problem, but prevents crashing affected users.  To
avoid undoing the feature from the breaking commit, hide the window only
when advancing to a new level, rather than unconditionally.  A player
advancing to a new level already lacks the move-at-cold-start capability
even on successfully escaping the mine, so no functionality is lost with
this change.  Players who are dead and do not advance to a new level
retain that capability.

Fixes: 88b5e616a9 ("Replace calls to window_set_visible in DoPlayerDead() with stop/start_time()")
Reported-by: Ninjared <https://forum.dxx-rebirth.com/showthread.php?tid=1097>
2018-12-08 19:16:01 +00:00
Kp 5a64ee5132 Add experimental support for larger cooperative games
- Raise the player limit to 8.
- Remove the logic that forces player counts up/down when switching
  between cooperative and deathmatch game modes.
- Add heuristics to add start positions for the extra players, since
  standard maps will not have the required number of starts.
2018-12-03 04:25:11 +00:00
Kp 24cc62caa3 Increase version to 0.61.0
Using 0.59.100 on master, which is well ahead of the 0.59.100 beta tag,
leads to confusing reports.  Raise the version number to disambiguate
this.
2018-12-01 17:14:52 +00:00
Kp 35d91d389a Raise player life count storage from uint8_t to uint16_t
Reported-by: Buff Skeleton <https://forum.dxx-rebirth.com/showthread.php?tid=1096>
2018-12-01 01:58:37 +00:00
Kp 2dd52b4699 Fix bogus "Game Over" when dying with the maximum number of lives
Reported-by: Buff Skeleton <https://forum.dxx-rebirth.com/showthread.php?tid=1096>
2018-12-01 01:58:37 +00:00
Kp 9f460e89a5 Skip exploding walls during demo playback
Demo playback manages the exploding walls explicitly.  Running the
normal exploding wall logic alongside the forced playback corrupts level
state.

Reported-by: _madness <https://forum.dxx-rebirth.com/showthread.php?tid=1095>
Fixes: 36ada21c0c ("Fold exploding walls into regular walls")
2018-12-01 01:58:37 +00:00
Kp f6352e7957 Pass correct object to check_effect_blowup
`check_effect_blowup` should receive the `laser_info` of the weapon that
caused the blast.  Previously, it was given the `laser_info` of the
parent of that weapon.  The parent was not of type `OBJ_WEAPON`, so
passing its `laser_info` is meaningless.

Fixes: 9bd1ba7c47
2018-11-01 02:41:30 +00:00
Kp 4d3612e453 Do not modify UserBuildSettings in SConf
Creating an attribute on UserBuildSettings during SConf breaks
clean/help, which do not run configure tests.  Remove that and add a
method to return the value the attribute would have had.

Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/412>
Fixes: 1be414217c ("Add build time flag to choose whether to enable ADL MIDI support")
2018-10-21 20:09:49 +00:00
Kp a0ed5cb283 Pass Vclip as context 2018-10-21 00:24:07 +00:00
Kp 991f72a775 Add fwd-vclip.h 2018-10-21 00:24:07 +00:00
Kp d1092f3ea2 Adjust release note about ADL MIDI support
"adlmidi"[1] and "libADLMIDI"[2] are different projects.  Only the latter is
targeted by the contributed feature.  Adjust the release note to use the
name of the latter instead of letting readers guess which project is
intended.

[1]: https://github.com/bisqwit/adlmidi
[2]: https://github.com/Wohlstand/libADLMIDI

Reported-by: Wohlstand <https://github.com/dxx-rebirth/dxx-rebirth/issues/407#issuecomment-430997300>
Fixes: a76487405c ("Make ADL MIDI runtime configurable")
2018-10-21 00:24:07 +00:00
Kp 89b9561617 Remove explicit std::move in prepare_mission_menu_state return
clang warns that this interferes with copy elision.  The generated code
is slightly worse after following clang's advice and removing this, but
this is not a hot path, so take the hit to silence clang instead of
complicating the source.

Fixes: d97afc2ad5 ("Retain directory structure in New Game dialog")
2018-10-20 17:25:59 +00:00
Kp 7e9ec36018 Fix gcc-4.9 build of similar/main/net_udp.cpp
gcc-4.9 std::array::size() is `constexpr`, but gcc-4.9 refuses to
initialize a local `constexpr std::size_t` from the result of calling
`size()` on a `std::array`.  Later gcc permit this.  gcc-8 generates the
same code whether the variable is `constexpr std::size_t` or `const
std::size_t`, and the latter allows gcc-4.9 to build, so remove
`constexpr` and use plain `const`.

Reported-by: joolswills <https://github.com/dxx-rebirth/dxx-rebirth/issues/411>
Fixes: 91d6285751 ("Factor out shortening game/mission names")
2018-10-20 17:25:59 +00:00
Kp ea5020a773 Fix gcc-4.9 build of similar/main/wall.cpp
gcc-4.9 shipped without support for std::is_trivially_move_assignable.
This is only needed in a sanity check, so preprocess it out when using a
gcc below gcc-5.

Reported-by: joolswills <https://github.com/dxx-rebirth/dxx-rebirth/issues/411>
Fixes: 57334255ac ("Simplify stuck object cleanup")
2018-10-20 17:25:59 +00:00